本文整理汇总了PHP中getProjects函数的典型用法代码示例。如果您正苦于以下问题:PHP getProjects函数的具体用法?PHP getProjects怎么用?PHP getProjects使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getProjects函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printProjects
function printProjects()
{
$row = 1;
foreach (getProjects() as $project) {
echo '<a href="/projects/view/' . $project['project_id'] . '"><div class="project_thumb">';
$img = '<img src="' . getProjectImage($project['project_id']) . '" />';
$text = '<div><h2>' . $project['project_name'] . '</h2><p class="subtitle">' . $project['project_description'] . '</p></div>';
echo $row > 0 ? $img . $text : $text . $img;
echo '</div>';
$row *= -1;
}
}
示例2: getFilters
function getFilters()
{
$statusItems = getStatusData();
$filters['taskStatus'] = $statusItems;
//Get Who
$people = getPeopleData();
$filters['assigned'] = $people;
//Get All (now just staff later all)
$filters['people'] = $people;
//Projects
$projects = getProjects();
$filters['projects'] = $projects;
//Levels
$levels = getLevels();
$filters['levels'] = $levels;
echo json_encode($filters);
}
示例3: checkRemovableProjects
Utils::validateAPIKey();
checkRemovableProjects();
break;
case 'setFavorite':
setFavorite();
break;
case 'getBonusHistory':
getBonusHistory();
break;
case 'getMultipleBidList':
getMultipleBidList();
break;
case 'getProjects':
$userId = isset($_SESSION['userid']) ? $_SESSION['userid'] : 0;
$currentUser = User::find($userId);
getProjects(!$currentUser->isInternal());
break;
case 'getUserList':
getUserList();
break;
case 'getUsersList':
getUsersList();
break;
case 'payBonus':
payBonus();
break;
case 'pingTask':
pingTask();
break;
case 'userReview':
userReview();
示例4: foreach
$startDate = $processDate;
$endDate = $processDate;
foreach ($dimensions as $key => $value) {
print_r("---DIMENSIONS---" . json_encode($value));
$result = $client->get_statistics(array('format' => 'json', 'account_id' => $account_id, 'dimensions' => json_encode($value), 'metrics' => json_encode(array('impression', 'click', 'click_rate', 'reach_impression', 'total_cost', 'confirmed_tracked_conversion', 'expand', 'event', 'average_expand_time', 'pageview', 'average_visibility_time', 'progress_100', 'progress_50', 'user_play', 'close', 'impression_adwords', 'click_adwords', 'cost_adwords', 'bounce_rate', 'average_time_spent_on_site', 'cost_per_pageview')), 'start_date' => $processDate, 'end_date' => $processDate));
echo '<pre>';
////print_r($result->headers);
//print_r($result);
//die();
/*
************* METADATA **************
*/
$adspacesMeta = getAdspaces($mysqli);
$campaignsMeta = getCampaigns($mysqli);
$channelsMeta = getChannels($mysqli);
$projectsMeta = getProjects($mysqli);
$creativesMeta = getCreatives($mysqli);
$adnetworksMeta = getAdnetworks($mysqli);
$insertionsMeta = getInsertions($mysqli);
$agesMeta = getAges($mysqli);
$ispsMeta = getIsps($mysqli);
$opsMeta = getOps($mysqli);
$browsersMeta = getBrowsers($mysqli);
$socialsMeta = getSocials($mysqli);
$gendersMeta = getGenders($mysqli);
$GLOBALS["metrics"] = getMetrics($mysqli);
$metrics = $GLOBALS["metrics"];
/*
$metadata = $result->body->metadata;
foreach ($metadata as $key => $value) {
//print_r($key.'/');
示例5: getProjects
?>
<h2>Käyttäjän <?php
echo $username->username;
?>
portfolio</h2>
<?php
}
?>
<?php
if (getProjects($username->uid, $DBH) == NULL) {
?>
<p>Ei projekteja.</p>
<?php
}
$projektit = getProjects($username->uid, $DBH);
foreach ($projektit as $projekti) {
?>
<a href="<?php
echo SITE_ROOT;
?>
/?portfolio=<?php
echo $username->username;
?>
&projekti=<?php
echo $projekti->pid;
?>
">
<div class="polaroid">
<img src="img/<?php
echo $username->username;
示例6: json_encode
<?php
require_once 'settings.php';
if ($_SERVER['REQUEST_METHOD'] == "GET") {
if (!empty($_GET['id'])) {
echo json_encode(getProject($_GET['id']));
} else {
echo json_encode(getProjects());
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
// $json = file_get_contents('php://input');
// if($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] == 'PUT') {
// //This is an UPDATE call
// if(!empty($json))
// return json_encode(updatePrice());
// }
// elseif($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] == 'DELETE') {
// //This is a DELETE call
// // die($json);
// if(!empty($_GET['id'] && !empty($_GET['quantity'])))
// return json_encode(deletePriceFromQuantity($_GET['id'], $_GET['quantity']));
// }
// else {
// //This is an ADD call
// if(!empty($json))
// return json_encode(addPrice());
// }
}
function getProject($id)
{
示例7: queryProjects
/**
* @param $start int
* @param $step int
* @param $search_in_pname string|null
* @param $search_source string|null
* @param $search_target string|null
* @param $search_status string|null
* @param $search_onlycompleted bool
* @param $filter_enabled bool
* @param $project_id int
*
* @return array
* @throws Exception
*/
public static function queryProjects($start, $step, $search_in_pname, $search_source, $search_target, $search_status, $search_onlycompleted, $filter_enabled, $project_id)
{
$data = getProjects($start, $step, $search_in_pname, $search_source, $search_target, $search_status, $search_onlycompleted, $filter_enabled, $project_id);
$projects = array();
$projectIDs = array();
$project2info = array();
//get project IDs from projects array
foreach ($data as $item) {
$projectIDs[] = $item['pid'];
}
if (empty($projectIDs)) {
return array();
}
//get job data using job IDs
$jobData = getJobsFromProjects($projectIDs, $search_source, $search_target, $search_status, $search_onlycompleted);
$lang_handler = Langs_Languages::getInstance();
//Prepare job data
$project2jobChunk = array();
foreach ($jobData as $job_array) {
$job = array();
/**
* Assign job extracted variables
*/
$job['id'] = $job_array['id'];
$job['pid'] = $job_array['id_project'];
$job['password'] = $job_array['password'];
$job['source'] = $job_array['source'];
$job['target'] = $job_array['target'];
$job['subject'] = $job_array['subject'];
$job['sourceTxt'] = $lang_handler->getLocalizedName($job['source']);
$job['targetTxt'] = $lang_handler->getLocalizedName($job['target']);
$job['create_date'] = $job_array['create_date'];
$job['formatted_create_date'] = self::formatJobDate($job_array['create_date']);
$job['job_first_segment'] = $job_array['job_first_segment'];
$job['job_last_segment'] = $job_array['job_last_segment'];
$job['mt_engine_name'] = $job_array['name'];
$job['id_tms'] = $job_array['id_tms'];
//generate and set job stats
$jobStats = new WordCount_Struct();
$jobStats->setDraftWords($job_array['DRAFT']);
$jobStats->setRejectedWords($job_array['REJECT']);
$jobStats->setTranslatedWords($job_array['TRANSLATED']);
$jobStats->setApprovedWords($job_array['APPROVED']);
//These would be redundant in response. Unset them.
unset($job_array['DRAFT']);
unset($job_array['REJECT']);
unset($job_array['TRANSLATED']);
unset($job_array['APPROVED']);
$job['stats'] = CatUtils::getFastStatsForJob($jobStats);
//generate and set job tm_keys
$tm_keys_json = $job_array['tm_keys'];
$tm_keys_json = TmKeyManagement_TmKeyManagement::getOwnerKeys(array($tm_keys_json));
$tm_keys = array();
foreach ($tm_keys_json as $tm_key_struct) {
/**
* @var $tm_key_struct TmKeyManagement_TmKeyStruct
*/
$tm_keys[] = array("key" => $tm_key_struct->key, "r" => $tm_key_struct->r ? 'Lookup' : ' ', "w" => $tm_key_struct->w ? 'Update' : '');
}
$job['private_tm_key'] = json_encode($tm_keys);
$job['disabled'] = $job_array['status_owner'] == Constants_JobStatus::STATUS_CANCELLED ? "disabled" : "";
$job['status'] = $job_array['status_owner'];
//These vars will be used in projects loop for some flag evaluation.
$project2info[$job['pid']]['status'][] = $job['status'];
$project2info[$job['pid']]['mt_engine_name'] = $job['mt_engine_name'];
$project2info[$job['pid']]['id_tms'] = $job['id_tms'];
$project2jobChunk[$job['pid']][$job['id']][$job['job_first_segment']] = $job;
}
//Prepare project data
foreach ($data as $item) {
$project = array();
$project['id'] = $item['pid'];
$project['name'] = $item['name'];
$project['jobs'] = array();
$project['no_active_jobs'] = true;
$project['has_cancelled'] = 0;
$project['has_archived'] = 0;
$project['password'] = $item['password'];
$project['tm_analysis'] = number_format($item['tm_analysis_wc'], 0, ".", ",");
$project['jobs'] = $project2jobChunk[$project['id']];
$project['no_active_jobs'] = $project['no_active_jobs'] ? ' allCancelled' : '';
$project2info[$project['id']]['status'] = array_unique($project2info[$project['id']]['status']);
$project['no_active_jobs'] = !in_array(Constants_JobStatus::STATUS_ACTIVE, $project2info[$project['id']]['status']) ? ' allCancelled' : '';
$project['has_cancelled'] = in_array(Constants_JobStatus::STATUS_CANCELLED, $project2info[$project['id']]['status']);
$project['has_archived'] = in_array(Constants_JobStatus::STATUS_ARCHIVED, $project2info[$project['id']]['status']);
$project['mt_engine_name'] = $project2info[$project['id']]['mt_engine_name'];
//.........这里部分代码省略.........
示例8: createCurrentMonthData
function createCurrentMonthData()
{
error_log('create current month data');
$db = db();
$config = config();
// delete data for previous month
error_log('clear previous month data');
$db->beginTransaction();
$db->prepare('delete from monthlyresults_google
where checkdate < date_format(date_sub(now(), interval 1 day), "%Y-%m-01")
')->execute();
$db->prepare('delete from monthlyresults_mail
where checkdate < date_format(date_sub(now(), interval 1 day), "%Y-%m-01")
')->execute();
$db->prepare('delete from monthlyresults_yandex
where checkdate < date_format(date_sub(now(), interval 1 day), "%Y-%m-01")
')->execute();
$db->commit();
error_log('create stat file');
$selectMonthStat = [];
$selectMonthStat['google'] = $db->prepare('
select * from monthlyresults_google
where project = ?
');
$selectMonthStat['mail'] = $db->prepare('
select * from monthlyresults_mail
where project = ?
');
$selectMonthStat['yandex'] = $db->prepare('
select * from monthlyresults_yandex
where project = ?
');
$monthDays = date('t');
$todayPrefix = date('Y-m-');
$fieldSep = ';';
foreach (getProjects() as $project) {
$statDir = DATA_PATH . '/stat/' . $project['name'];
// make dir for project stat
if (!is_dir($statDir)) {
mkdir($statDir);
}
$statFile = $statDir . '/' . $project['name'] . '_' . $todayPrefix . '01.csv';
if (file_exists($statFile)) {
unlink($statFile);
}
if ($fp = fopen($statFile, 'w')) {
foreach ($selectMonthStat as $checkerName => $checkerStat) {
$monthStat = [];
$checkerStat->execute([$project['name']]);
// fill data by keyword, date
foreach ($checkerStat as $row) {
if ($checkerName == 'yandex') {
$monthStat[$row->region_name][$row->keyword][$row->checkdate] = $row->pos;
} else {
$monthStat['single'][$row->keyword][$row->checkdate] = $row->pos;
}
}
//print_r($monthStat);
// create stat table
foreach ($monthStat as $region => $nextMonthStat) {
// header
fwrite($fp, $checkerName . ($checkerName == 'yandex' ? ' ' . $region : '') . $fieldSep);
foreach (range(1, $monthDays) as $day) {
fwrite($fp, ($day < 10 ? '0' . $day : $day) . $fieldSep);
}
fwrite($fp, PHP_EOL);
// keywords positions
foreach ($project['keywords'] as $keyword) {
fwrite($fp, $keyword . $fieldSep);
if (isset($nextMonthStat[$keyword])) {
foreach (range(1, $monthDays) as $day) {
$sday = $todayPrefix . ($day < 10 ? '0' . $day : $day);
fwrite($fp, (isset($nextMonthStat[$keyword][$sday]) ? $nextMonthStat[$keyword][$sday] : '0') . $fieldSep);
}
}
fwrite($fp, PHP_EOL);
}
fwrite($fp, PHP_EOL);
}
}
// end foreach checker
fclose($fp);
} else {
error_log("Can't create file " . $statFile);
}
}
// end foreach project
}
示例9: w2PgetParam
global $AppUI, $cal_sdf;
$AppUI->loadCalendarJS();
$project_id = (int) w2PgetParam($_GET, 'project_id', 0);
$company_id = (int) w2PgetParam($_GET, 'company_id', $AppUI->user_company);
$contact_id = (int) w2PgetParam($_GET, 'contact_id', 0);
$perms =& $AppUI->acl();
// check permissions for this record
$canEdit = $perms->checkModuleItem('projects', 'edit', $project_id);
$canAuthor = $perms->checkModuleItem('projects', 'add');
if (!$canEdit && $project_id > 0 || !$canAuthor && $project_id == 0) {
$AppUI->redirect('m=public&a=access_denied');
}
$pstatus = w2PgetSysVal('ProjectStatus');
$ptype = w2PgetSysVal('ProjectType');
$project = new CProject();
$structprojs = getProjects();
$structprojs = $project->getAllowedProjects($AppUI->user_id, false);
unset($structprojs[$project_id]);
$structprojs = array_map('temp_filterArrayForSelectTree', $structprojs);
$structprojects = arrayMerge(array('0' => array(0 => 0, 1 => '(' . $AppUI->_('No Parent') . ')', 2 => '')), $structprojs);
// get a list of permitted companies
$company = new CCompany();
$companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => ''), $companies);
// load the record data
$obj = $AppUI->restoreObject();
if ($obj) {
$project = $obj;
$project_id = $project->project_id;
} else {
$project->loadFull($AppUI, $project_id);
示例10: foreach
$startDate = $processDate;
$endDate = $processDate;
foreach ($dimensions as $key => $value) {
print_r("---DIMENSIONS---" . json_encode($value));
$result = $client->get_statistics(array('format' => 'json', 'account_id' => $account_id, 'dimensions' => json_encode($value), 'metrics' => json_encode(array('impression', 'click', 'click_rate', 'reach_impression', 'total_cost', 'confirmed_tracked_conversion', 'expand', 'event', 'average_expand_time', 'pageview', 'average_visibility_time', 'progress_100', 'progress_50', 'user_play', 'close', 'impression_adwords', 'click_adwords', 'cost_adwords', 'bounce_rate', 'average_time_spent_on_site', 'cost_per_pageview')), 'start_date' => $processDate, 'end_date' => $processDate));
echo '<pre>';
////print_r($result->headers);
//print_r($result);
//die();
/*
************* METADATA **************
*/
$adspacesMeta = getAdspaces($connSqlsrv);
$campaignsMeta = getCampaigns($connSqlsrv);
$channelsMeta = getChannels($connSqlsrv);
$projectsMeta = getProjects($connSqlsrv);
$creativesMeta = getCreatives($connSqlsrv);
$adnetworksMeta = getAdnetworks($connSqlsrv);
$insertionsMeta = getInsertions($connSqlsrv);
$agesMeta = getAges($connSqlsrv);
$ispsMeta = getIsps($connSqlsrv);
$opsMeta = getOps($connSqlsrv);
$browsersMeta = getBrowsers($connSqlsrv);
$socialsMeta = getSocials($connSqlsrv);
$gendersMeta = getGenders($connSqlsrv);
$GLOBALS["metrics"] = getMetrics($connSqlsrv);
$metrics = $GLOBALS["metrics"];
$metadata = $result->body->metadata;
foreach ($metadata as $key => $value) {
//print_r($key.'/');
foreach ($value as $idWeborama => $arrValues) {
示例11: getSubjects
<?php
include_once "analyticstracking.php";
include "../backend/sql-homepage.php";
$subjectsList = getSubjects();
$projects = getProjects();
$courseList = getCourses();
$subjectIcons = array();
foreach ($subjectsList as &$subject) {
$subjectIcons[$subject['subject_name']] = $subject['subject_icon'];
}
?>
<html lang="en-US">
<head>
<meta name="keywords" content="HTML, CSS, SQL, PHP, JavaScript">
<meta name="description" content="My personal homepage">
<meta charset="UTF-8">
<meta name="author" content="Roar Hoksnes Eriksen">
<link rel="stylesheet" href="styles/external-libraries/bootstrap.min.css">
<link rel="stylesheet" href="styles/external-libraries/font-awesome.min.css">
<link rel="stylesheet" href="styles/external-libraries/bootstrap-theme.min.css">
<link rel="stylesheet" href="styles/external-libraries/bootstrap.css.map">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<title>Roar Hoksnes Eriksen</title>
<link rel="stylesheet" href="styles/style.css">
</head>
<body>
<aside id="contact">
<button class="btn" onclick="openLinkedIn()"><span class="fontawesome" id="linked-in"></span></button>
示例12: testGetProjects
/**
* Tests getting projects from outside project class
*/
public function testGetProjects()
{
$projects = getProjects();
$this->assertEquals(4, count($projects));
$this->assertEquals(1, $projects[1]['project_id']);
$this->assertEquals('Test Project', $projects[1]['project_name']);
$this->assertEquals(1, $projects[1]['project_parent']);
$this->assertEquals(1, $projects[1][0]);
$this->assertEquals('Test Project', $projects[1][1]);
$this->assertEquals('', $projects[1][2]);
$this->assertEquals(2, $projects[2]['project_id']);
$this->assertEquals('Test Project 2', $projects[2]['project_name']);
$this->assertEquals(1, $projects[2]['project_parent']);
$this->assertEquals(2, $projects[2][0]);
$this->assertEquals('Test Project 2', $projects[2][1]);
$this->assertEquals(1, $projects[2][2]);
$this->assertEquals(3, $projects[3]['project_id']);
$this->assertEquals('Test Project 3', $projects[3]['project_name']);
$this->assertEquals(1, $projects[3]['project_parent']);
$this->assertEquals(3, $projects[3][0]);
$this->assertEquals('Test Project 3', $projects[3][1]);
$this->assertEquals(1, $projects[3][2]);
$this->assertEquals(4, $projects[4]['project_id']);
$this->assertEquals('Test Project 4', $projects[4]['project_name']);
$this->assertEquals(1, $projects[4]['project_parent']);
$this->assertEquals(4, $projects[4][0]);
$this->assertEquals('Test Project 4', $projects[4][1]);
$this->assertEquals(1, $projects[4][2]);
}
示例13: getAccounts
}
if (isset($_COOKIE['project'])) {
$_SESSION['project'] = $_COOKIE['project'];
}
if (isset($_COOKIE['account_href'])) {
$_SESSION['account_href'] = $_COOKIE['account_href'];
}
if (!isset($_GET['action'])) {
if (!isset($_SESSION['token'])) {
$oauth->requestAuthentication(array('user_id' => 10, 'project_id' => 20));
}
if (!isset($_SESSION['account_href'])) {
getAccounts($_SESSION['token']);
}
if (!isset($_SESSION['project_href'])) {
getProjects($_SESSION['account_href'], $_SESSION['token']);
}
getTodos($_SESSION['project'], $_SESSION['token']);
} else {
switch ($_GET['action']) {
case 'redirect':
if (!isset($_GET['code'])) {
throw new InvalidArgumentException("verification code missing");
}
$verification_code = $_GET['code'];
$tokens = $oauth->exchangeVerificationCode($verification_code);
$_SESSION['token'] = $tokens['access_token'];
setcookie('token', $tokens['access_token']);
file_put_contents('tokens', serialize($tokens) . "\n-----------------------\n", FILE_APPEND);
getAccounts($tokens['access_token']);
break;
示例14: setSchedule
setSchedule();
// ya
break;
case "NEWPROJECT":
createProject();
// ya
break;
case "DELETEPROJECT":
deleteProject();
// ya
break;
case "ADDUSER":
addUser();
break;
case "GETPROJECTS":
getProjects();
// ya
break;
case "GETPROJECTINFO":
getProjectInfo();
break;
case "GETTASKS":
getTasks();
break;
case "ADDTASK":
addTask();
break;
case "COMPLETETASK":
completeTask();
break;
case "SEARCHCOLLABORATORS":
示例15: session_start
<!DOCTYPE html>
<?php
session_start();
include "util/DbUtil.php";
$db_conn = getConnectedDb();
$content = array();
$languages = array();
$projects = array();
if (is_null($db_conn)) {
$errorMsg = new Content(null, "No database found.", null, null, null, null, null, null, null);
$content = $errorMsg;
} else {
$languages = getLanguages($db_conn);
$projects = getProjects($db_conn);
}
if (isset($_GET['project'])) {
$content = getContent_search_project($db_conn, $_GET['project']);
} else {
if (isset($_GET['language'])) {
$content = getContent_search_language($db_conn, $_GET['language']);
} else {
$content = getContent_select10($db_conn, $_GET['page'] * 10, ($_GET['page'] + 1) * 10);
}
}
?>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>