public function update($from = false) { $this->data['lastUpdated'] = $this->mapmodel->getLastUpdatedDate(); if ($from) { $this->data['result'] = getRecords($from); } $this->load->view('map/update', $this->data); }
function list_functions_init($options = array()) { global $CURRENT_USER, $isRelatedRecords; // set defaults $isRelatedRecords = @$options['isRelatedRecords']; $tableName = @$options['tableName'] ? $options['tableName'] : $GLOBALS['tableName']; $schema = @$options['tableName'] ? loadSchema(@$options['tableName']) : $GLOBALS['schema']; $accessWhere = @$options['where'] ? $options['where'] : 'true'; $perPage = @$options['perPage']; // Perform search // if the search form was submitted, we need to reset page=1 if (@$_REQUEST['_defaultAction']) { $_REQUEST['page'] = 1; } // Reset Search (and clear saved editor state) if (@$_REQUEST['_resetSearch'] || @$_REQUEST['_resetSavedSearch']) { // clear last state and request on resetSearch. _resetSavedSearch is for custom links where you don't want previously saved search info to interfere $_SESSION['lastRequest'][$tableName] = array('showAdvancedSearch' => @$_SESSION['lastRequest'][$tableName]['showAdvancedSearch'], 'perPage' => @$_SESSION['lastRequest'][$tableName]['perPage'], 'page' => 1); } if (@$_REQUEST['_resetSearch']) { // clear last state and request on resetSearch $_REQUEST = array('menu' => @$_REQUEST['menu'], 'perPage' => @$_REQUEST['perPage'], 'page' => 1); } // Load last _REQUEST from _SESSION (current _REQUEST values override old ones) if (@$_SESSION['lastRequest'][$tableName] && !$isRelatedRecords && !@$_REQUEST['_ignoreSavedSearch']) { $sortByField = @$_SESSION['lastRequest'][$tableName]['sortBy']; $invalidSortByField = $sortByField && !@$schema[$sortByField]; if ($invalidSortByField) { unset($_SESSION['lastRequest'][$tableName]['sortBy']); } // v2.52 remove invalid sort by fields $_REQUEST += $_SESSION['lastRequest'][$tableName]; } // get user where (to limit to records user has access to) $showAllRecords = false; if (!@$schema['createdByUserNum']) { $showAllRecords = true; } elseif ($GLOBALS['hasEditorAccess']) { $showAllRecords = true; } elseif ($GLOBALS['hasViewerAccessOnly']) { $showAllRecords = true; } elseif ($GLOBALS['hasAuthorViewerAccess']) { $showAllRecords = true; } // viewers can see all records if (!$showAllRecords) { $accessWhere = "({$accessWhere}) AND `createdByUserNum` = '{$CURRENT_USER['num']}'"; } if ($tableName == 'accounts' && !@$CURRENT_USER['isAdmin']) { $accessWhere = "({$accessWhere}) AND `isAdmin` = '0'"; } // get ORDER BY $orderBy = $schema['listPageOrder']; if (@$_REQUEST['sortBy']) { if (!@$schema[$_REQUEST['sortBy']]) { die("Can't sortBy '" . htmlencode($_REQUEST['sortBy']) . "'. Not a valid field!"); } $orderBy = "`{$_REQUEST['sortBy']}` "; if (@$_REQUEST['sortDir'] == 'desc') { $orderBy .= " DESC"; } } // $accessWhere - This is for access control, records filtered out here aren't included in the record count (Total Record: 123) $accessWhere = applyFilters('list_where', $accessWhere, $tableName); // This is for searching, records filtered out here _are_ included in the record count (Total Record: 123) $accessWhere = applyFilters('record_access_where', $accessWhere, $tableName); // same as above, but this filter is also called in _displayRecordAccessErrors() $orderBy = applyFilters('list_orderBy', $orderBy, $tableName); // This is for modifying the orderBy option $searchWhere = $accessWhere; // load records list($records, $metaData) = getRecords(array('tableName' => $tableName, 'perPage' => $isRelatedRecords ? $perPage : getFirstDefinedValue(@$_REQUEST['perPage'], @$schema['_perPageDefault'], 25), 'pageNum' => $isRelatedRecords ? 1 : intval(@$_REQUEST['page']), 'orderBy' => $orderBy, 'where' => $searchWhere, 'allowSearch' => $isRelatedRecords ? false : true, 'requireSearchSuffix' => 'true', 'ignoreHidden' => true, 'ignorePublishDate' => true, 'ignoreRemoveDate' => true, 'includeDisabledAccounts' => true, 'loadPseudoFields' => false)); $metaData['totalMatches'] = $metaData['totalRecords']; $metaData['totalRecords'] = mysql_count($tableName, $accessWhere); // save _REQUEST to _SESSION (this is how we maintain state when user returns to list page) if (!$isRelatedRecords) { $skipFields = array('menu'); foreach ($_REQUEST as $key => $value) { // save all submitted values if (preg_match('/^_/', $key)) { continue; } // skip program command fields: _defaultAction, _advancedAction, etc if (in_array($key, $skipFields)) { continue; } // $_SESSION['lastRequest'][$tableName][$key] = $value; } $_SESSION['lastRequest'][$tableName]['page'] = $metaData['page']; // override page with calculated actual page from getRecords() $_SESSION['lastRequest'][$tableName]['perPage'] = $metaData['perPage']; // override perPage with actual perPage from getRecords() } // $listFields = preg_split("/\\s*,\\s*/", $schema['listPageFields']); // fields to show on list page return array($listFields, $records, $metaData); }
<?php include "../config.php"; include './app_functions.php'; $output = ""; $sql_crausel_mov = getRecords("SELECT ID,website_name,website_url,logo_path,location,description,channel FROM apps_availabe_on WHERE STATUS='1' ORDER BY ID DESC"); if (!empty($sql_crausel_mov)) { foreach ($sql_crausel_mov as $no => $row_data) { $hbo = "no"; $hd = "no"; if (explode(",", $row_data->channel)) { $channel = explode(",", $row_data->channel); foreach ($channel as $ch) { if ($ch == "1") { $hbo = "yes"; } else { if ($ch == "2") { $hd = "yes"; } } } } else { $channel = $row_data->channel; if ($channel == "1") { $hbo = "yes"; } else { if ($channel == "2") { $hd = "yes"; } } }
<?php include "../config.php"; include './app_functions.php'; $output = ""; $today = date('Y-m-d'); //echo "SELECT * from d_didyouknow WHERE DATE(ShowDate) <= '$today' ORDER BY ShowDate DESC LIMIT 15"; $sql_crausel_mov = getRecords("SELECT * FROM d_didyouknow ORDER BY RAND() LIMIT 3"); foreach ($sql_crausel_mov as $no => $row_data) { $output .= "<diduknow>\n\t\t<id>" . $row_data->DidYouKnowID . " </id>\n\t\t<description><![CDATA[" . $row_data->StoryLine . "]]></description> \n\t</diduknow>"; } header('Content-Type: application/xml; charset=utf-8'); echo '<?xml version="1.0" encoding="utf-8"?> <didyouknow_list> ' . $output . ' </didyouknow_list>';
<?php include "../config.php"; include './app_functions.php'; $stant_name = $_REQUEST['key']; $stant_value = $_REQUEST['val']; $output = ""; $sql_query = "SELECT * FROM b_movies WHERE Status=1 AND " . $stant_name . " = '" . $stant_value . "' ORDER BY AiringDateTime ASC LIMIT 25"; $sql_crausel_mov = getRecords($sql_query); //print_r($sql_crausel_mov); foreach ($sql_crausel_mov as $no => $row_data) { $is_hd = 0; if (!empty($row_data->IsHd)) { $is_hd = 1; } $arriving_time = $row_data->AiringDateTime; $remtime = date('Y-m-d H:i:s', strtotime($arriving_time . "- 1 hour")); $curtime = date('Y-m-d H:i:s'); $start_time = date('d-m-Y H:i:s', strtotime($arriving_time . "- 1 hour")); $end_time = date('d-m-Y H:i:s', strtotime($arriving_time . "-30 min")); $reminder = ""; if ($curtime >= $remtime) { $reminder = "no"; } else { $reminder = "yes"; } $movieurl = WEBSITE_PATH . getmoviename($row_data->Title, $row_data->MovieID); $output .= '<movie> <movie_id> ' . $row_data->MovieID . ' </movie_id> <title><![CDATA[' . $row_data->Title . ']]></title> <tuning>' . DateFormatWhole($row_data->AiringDateTime) . '</tuning>
<?php function getRecords() { $result = $pdo->query('SELECT * FROM articles'); while ($record = $pdo->fetch()) { (yield $record); } } foreach (getRecords() as $record) { echo $record['title'], "\n"; }
</th> <th class="text-center"><?php echo $Laverage[$lang]; ?> </th> <th class="text-center">WR</th> <th class="text-center">CR</th> <th class="text-center">NR</th> <th class="text-center">Gold</th> <th class="text-center">Silver</th> <th class="text-center">Bronze</th> </tr> </thead> <tbody> <?php getRecords(); ?> </tbody> </table> </div> </div> <!-- 結果履歴 --> <div class="tab-pane" id="history_tab"> <div class="panel-group" id="accordion1"> <?php getHistory(); ?> </div> </div>
<?php include "../config.php"; include './app_functions.php'; $sql_crausel_mov = getRecords("SELECT * FROM apps_cnst_update WHERE cnt_status = '1' ORDER BY id DESC"); foreach ($sql_crausel_mov as $no => $row_data) { $output .= '<updates> <id>' . $row_data->id . '</id> <title><![CDATA[' . nl2br(stripslashes($row_data->title)) . ']]></title> <thumb_image><![CDATA[' . $row_data->thumb_image . ']]></thumb_image> <description><![CDATA[' . htmlentities($row_data->description) . ' ]]></description> <update_url><![CDATA[' . htmlentities($row_data->updates_url) . ' ]]></update_url> <date>' . DateFormatWhole($row_data->update_date) . '</date> </updates>'; } header('Content-Type: application/xml; charset=utf-8'); echo '<?xml version="1.0" encoding="utf-8"?> <update_list> ' . $output . ' </update_list>';
function BuildTable() { global $flag, $idnum, $loggedin; $table = ''; #$table .= rowHTML(0, 0, -1, '#', 'NAME', 'NOTES', 'END DATE', 'ASSIGNED TO'); $ra = getRecords(); $number = 0; if ($flag == 'add') { #$flag = 'edit'; $table .= rowHTML(0, 1, 1, 1); } foreach ($ra as $entry) { $number++; $id = $entry['id']; $forceEdit = 0; $showButtons = 0; if ($loggedin == 1) { $showButtons = 1; } if ($flag == 'edit' && $id == $idnum) { $forceEdit = 1; } if ($flag == 'edit' && $id != $idnum) { $showButtons = 0; } if ($flag == 'add') { $showButtons = 0; } $table .= rowHTML($number, $entry, $forceEdit, $showButtons); } return $table; }
)); $kona_landing_pageRecord = @$kona_landing_pageRecords[0]; // get first record // show error message if no matching record is found if (!$kona_landing_pageRecord) { header("HTTP/1.0 404 Not Found"); print "Record not found!"; exit; } // Start Breadcrumb code $sqlQuery = str_replace(':', ',', $kona_landing_pageRecord['breadcrumb_identity']);// replace ":" with "," $removeEnd = substr_replace($sqlQuery ,"",-1); // remove "," from end of string $SQL = substr($removeEnd, 1); // remove "," from begining of string list($breadcrumbsRecords, $breadcrumbsMetaData) = getRecords(array( 'tableName' => 'breadcrumbs', 'where' => 'num IN(' . $SQL . ')', )); //declare h1 variable $headLineText = $kona_landing_pageRecord['headline_text']; include("/includes/viewerCode.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo $kona_landing_pageRecord['title'] ?></title> <meta name="description" content="<?php echo $kona_landing_pageRecord['seo_meta_description'] ?>" /> <meta name="keywords" content="<?php echo $kona_landing_pageRecord['seo_meta_keywords'] ?>" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<?php // records.php const QUARTER_SEC = 250000; const HALF_SEC = 500000; $recordCount = $_GET['count'] ? $_GET['count'] : 10; $range = range(1, $recordCount); $records = getRecords(); $start = microtime(true); foreach ($range as $i) { $records->next(); $record = $records->current(); $elapsed = round((microtime(true) - $start) * 1000); echo "{$record} fetched @ {$elapsed}ms <br>"; } function getRecords() { $preloadedRecords = array_map(function ($i) { return "Preloaded record #{$i}"; }, range(0, 10)); foreach ($preloadedRecords as $record) { (yield $record); } yield from loadOnlineRecords(); } function loadOnlineRecords() { $nearlineRecordCount = 10; foreach (range(1, $nearlineRecordCount) as $recordIndex) { $recordValue = "Online record #{$recordIndex}"; usleep(QUARTER_SEC);
if (!$organizations_pageRecord) { dieWith404("Record not found!"); } // show error message if no record found // load records from 'organization_listings' list($organization_listingsRecords, $organization_listingsMetaData) = getRecords(array('tableName' => 'organization_listings', 'loadUploads' => true, 'allowSearch' => false)); // load record from 'contact_info' list($contact_infoRecords, $contact_infoMetaData) = getRecords(array('tableName' => 'contact_info', 'where' => '', 'loadUploads' => true, 'allowSearch' => false, 'limit' => '1')); $contact_infoRecord = @$contact_infoRecords[0]; // get first record if (!$contact_infoRecord) { dieWith404("Record not found!"); } // show error message if no record found // load records from 'supporters_listings' list($supporters_listingsRecords, $supporters_listingsMetaData) = getRecords(array('tableName' => 'supporters_listings', 'loadUploads' => true, 'allowSearch' => false)); foreach ($homepage_contentRecord['open_graph_image'] as $index => $upload) { $open_graph_image = htmlencode($upload['urlPath']); } // FORM CODE $errorsAndAlerts = ""; $success = ""; if (@$_REQUEST['contact']) { //set error messages if (!@$_REQUEST['name']) { $errorsAndAlerts .= "<li>Please enter your name.</li>"; } if (!@$_REQUEST['email']) { $errorsAndAlerts .= "<li>Please enter your email address.</li>"; } elseif (!isValidEmail(@$_REQUEST['email'])) { $errorsAndAlerts .= "<li>Please enter a valid email address.</li>";
<h2>Влажность в камере</h2> <div class="mini_chart"></div> </figure> <figure id="temperature_processing"> <h2>Темп. подачи</h2> <div class="mini_chart"></div> </figure> <figure id="temperature_flow"> <h2>Темп. обработки</h2> <div class="mini_chart"></div> </figure> </div> <div id="center_column"> <figure id="chart" data-chart-limit="10" <?php foreach (getRecords('temperature', 10) as $number => $_data) { ?> <?php foreach ($_data as $name => $value) { echo "data-chart-{$name}-{$number}='{$value}' "; } ?> <?php } ?> ></figure> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="chart.js"></script> <script src="script.js"></script>
include "../includes/cms.php"; // load record from 'homepage_content' list($homepage_contentRecords, $homepage_contentMetaData) = getRecords(array('tableName' => 'homepage_content', 'where' => '', 'loadUploads' => true, 'allowSearch' => false, 'limit' => '1')); $homepage_contentRecord = @$homepage_contentRecords[0]; // get first record if (!$homepage_contentRecord) { dieWith404("Record not found!"); } // show error message if no record found // load records from 'articles' list($articlesRecords, $articlesMetaData) = getRecords(array('tableName' => 'articles', 'loadUploads' => true, 'allowSearch' => true)); $articlesRecord = @$articlesRecords[0]; // get first record // load record from 'contact_info' list($contact_infoRecords, $contact_infoMetaData) = getRecords(array('tableName' => 'contact_info', 'where' => '', 'loadUploads' => true, 'allowSearch' => false, 'limit' => '1')); $contact_infoRecord = @$contact_infoRecords[0]; // get first record if (!$contact_infoRecord) { dieWith404("Record not found!"); } // show error message if no record found foreach ($homepage_contentRecord['open_graph_image'] as $index => $upload) { $open_graph_image = htmlencode($upload['urlPath']); } // FORM CODE $errorsAndAlerts = ""; $success = ""; if (@$_REQUEST['contact']) { //set error messages if (!@$_REQUEST['name']) {
function getStandings($allSchools) { $all_records = []; $all_leagues = []; $ccc_d1e = []; $ccc_d1w = []; $ccc_d2e = []; $ccc_d2w = []; $ccc_d3e = []; $ccc_d3w = []; $csc = []; $ecc_d1 = []; $ecc_d2 = []; $fciac_d1 = []; $fciac_d2 = []; $nvl_brass = []; $nvl_copper = []; $nvl_iron = []; $peq_east = []; $peq_south = []; $peq_west = []; $scc_d1e = []; $scc_d1w = []; $scc_d2e = []; $scc_d2w = []; $swc_colonial = []; $swc_patriot = []; $db_standings = new Database(); // foreach ($allSchools as $team) { $getTeamRecord = "CALL getRecord('{$team['0']}')"; $record = $db_standings->getData($getTeamRecord); $record = getRecords($record, $team); if ($record[1] == 'Central Connecticut' && $record[2] == 'Div I East') { array_push($ccc_d1e, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'Div I West') { array_push($ccc_d1w, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'Div II East') { array_push($ccc_d2e, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'Div II West') { array_push($ccc_d2w, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'Div III East') { array_push($ccc_d3e, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'Div III West') { array_push($ccc_d3w, $record); } elseif ($record[1] == 'Constitution State') { array_push($csc, $record); } elseif ($record[1] == 'Eastern Connecticut' && $record[2] == 'Div I') { array_push($ecc_d1, $record); } elseif ($record[1] == 'Eastern Connecticut' && $record[2] == 'Div II') { array_push($ecc_d2, $record); } elseif ($record[1] == 'Fairfield County Interscholastic Athletic' && $record[2] == 'Div I') { array_push($fciac_d1, $record); } elseif ($record[1] == 'Fairfield County Interscholastic Athletic' && $record[2] == 'Div II') { array_push($fciac_d2, $record); } elseif ($record[1] == 'Naugatuck Valley' && $record[2] == 'Brass') { array_push($nvl_brass, $record); } elseif ($record[1] == 'Naugatuck Valley' && $record[2] == 'Copper') { array_push($nvl_copper, $record); } elseif ($record[1] == 'Naugatuck Valley' && $record[2] == 'Iron') { array_push($nvl_iron, $record); } elseif ($record[1] == 'Pequot' && $record[2] == 'East') { array_push($peq_east, $record); } elseif ($record[1] == 'Pequot' && $record[2] == 'South') { array_push($peq_south, $record); } elseif ($record[1] == 'Pequot' && $record[2] == 'West') { array_push($peq_west, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Div I East') { array_push($scc_d1e, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Div I West') { array_push($scc_d1w, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Div II East') { array_push($scc_d2e, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Div II West') { array_push($scc_d2w, $record); } elseif ($record[1] == 'South West' && $record[2] == 'Colonial') { array_push($swc_colonial, $record); } elseif ($record[1] == 'South West' && $record[2] == 'Patriot') { array_push($swc_patriot, $record); } else { array_push($all_records, $record); } // Sort ccc arrays by overal w, l usort($ccc_d1e, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_d1w, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_d2e, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_d2w, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_d3e, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_d3w, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort csc arrays by overal w, l usort($csc, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort ecc arrays by overal w, l usort($ecc_d1, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ecc_d2, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort fcica arrays by overal w, l usort($fciac_d1, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($fciac_d2, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort nvl arrays by overal w, l usort($nvl_brass, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($nvl_copper, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($nvl_iron, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort peq arrays by overal w, l usort($peq_east, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($peq_south, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($peq_west, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort scc arrays by overal w, l usort($scc_d1e, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($scc_d1w, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($scc_d2e, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($scc_d2w, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort swc arrays by overal w, l usort($swc_colonial, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($swc_patriot, make_comparer([14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Combine divisions into league array $ccc = [$ccc_d1e, $ccc_d1w, $ccc_d2e, $ccc_d2w, $ccc_d3e, $ccc_d3w]; $ecc = [$ecc_d1, $ecc_d2]; $fciac = [$fciac_d1, $fciac_d2]; $nvl = [$nvl_brass, $nvl_copper, $nvl_iron]; $peq = [$peq_east, $peq_south, $peq_west]; $scc = [$scc_d1e, $scc_d1w, $scc_d2e, $scc_d2w]; $swc = [$swc_colonial, $swc_patriot]; // Combine sorted divisions into all leagues array $all_leagues = ['central connecticut' => $ccc, 'constitution state' => $csc, 'eastern connecticut' => $ecc, 'fairfield county interscholastic athletic' => $fciac, 'naugatuck valley' => $nvl, 'pequot' => $peq, 'southern connecticut' => $scc, 'south west' => $swc]; } return $all_leagues; }
} $rowcount = count($records); return $records; } //print_r($_REQUEST); $where = $_REQUEST['where']; $orderby = $_REQUEST['orderby']; $limit = $_REQUEST['limit']; $offset = $_REQUEST['offset']; $pagesize = $_REQUEST['pagesize']; $rowcount = 0; //Open database connection: defined in db_conn.php $con = mysqli_connect(DBHOST, DBUSER, DBUSERPWD, DBNAME); //JSON must be UTF8 mysqli_set_charset($con, "utf8"); //Get records from database $records = getRecords($con, $where, $orderby, $limit, $offset, $pagesize, $rowcount); //Close database connection mysqli_close($con); //Return result to client $response = array(); $response['result'] = 'OK'; $response['where'] = $where; $response['orderby'] = $orderby; $response['limit'] = $limit; $response['offset'] = $offset; $response['pagesize'] = $pagesize; $response['records'] = $records; $response['rowcount'] = $rowcount; header("Content-type: application/json; charset=utf-8"); print json_encode($response);
</div> <?php } ?> <div style="<?php echo $style1; ?> "> <div style="<?php echo $style2; ?> "><b>Messages Posted by Others: </b></div> <?php $recs = getRecords($mb_table, "where board = \"{$mb_board}\" and id < {$mb_lastid} order by created desc limit {$mb_msgs_per_page}"); $n = count($recs); for ($i = 0; $i < $n; $i++) { $r = $recs[$i]; $id = $r["id"]; $author = $r["author"]; $body = $r["body"]; $created = $r["created"]; $subject = $r["subject"]; $mb_lastid = $id; ?> <table width=100%> <tr> <td align=left> <b> Message #<?php echo $id; ?>
$output = ""; $fromdate = date('Y-m-d'); $todate = date('Y-m-d', strtotime(date('Y-m-d') . "+ 13 day")); $fromTime = date('Y-m-d') . ' 19:00:00'; $toTime = date('Y-m-d H:i:s', strtotime("+8 hours", strtotime(date('Y-m-d') . ' 19:00:00'))); $next2days = date('Y-m-d', strtotime(date('Y-m-d') . "+ 2 day")); // // //$parentTime = strtotime($parent); //$later = strtotime("+6 hours", $parentTime); //echo date('Y-m-d H:i:s', $later); $sql_crausel_mov = getRecords("SELECT * FROM b_movies WHERE (DATE(AiringDateTime) BETWEEN '" . $fromdate . "' AND '" . $todate . "' OR promospot=1 ) AND `Status`=1 AND HomeCarausalPath !='' group by Title ORDER BY AiringDateTime ASC limit 0,8"); $sql_tonight_mov = getRecords("SELECT * FROM b_movies WHERE AiringDateTime BETWEEN '" . $fromTime . "' AND '" . $toTime . "' AND Status=1 ORDER BY AiringDateTime LIMIT 6"); $sql_banner = getRecords("SELECT id,title,banner_img FROM b_banners WHERE istatus = '1' ORDER BY img_order ASC LIMIT 5"); //$sql_3days_highligths = getRecords("SELECT * FROM b_movies WHERE (DATE(AiringDateTime) BETWEEN '" . $fromdate . "' AND '" . $next2days . "' OR IsHighlight=1 ) AND `Status`=1 group by Title ORDER BY AiringDateTime ASC limit 0,3"); $sql_3days_highligths = getRecords("SELECT * FROM b_movies WHERE IsHighlight=1 AND `Status`=1 AND DATE(AiringDateTime) >= '" . $fromdate . "' group by Title ORDER BY AiringDateTime ASC limit 0,3"); //Loop for hbo highlights movies foreach ($sql_banner as $no => $row_banner) { $output .= '<highlights_mov> <movie_id> ' . $row_banner->id . ' </movie_id> <title><![CDATA[' . $row_banner->title . ']]></title> <crausel_img><![CDATA[' . IMAGE_PATH . $row_banner->banner_img . ']]></crausel_img> <type>banner</type> </highlights_mov> '; } //Loop for hbo highlights movies foreach ($sql_crausel_mov as $no => $row_data) { $arriving_time = $row_data->AiringDateTime; $remtime = date('Y-m-d H:i:s', strtotime($arriving_time . "- 1 hour")); $curtime = date('Y-m-d H:i:s');
// load records from 'photo_and_video_links' list($photo_and_video_linksRecords, $photo_and_video_linksMetaData) = getRecords(array('tableName' => 'photo_and_video_links', 'loadUploads' => true, 'allowSearch' => false)); // load record from 'contact_info' list($contact_infoRecords, $contact_infoMetaData) = getRecords(array('tableName' => 'contact_info', 'where' => '', 'loadUploads' => true, 'allowSearch' => false, 'limit' => '1')); $contact_infoRecord = @$contact_infoRecords[0]; // get first record if (!$contact_infoRecord) { dieWith404("Record not found!"); } // show error message if no record found // load records from 'organization_listings' list($organization_listingsRecords, $organization_listingsMetaData) = getRecords(array('tableName' => 'organization_listings', 'loadUploads' => true, 'allowSearch' => false)); // load records from 'check_yourself_items' list($check_yourself_itemsRecords, $check_yourself_itemsMetaData) = getRecords(array('tableName' => 'check_yourself_items', 'loadUploads' => true, 'allowSearch' => false)); // load records from 'whos_flying' list($whos_flyingRecords, $whos_flyingMetaData) = getRecords(array('tableName' => 'whos_flying', 'loadUploads' => true, 'allowSearch' => false)); foreach ($homepage_contentRecord['open_graph_image'] as $index => $upload) { $open_graph_image = htmlencode($upload['urlPath']); } // FORM CODE $errorsAndAlerts = ""; $success = ""; if (@$_REQUEST['contact']) { //set error messages if (!@$_REQUEST['name']) { $errorsAndAlerts .= "<li>Please enter your name.</li>"; } if (!@$_REQUEST['email']) { $errorsAndAlerts .= "<li>Please enter your email address.</li>"; } elseif (!isValidEmail(@$_REQUEST['email'])) { $errorsAndAlerts .= "<li>Please enter a valid email address.</li>";
function getRecords($format, $set, $resumption = "") { global $OAI; try { $req = $OAI . "verb=ListRecords"; if ($resumption == "") { $req .= "&metadataPrefix={$format}&set={$set}"; } else { $req .= "&resumptionToken=" . $resumption; } error_reporting(0); $ret = file_get_contents($req); if ($ret == "") { return; } $xml = new DOMDocument(); $stat = $xml->loadXML($ret); if (!$stat) { throw new exception("No data for list reocrds {$req}"); } $nl = $xml->getElementsByTagNameNS("http://www.openarchives.org/OAI/2.0/", "record"); $r2 = htmlspecialchars($req); //echo "<req>{$r2} {$nl->length}</req>"; for ($i = 0; $i < $nl->length; $i++) { echo $xml->saveXML($nl->item($i)); } $nl = $xml->getElementsByTagName("resumptionToken"); if ($nl->length == 1) { $token = $nl->item(0)->nodeValue; if ($token == null) { return; } if ($token == "") { return; } getRecords($format, $set, $token); } } catch (exception $ex) { echo "ERROR: {$ex}"; } }
function getStandings($allSchools) { $all_records = []; $all_leagues = []; $brk = []; $ccc_nrw = []; $ccc_nrb = []; $ccc_crw = []; $ccc_crb = []; $ccc_srw = []; $ccc_srb = []; $cra = []; $csc_west = []; $csc_central = []; $csc_east = []; $ecc_lg = []; $ecc_md = []; $ecc_sm = []; $fciac_east = []; $fciac_central = []; $fciac_west = []; $nvl_brass = []; $nvl_copper = []; $nccc = []; $scc_ham = []; $scc_hou = []; $scc_oro = []; $scc_qui = []; $shr = []; $swc_colonial = []; $swc_patriot = []; $db_standings = new Database(); // foreach ($allSchools as $team) { $getTeamRecord = "CALL getRecord('{$team['0']}')"; $record = $db_standings->getData($getTeamRecord); $record = getRecords($record, $team); if ($record[1] == 'Berkshire') { array_push($brk, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'North Region White') { array_push($ccc_nrw, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'North Region Blue') { array_push($ccc_nrb, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'Central Region White') { array_push($ccc_crw, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'Central Region Blue') { array_push($ccc_crb, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'South Region White') { array_push($ccc_srw, $record); } elseif ($record[1] == 'Central Connecticut' && $record[2] == 'South Region Blue') { array_push($ccc_srb, $record); } elseif ($record[1] == 'Capital Region Athletic') { array_push($cra, $record); } elseif ($record[1] == 'Constitution State' && $record[2] == 'West') { array_push($csc_west, $record); } elseif ($record[1] == 'Constitution State' && $record[2] == 'Central') { array_push($csc_central, $record); } elseif ($record[1] == 'Constitution State' && $record[2] == 'East') { array_push($csc_east, $record); } elseif ($record[1] == 'Eastern Connecticut' && $record[2] == 'Large') { array_push($ecc_lg, $record); } elseif ($record[1] == 'Eastern Connecticut' && $record[2] == 'Medium') { array_push($ecc_md, $record); } elseif ($record[1] == 'Eastern Connecticut' && $record[2] == 'Small') { array_push($ecc_sm, $record); } elseif ($record[1] == 'Fairfield County Interscholastic Athletic' && $record[2] == 'East') { array_push($fciac_east, $record); } elseif ($record[1] == 'Fairfield County Interscholastic Athletic' && $record[2] == 'Central') { array_push($fciac_central, $record); } elseif ($record[1] == 'Fairfield County Interscholastic Athletic' && $record[2] == 'West') { array_push($fciac_west, $record); } elseif ($record[1] == 'Naugatuck Valley' && $record[2] == 'Brass') { array_push($nvl_brass, $record); } elseif ($record[1] == 'Naugatuck Valley' && $record[2] == 'Copper') { array_push($nvl_copper, $record); } elseif ($record[1] == 'North Central Connecticut') { array_push($nccc, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Hammonasset') { array_push($scc_ham, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Housatonic') { array_push($scc_hou, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Oronoque') { array_push($scc_oro, $record); } elseif ($record[1] == 'Southern Connecticut' && $record[2] == 'Quinnipiac') { array_push($scc_qui, $record); } elseif ($record[1] == 'Shoreline') { array_push($shr, $record); } elseif ($record[1] == 'South West' && $record[2] == 'Colonial') { array_push($swc_colonial, $record); } elseif ($record[1] == 'South West' && $record[2] == 'Patriot') { array_push($swc_patriot, $record); } else { array_push($all_records, $record); } // usort($brk, make_comparer([9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort ccc arrays by overal w, l usort($ccc_nrw, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_nrb, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_crw, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_crb, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_srw, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ccc_srb, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort cra arrays by overal w, l usort($cra, make_comparer([9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort csc arrays by overal w, l usort($csc_west, make_comparer([9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($csc_central, make_comparer([9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($csc_east, make_comparer([9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort ecc arrays by overal w, l usort($ecc_lg, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ecc_md, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($ecc_sm, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort fcica arrays by overal w, l usort($fciac_east, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($fciac_central, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($fciac_west, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort nccc arrays by overal w, l usort($nccc, make_comparer([9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort nvl arrays by overal w, l usort($nvl_brass, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($nvl_copper, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort scc arrays by overal w, l usort($scc_ham, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($scc_hou, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($scc_oro, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($scc_qui, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort shr arrays by overal w, l usort($shr, make_comparer([9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Sort swc arrays by overal w, l usort($swc_colonial, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); usort($swc_patriot, make_comparer([4, SORT_DESC], [5, SORT_ASC], [7, SORT_DESC], [9, SORT_DESC], [10, SORT_ASC], [12, SORT_DESC], [14, SORT_DESC], [15, SORT_ASC], [17, SORT_DESC], [0, SORT_ASC])); // Combine divisions into league array $ccc = [$ccc_nrw, $ccc_nrb, $ccc_crw, $ccc_crb, $ccc_srw, $ccc_srb]; $csc = [$csc_west, $csc_central, $csc_east]; $ecc = [$ecc_lg, $ecc_md, $ecc_sm]; $fciac = [$fciac_west, $fciac_central, $fciac_east]; $nvl = [$nvl_brass, $nvl_copper]; $scc = [$scc_ham, $scc_hou, $scc_oro, $scc_qui]; $swc = [$swc_colonial, $swc_patriot]; // Combine sorted divisions into all leagues array $all_leagues = ['berkshire' => $brk, 'capital region athletic' => $cra, 'central connecticut' => $ccc, 'constitution state' => $csc, 'eastern connecticut' => $ecc, 'fairfield county interscholastic athletic' => $fciac, 'north central connecticut' => $nccc, 'naugatuck valley' => $nvl, 'shoreline' => $shr, 'southern connecticut' => $scc, 'south west' => $swc]; } return $all_leagues; }
include './app_functions.php'; $day = $_REQUEST['day']; $displayDate = ""; $output = ""; $sql_crausel_mov = ""; if ($day == 1) { $todate = date('Y-m-d'); //display current day schedule $toTime = date('H:i:s'); $displayDate = date('M d, Y'); $sql_crausel_mov = getRecords("SELECT * FROM b_movies WHERE DATE(AiringDateTime) = '" . $todate . "' AND TIME(AiringDateTime) >= '" . $toTime . "' AND Status=1 ORDER BY AiringDateTime"); } else { $day = $day - 1; $todate = date('Y-m-d', strtotime(date('Y-m-d') . "+ " . $day . " day")); $displayDate = date('M d, Y', strtotime(date('Y-m-d') . "+ " . $day . " day")); $sql_crausel_mov = getRecords("SELECT * FROM b_movies WHERE DATE(AiringDateTime) = '" . $todate . "' AND Status=1 ORDER BY AiringDateTime"); } foreach ($sql_crausel_mov as $no => $row_data) { $is_hd = 0; if (!empty($row_data->IsHd)) { $is_hd = 1; } $arriving_time = $row_data->AiringDateTime; $remtime = date('Y-m-d H:i:s', strtotime($arriving_time . "- 1 hour")); $curtime = date('Y-m-d H:i:s'); $start_time = date('d-m-Y H:i:s', strtotime($arriving_time . "- 1 hour")); $end_time = date('d-m-Y H:i:s', strtotime($arriving_time . "-30 min")); $reminder = ""; if ($curtime >= $remtime) { $reminder = "no"; } else {
<?php include "../config.php"; include './app_functions.php'; $output = ""; $sql_crausel_mov = getRecords("SELECT * FROM apps_contest WHERE cnt_status = '1' ORDER BY contest_id DESC"); foreach ($sql_crausel_mov as $no => $row_data) { $output .= '<contest> <contest_id> ' . $row_data->contest_id . ' </contest_id> <contest_name><![CDATA[ ' . nl2br(stripslashes($row_data->contest_name)) . ']]></contest_name> <thumb_image> ' . $row_data->thumb_image . ' </thumb_image> <description><![CDATA[ ' . htmlentities($row_data->description) . ']]></description> <contest_url> ' . $row_data->contest_url . ' </contest_url> <start_date> ' . DateFormatWhole($row_data->start_date) . ' </start_date> <end_date> ' . DateFormatWhole($row_data->end_date) . ' </end_date> </contest>'; } header('Content-Type: application/xml; charset=utf-8'); echo '<?xml version="1.0" encoding="utf-8"?> <contest_list> ' . $output . ' </contest_list>';
if ($isSingleMenu) { $_REQUEST['num'] = 1; } ### load record $num = (int) @$_REQUEST['num']; // error checking if ($escapedTableName == '') { die("no tablename specified!"); } if ($num != (int) $num) { die("record number value must be an integer!"); } // load record $GLOBALS['RECORD'] = array(); if ($num) { list($records) = getRecords(array('tableName' => $tableName, 'where' => mysql_escapef(" num = ? ", $num), 'limit' => '1', 'loadCreatedBy' => false, 'allowSearch' => false, 'loadUploads' => false, 'loadPseudoFields' => true, 'ignoreHidden' => true, 'ignorePublishDate' => true, 'ignoreRemoveDate' => true, 'includeDisabledAccounts' => true)); $GLOBALS['RECORD'] = @$records[0]; // get first record } if (!$GLOBALS['RECORD']) { alert(t("Couldn't view record (record no longer exists)!")); include 'lib/menus/default/list.php'; exit; } // //doAction('record_preedit', $tableName, @$_REQUEST['num']); // showHeader(); ?> <script type="text/javascript" src="<?php
<?php $recipeCategory = getCategory(); // DEFINED VALUE $post_category_recipes = $_POST['category']; $post_recipes_name = $_POST['recipe_name']; $post_recipes_date = $_POST['recipe_date']; $post_ingredients = addslashes($_POST['recipe_ingredients']); $post_sauce = addslashes($_POST['recipe_sauce']); $post_method = addslashes($_POST['recipe_method']); $getRecords = getRecords($post_recipes_name); if ($_POST['btn-add-recipes'] == "Save Changes" || $_POST['btn-add-recipes'] == "Save Changes & Exit") { $checkName = getName($post_recipes_name); if ($checkName['rows'] > 0) { for ($i = 0; $i <= $getRecords['rows']; $i++) { $recipe_name = cleanurl($post_recipes_name . randomchr()); } } else { $recipe_name = cleanurl($post_recipes_name); } $uploads_dir = '../files/uploads/recipes_image/'; $userfile_name = str_replace(array('(', ')', ' '), '_', $_FILES['upload_recipes_1']['name']); $userfile_tmp = $_FILES['upload_recipes_1']['tmp_name']; $prefix = 'recipes_image-'; $prod_img = $uploads_dir . $prefix . $userfile_name; move_uploaded_file($userfile_tmp, $prod_img); $slider_image = $prefix . $userfile_name; $filename = "files/uploads/recipes_image/" . $slider_image; addNews($post_category_recipes, $post_recipes_name, $filename, $post_recipes_date, $post_ingredients, $post_sauce, $post_method, cleanurl($recipe_name), 'Visible', 'top'); if ($_POST['btn-add-recipes'] == "Save Changes & Exit") { ?>
function getPrevAndNextRecords($options) { global $TABLE_PREFIX; // error checking $errors = ''; if (!@$options['tableName']) { $errors .= "No 'tableName' value specified in options!<br/>\n"; } if ($errors) { die(__FUNCTION__ . ": {$errors}"); } $tableSchema = loadSchema($options['tableName']); $mysqlTableName = mysql_escape($TABLE_PREFIX . $options['tableName']); $targetNum = @$options['recordNum'] ? mysql_escape($options['recordNum']) : 0; $orderBy = @$options['orderBy'] ? $options['orderBy'] : $tableSchema['listPageOrder']; // set inital mysql variables $query = "SELECT @lastSeenNum:=0, @prevNum:=0, @nextNum:=0, @firstNum:=0, @lastNum:=0, @prevNumSet:=0, @foundTarget:=0"; if (@$options['debugSql']) { print "<xmp>{$query}</xmp>"; } mysql_query($query) or die("MySQL Error: " . htmlencode(mysql_error()) . "\n"); // get mysql to figure out which nums are prev, next, first, and last // NOTE: "The order of evaluation for expressions involving user variables is undefined..." See: http://dev.mysql.com/doc/refman/5.0/en/user-variables.html $query = "SELECT \n"; $query .= " IF(@firstNum, NULL, @firstNum:=num),\n"; // get firstRecordNum $query .= " @lastNum := num,\n"; // get lastRecordNum $query .= " IF(num='{$targetNum}', (@foundTarget:=1) & (@prevNum:=@lastSeenNum), @lastSeenNum:=num),\n"; // get prevRecordNum (Note that using AND here instead of & caused an issue with unexpected evalutation of the assignment operators on a Windows/MySQL 5.5.33 server) $query .= " IF(@foundTarget=1 AND num !='{$targetNum}' AND @nextNum = 0, @nextNum := num, null)\n"; // get nextRecordNum $query .= "FROM `{$mysqlTableName}` \n"; if (@$options['where']) { $query .= "WHERE {$options['where']} \n"; } $query .= "ORDER BY {$orderBy} \n"; if (@$options['debugSql']) { print "<xmp>{$query}</xmp>"; } mysql_query($query) or die("MySQL Error: " . htmlencode(mysql_error()) . "\n"); // load our calculated nums $query = "SELECT @prevNum as 'prevRecordNum', @nextNum as 'nextRecordNum', @firstNum as 'firstRecordNum', @lastNum as 'lastRecordNum'"; if (@$options['debugSql']) { print "<xmp>{$query}</xmp>"; } $row = mysql_get_query($query); // load records matching returned nums $numsToGet = array_values(array_filter($row)); array_push($numsToGet, 0); list($records, $metaData) = getRecords(array('tableName' => $options['tableName'], 'where' => "num IN (" . implode(',', $numsToGet) . ")", 'allowSearch' => false, 'debugSql' => @$options['debugSql'])); $recordsByNum = array_combine(array_pluck($records, 'num'), $records); // package up output $firstRecord = $row['firstRecordNum'] ? @$recordsByNum[$row['firstRecordNum']] : array(); $prevRecord = $row['prevRecordNum'] ? @$recordsByNum[$row['prevRecordNum']] : array(); $nextRecord = $row['nextRecordNum'] ? @$recordsByNum[$row['nextRecordNum']] : array(); $lastRecord = $row['lastRecordNum'] ? @$recordsByNum[$row['lastRecordNum']] : array(); return array($prevRecord, $nextRecord, $firstRecord, $lastRecord); }
$rid = $_GET["rid"]; $ptInfo = getPtInfo($pid); foreach ($ptInfo as $in) { $pid = $in["pid"]; $firstname = $in["firstname"]; $middlename = $in["middlename"]; $lastname = $in["lastname"]; $membership = $in["membership"]; $sex = $in["sex"]; $cs = $in["cs"]; $dob = $in["dateofbirth"]; $dateofbirth = date('F d, Y', strtotime($in["dateofbirth"])); $opdnum = $in["opdnum"]; $address = $in["address"]; } $ptRec = getRecords($pid); foreach ($ptRec as $r) { $dateofvisit = date('F d, Y', strtotime($r["dateofvisit"])); $age = $r["age"]; } $adm = getAdmissionDet($pid, $rid); foreach ($adm as $ad) { $aid = $ad["aid"]; $getdatead = $ad["dateadmitted"]; $service = $ad["service"]; $roomno = $ad["roomno"]; $bednumber = $ad["bednumber"]; $dayadmitted = date('d', strtotime($ad["dateadmitted"])); $undateadmitted = $ad["dateadmitted"]; $dateadmitted = date('F d, Y', strtotime($ad["dateadmitted"])); $timeadmitted = date('h:m a', strtotime($ad["dateadmitted"]));
Slim::registerAutoloader(); $app = new Slim(); if (USE_ADMIN_LOGIN) { $app->add(new BasicAuth(ADMIN_USERNAME, ADMIN_PASSWORD, 'private', array(new Route('DELETE', '/records'), new Route('DELETE', '/explorations'), new Route('PUT', '/explorations'), new Route('POST', '/explorations')))); } //exploration routes $app->get('/explorations/', 'listExplorations'); $app->get('/explorations/:id', 'getExploration'); $app->put('/explorations/:id', 'saveExploration'); $app->post('/explorations/', 'saveExploration'); $app->delete('/explorations/:id', 'deleteExploration'); //record routes $app->get('/records/:arg', 'getRecord'); $app->get('/records/', function () use($app) { $req = $app->request->params('exploration_id'); getRecords($req); }); $app->delete('/records/:arg', 'deleteRecord'); //upload record routes $app->post('/records/submit/', 'submitRecord'); $app->post('/records/upload/', 'uploadRecordFile'); $app->run(); /* Exploration Methods */ function getExploration($arg) { try { $db = getConnection(); $stmt = $db->prepare("SELECT * FROM " . DB_TABLE_EXPLORATIONS . " WHERE id = :id"); $stmt->execute(array(':id' => $arg)); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); $db = null;