session_destroy(); $_SESSION = null; $loggedin = 0; break; case 'delete': deleteRecord($idnum); break; case 'edit': //nothing here break; case 'cancel': //nothing here break; case 'save': if ($idnum == -1) { addRecord($name, $notes, $enddate, $person); } else { saveRecord($idnum, $name, $notes, $enddate, $person); } break; case 'add': //nothing here break; } ################################################################ ## HTML ################################################################ $table = BuildTable(); if ($msg == '') { #$msg = "SESSION: " . $_SESSION['loggedin']; #. ">>>>" . (mktime() - $_SESSION['time']);
$package = getTravelPackages($_SESSION["packageid"]); $bookingNo = makeBookingId(); $today = date('Y-m-d h:i:s'); $TravelerCount = $_REQUEST["numTrav"]; //Array for the bookings table $bookingArray = array("BookingDate" => $today, "BookingNo" => $bookingNo, "TravelerCount" => $TravelerCount, "CustomerId" => $_SESSION["userid"], "PackageId" => $_SESSION["packageid"]); $class = ""; //get the correct class ID switch ($_REQUEST["ClassMult"]) { case 1: $class = "ECN"; break; case 1.5: $class = "BSN"; break; case 2: $class = "FST"; break; default: break; } addRecord($bookingArray, "bookings"); //get id of just the booking we just added $newBookingId = getBookingId($bookingNo); //array for booking details table $bookingDetailsArray = array("TripStart" => $package[0]['PkgStartDate'], "TripEnd" => $package[0]['PkgEndDate'], "BasePrice" => $package[0]['PkgBasePrice'], "BookingId" => $newBookingId, "ClassId" => $class); addRecord($bookingDetailsArray, "bookingdetails"); //update session variables $_SESSION["message"] = "Booking Successful!"; $_SESSION["lastpage"] = "index.php"; header("Location: messages.php");
echo "checking - false"; } $recordUiContainers = $record->createUiContainers(); new NotifyWidgetFailure($errors); } else { if ($DEBUG) { echo "checking - ok"; } $value = $record->valuesToString(); if ($typeToLoad == "custom") { $type = $record->typeName(); } if ($DEBUG) { echo sprintf("zone:%s type:%s hn:%s val:%s", $zone, $type, $record->hostname(), $value); } else { addRecord($curzone, $type, $record->hostname(), $value); header("Location: " . urlStrRedirect("network/network/zonerecords", array("zone" => $zone, "reverse" => $reverse))); exit; } } } /* Editing a record */ if (isset($_POST["bedit"])) { $type = $_POST["recordtype"]; $typeToLoad = in_array(strtoupper($type), $recordTypes) ? strtolower($type) : "custom"; require_once "dnsrecords/" . $typeToLoad . ".php"; $RecordClass = $typeToLoad . "Record"; $record = new $RecordClass(array("zone" => $zone, "type" => strtolower($type))); $record->initValuesFromArray($_POST); $errors = $record->check(); if ($errors) {
<?php include 'controller.php'; $id = $_POST['id']; $name = $_POST['name']; $count = $_POST['count']; addRecord($id, $name, $count);
} if (isset($_POST['b2'])) { echo "新增品牌: " . $_POST['b2']; addRecord($conn, $_POST['b2']); } if (isset($_POST['b3'])) { echo "新增品牌: " . $_POST['b3']; addRecord($conn, $_POST['b3']); } if (isset($_POST['b4'])) { echo "新增品牌: " . $_POST['b4']; addRecord($conn, $_POST['b4']); } if (isset($_POST['b5'])) { echo "新增品牌: " . $_POST['b5']; addRecord($conn, $_POST['b5']); } ?> <form method="post" action="<?php $_SERVER['PHP_SELF']; ?> " > <input name="b1" type="text" size="30"/><br/> <input name="b2" type="text" size="30"/><br/> <input name="b3" type="text" size="30"/><br/> <input name="b4" type="text" size="30"/><br/> <input name="b5" type="text" size="30"/><br/> <input type="submit" value="submit"/> </form>
function saveToShapeFile($aROIs, $szFileName, $debug) { foreach ($aROIs as $aROI) { fwrite($debug, "adding record to {$szFileName}\n"); $oShape = $aROI['shapeObj']; addRecord($szFileName, $oShape, array(-1, $aROI['type'], -1, -1, $aROI['label']), $debug); fwrite($debug, "record added\n"); } }
);$siswaibuSV=(isset($_POST['idformTB']) && !empty($_POST['idformTB']))?editRecord($siswaibuF,$tb3,'siswa',$_POST['idformTB']):addRecord($siswaibuF,$tb3); if(!$siswaibuSV['isSukses']){ $stat='gagal_insert_siswa_ibu'; }else{ // siswa - walimurid (optional) ----------------------------------------------------------------------------------------- $siswawaliStat=true; if(isset($_POST['siswawaliTB']) && $_POST['siswawaliTB']=='on'){ $siswawaliF = array( 'siswa'=>$_POST['idformTB']==''?($siswaSV['id']!=''?$siswaSV['id']:null):$_POST['idformTB'], 'namawali', 'alamatwali', 'telponwali', 'jkelaminwali', 'kotawali', ); $siswawaliSV=isset($_POST['idsiswawaliTB']) && $_POST['idsiswawaliTB']!=''?editRecord($siswawaliF,$tb4,'siswa',$_POST['idformTB']):addRecord($siswawaliF,$tb4); $siswawaliStat=!$siswawaliSV['isSukses']?false:true; }else{ $siswawaliStat=true; if(isset($_POST['idsiswawaliTB']) && $_POST['idsiswawaliTB']!=''){ $s='DELETE FROM '.$tb4.' WHERE replid='.$_POST['idsiswawaliTB']; $e=mysql_query($s); $siswawaliStat=!$e?false:true; } } if(!$siswawaliStat){ $stat='gagal_insert_or_update_wali'; }else{ // siswa - kontak darurat ----------------------------------------------------------------------------------------- $siswakontakdaruratStat=true;
$db_log = 'ivoice00_db'; $db_pass = '******'; $db_name = 'ivoice00_db'; $db_table = 'temperature'; try { if (!testInternet()) { error_log('no internet connection'); } if (!testInternet($xml_host)) { error_log("no connection with {$xml_host}"); } if (!testDBConnect($db_host, $db_log, $db_pass, $db_name)) { } $xmlData = getXml($xml_url, $xml_login, $xml_password); $xmlData = parseXml($xmlData); addRecord($xmlData, $db_host, $db_log, $db_pass, $db_name, $db_table); } catch (Exception $e) { unlink($lock_file); throw new Exception($e->getMessage()); } unlink($lock_file); /*************/ /* FUNCTIONS */ /*************/ function testInternet($host = 'google.com', $port = 80, $auth = array()) { $waitTimeoutInSeconds = 30; $header = "GET / HTTP/1.0\r\n\r\n"; $header .= "Accept: text/html\r\n"; if (!empty($auth)) { $header .= "Authorization: Basic " . base64_encode("{$auth[0]}:{$auth[1]}") . "\r\n\r\n";
* Update DNS */ $currentIps = getCurrentIps($config['record_name']); $newIps = getNewIps($config['cname']); if ($config['simulate']) { echo "SIMULATION MODE ON! No changes to Cloudflare DNS will be made.\r\n"; } if ($config['verbose']) { echo 'Existing IPs: ' . join(', ', array_keys($currentIps)) . "\r\n"; echo 'New IPs: ' . join(', ', array_keys($newIps)) . "\r\n"; } // Add new IPs foreach ($newIps as $ip => $type) { if (!array_key_exists($ip, $currentIps)) { if ($config['simulate']) { addRecord($type, $config['record_name'], $ip); } if ($config['verbose']) { echo "Adding new IP {$ip}\r\n"; } } else { unset($currentIps[$ip]); } } // Delete expired/invalidated IPs foreach ($currentIps as $ip => $rec_id) { if ($config['simulate']) { deleteRecord($rec_id); } if ($config['verbose']) { echo "Deleting invalidated IP {$ip}\r\n";
} else { if ($type == "addCharacter") { $message = addCharacter($conn); $characters = readCharacters($conn); } else { if ($type == "editCharacter") { $message = editCharacter($conn); $characters = readCharacters($conn); $records = readRecords($conn); } else { if ($type == "deleteCharacter") { $message = deleteCharacter($conn); $characters = readCharacters($conn); } else { if ($type == "addRecord") { $message = addRecord($conn); $records = readRecords($conn); } else { if ($type == "editRecord") { $message = editRecord($conn); $records = readRecords($conn); } else { if ($type == "editCharactersRecord") { $message = editCharactersRecord($conn); $records = readRecords($conn); } else { if ($type == "deleteRecord") { $message = deleteRecord($conn); $records = readRecords($conn); } else { if ($type == "addGameBuild") {