function makepage($page, $edit) { include 'config.php'; $path = 'pages/' . $page . '.tm2'; if ($page == $allpages) { // Special page that lists all pages echo "<div id=\"pagecontent\"><p>This page lists all pages in this wiki</p><ul>"; $handler = opendir('pages'); while ($file = readdir($handler)) { if ($file != "." && $file != ".." && substr($file, -4) == ".tm2") { $pagename = substr($file, 0, -4); // Slice file extensions echo "<li><a href=\"?page={$pagename}\">{$pagename}</a></li>"; } } echo "</ul><br /></div><hr />"; return; } if (file_exists($path)) { $file = fopen($path, "r"); $rawcontent = fread($file, filesize($path)); } else { $rawcontent = 'Page does not exist. You can create it here.'; } $content = tsukimark2($page, $rawcontent); echo "<div id=\"pagecontent\">{$content}<br /></div><hr />"; if ($edit) { makeform($rawcontent, $edit); } }
function edit() { // we need a user, then to provide him with choices - edit the login details, edit his personal info, or fix his map... global $PAGE, $STORAGE, $TRADS; $current = $this->arrayGetUsrInfo($_SESSION['idsr_usrs_login']); if (isset($_POST['submit'])) { // change the data... $args = array('tbl' => 'sr_ads', 'formDesc' => $_SESSION['formDesc']); $pd = checkform($args); if ($pd['result'] == 'passed') { // the data is good... global $STORAGE; $condition = 'idsr_usrs_login = '******'idsr_usrs_login']; if ($_POST['submit']) { unset($_POST['submit']); } if ($_POST[$TRADS->popTrad('submit')]) { unset($_POST[$TRADS->popTrad('submit')]); } $nu = $STORAGE->formToDB('sr_usrs_info', '', 'update', $condition); if ($nu !== false) { // we have an ad inserted! if ($_POST['sr_street'] !== $current['sr_street'] || $_POST['sr_city'] !== $current['sr_city']) { // recode the location... include_once 'inc/googleRecordLocFunc.inc.php'; //$address = $_POST["sr_street"] . ',' . $_POST["sr_city"] . ',' . $_POST["sr_state"] . ',' . $_POST["sr_country"]; $address = $_POST["sr_street"] . ',' . $_POST["sr_city"] . ',' . $_POST["sr_country"]; $aull = split(',', strGoogleGetLatLng($address)); //die($aull[0]); //die(stripos($aull[0], 'failed')); if (stripos($aull[0], 'failed')) { //die('badaddress'); $PAGE->body_error .= $aull[0] . ', ' . $aull[1]; $this->errors .= $aull[0] . ', ' . $aull[1]; $PAGE->forwardMessage('impossible de localiser votre address. Essayez de nouveau.', 'error'); header('location:' . $_SERVER['REQUEST_URI']); //break; } // TODO get the current session start time and the current timestamp $ary = array('sr_lat' => $aull[0], 'sr_lng' => $aull[1]); //$condition = 'idsr_usrs_login = '******'id'] //$udata = & new storage(); $r = $STORAGE->formToDB('sr_usrs_data', '', 'update', $condition, $ary); $locstr = $_SERVER['PHP_SELF'] . '?where=users&what=view'; header('location:' . $locstr); } $locstr = $_SERVER['PHP_SELF'] . '?where=users&what=view'; header('location:' . $locstr); } else { // didn't work :-( die('didn\'t get an update - got : ' . $nu); // TODO make a routine for failed inserts - a form to open an issue ticket? } } } $args = array('tbl' => 'sr_usrs_info', 'currentArray' => $current); $PAGE->body_message .= $TRADS->popTrad('please_complete_details'); $pd = makeform($args); foreach ($pd as $k => $v) { // $GLOBALS[$k] = $v; $PAGE->{$k} .= $v; } }
<?php $args = array('tbl' => 'sr_usrs_login'); $pd = makeform($args); global $PAGE, $TRADS; /* Check the POST data to see if the username already exists... if it does, see if the person forgot their username.*/ if (isset($_POST['sr_usrname'])) { $args = array('tbl' => 'sr_usrs_login', 'formDesc' => $_SESSION['formDesc']); $pd = checkform($args); //die(print_r($pd)); if ($pd['result'] == 'passed') { //ok, we passed the test, so now lets process the data... $_POST['sr_usrgroup'] = 'users'; //die("you're in"); global $STORAGE; //include_once 'app/core/storage.class.php'; //$STORAGE = & $registry->get('STORAGE'); // $STORAGE = & new storage(); // parent::sestusr(); if ($_POST['submit']) { unset($_POST['submit']); } if ($_POST[$TRADS->popTrad('submit')]) { unset($_POST[$TRADS->popTrad('submit')]); } $nu = $STORAGE->formToDB('sr_usrs_login'); if ($nu) { //$PAGE->body_message = $TRADS->popTrad('PLEASE_LOGIN_TO_CONTINUE_SIGNUP'); $PAGE->forwardMessage($TRADS->popTrad('You_must_be_logged_in_to_continue')); // $STORAGE->store('PLEASE_LOGIN_TO_CONTINUE_SIGNUP', 'MESSAGE', 'global');
<?php require_once 'functions.php'; ?> <!DOCTYPE html> <html> <head> <title>ACMS: Make Payment</title> <?php _Header(); ?> <body> <paper-toolbar> <paper-icon-button id="back" src="../img/arrow-left.png" onclick="location.href='../index.php'">-></paper-icon-button> <span class="flex">Add New Customer</span> </paper-toolbar> <?php makeform(htmlspecialchars("CustAdded.php")); item("Name", 'text', 'name'); item("State", 'text', 'state'); item("District", 'text', 'dist'); item("Street", 'text', 'street'); item("Email", 'text', 'email'); item("Phone", 'text', 'phone'); item("", 'submit', 'roll'); _link("Show Costumers", "ShowCust.php"); _link("Index Page", "../index.php"); endform(); _Footer();
<link rel="import" href="../trying_design/bower_components/paper-fab/paper-fab.html"> <link rel="import" href="../trying_design/bower_components/paper-tabs/paper-tabs.html"> <link rel="import" href="../trying_design/bower_components/paper-toast/paper-toast.html"> <link rel="import" href="../trying_design/bower_components/paper-dialog/paper-dialog.html"> <link rel="import" href="../trying_design/bower_components/paper-dropdown-menu/paper-dropdown-menu.html"> <link rel="import" href="../trying_design/bower_components/paper-styles/color.html"> <link rel="stylesheet" href="../trying_design/styles.css"> </head> <body> <paper-toolbar> <paper-icon-button id="back" src="../img/arrow-left.png" onclick="location.href='../index.php'">-></paper-icon-button> <span class="flex">Add New Bill</span> </paper-toolbar> <?php makeform(htmlspecialchars("AddedBill.php")); item("Date", 'date', 'date'); echo "Customer Name: "; //Show List of Customers echo '<select id="cust_list" name="cid">'; $sql = "SELECT Cust_ID, Cust_Name FROM customer_details"; $result = $mysqli->query($sql); while ($row = $result->fetch_assoc()) { echo $row['Cust_ID']; echo $row['Cust_Name']; //echo "<option value='".$c->id."' ".$selected.">".$c->name."</option>" ; echo "<option value='" . $row['Cust_ID'] . "'>" . $row['Cust_Name'] . "</option>"; } echo "</select><br><br>"; //End of LIST item("Amount", 'text', 'amt');