function write_details($_POST) { extract($_POST); # validate input require_lib("validate"); $v = new validate(); $v->isOk($branch_ip, "url", 1, 50, "Invalid Branch IP."); $v->isOk($branch_company, "url", 4, 4, "Invalid Branch Company Code."); $v->isOk($branch_username, "string", 1, 50, "Invalid Branch Username."); // $v->isOk ($branch_password, "url", 1, 50, "Invalid Branch Password."); // $v->isOk ($branch_passwordconfirm, "url", 1, 50, "Invalid Branch Password."); // $v->isOk ($branch_ip, "url", 1, 50, "Invalid Branch IP."); if ($branch_password != $branch_passwordconfirm) { $v->addError($branch_password, "Passwords do not match."); } # display errors, if any if ($v->isError()) { $confirmCust = ""; $errors = $v->getErrors(); foreach ($errors as $e) { $confirmCust .= "<li class='err'>" . $e["msg"] . "</li>"; } return get_details($_POST, $confirmCust); } db_connect(); $add_sql = "\n\t\tINSERT INTO branches_data (\n\t\t\tbranch_name, branch_desc, branch_contact, branch_ip, \n\t\t\tdate_added, last_online, branch_username, branch_password, \n\t\t\tlast_login_from, branch_localuser, branch_company\n\t\t) VALUES (\n\t\t\t'{$branch_name}', '{$branch_desc}', '{$branch_contact}', '{$branch_ip}', \n\t\t\t'now', '1990-01-01', '{$branch_username}', md5('{$branch_password}'), \n\t\t\t'1990-01-01', '{$branch_localuser}', '{$branch_company}'\n\t\t)"; $run_add = pg_exec($add_sql) or errDie("Unable to add branch information."); $display = "\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>Branch Added</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>Branch Has Been Added.</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t"; return $display; }
function get_email_template($id) { global $booking; $body = file_get_contents(PLUGIN_DIR . 'templates/' . $booking['email_template'] . '/index.html'); $title = str_replace("[title]", $booking['email_title'], $body); $heading = str_replace("[heading]", $booking['email_heading'], $title); $intro = str_replace("[intro]", $booking['email_intro'], $heading); $banner = str_replace("[banner]", $booking['email_banner']['url'], $intro); $logo = str_replace("[logo]", $booking['email_logo']['url'], $banner); $link = str_replace("[link]", get_bloginfo('url'), $logo); $fb = str_replace("[fb_url]", $booking['facebook_url'], $link); $li = str_replace("[li_url]", $booking['linkedin_url'], $fb); $tw = str_replace("[tw_url]", $booking['twitter_url'], $li); $src = str_replace("[src]", PLUGIN_DIR_URL . 'templates/' . $booking['email_template'], $tw); $html = $src; $final = str_replace("[details]", get_details($id), $html); return $final; }
function runWales() { echo "Wales"; // the maximum nuber of pages to scrape $currentMaxPages = 24; // bookmark the current country scraperwiki::save_var("currentcountry", "wales"); // The URL to scrape $url = "http://www.english-country-cottages.co.uk/wales?page="; // Call the scraper get_details($url, $currentMaxPages); // Reset the page counter and move on to the next country scraperwiki::save_var("page", 1); }
function build_result($array, $pager) { //define some vars $result = $array['search']['results']['subtitle']; $base = get_base($array['search']['base']); $time = get_results($array['search']['results']); //print the content if (count($result) == 0) { print "<div align=\"center\"><h2>No result found</h2></div>"; } else { ?> <table width="55%" style="border-collapse:collapse;" border="1" cellspacing="0" cellpadding="5"> <tr> <td colspan="9" align="right">Search took <font class="releasename"> <?php echo $time["searchtime"]; ?> s</font>, Items found <font class="releasename"> <?php echo $time["itemsfound"]; ?> </font></td> </tr> <tr> <td align="left" colspan="4" width="100%">Movie name</td> <td nowrap="nowrap" align="center">Added</td> <td nowrap="nowrap" align="center"><img src="imgs/icon-files.gif" width="12" height="12" alt=" " title="CDs" /></td> <td nowrap="nowrap" align="center"><img src="imgs/icon-format.gif" width="12" height="13" alt=" " title="Format" /></td> <td nowrap="nowrap" align="center"><img src="imgs/icon-upper.gif" width="15" height="17" alt=" " title="Uploader" /></td> </tr> <?php $count = $time["itemsfound"] == 1 ? 1 : count($result); for ($i = 0; $i < $count; $i++) { $movie = $count == 1 ? get_details($result) : get_details($result[$i]); ?> <tr> <td align="center" nowrap="nowrap"><img src="flag/<?php echo $movie["iso639"]; ?> .gif" width="18" height="12" border="0" alt="<?php echo $movie["language"]; ?> " title="<?php echo $movie["language"]; ?> " /></td> <td align="left" colspan="2" width="100%"><a href="<?php echo $base . $movie["detail"]; ?> " target="_blank"> <?php echo $movie["movie"]; ?> </a> <?php echo $movie["releasename"] ? "<br/><font class=\"releasename\">" . $movie["releasename"] . "</font>" : ""; ?> </td> <td nowrap="nowrap" align="center"><a href="<?php echo $base . $movie["download"]; ?> " target="blank"><img src="imgs/icon-download.gif" width="12" height="12" border="0" alt=" " title="download" /></a></td> <td nowrap="nowrap" align="center"><?php echo str_replace(" ", "<br/>", $movie["subadddate"]); ?> </td> <td nowrap="nowrap" align="center"><?php echo $movie["files"]; ?> </td> <td nowrap="nowrap" align="center"><?php echo $movie["format"]; ?> </td> <td nowrap="nowrap" align="center"><?php echo $movie["user"] == "" ? "Unknown" : $movie["user"]; ?> </td> </tr> <?php } ?> </table> <?php echo $time["itemsfound"] > 40 ? "<br/><div align=\"center\">" . pager($time["itemsfound"], $pager) . "</div>" : ""; ?> <?php } }
// Класс окна $page_class = "class=\"main\""; // Программа $page_scripts = "<script src=\"js/index.js\"></script>\r\n<script src=\"js/index-dataupdater.js\"></script>\r\n<script src=\"lib/notify-custom.min.js\"></script>"; $page_styles = ""; require "include/header.php"; // Вставим заголовочный файл темы echo "<audio loop preload=\"auto\"><source src=\"sound/alarm.ogg\" type='audio/ogg; codecs=vorbis'><source src=\"sound/alarm.mp3\" type=\"audio/mpeg\"></audio>"; // Подключим звуки аварий echo "<script>var sensorstr = " . get_sensor_config_array($config_xml) . "; </script>"; // Выведем объект JavaScript содержащий описания всех датчиков ?> <div class="layout full"> <div class="sidebar" id="details"><?php get_details($config_xml, $user['rights']); // Выведем окна детализации для устройств ?> </div> <?php echo get_minimap_tabs($mysqli, $user, "content"); ?> </div> </div> <?php // Вставим подвал require "include/footer.php"; // Отключимся от базы
?> <!-- table req details --> <!-- table details --> <?php if (isset($_GET['id']) && isset($_GET['tbl'])) { $tbl = htmlspecialchars($_GET['tbl']); $tabel = getnamatbl($tbl); $dafkol = $this->db->list_fields($tabel); $fkol = array_shift(array_slice($dafkol, 0, 1)); $id = rtrim(htmlspecialchars($_GET['id'])); $cekurld = cekurlid($tabel, $fkol); if (in_array($id, $cekurld)) { $datanya = get_details($id, $tbl); ?> <div class="table-responsive"> <table class="table table-bordered"> <thead> <tr> <?php if (is_admin() || is_mimin()) { ?> <th>Aksi</th> <?php } ?> <?php if (in_array('idimg', $dafkol)) { ?>
// function to get the details from the database function get_details() { //$id = 15; if (isset($_POST['idNo'])) { $id = $_POST['idNo']; } $file_db = get_db(); $sql = 'SELECT technique_name,description,people,method,problem_solving,creative_phases,location,equipment FROM tech WHERE technique_id = :id'; $sth = $file_db->prepare($sql); $sth->execute(array(':id' => $id)); return $sth; } $result = get_details(); // Populate the contents variables foreach ($result as $m) { $techName = $m['technique_name']; $description = en_dash_ellipsis($m['description']); $method = en_dash_ellipsis($m['method']); $people = en_dash_ellipsis($m['people']); $problem = en_dash_ellipsis($m['problem_solving']); $creative = en_dash_ellipsis($m['creative_phases']); $location = en_dash_ellipsis($m['location']); $equipment = en_dash_ellipsis($m['equipment']); //Remove unwanted tags from description and method $description = strip_tags($description, '<body><p><ol><ul><li>'); $method = strip_tags($method, '<body><p><ol><ul><li>'); } // function to deal with the en dashes
function confirm_details($_POST) { extract($_POST); if ($bursary == "0") { return get_details($_POST, "<li class='err'>Please Select a Bursary To grant</li>"); } if (strlen($from_year) < 4 or strlen($from_month) < 2 or strlen($from_day) < 2) { return get_details($_POST, "<li class='err'>Please Select a Valid From Date</li>"); } if (strlen($to_year) < 4 or strlen($to_month) < 2 or strlen($to_day) < 2) { return get_details($_POST, "<li class='err'>Please Select a Valid To Date</li>"); } db_connect(); $get_bur = "SELECT * FROM bursaries WHERE id = '{$bursary}' LIMIT 1"; $run_bur = db_exec($get_bur) or errDie("Unable to get bursary information."); if (pg_numrows($run_bur) < 1) { return "<li class='err'>Invalid Use Of Module. Invalid Bursary.</li>"; } $burarr = pg_fetch_array($run_bur); $showburs = $burarr['bursary_name']; $display = "\n\t\t\t<h2>Grant Bursary</h2>\n\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t\t<input type='hidden' name='key' value='write'>\n\n\t\t\t\t<input type='hidden' name='bursary' value='{$bursary}'>\n\t\t\t\t<input type='hidden' name='rec_name' value='{$rec_name}'>\n\t\t\t\t<input type='hidden' name='rec_add1' value='{$rec_add1}'>\n\t\t\t\t<input type='hidden' name='rec_add2' value='{$rec_add2}'>\n\t\t\t\t<input type='hidden' name='rec_add3' value='{$rec_add3}'>\n\t\t\t\t<input type='hidden' name='rec_add4' value='{$rec_add4}'>\n\t\t\t\t<input type='hidden' name='rec_idnum' value='{$rec_idnum}'>\n\t\t\t\t<input type='hidden' name='rec_telephone' value='{$rec_telephone}'>\n\t\t\t\t<input type='hidden' name='from_year' value='{$from_year}'>\n\t\t\t\t<input type='hidden' name='from_month' value='{$from_month}'>\n\t\t\t\t<input type='hidden' name='from_day' value='{$from_day}'>\n\t\t\t\t<input type='hidden' name='to_year' value='{$to_year}'>\n\t\t\t\t<input type='hidden' name='to_month' value='{$to_month}'>\n\t\t\t\t<input type='hidden' name='to_day' value='{$to_day}'>\n\t\t\t\t<input type='hidden' name='notes' value='{$notes}'>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan='2'>Recipient Information</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Bursary</td>\n\t\t\t\t\t<td>{$showburs}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Name</td>\n\t\t\t\t\t<td>{$rec_name}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Address</td>\n\t\t\t\t\t<td>{$rec_add1}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td>{$rec_add2}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td>{$rec_add3}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td>{$rec_add4}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>ID Number</td>\n\t\t\t\t\t<td>{$rec_idnum}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Telephone</td>\n\t\t\t\t\t<td>{$rec_telephone}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Date From</td>\n\t\t\t\t\t<td>{$from_year}-{$from_month}-{$from_day}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Date To</td>\n\t\t\t\t\t<td>{$to_year}-{$to_month}-{$to_day}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t<td>Notes</td>\n\t\t\t\t\t<td>" . nl2br($notes) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr><td><br></td></tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2' align='right'><input type='submit' value='Confirm'></td>\n\t\t\t\t</tr>\n\t\t\t</form>\n\t\t\t</table><br>" . mkQuickLinks(ql("bursary_type_add.php", "Add Bursary"), ql("bursary_type_view.php", "View Bursaries")); return $display; }