<?php require "../../../../load.php"; if (isset($_POST['appId']) && isset($_POST['key'])) { $app = $_POST['appId']; $key = $_POST['key']; if (!removeData($app, $key)) { echo "bad"; } else { echo "good"; } } else { echo "fieldsMissing"; }
<?php require "../../../../load.php"; if (isset($_POST['appID']) && isset($_POST['key'])) { $app = $_POST['appID']; $key = $_POST['key']; if (!removeData($key, $app)) { echo "bad"; } else { echo "good"; } } else { echo "fieldsMissing"; }
/** * Clear Data */ public function clear() { removeData("male_candidates"); removeData("female_candidates"); removeData("student_passwords"); removeData("election_votes"); }
// check if sensor id is entered, if not display message & return if (empty($sensorID)) { echo '<ul class="list-group"> <li class="list-group-item list-group-item-danger">No sensor id was entered.</li> </ul>'; } else { // Check if sensorID is in the database $results = validateSensor($sensorID, $conn); // if sensor id does not exists in database, display message & return if (empty($results)) { echo '<ul class="list-group"> <li class="list-group-item list-group-item-danger">SensorID : ' . $sensorID . ' does not exist in the database. </li> </ul>'; } else { removeSubscriptionsFromSensorID($sensorID, $conn); removeData($sensorID, $conn); removeSensor($sensorID, $conn); } } } // retrieve contents of sensors table to display function get_all_sensors($conn) { $arr = array(); $sql = 'SELECT * FROM sensors s'; $stid = oci_parse($conn, $sql); $res = oci_execute($stid); if (!$res) { $err = oci_error($stid); echo htmlentities($err['message']); }
//switchboard for the CRUD task requested switch ($task) { case "create": addData(); break; case "readStock": showData('stock'); break; case "readIndustry": getData('industry'); break; case "update": saveData(); break; case "delete": removeData(); break; case "calcTax": getTax(); break; default: echo "{failure:true}"; break; } //end switch function showData($table) { global $taxRate; /* By specifying the start/limit params in ds.load * the values are passed here * if using ScriptTagProxy the values will be in $_GET