hours </td> <?php } ?> <td> </td> </tr> <?php $category = getCategory($_GET['user_id'], $fromdate, $todate); if ($category) { foreach ($category as $categoryKey => $categoryValue) { $categorycnt[$categoryValue] = 1; $project = getProject($_GET['user_id'], $categoryKey, $fromdate, $todate); if ($project) { foreach ($project as $projectKey => $projectValue) { $projectcnt[$projectValue] = 1; $task = getTask($_GET['user_id'], $categoryKey, $projectKey, $fromdate, $todate); if ($task) { $j = 0; foreach ($task as $taskKey => $taskValue) { ?> <tr> <td><?php if ($categorycnt[$categoryValue] == 1) { echo $categoryValue; } $categorycnt[$categoryValue]++; ?> </td> <td><?php if ($projectcnt[$projectValue] == 1) { echo $projectValue;
function getWeeksTime($time, $user_id) { $colname_rsTimesheet = "-1"; if (isset($user_id)) { $colname_rsTimesheet = get_magic_quotes_gpc() ? $user_id : addslashes($user_id); } $query_rsTimesheet = sprintf("SELECT * FROM procentris_timesheet WHERE user_id = %s", $colname_rsTimesheet); $rsTimesheet = mysql_query($query_rsTimesheet) or die(mysql_error()); $row_rsTimesheet = mysql_fetch_assoc($rsTimesheet); $totalRows_rsTimesheet = mysql_num_rows($rsTimesheet); $today = getdate($time); $chkdate = $today['weekday']; $chkdate2 = strtolower($chkdate); $arr = getDays($time); $fromdate = $arr['monday']['year'] . "-" . $arr['monday']['mon'] . "-" . $arr['monday']['mday']; $todate = $arr['sunday']['year'] . "-" . $arr['sunday']['mon'] . "-" . $arr['sunday']['mday']; //$fromdate = $arr[$chkdate2]['year']."-".$arr[$chkdate2]['mon']."-".$arr[$chkdate2]['mday']; //$todate = $arr[$chkdate2]['year']."-".$arr[$chkdate2]['mon']."-".$arr[$chkdate2]['mday']; $category = getCategory($user_id, $fromdate, $todate); if ($category) { $result = '<table border=1 cellspacing=0 cellpadding=2>'; $result .= '<tr><td colspan=10 align=center>' . $today['mday'] . ' ' . $today['month'] . ', ' . $today['year'] . '</td></tr>'; $result .= '<tr><td align=left><b>Client</b></td><td align=left><b>Project</b></td><td align=left><b>Task</b></td>'; foreach ($arr as $key => $value) { $result .= '<td align=left><b>' . substr(ucfirst($key), 0, 3) . '</b></td>'; } $result .= '</tr>'; foreach ($category as $categoryKey => $categoryValue) { $categorycnt[$categoryValue] = 1; $project = getProject($user_id, $categoryKey, $fromdate, $todate); if ($project) { foreach ($project as $projectKey => $projectValue) { $projectcnt[$projectValue] = 1; $task = getTask($user_id, $categoryKey, $projectKey, $fromdate, $todate); if ($task) { $j = 0; foreach ($task as $taskKey => $taskValue) { if ($categorycnt[$categoryValue] == 1) { $result .= '<tr> <td align=left>' . $categoryValue . '</td>'; } else { $result .= '<td align=left> </td>'; } $categorycnt[$categoryValue]++; if ($projectcnt[$projectValue] == 1) { $result .= '<td align=left>' . $projectValue . '</td>'; } else { $result .= '<td align=left> </td>'; } $projectcnt[$projectValue]++; $result .= '<td align=left>' . $taskValue . '</td>'; $i = 0; $totalh[$j] = 0; foreach ($arr as $key => $value) { $timetaken[$i] = getTime($user_id, $categoryKey, $projectKey, $taskKey, $arr[$key]['year'] . "-" . $arr[$key]['mon'] . "-" . $arr[$key]['mday']); if (number_format($timetaken[$i], 2) == "0.00") { $taketime = " "; } else { $taketime = number_format($timetaken[$i], 2); } $result .= '<td align=right>' . $taketime . '</td>'; $totalv[$key] += $timetaken[$i]; $totalh[$j] += $timetaken[$i]; $i++; } $j++; $result .= '</tr>'; } } } } } $result .= '<tr><td align=left> </td><td align=left> </td><td align=right><b>Total:</b></td>'; foreach ($arr as $key => $value) { $grandtotal += $totalv[$key]; $result .= '<td align=right>' . number_format($totalv[$key], 2) . '</td>'; } $result .= '</tr>'; $result .= '<tr><td colspan=10 align=center>TOTAL HOURS WORKED THIS WEEK: <b>' . number_format($grandtotal, 2) . '</b></td></tr>'; $result .= '</table>'; return $result; } }
$tmp++; } $excel .= "Total\r\n"; $worksheet->writeString($row, $tmp, "Total", $formatbold); $tmp = 0; $row++; for ($x = 0; $x < 11; $x++) { $worksheet->writeString($row, $x, "", $formatborder); } foreach ($category as $categoryKey => $categoryValue) { $categorycnt[$categoryValue] = 1; $project = getProject($user_id, $categoryKey, $fromdate, $todate); if ($project) { foreach ($project as $projectKey => $projectValue) { $projectcnt[$projectValue] = 1; $task = getTask($user_id, $categoryKey, $projectKey, $fromdate, $todate); if ($task) { $j = 0; foreach ($task as $taskKey => $taskValue) { if ($categorycnt[$categoryValue] == 1) { $excel .= $categoryValue; $worksheet->writeString($row, $tmp, $categoryValue, $format1); } $excel .= "\t"; $tmp++; $categorycnt[$categoryValue]++; if ($projectcnt[$projectValue] == 1) { $excel .= $projectValue; $worksheet->writeString($row, $tmp, $projectValue, $format1); } $excel .= "\t";
case 'patient': //loadView(); //get patient details according to patient_id in url query $patient = getPatient(getVar('patient_id')); //get user info $user = get_userdata($patient->practitioner); //get appointments $appointments = getAppointments($patient->patient_id); //get user_id $practitioner_id = get_current_user_id(); //$letterCount = letterCount();//used in de patient_menu module loadJS('patient.js', 'patient'); include 'views/patient_new.php'; break; } switch (getTask()) { case 'search': $patients = Patient::searchPatients(getVar('q')); include 'views/search_results.php'; break; case 'save_notes': //$notes = $_POST["notes"]; $notes = getVar('notes'); $wpdb->update('table_patients', array('notes' => getVar('notes')), array('patient_id' => getVar('patient_id'))); break; } ?>
<?php include $VERSION_PATH . "core/header.php"; if (isset($_GET['tid'])) { $row = mysql_fetch_array(getTask($_GET['tid'])); echo "Working on Task: " . $row['TID']; } else { //echo "NO TASK SELECTED"; } if (isset($_POST['description'])) { $description = cleanInput($_POST['description']); if ($description) { $comments = cleanInput($_POST['comments']); $completed = isset($_POST['completed']) ? 1 : 0; if (updateTask(cleanInput($_POST['tid']), $description, $comments, $completed)) { echo "TASK SUCCESSFULLY UPDATED"; } else { echo "THERE WAS AN ERROR UPDATING YOUR TASK. PLEASE TRY AGAIN LATER."; } } else { echo "PLEASE FILL OUT ALL REQUIRED FIELDS."; } } ?> <h1 class="title">Update Task</h1> <div class="entry"> <form name="input" action="/update/index.php" method="post"> <table> <tr><td colspan="3"><hr /></td></tr> <tr> <td align="left"><b>TASK DETAILS</b></td>
</head> <body> <div id="container"> <h1>Train the classifiers</h1> <?php $crisisFilterString = ""; if (isset($crisisID)) { $crisisFilterString = "?crisisid=" . $crisisID; } echo '<form method="post" action="submit_task.php' . $crisisFilterString . '" onsubmit="return validateInput()">'; $userID = getUserID(); $crisisID = null; if (isset($_GET["crisisid"])) { $crisisID = intval($_GET["crisisid"]); } $task = getTask($crisisID, $userID); if (is_null($task)) { echo '<div class="panel"><h2>Thank you</h2><div class="subpanel">There are no more documents to label. Please check back later.</div></div>'; } else { echo '<h2>Document</h2>'; echo '<div id="document" class="panel text">'; echo '<input type="hidden" name="crisisID" value="' . $crisisID . '" />'; echo '<input type="hidden" name="documentID" value="' . $task->documentID . '" />'; echo "<div class=\"subpanel\">" . linkify($task->getText()) . "</div>"; echo '</div>'; echo '<h2>Labels</h2>'; echo '<div id="options" class="panel">'; foreach ($task->attributeInfo as $attribute) { $attributeID = $attribute->{'id'}; $attributeName = $attribute->{'name'}; $labels = $attribute->{'labels'};
} if ($checkexist) { if (APinDB($bssid, $essid, $key)) { return 4; } } $aps[] = $bssid; $stmt->bind_param("ssssssssssssssssssssssssssssssssssss", $comment, $row[0], $row[1], $row[4], $row[5], $row[6], $row[7], $row[8], $row[9], $row[10], $row[11], $row[12], $row[13], $row[14], $row[15], $row[16], $row[17], $row[18], $comment, $row[0], $row[1], $row[4], $row[5], $row[6], $row[7], $row[8], $row[9], $row[10], $row[11], $row[12], $row[13], $row[14], $row[15], $row[16], $row[17], $row[18]); $stmt->execute(); return 0; } if (!db_connect()) { break; } $tid = $db->real_escape_string($tid); $task = getTask($tid); if ($task !== false) { $checkexist = $task['checkexist']; if ($checkexist) { $chkst = $db->prepare("SELECT * FROM `free` WHERE `BSSID`=? AND `ESSID`=? AND `WiFiKey`=? LIMIT 1"); } $warn = array(); $ext = $task['ext']; $filename = 'uploads/' . $tid . $ext; if (($handle = fopen($filename, 'r')) !== false) { $comment = $task['comment']; $sql = 'INSERT INTO `free` (`comment`,`IP`,`Port`,`Authorization`,`name`,`RadioOff`,`Hidden`,`BSSID`,`ESSID`,`Security`,`WiFiKey`,`WPSPIN`,`LANIP`,`LANMask`,`WANIP`,`WANMask`,`WANGateway`,`DNS`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE `comment`=?,`IP`=?,`Port`=?,`Authorization`=?,`name`=?,`RadioOff`=?,`Hidden`=?,`BSSID`=?,`ESSID`=?,`Security`=?,`WiFiKey`=?,`WPSPIN`=?,`LANIP`=?,`LANMask`=?,`WANIP`=?,`WANMask`=?,`WANGateway`=?,`DNS`=?;'; $stmt = $db->prepare($sql); $i = 0; $cnt = 0; $aps = array();
//Marcar conclusão de uma tarefa $success = taskDone($id); if ($success) { $success->status = 200; echo json_encode($success, JSON_PRETTY_PRINT); return http_response_code($RESPONSE_CODES['ok']); } else { $responseCode = http_response_code(403); echo json_encode(["status" => $responseCode, "mensagem" => sprintf($ERROR_MESSAGES['task_not_found'], $id)]); return $responseCode; } } case 'DELETE': parse_str(file_get_contents('php://input'), $vars); if (!empty($id = $vars['id'])) { $task = getTask($id); if ($task) { removeTask($task->id); $responseCode = $RESPONSE_CODES['no_content']; echo json_encode(["status" => $responseCode, "mensagem" => "Tarefa apagada"]); return http_response_code($responseCode); } else { echo json_encode(["status" => $RESPONSE_CODES['bad_request'], "mensagem" => "Tarefa não encontrada"]); return http_response_code($RESPONSE_CODES['bad_request']); } } else { $responseCode = $RESPONSE_CODES['bad_request']; echo json_encode(["status" => $responseCode, "mensagem" => sprintf($ERROR_MESSAGES['miss_param'], "id")]); return $responseCode; } }
<?php /** * Created by JetBrains PhpStorm. * User: User * Date: 10.12.15 * Time: 22:22 * To change this template use File | Settings | File Templates. */ set_include_path('..'); require_once 'Core/Auth.php'; require_once 'Repository/TreeRepository.php'; require_once 'Repository/TaskRepository.php'; $Position = (int) $_POST['position']; if ($CurrentUser != null) { if ($CurrentUser->CurrentTreeID == null) { chooseTask($CurrentUser, $Position); $CurrentUser = getUserBySession($_COOKIE['auth']); } $Tree = getTree($CurrentUser->CurrentTreeID); if ($Tree->Position == $Position) { $Task = getTask($Tree->TaskID); echo json_encode(array("text" => $Task->Text)); die; } } die("Error!");
if (!is_file($proxy)) { loger("Loading proxy list"); include DIR . 'proxy.php'; } $proxy = file($proxy); $proxy = array_map("trim", $proxy); $proxy = array_unique($proxy); if (empty($proxy)) { loger("No proxy found"); exit(1); } else { loger("Load proxy success, total " . count($proxy)); } //加载任务列表 include DIR . 'task.php'; $task = getTask(); if (empty($task)) { loger("No task found"); exit(1); } else { loger("Load task success, total " . count($task)); //清空进程锁目录 $dir = DIR . "cache/thread/*"; `rm -f {$dir}`; //如何实现异步多线程 foreach ($task as $job => $tasks) { foreach ($tasks as $url) { //进程上限锁 while (thread_count() > 10) { sleep(1); }
getEvent(); getUser(); getRole(); buildSummary(); } elseif ($type == "orguser") { getVApp(); getVAppTemplate(); getVAppNetwork(); getVM(); getVMNetwork(); getCatalog(); getCatalogItem(); getMedia(); getOrgVdc(); getOrgNet(); getTask(); getEvent(); getUser(); buildSummary(); } else { $service->logout(); echo "Invalid report type!\n"; exit(1); } // log out $service->logout(); buildHtmlFooter(); function buildSummary() { if ($GLOBALS['SUMMARY'] != "yes") { return;
<?php /** Page that processes ajax calls made by taskList.php page. @author Joseph Fehrman */ session_start(); include_once "../db/connection.php"; $username = $_SESSION['username']; $validation = getTask($username, $conn); /** Prints the current task list as the response. */ function getTask($user, $connection) { $completed = $_POST['completed_task']; $taskHTML = "<tr><th>ID</th><th>Task Name</th><th>Description</th><th>Difficulty</th><th>Assigned</th><th>Due</th><th></th></tr>"; // Check to see if the page needs to load active or resolved task. if ($completed == "true") { $status = "resolved"; } else { $status = "active"; } $sqlGetTask = "SELECT tt.id as id, task_name, description, tdr.difficulty_type as difficulty_type, assigned_date, due_date FROM todo_task tt LEFT JOIN todo_task_difficulty_rating tdr ON tdr.id = tt.difficulty_id WHERE Username = '******' AND status='{$status}'"; $results = mysqli_query($connection, $sqlGetTask) or die("Error on query: " . $sqlGetTask); while ($row = mysqli_fetch_array($results)) { $due_date = null; $assigned_date = null; if ($row['due_date'] != null) { $due_date = date("m/d/Y", strtotime($row['due_date']));
/** * Marca uma tarefa como concluida * @param $id Id da tarefa * @return mixed A tarefa modificada, ou false em caso de falha */ function taskDone($id) { global $TASKS_DIR; $filename = "{$TASKS_DIR}/{$id}.json"; $task = getTask($id); if ($task) { $task->concluida = true; $task->modificada = date("Y-m-d"); writeJson($filename, $task); return $task; } return false; }
require_once 'Servicios/getTask.php'; $app = new \Slim\Slim(); require_once 'Servicios/Auth.php'; $log = new IOManager(); $log->logAll($app->request->headers); $deviceId = $app->request->headers->get('deviceID'); $hash = $app->request->headers->get('hash'); $respuesta = auth($deviceId, $hash); if ($respuesta != "Auth_OK") { echo $respuesta; return; } //Obtiene los parametros del header http $idTask = $app->request->headers->get('idTask'); //LLama el método que lee de la base de datos y obtiene la respuesta $respuesta = getTask($idTask); //Muestra la respuesta al cliente echo $respuesta; }); //-------------------------------------------------------------------------------------------------- $app->put('/addTask', function () { //Importa el archivo que contiene el método require_once 'Servicios/editTask.php'; $app = new \Slim\Slim(); require_once 'Servicios/Auth.php'; $deviceId = $app->request->headers->get('deviceID'); $hash = $app->request->headers->get('hash'); $respuesta = auth($deviceId, $hash); if ($respuesta != "Auth_OK") { echo $respuesta; return;