本文整理汇总了PHP中request::connectClass方法的典型用法代码示例。如果您正苦于以下问题:PHP request::connectClass方法的具体用法?PHP request::connectClass怎么用?PHP request::connectClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::connectClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: securePost
<?php
$checkSession = true;
require_once '../includes/library.php';
include_once 'addon_functions.inc.php';
include_once 'addon_variables.inc.php';
//echo("ok");
//echo $_POST["id"];
//echo "status : ".$_POST["status"];
$status = securePost("status", VARTYPE_BOOL);
$id = securePost("id", VARTYPE_INT);
$message = securePost("comment", VARTYPE_TXT);
$datetime = date("Y-m-d H:i:s");
echo $datetime;
$updateDB = new request();
$updateDB->connectClass();
if ($status) {
//When turning on
$query = "INSERT INTO no_tasks_timer (task, owner, start) VALUES ({$id}, {$_SESSION['idSession']}, NOW())";
} else {
//When turning off
//Generate netOffice date from actual date
$date = date("Y-m-d");
$duration = 1;
//Generate duration from start time and present time
//Update task time
$query = "INSERT INTO no_tasks_time (project, task, owner, date, hours, comments, created, modified, encoder) \n\t\tVALUES ((SELECT project FROM no_tasks WHERE id = {$id} LIMIT 1), \n\t\t\t{$id}, \n\t\t\t{$_SESSION['idSession']}, \n\t\t\t'{$date}', \n\t\t\t(SELECT TIME_TO_SEC(TIMEDIFF( NOW(), start )) / 3600 \n\t\t\t\tFROM `no_tasks_timer` \n\t\t\t\tWHERE task = {$id} and owner = {$_SESSION['idSession']}), \n\t\t\t'{$message}', \n\t\t\tNOW(), \n\t\t\tNOW(), \n\t\t\t{$_SESSION['idSession']}); ";
$updateDB->query($query);
//Delete timer
$query = "DELETE FROM no_tasks_timer WHERE owner = {$_SESSION['idSession']};";
}
示例2: exit
include PHPCOLLAB_LANG_DIR . "lang_" . $langDefault . ".php";
// Check if emailAlerts is set to true
if ($emailAlerts == "false") {
// Return false
exit(1);
}
// Check that database vars are set
if (!defined('MYSERVER') || !defined('MYLOGIN') || !defined('MYPASSWORD') || !defined('MYDATABASE')) {
echo $strings['error_server'];
exit(1);
}
// Create database requests
$alert = new request();
$alert->connectClass();
$alertSub = new request();
$alertSub->connectClass();
// Get table names
$membersTable = $tableCollab['members'];
$notificationsTable = $tableCollab['notifications'];
$tasksTable = $tableCollab['tasks'];
$subtasksTable = $tableCollab['subtasks'];
$projectsTable = $tableCollab['projects'];
// Get current date
$today = date("Y-m-d", time());
// Create new notification
$mail = new notification();
$mail->message_type = "alt";
// Get list of members and notification settings
$query = "SELECT {$membersTable}.id, \n {$membersTable}.name,\n {$membersTable}.email_work\n FROM {$membersTable}, {$notificationsTable} \n WHERE {$membersTable}.id = {$notificationsTable}.member\n AND {$notificationsTable}.dailyAlert = 0";
// Gpet result
$alert->query($query);
示例3: foreach
$displayDate = "";
$delta = 0;
$totalDelta = 0;
//*** New functioning - browse through open days and compare to DB records ***
//Special case for Employer listing
if ($displayStyle == TASKTIME_EMPLOYER) {
//echo "TASKTIME_EMPLOYER";
//$project_group_addon="org.name ASC, ";
//$org_group_addon="tim.project ASC, ";
$projectsList = "";
foreach ($aEmployedProjectIDs as $work_package) {
$wpProjectID = is_array($work_package[PROJECT_ID]) ? implode(",", $work_package[PROJECT_ID]) : $work_package[PROJECT_ID];
$projectsList = $wpProjectID;
$tmpquery = "SELECT O.name, P.name, SUM(TT.hours) AS work\n\t\t\tFROM {$tableCollab["tasks_time"]} TT\n\t\t\tINNER JOIN {$tableCollab["projects"]} P ON TT.project = P.id\n\t\t\tINNER JOIN {$tableCollab["organizations"]} O ON P.organization = O.id\n\t\t\tWHERE TT.project IN ({$projectsList})\n\t\t\tGROUP BY P.name";
//echo $tmpquery;
$listHours->connectClass();
$listHours->query($tmpquery);
$totalHours = 0;
$theor_weekly_hours = $work_package[PROJECT_WEEKLY_HOURS];
//$project_begin=new DateTime($work_package[PROJECT_BEGIN]);
$project_begin = $work_package[PROJECT_BEGIN];
//echo $work_package[PROJECT_BEGIN];
//$project_now=new DateTime();
$project_now = "NOW";
//$project_duration_interval=date_diff($project_begin,$project_now);
//$project_duration=($project_duration_interval->format("%d"));
$project_duration_interval = date_diff_outdated($project_begin, $project_now, "w");
//echo $project_duration;
//echo $project_duration_interval;
while ($row = $listHours->fetch()) {
$block2->openRow($db_date_index);
示例4: request
document.xwbTForm.submit();
*/
/**
* --- Task Timer ---
*
*/
//Check if a running timer exists
/**
* TODO Check that idSession is numeric
*/
$timerToggleScript = "";
$activeTask = 0;
$activeTaskStart = 0;
$existingtasktimer = new request();
$query = "SELECT task, start FROM no_tasks_timer WHERE owner = {$_SESSION['idSession']} LIMIT 1";
$existingtasktimer->connectClass();
$existingtasktimer->query($query);
if ($foundtasktimer = $existingtasktimer->fetch()) {
// echo $foundtasktimer[0];
$activeTask = $foundtasktimer[0];
$activeTaskStart = $foundtasktimer[1];
} else {
// echo "nothing found";
}
//echo $_SESSION['idSession'];
/**
* TODO Add timer begin date and time at the end of task name
*/
//Add timer begin date and time at the end of task name
// DEBUG
// foreach ($_POST as $k => $v) { print "<font color=blue>\$_POST[$k] => $v</font><br>"; }