echo "<td style='font-family:Monaco !important; font-size:12px !important;' class=\"mdl-data-table__cell--non-numeric\" align=\"center\" onmouseover=\"this.innerHTML='{$row[$name]}';\" onmouseout=\"this.innerHTML='{$pw}';\">{$pw}</td>"; } else { if ($name == "registration_date" || $name == "latest_login" || $name == "last_login" || $name == "trn_date") { setlocale(LC_ALL, 'de_DE@euro'); $p = strtotime($row[$name]); $p_string = date('j.n.Y, H:i', $p); echo "<td class=\"mdl-data-table__cell--non-numeric\" align=\"center\">" . $p_string . "</td>"; } else { if ($name == "date") { setlocale(LC_ALL, 'de_DE@euro'); $t = strtotime($row[$name]); $date_string = date('j. F Y', $t); echo "<td class=\"mdl-data-table__cell--non-numeric\" align=\"center\">" . str_replace($english_months, $deutsch_monate, $date_string) . "</td>"; } else { if ($name == "linked_student") { echo "<td class=\"mdl-data-table__cell--non-numeric\" align=\"center\">" . getNameOfStudent($row['linked_student'], $row['linked_exam']) . "</td>"; } else { if ($name == "responsible_person") { echo "<td class=\"mdl-data-table__cell--non-numeric\" align=\"center\">" . getValueByKey($phd_db_name, "id", $row[$name], "name") . "</td>"; } else { if ($name == "linked_task") { echo "<td class=\"mdl-data-table__cell--non-numeric\" align=\"center\">" . getValueByKey($task_db_name, "id", $row[$name], "number") . getValueByKey($subtask_db_name, "id", $row['linked_subtask'], "letter") . "</td>"; } else { if ($name == "linked_subtask") { // } else { echo "<td class=\"mdl-data-table__cell--non-numeric\" align=\"center\">" . $row[$name] . "</td>"; } } } }
} else { if ($intent == "request") { if ($phd_mode) { $query = "SELECT * from `requests` WHERE linked_phd = {$id_phd} AND linked_exam = '{$exam_name}' AND DATE(start_time) = DATE(NOW()) ORDER BY start_time ASC"; } else { $query = "SELECT * from `requests` WHERE linked_student = {$matrikelnummer} AND linked_exam = '{$exam_name}' AND DATE(start_time) = DATE(NOW()) ORDER BY start_time ASC"; } $result = mysql_query($query); $val = 0; if (mysql_num_rows($result)) { while ($post = mysql_fetch_assoc($result)) { $post['task_name'] = getValueByKey($task_db_name, "id", $post['linked_task'], "number"); $post['subtask_name'] = getValueByKey($subtask_db_name, "id", $post['linked_subtask'], "letter"); if ($phd_mode) { $post['seat'] = getSeatbyMatrikel($post['linked_student'], $exam_name); $post['linked_student'] = getNameOfStudent($post['linked_student'], $exam_name); } else { $post['linked_phd'] = getValueByKey($phd_db_name, "id", $post['linked_phd'], 'name'); } if ($post['subtask_name'] == null) { $post['subtask_name'] = ""; } $posts[$val] = $post; $val = $val + 1; } } } else { if ($intent == "calendar" && $phd_mode == true) { if ($phd_mode) { $query = "SELECT * from `exams`"; $result = mysql_query($query);
$start_time = $now; $end_time = date($date_string, strtotime($now) + 600); } else { //CHECK ob zwischen 2 Elementen noch Platz ist. $time = date($date_string, strtotime($now) + 600); while ($current_time_item = mysql_fetch_assoc($date_result_reverse)) { $current_time_item_reverse_start = date($date_string, strtotime($current_time_item['start_time'])); $current_time_item_reverse_end = date($date_string, strtotime($current_time_item['end_time'])); if (abs(strtotime($current_time_item_reverse_start) - strtotime($time)) > 10 * 60) { $start_time = date($date_string, strtotime($time)); $end_time = date($date_string, strtotime($time) + 600); break; } $time = $current_time_item_reverse_end; } } } $query = "insert into requests (`linked_subtask`,`linked_task`,`linked_exam`,`linked_phd`,`linked_student`,`submission_date`,`start_time`,`end_time`,`type_of_question`) values('{$subtask_id}','{$task_id}','{$exam_name}','{$phd}','{$matrikelnummer}',now(),'{$start_time}','{$end_time}','{$type_of_question}')"; $settings = array("result" => "true"); mysql_query($query); include 'push.php'; $res = launchPushService(getValueByKey($phd_db_name, "id", $phd, 'deviceID'), "Neue Anfrage bei SmartInsight", "Anfrage von " . getNameOfStudent($matrikelnummer, $exam_name) . " betreffs {$type_of_question}!"); } } else { $settings = array("result" => "Ein unbekannter Fehler ist aufgetreten!"); } } } } } echo json_encode($settings);