function getSchedule($needle, $schedules, $strict = false) { foreach ($schedules as $schedule) { if (($strict ? $schedule === $needle : $schedule == $needle) || is_array($schedule) && getSchedule($needle, $schedule, $strict)) { return $schedule; } } return false; }
public function actionView() { global $urlRequestRoot, $sourceFolder, $templateFolder, $cmsFolder, $moduleFolder; $moduleComponentId = $this->moduleComponentId; $userId = $this->userId; $scriptFolder = "{$sourceFolder}/{$moduleFolder}/events/"; require_once "{$sourceFolder}/{$moduleFolder}/events/events_common.php"; if (isset($_GET['subaction'])) { if ($_GET['subaction'] == "map") { return showEventMap(); } if ($_GET['subaction'] == "mobile") { return getEventsJSON($moduleComponentId); exit; } if ($_GET['subaction'] == "schedule") { return getSchedule($moduleComponentId); } } else { return selectViewSubaction(); } }
$this->open($stringDB); } } $type = $_REQUEST["type"]; //Läser in variablen type från GET-meddelandet. if ($type == "checkName") { //kylschema.php?type=checkName&name="namnet" checkName(); } else { if ($type == "saveSchedule") { //kylschema.php?type=saveSchedule&name="namnet"&temp="temperaturen" saveSchedule(); } else { if ($type == "getSchedule") { //kylschema.php?type=getSchedule&name="namnet" getSchedule(); } else { if ($type == "getList") { //kylschema.php?type=getList getList(); } else { if ($type == "upLoad") { //kylschema.php?type=upLoad&name="namnet"&temp="temperaturen" upLoad(); } else { if ($type = "delete") { //kylschema.php?type=delete&name="namnet" delete(); } } }
function schedule() { $row = getSchedule(); return $row; }
protected function OnInput() { parent::OnInput(); $this->title = 'Распорядок дня'; $this->schedule = getSchedule($this->date); }
<?php include 'db_helper.php'; if ($_GET['f'] == 'add' && $_GET['p1'] && $_GET['p2'] && $_GET['p3'] && $_GET['p4']) { addSchedule($_GET['p1'], $_GET['p2'], $_GET['p3'], $_GET['p4']); } elseif ($_GET['f'] == 'get' && $_GET['p1']) { getSchedule($_GET['p1']); } elseif ($_GET['f'] == 'del' && $_GET['p1'] && $_GET['p2'] && $_GET['p3'] && $_GET['p4']) { deleteSchedule($_GET['p1'], $_GET['p2'], $_GET['p3'], $_GET['p4']); } function addSchedule($TID, $Day, $Start, $End) { $dbQuery = sprintf("INSERT INTO Schedule (TID,Day,Start,End) VALUES ('%d','%s','%d','%d')", $TID, mysql_real_escape_string($Day), $Start, $End); $result = getDBResultInserted($dbQuery, 'TID'); //header("Content-type: application/json"); echo json_encode($result); } function deleteSchedule($TID, $Day, $Start, $End) { $dbQuery = sprintf("DELETE from Schedule WHERE TID ='%d', Day='s%', Start='%d', End='%d'", $TID, mysql_real_escape_string($Day), $Start, $End); $result = getDBResultInserted($dbQuery, 'TID'); //header("Content-type: application/json"); echo json_encode($result); } function getSchedule($TID, $Day, $Start, $End) { $dbQuery = sprintf("SELECT * from Schedule WHERE TID ='%d'", $TID, mysql_real_escape_string($Day), $Start, $End); $result = getDBResultInserted($dbQuery, 'TID'); //header("Content-type: application/json"); echo json_encode($result); }
/** * Reply the schedule of the groups(array) to the user(tweet) */ function replySchedule($tweet, $groups) { foreach ($groups as $group) { $message = getSchedule($group); postStatus("Under Construction", $tweet); } }
} ?> </div> <div id='php_sc_phase3'> <?php if(isset($_POST['phase2'])) { echo "<form action='#' method='post'>"; $batid = $_POST["batid"]; $sec = $_POST['sec']; $clsnum = $_POST['clsnum']; putPeriods($batid,$sec,$clsnum,$_POST['inputs'],$_POST['outputs']); echo getSchedule($batid,$sec,$clsnum); echo "<input type='hidden' name='batid' value='".$batid."'></input>"; echo "<input type='hidden' name='sec' value='".$sec."'></input>"; echo "<input type='hidden' name='clsnum' value='".$clsnum."'></input>"; echo "<input type='submit' name='phase3'></input></form>"; } ?> </div> <div id='phase4'> <?php if(isset($_POST['phase3'])) { $clsname = "Constants"; $con = mysql_connect($clsname::$dbhost, $clsname::$dbuname,$clsname::$dbpass);
saveSchedule($rptuser, $schedID, $schedReport, $schedName, $schedEmail, $schedTemplate, $schedFreq, $schedDay, $schedWeek, $schedWeekDay, $schedMonth, $schedMonthDay, $schedFormat, $_REQUEST['schedMessage']); sendResponse($finalResult['SchedulesInfo'], 'schedule'); } else { if ($function == 'remSchedule') { logger("Removing Schedule"); if (isset($schedule) && $schedule != '') { remSchedule($schedule); } else { if (isset($schedules) && $schedules != '') { remSchedule($schedules); } } } else { if ($function == 'getSchedule') { logger("Getting Schedule"); getSchedule($schedule); $msg_node[] = 'message'; sendResponse($finalResult['Schedule'], 'values', $msg_node); } else { if ($function == 'getSchedules') { logger("Getting Schedules"); getAllSchedules($rptuser); sendResponse($finalResult['SchedulesInfo'], 'schedule'); } else { if ($function == 'getSettings') { logger("Getting Settings"); getAllSettings($rptuser); sendResponse($finalResult['SettingsInfo'], 'setting'); } else { if ($function == 'saveSettings') { logger("Saving Settings - {$m}, {$d}, {$r}");
} else { include_once 'base_config.php'; } if ($RG_ROOT != '') { chdir("{$RG_ROOT}/lib"); } echo "Changing directory to " . getcwd() . "\n"; $schedules_skipped = array(); $schedules_ran = array(); $sched_count = 0; if (isset($finalResult['SchedulesInfo'])) { foreach ($finalResult['SchedulesInfo'] as $key => $sobj) { $sched_count++; $sid = $sobj['schid']; // Get all the details first getSchedule($sid); $sched = $finalResult['Schedule'][0]; // Read details $sfreq = $sched['frequency']; $sname = $sched['name']; $sfmt = $sched['format']; $srpt = $sched['repeat']; $sopt = $sched['options']; $semail = $sched['email']; $smessage = $sched['message']; $screated = $sched['created']; $smodified = $sched['modified']; $slastrun = $sched['lastrun']; $subject_text = ""; if ($smodified == '00000000000000') { $smodified = $screated;