Created
September 6, 2011 17:50
-
-
Save projectxcappe/1198419 to your computer and use it in GitHub Desktop.
Android App using PhoneGap (in work)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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>Android v1.1</title> | |
<script type="text/javascript" src="js/jquery-1.6.min.js"></script> | |
<link rel="stylesheet" href="includes/styles.css" type="text/css" media="screen"> | |
<link rel="stylesheet" href="includes/demo_table_jui.css" type="text/css" media="screen"> | |
<script> | |
$(document).ready(function(){ | |
$("#submit").click(function(){ | |
$.ajax({ | |
url: 'http://xxx.xxx.xxx/sandbox/websrvc/websrvc.php', | |
data: {my_function:"incident_list", client_uid: document.URL.split('#')[1]}, | |
dataType: 'jsonp', | |
jsonp: 'callback', | |
jsonpCallback: 'jsonpCallback', | |
success: function(){ | |
//alert("Successfully Connected"); | |
} | |
}); | |
}); | |
}); | |
function jsonpCallback(data){ | |
var incidentData = data.message; | |
//alert(incidentData); | |
var incidentArr = incidentData.split(","); | |
//alert(incidentArr[0]); | |
var tbl = document.getElementById("incidentTable"); | |
var i=0; | |
for(i=0; i<incidentArr.length-1; i++) | |
{ | |
var newRow = tbl.insertRow(-1); | |
var newCell = newRow.insertCell(0); | |
if(i%2 == 0){ | |
newCell.innerHTML = '<tr class="oddMobile"><td height="100"><button class="CustomButton">' + incidentArr[i] + '</button></td></tr>'; | |
} else { | |
newCell.innerHTML = '<tr class="evenMobile"><td height="100"><button class="CustomButton">' + incidentArr[i] + '</button></td></tr>'; | |
} | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<div align="center"> | |
<img src="images/logowhite.png" width="240" height="56"/> | |
</div> | |
<div id="incidentLoad" align="center"> | |
<form name="form1" method="post" action="" onsubmit="return false"> | |
<button id="submit" style="width:200px; class="CustomButton">Load Active Incidents</button> | |
</form> | |
<div id="main_mobile"> | |
<table id="incidentTable" width="300" border="0"></table> | |
</div> | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//THIS IS FOR DEVELOPMENT ONLY!!! | |
session_start(); | |
//Redirect to SSL | |
//if(!ISSET($_REQUEST[force])){ | |
// if($_SERVER['HTTPS']!='on'){ | |
// header("Location: https://www.xxxx.com{$_SERVER[REQUEST_URI]}"); | |
// exit; | |
// } | |
//} | |
//Check if we have error-checking turned on for this page (?ec=1) | |
//if ($_GET['ec']){ | |
// error_reporting(E_ALL); | |
// ini_set('display_errors', '1'); | |
//} | |
/** | |
* Common Database Connection | |
*/ | |
class pdoBase extends PDO{ | |
private $_mode = null; | |
// Production database connection details | |
private $_prodDsn = 'mysql:host=localhost;dbname=xxxx_prod'; | |
private $_prodUser = 'xxxx'; | |
private $_prodPass = 'xxxx'; | |
private $_prodServer = "localhost"; | |
private $_prodDB = "xxxx_prod"; | |
// Development database connection details | |
private $_devDsn = 'mysql:host=localhost;dbname=xxxx_sandbox'; | |
private $_devUser = 'xxxx'; | |
private $_devPass = 'xxxx'; | |
private $_devServer = "localhost"; | |
private $_devDB = "xxxx_sandbox"; | |
public function __construct(){ | |
parent::__construct($this->getDsn(), $this->getUser(), $this->getPass()); | |
parent:: $this->buildSession(); | |
} | |
/** | |
* @return string (either 'dev' or 'prod') | |
*/ | |
private function getMode(){ | |
// We determine the mode one time and store the results in $this->_mode | |
// This allows all further calls to this to be ultra fast. | |
if (is_null($this->_mode)){ | |
$path_temp = $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; | |
if (strpos($path_temp, "xxx.xxx.xxx.xxx/sandbox") !== false) { | |
//if($_SERVER['HTTPS']!='on'){ | |
// //header("Location: https://xxx.xxx.xxx.xxx{$_SERVER[REQUEST_URI]}"); | |
// exit; | |
//} | |
$_SESSION['server_type'] = "Sandbox Development Server"; | |
$this->_mode = 'dev'; | |
} elseif (strpos($path_temp, "xxx.xxx.xxx.xxx") !== false) { | |
//if($_SERVER['HTTPS']!='on'){ | |
// //header("Location: https://xxx.xxx.xxx.xxx{$_SERVER[REQUEST_URI]}"); | |
// exit; | |
//} | |
$_SESSION['server_type'] = "Development Server"; | |
$this->_mode = 'prod'; | |
} elseif (strpos($path_temp, "localhost") !== false) { | |
$_SESSION['server_type'] = "LocalHost Server"; | |
$this->_mode = 'local'; | |
} | |
} | |
return $this->_mode; | |
} | |
/** | |
* @return string dsn connection string for dev or prod | |
*/ | |
private function getDsn(){ | |
if ($this->getMode()=='dev'){ | |
return $this->_devDsn; | |
} | |
else if ($this->getMode()=='prod'){ | |
return $this->_prodDsn; | |
} | |
else if ($this->getMode()=='local'){ | |
return $this->_localDsn; | |
} | |
} | |
/** | |
* @return string username string for dev or prod | |
*/ | |
private function getUser(){ | |
if ($this->getMode()=='dev'){ | |
return $this->_devUser; | |
} | |
else if ($this->getMode()=='prod'){ | |
return $this->_prodUser; | |
} | |
else if ($this->getMode()=='local'){ | |
return $this->_localUser; | |
} | |
} | |
/** | |
* @return string password string for dev or prod | |
*/ | |
private function getPass(){ | |
if ($this->getMode()=='dev'){ | |
return $this->_devPass; | |
} | |
else if ($this->getMode()=='prod'){ | |
return $this->_prodPass; | |
} | |
else if ($this->getMode()=='local'){ | |
return $this->_localPass; | |
} | |
} | |
/** | |
* set session variables for jquery datatable (this may need to change) | |
*/ | |
private function buildSession(){ | |
if ($this->getMode()=='dev'){ | |
$_SESSION['_server'] = $this->_devServer; | |
$_SESSION['_db'] = $this->_devDB; | |
$_SESSION['_user'] = $this->_devUser; | |
$_SESSION['_pass'] = $this->_devPass; | |
return; | |
} | |
else if ($this->getMode()=='prod'){ | |
$_SESSION['_server'] = $this->_prodServer; | |
$_SESSION['_db'] = $this->_prodDB; | |
$_SESSION['_user'] = $this->_prodUser; | |
$_SESSION['_pass'] = $this->_prodPass; | |
return; | |
} | |
else if ($this->getMode()=='local'){ | |
$_SESSION['_server'] = $this->_localServer; | |
$_SESSION['_db'] = $this->_localDB; | |
$_SESSION['_user'] = $this->_localUser; | |
$_SESSION['_pass'] = $this->_localPass; | |
return; | |
} | |
} | |
/** | |
* Common Functions | |
*/ | |
public function doIMLog($action, $im_incident_uid, $im_incident_name, $my_time_stamp){ | |
$sql = $this->prepare('INSERT INTO im_log (uid, user_uid, user_name, client_uid, im_incident_uid, im_incident_name, log_date, action) VALUES ("' . uniqid() . '", "' . $_SESSION['user_uid'] . '", "' . $_SESSION['user_fullname'] . '", "' . $_SESSION['client_uid'] . '", "' . $im_incident_uid . '", "' . $im_incident_name . '", "' . $my_time_stamp . '", "' . $action . '")'); | |
return $sql->execute(); | |
} | |
public function doLog($action){ | |
$sql = $this->prepare('INSERT INTO log_file (uid, user_uid, client_uid, log_date, token, log_ip, full_name, action, client_name) VALUES ("' . uniqid() . '", "' . $_SESSION['user_uid'] . '", "' . $_SESSION['client_uid'] . '", "' . date("m/d/Y H:i:s") . " " . date('T') . '", "' . $_SESSION['token'] . '", "' . $_SERVER['REMOTE_ADDR'] . '", "' . $_SESSION['user_fullname'] . '", "' . $action . '", "' . $_SESSION['client_name'] . '")'); | |
return $sql->execute(); | |
} | |
public function doLogin($user_name, $user_password){ | |
$sql = $this->prepare('SELECT * FROM personnel WHERE user_name =:user_name AND user_password=:user_password'); | |
$sql->bindParam(':user_name', $user_name); | |
$sql->bindParam(':user_password', $user_password); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function updateLogon($last_logon, $uid){ | |
$sql = $this->prepare('UPDATE personnel SET last_logon=:last_logon WHERE uid=:uid'); | |
$sql->bindParam(':last_logon', $last_logon); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doLoadClient(){ | |
$sql = $this->prepare('SELECT * FROM clients WHERE uid =:uid'); | |
$sql->bindParam(':uid', $_SESSION['client_uid']); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadClients($client_template){ | |
if($client_template == ""){ | |
$client_template = "0"; | |
} | |
return $this->query('SELECT * FROM clients WHERE client_template = "' . $client_template . '" ORDER BY client_name'); | |
} | |
public function doLoadPersonnel(){ | |
return $this->query('SELECT * FROM personnel WHERE client_uid = "' . $_SESSION['client_uid'] . '" ORDER BY last_name'); | |
} | |
public function doLoadIMIncident(){ | |
return $this->query('SELECT * FROM im_incident WHERE client_uid = "' . $_SESSION['client_uid'] . '" AND active = "1" AND preplan <> "1" ORDER BY incident_name'); | |
} | |
public function doLoadIMIncidentArchive(){ | |
return $this->query('SELECT * FROM im_incident WHERE client_uid = "' . $_SESSION['client_uid'] . '" AND active = "0" AND preplan <> "1" ORDER BY incident_name'); | |
} | |
public function doLoadIMPreplan(){ | |
return $this->query('SELECT * FROM im_incident WHERE client_uid = "' . $_SESSION['client_uid'] . '" AND active = "1" AND preplan = "1" ORDER BY incident_name'); | |
} | |
public function doLoadIMUnit(){ | |
return $this->query('SELECT * FROM im_unit WHERE client_uid = "' . $_SESSION['client_uid'] . '" ORDER BY unit_name'); | |
} | |
public function doLoadIMLandmarkObject($filter){ | |
if($filter == ""){ | |
return $this->query('SELECT * FROM im_landmark_object WHERE client_uid = "' . $_SESSION['client_uid'] . '" ORDER BY landmark_name'); | |
} else { | |
return $this->query('SELECT * FROM im_landmark_object WHERE client_uid = "' . $_SESSION['client_uid'] . '" AND layer_uid = "' . $filter . '" ORDER BY landmark_name'); | |
} | |
} | |
public function doLoadIMLandmarkLayer(){ | |
return $this->query('SELECT * FROM im_landmark_layer WHERE client_uid = "' . $_SESSION['client_uid'] . '" ORDER BY layer_name'); | |
} | |
public function doLoadPersonnelInfo($personnel_uid){ | |
$sql = $this->query('SELECT * FROM personnel WHERE uid = "' . $personnel_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadPersonnelData($field_uid, $personnel_uid){ | |
$sql = $this->query('SELECT * FROM personnel_data WHERE field_uid = "' . $field_uid . '" AND personnel_uid = "' . $personnel_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadIMIncidentInfo($im_incident_uid){ | |
$sql = $this->query('SELECT * FROM im_incident WHERE uid = "' . $im_incident_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadIMLandmark($im_landmark_type, $im_landmark_object_uid){ | |
$sql = $this->query('SELECT * FROM im_landmark_' . $im_landmark_type . ' WHERE uid = "' . $im_landmark_object_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
//public function doLoadIMLandmarkLayer($im_landmark_layer_uid){ | |
// $sql = $this->query('SELECT * FROM im_landmark_layer WHERE client_uid = "' . $im_landmark_layer_uid . '"'); | |
// $sql->execute(); | |
// return $sql->fetch(PDO::FETCH_ASSOC); | |
//} | |
public function doLoadIMUnitInfo($im_unit_uid){ | |
$sql = $this->query('SELECT * FROM im_unit WHERE uid = "' . $im_unit_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadIMIncidentData($field_uid, $im_incident_uid){ | |
$sql = $this->query('SELECT * FROM im_incident_data WHERE field_uid = "' . $field_uid . '" AND im_incident_uid = "' . $im_incident_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadIncidentData($field_uid, $incident_uid){ | |
$sql = $this->query('SELECT * FROM incident_data WHERE field_uid = "' . $field_uid . '" AND incident_uid = "' . $incident_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadIMUnitData($field_uid, $unit_uid){ | |
$sql = $this->query('SELECT * FROM im_unit_data WHERE field_uid = "' . $field_uid . '" AND im_unit_uid = "' . $unit_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadOrganizeData($field_uid, $organize_uid){ | |
$sql = $this->query('SELECT * FROM organize_data WHERE field_uid = "' . $field_uid . '" AND organize_uid = "' . $organize_uid . '"'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadFieldDef($field_filter, $field_cat){ | |
if($field_filter=="all"){ | |
return $this->query('SELECT * FROM field_defs WHERE client_uid = "' . $_SESSION['client_uid'] . '" AND field_cat = "' . $field_cat . '" AND field_dropdown_item = 0 ORDER BY field_order'); | |
} else { | |
return $this->query('SELECT * FROM field_defs WHERE field_tab = "' . $field_filter . '" AND field_cat = "' . $field_cat . '" AND client_uid = "' . $_SESSION['client_uid'] . '" AND field_dropdown_item = 0 ORDER BY field_order'); | |
} | |
} | |
public function doFieldDefCount($field_filter, $field_cat){ | |
//Generic Field Count Function | |
$sql = $this->query('SELECT COUNT(id) as row_count FROM field_defs WHERE field_tab = "' . $field_filter . '" AND field_cat = "' . $field_cat . '" AND client_uid = "' . $_SESSION['client_uid'] . '" AND field_dropdown_item = 0 ORDER BY field_order'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadFirstFieldTab($tab_field_type){ | |
$sql = $this->query('SELECT * FROM field_tabs WHERE client_uid = "' . $_SESSION['client_uid'] . '" AND tab_field_type = "' . $tab_field_type . '" ORDER BY tab_order'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doLoadFieldTabs($tab_field_type){ | |
if($tab_field_type=="all"){ | |
return $this->query('SELECT * FROM field_tabs WHERE client_uid = "' . $_SESSION['client_uid'] . '" ORDER BY tab_order'); | |
} else { | |
return $this->query('SELECT * FROM field_tabs WHERE tab_field_type = "' . $tab_field_type . '" AND client_uid = "' . $_SESSION['client_uid'] . '" ORDER BY tab_order'); | |
} | |
} | |
public function doTabFieldCount($what_table, $tab_field_type){ | |
//Generic Field Count Function | |
$sql = $this->query('SELECT COUNT(id) as row_count FROM ' . $what_table . ' WHERE tab_field_type = "' . $tab_field_type . '" AND client_uid = "' . $_SESSION['client_uid'] . '" ORDER BY tab_order'); | |
$sql->execute(); | |
return $sql->fetch(PDO::FETCH_ASSOC); | |
} | |
public function doInsertTab($tab_value, $tab_field_type,$tab_order, $tab_type){ | |
$sql = $this->prepare('INSERT INTO field_tabs (uid, client_uid, tab_value, tab_field_type, tab_order, tab_type) VALUES (:uid, :client_uid, :tab_value, :tab_field_type, :tab_order, :tab_type)'); | |
$sql->bindParam(':uid', uniqid()); | |
$sql->bindParam(':client_uid', $_SESSION['client_uid']); | |
$sql->bindParam(':tab_value', $tab_value); | |
$sql->bindParam(':tab_field_type', $tab_field_type); | |
$sql->bindParam(':tab_order', $tab_order); | |
$sql->bindParam(':tab_type', $tab_type); | |
return $sql->execute(); | |
} | |
public function doUpdateTab($tab_value, $tab_order, $uid){ | |
$sql = $this->prepare('UPDATE field_tabs SET tab_value=:tab_value, tab_order=:tab_order WHERE uid=:uid'); | |
$sql->bindParam(':tab_value', $tab_value); | |
$sql->bindParam(':tab_order', $tab_order); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeleteTab($uid){ | |
$sql = $this->prepare('DELETE FROM field_tabs WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
//Delete all associated data as well | |
$sql = $this->prepare('DELETE FROM field_defs WHERE field_tab=:uid'); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doInsertField($field_name, $field_type, $field_rows, $field_size, $field_cat, $field_order, $field_tab, $field_access, $field_menu, $field_menu_order){ | |
$sql = $this->prepare('INSERT INTO field_defs (uid, client_uid, field_name, field_type, field_rows, field_size, field_cat, field_order, field_tab, field_access, field_menu, field_menu_order) VALUES (:uid, :client_uid, :field_name, :field_type, :field_rows, :field_size, :field_cat, :field_order, :field_tab, :field_access, :field_menu, :field_menu_order)'); | |
$sql->bindParam(':uid', uniqid()); | |
$sql->bindParam(':client_uid', $_SESSION['client_uid']); | |
$sql->bindParam(':field_name', $field_name); | |
$sql->bindParam(':field_type', $field_type); | |
$sql->bindParam(':field_rows', $field_rows); | |
$sql->bindParam(':field_size', $field_size); | |
$sql->bindParam(':field_cat', $field_cat); | |
$sql->bindParam(':field_order', $field_order); | |
$sql->bindParam(':field_tab', $field_tab); | |
$sql->bindParam(':field_access', $field_access); | |
$sql->bindParam(':field_menu', $field_menu); | |
$sql->bindParam(':field_menu_order', $field_menu_order); | |
return $sql->execute(); | |
} | |
public function doUpdateField($field_name, $field_type, $field_size, $field_rows, $field_order, $field_tab, $field_access, $field_menu, $field_menu_order, $uid){ | |
$sql = $this->prepare('UPDATE field_defs SET field_name=:field_name, field_type=:field_type, field_size=:field_size, field_rows=:field_rows, field_order=:field_order, field_tab=:field_tab, field_access=:field_access, field_menu=:field_menu, field_menu_order=:field_menu_order WHERE uid=:uid'); | |
$sql->bindParam(':field_name', $field_name); | |
$sql->bindParam(':field_type', $field_type); | |
$sql->bindParam(':field_size', $field_size); | |
$sql->bindParam(':field_rows', $field_rows); | |
$sql->bindParam(':field_order', $field_order); | |
$sql->bindParam(':field_tab', $field_tab); | |
$sql->bindParam(':field_access', $field_access); | |
$sql->bindParam(':field_menu', $field_menu); | |
$sql->bindParam(':field_menu_order', $field_menu_order); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeleteField($uid, $tabtype){ | |
$sql = $this->prepare('DELETE FROM field_defs WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
//Delete Drop Down info as well | |
$sql = $this->prepare('DELETE FROM field_defs WHERE field_parent_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
//We need to remove any user data associated with this field as well | |
$sql = $this->prepare('DELETE FROM personnel_data WHERE field_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
$sql = $this->prepare('DELETE FROM incident_data WHERE field_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doUpdatePersonnelCore($last_name, $first_name, $middle_name, $dob, $gender, $user_password, $user_name, $access_level, $cell_phone, $cell_carrier, $primary_email, $uid){ | |
$sql = $this->prepare('UPDATE personnel SET last_name=:last_name, first_name=:first_name, middle_name=:middle_name, dob=:dob, gender=:gender, user_password=:user_password, user_name=:user_name, access_level=:access_level, cell_phone=:cell_phone, cell_carrier=:cell_carrier, primary_email=:primary_email WHERE uid=:uid'); | |
$sql->bindParam(':last_name', $last_name); | |
$sql->bindParam(':first_name', $first_name); | |
$sql->bindParam(':middle_name', $middle_name); | |
$sql->bindParam(':dob', $dob); | |
$sql->bindParam(':gender', $gender); | |
$sql->bindParam(':user_password', $user_password ); | |
$sql->bindParam(':user_name', $user_name ); | |
$sql->bindParam(':access_level', $access_level ); | |
$sql->bindParam(':cell_phone', $cell_phone ); | |
$sql->bindParam(':cell_carrier', $cell_carrier ); | |
$sql->bindParam(':primary_email', $primary_email ); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeletePersonnel($uid){ | |
$sql = $this->prepare('DELETE FROM personnel WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
//Remove data records as well | |
$sql = $this->prepare('DELETE FROM personnel_data WHERE personnel_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeleteCredential($uid){ | |
$sql = $this->prepare('DELETE FROM personnel_credentials WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeleteIMIncident($uid){ | |
$sql = $this->prepare('DELETE FROM im_incident WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeleteOrganize($uid){ | |
$sql = $this->prepare('DELETE FROM organize WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
$sql = $this->prepare('DELETE FROM organize_data WHERE organize_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeleteIncident($uid){ | |
$sql = $this->prepare('DELETE FROM incident WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
//Remove data records as well | |
$sql = $this->prepare('DELETE FROM incident_attendance WHERE incident_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
$sql = $this->prepare('DELETE FROM incident_addendum WHERE incident_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
$sql = $this->prepare('DELETE FROM incident_data WHERE incident_uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
return $sql->execute(); | |
} | |
public function doDeleteIMUnit($uid){ | |
$sql = $this->prepare('DELETE FROM im_unit WHERE uid=:uid'); | |
$sql->bindParam(':uid', $uid); | |
$sql->execute(); | |
//Remove the Unit ID from any personnel assigned to this unit | |
$sql = $this->query('UPDATE personnel SET im_unit_uid = "" WHERE im_unit_uid = "' . $uid . '"'); | |
return $sql->execute(); | |
//Remove data records as well | |
//$sql = $this->prepare('DELETE FROM incident_attendance WHERE incident_uid=:uid'); | |
//$sql->bindParam(':uid', $uid); | |
//$sql->execute(); | |
//$sql = $this->prepare('DELETE FROM incident_data WHERE incident_uid=:uid'); | |
//$sql->bindParam(':uid', $uid); | |
//return $sql->execute(); | |
} | |
public function doLoadMenuItems($field_cat){ | |
return $this->query('SELECT * FROM field_defs WHERE client_uid = "' . $_SESSION['client_uid'] . '" AND field_cat = "' . $field_cat . '" AND field_menu = 1 ORDER BY field_menu_order'); | |
} | |
public function doLoadIncident(){ | |
return $this->query('SELECT * FROM incident WHERE client_uid = "' . $_SESSION['client_uid'] . '"'); | |
} | |
public function doLoadOrganize(){ | |
return $this->query('SELECT * FROM organize WHERE client_uid = "' . $_SESSION['client_uid'] . '"'); | |
} | |
public function doUpdateMapAPICount(){ | |
//Update the API count | |
$sql = $this->query('SELECT * FROM clients WHERE uid = "' . $_SESSION['client_uid'] . '"'); | |
$sql->execute(); | |
$results = $sql->fetch(PDO::FETCH_ASSOC); | |
$map_api_count = 1 + $results['map_api_count']; | |
$sql = $this->query('UPDATE clients SET map_api_count = "' . $map_api_count . '" WHERE uid = "' . $_SESSION['client_uid'] . '"'); | |
return $sql->execute(); | |
} | |
public function doDeleteTempTables(){ | |
$sql = $this->prepare('DROP TABLE temp_personnel_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_organize_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_incident_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_im_unit_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_im_unit_status_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_im_incident_active_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_im_incident_preplan_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_im_incident_archive_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP TABLE temp_im_unit_status_archive_' . $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP VIEW im_landmark_l_view_'. $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP VIEW im_landmark_o_view_'. $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
$sql = $this->prepare('DROP VIEW im_personnel_status_view_'. $_SESSION['client_uid'] . ''); | |
$sql->execute(); | |
} | |
//public function insertLog($action, $userid, $ip, $token, $fullname, $username){ | |
// //This updates the logfile | |
// $sql = $this->prepare('INSERT INTO log_file (userid, log_date, log_ip, token, full_name, user_name, action) VALUES (:UserID, :LogDate, :LogIP, :Token, :FullName, :UserName, :Action)'); | |
// $sql->bindParam(':UserID', $userid); | |
// $sql->bindParam(':LogDate', date("y-m-d G:i:s")); | |
// $sql->bindParam(':LogIP', $ip); | |
// $sql->bindParam(':Token', $token); | |
// $sql->bindParam(':FullName', $fullname); | |
// $sql->bindParam(':UserName', $username); | |
// $sql->bindParam(':Action', $action); | |
// return $sql->execute(); | |
//} | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
position: relative; | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
border: none; | |
} | |
body { | |
margin: 0; padding: 0; border: none; | |
font-family: sans-serif; | |
font-size: 12px; | |
background-color: white; | |
/*overflow: hidden;*/ | |
overflow: auto; | |
} | |
#topband { | |
position: absolute; | |
margin: 0; padding: 0; top: 0; left: 0; right: 0; height: 90px; border: none; | |
/*background: url(../images/background.png);*/ | |
overflow: hidden; | |
} | |
#navbar { | |
position: absolute; | |
margin: 0; padding: 0; | |
top: 85px; left: 0; width: 200px; bottom: 0px; | |
/*background: url(../images/background_2.png);*/ | |
overflow: hidden; | |
} | |
#main { | |
position: absolute; | |
top: 7em; left: 200px; bottom: 0; right: 0; | |
padding-top: 1em; padding-bottom: 3em; padding-left: 1em; padding-right: 1em; | |
background-color: white; overflow: auto; | |
} | |
#page_header { | |
position: absolute; | |
top: 90px; left: 200px; bottom: 0; right: 0; height: 3em; | |
padding-top: 0em; padding-bottom: 0em; padding-left: 0em; padding-right: 0em; | |
background-color: white; overflow: auto; | |
b/*ackground: white url(../images/top_tab.png);*/ | |
background-repeat:no-repeat; | |
} | |
#page_header_left { | |
position: relative; | |
float:left; | |
padding: 5px; | |
} | |
#page_header_right { | |
position: relative; | |
top:50%; | |
margin-top:-35px; | |
float:right; | |
padding: 5px; | |
} | |
#page_header_bottom { | |
position: absolute; | |
top: 60px; height: 30px; width: 100%; | |
background-color:#660000; | |
} | |
#page_header_indicator { | |
position: absolute; | |
top: 67px; | |
left: 10px; | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 16px; | |
font-weight: normal; | |
color: white; | |
z-index:1; | |
} | |
#page_header_incident { | |
position: absolute; | |
text-align: right; | |
right: 10px; | |
top: 67px; | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 16px; | |
font-weight: bold; | |
font-style:italic; | |
color: white; | |
z-index:1; | |
} | |
#page_header_text { | |
position:absolute; | |
left:145px; | |
top:110px; | |
width:290px; | |
height:32px; | |
z-index:1; | |
} | |
#main_copy { | |
position: absolute; | |
top: 90px; left: 194px; bottom: 0; right: 0; | |
padding-top: 1em; padding-bottom: 3em; padding-left: 1em; padding-right: 1em; | |
background-color: white; overflow: auto; | |
} | |
#login_copy { | |
position: absolute; | |
top: 90px; left: 0; bottom: 0; right: 0; | |
padding-top: 1em; padding-bottom: 3em; padding-left: 1em; padding-right: 1em; | |
background-color: white; overflow: auto; | |
} | |
#botband { | |
position: absolute; | |
margin: 0; padding: 0; | |
bottom: 0; left: 8em; right: 0; height: 2.1em; | |
background-color: #7f73a8; overflow: hidden; | |
} | |
#data_box { | |
background-color: white; overflow: auto; | |
border-style:solid; | |
border-width:1px; | |
border-color:#888; | |
padding: 5px; | |
} | |
#page_field_name { | |
position: relative; | |
width:100px; | |
float:left; | |
padding: 5px; | |
/*vertical-align: top;*/ | |
} | |
#page_field_icons { | |
position: relative; | |
/*width:100px;*/ | |
float:left; | |
padding: 5px; | |
/*vertical-align: top;*/ | |
} | |
#page_field_name_variable { | |
position: relative; | |
width:100px; | |
float:left; | |
padding: 5px; | |
/*vertical-align: top;*/ | |
} | |
#page_field_data { | |
position: relative; | |
/*float:left;*/ | |
padding: 5px; | |
} | |
#page_button_bar { | |
position: relative; | |
float:right; | |
padding: 5px; | |
height:20px; | |
} | |
.edit_buttons{ | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 12px; | |
font-weight: normal; | |
width:110px; | |
height: 20px; | |
cursor:pointer; | |
} | |
#editor_tag { | |
position: relative; | |
width:70px; | |
float:left; | |
padding: 3px; | |
vertical-align: top; | |
} | |
#editor_field { | |
position: relative; | |
/*float:left;*/ | |
padding: 3px; | |
} | |
#cred_field_name { | |
position: relative; | |
width:500px; | |
float:left; | |
padding: 0px; | |
/*vertical-align: top;*/ | |
} | |
#cred_field_data { | |
position: relative; | |
/*float:left;*/ | |
padding: 0px; | |
} | |
h1{ | |
font-family: Verdana; font-size: 1.5em; margin-left: 0; margin-top: .5em; | |
} | |
#main p { | |
margin: 0; margin-bottom: .5em; | |
} | |
#navbar p { | |
font-family: sans-serif; font-weight: bold; | |
margin-left: 1em; margin-right: .5em; margin-top: .5em; margin-bottom: .5em; | |
} | |
#navbar hr { | |
margin-left: .5em; margin-right: .5em; | |
} | |
#botband p { | |
margin: 0; margin-top: .5em; | |
} | |
.BodyText { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 12px; | |
font-weight: bold; | |
} | |
.BodyTextBlue { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 12px; | |
font-weight: normal; | |
color:#06C; | |
} | |
.SliderText { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 1em; | |
font-weight: normal; | |
font-color: white; | |
} | |
.credit { | |
line-height: 1.2em; margin-top: 4em; | |
font-size: .7em; | |
} | |
.Footer { | |
line-height: 1.2em; margin-top: 4em; | |
font-size: .7em; | |
} | |
div.bot { | |
position: absolute; | |
bottom: .5em; left: .5em; right: .5em; text-align: center; | |
} | |
#navbar img { border: none; margin: 0; padding: 0 } | |
.navbarstyle a:link { | |
text-decoration: none; | |
color: #CCC; | |
} | |
.navbarstyle a:visited { | |
text-decoration: none; | |
color: #CCC; | |
} | |
.navbarstyle a:hover { | |
text-decoration: none; | |
color: #0d1178; | |
} | |
.navbarstyle a:active { | |
text-decoration: none; | |
color: #CCC | |
} | |
a:link { | |
text-decoration: none; | |
color:#888; | |
} | |
a:visited { | |
text-decoration: none; | |
color: #888; | |
} | |
a:hover { | |
text-decoration: none; | |
color:#600; | |
} | |
a:active { | |
text-decoration: none; | |
color: #888; | |
} | |
.glossymenu{ | |
margin: 5px 0; | |
padding: 0; | |
width: 190px; /*width of menu*/ | |
border: 1px solid #9A9A9A; | |
border-top:none; | |
border-left: none; | |
} | |
.glossymenu a.menuitem{ | |
/*background: black url(glossyback.gif) repeat-x bottom left;*/ | |
background-color: #eeeeee; | |
font: bold 20px "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, sans-serif; | |
color: black; | |
display: block; | |
position: relative; /*To help in the anchoring of the ".statusicon" icon image*/ | |
width: auto; | |
padding: 4px 0; | |
padding-left: 10px; | |
text-decoration: none; | |
} | |
.glossymenu a.menuitem:visited, .glossymenu .menuitem:active{ | |
color: black; | |
} | |
.glossymenu a.menuitem .statusicon{ /*CSS for icon image that gets dynamically added to headers*/ | |
position: absolute; | |
top: 9px; | |
right: 5px; | |
border: none; | |
} | |
.glossymenu a.menuitem:hover{ | |
/*background-image: url(glossyback2.gif);*/ | |
background-color:#3333cc; | |
color: white; | |
cursor:pointer; | |
} | |
.glossymenu div.submenu{ /*DIV that contains each sub menu*/ | |
background: white; | |
} | |
.glossymenu div.submenu ul{ /*UL of each sub menu*/ | |
list-style-type: none; | |
margin: 0; | |
padding: 0; | |
} | |
.glossymenu div.submenu ul li{ | |
border-bottom: 1px solid #9A9A9A; | |
} | |
.glossymenu div.submenu ul li a{ | |
display: block; | |
font: normal 18px "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, sans-serif; | |
color: black; | |
text-decoration: none; | |
padding: 2px 0; | |
padding-left: 10px; | |
} | |
.glossymenu div.submenu ul li a:hover{ | |
background: #DFDCCB; | |
color: white; | |
} | |
.SmallBody { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 10px; | |
} | |
.BodyGrey { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 12px; | |
color: #666666; | |
} | |
.BodyGreySmall { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 10px; | |
font-style:italic; | |
color: #666666; | |
} | |
.BoldLargeBody { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 12px; | |
} | |
.BoldLargeClock { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 16px; | |
color: #660000; | |
} | |
.QuickMenu{ | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 14px; | |
} | |
.BoldLargeBodyGrey { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 12px; | |
color: #666666; | |
} | |
.BoldLargeBodyWhite { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 12px; | |
color:#FFF; | |
} | |
.SmallBodyWhite { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 10px; | |
color:#FFF; | |
} | |
.BoldSmallBodyGrey { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 10px; | |
color: #666666; | |
} | |
.BoldSmallBodyRed { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 10px; | |
color:#900; | |
} | |
.Title { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 24px; | |
} | |
.Body { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 12px; | |
} | |
.BodyBold { | |
font-size: 14px; | |
font-weight: bold; | |
font-family: Arial, Helvetica, sans-serif; | |
} | |
.HeaderText { | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 24px; | |
color:#FFF; | |
font-style: italic; | |
} | |
.CustomButton{ | |
text-align:center; | |
cursor:pointer; | |
border-radius: 10px; | |
-moz-border-radius: 10px; | |
-webkit-border-radius: 10px; | |
border-style: solid; | |
border-width: 1px; | |
border-color: #888; | |
padding: 2px; | |
width:100px; | |
height:20px; | |
font-family: Arial, Helvetica, sans-serif; | |
font-weight: bold; | |
font-size: 10px; | |
color: #666666; | |
background-color:#D5D5D5; | |
} | |
/* Table Sorter Styles */ | |
* {margin:0; padding:2; outline:none} | |
#tablewrapper {width:100%; margin:0 auto} | |
#tableheader {width:100%; height:40px} | |
.search {float:left; padding:2px;} | |
#tableheader select {float:left; font-size:12px; width:140px; padding:2px 4px 4px} | |
#tableheader input {float:left; font-size:12px; height:10x; width:225px; padding:2px 4px 4px; margin-left:4px} | |
.details {float:right; padding-top:12px; margin-right:8px} | |
.details div {float:left; margin-left:15px; font-size:12px} | |
.tinytable {width:100%px;border:none} | |
.tinytable th {background:url(../images/header-bg.gif); text-align:left; color:#555555; border:1px solid #d3d3d3;border-right:none;} | |
.tinytable th h3 {font-size:12px; font-weight:normal; padding:6px 8px 8px} | |
.tinytable td {padding:4px 6px 6px; border:none} | |
.tinytable .head h3 {background:url(../images/sort.gif) right no-repeat; cursor:pointer;} | |
/*.tinytable .desc, .sortable .asc {background:url(../images/header-selected-bg.gif)}*/ | |
.tinytable .desc h3 {background:url(../images/desc.gif) right no-repeat; cursor:pointer;} | |
.tinytable .asc h3 {background:url(../images/asc.gif) right no-repeat; cursor:pointer;} | |
/*.tinytable .head:hover, .tinytable .desc:hover, .tinytable .asc:hover {color:#fff}*/ | |
.tinytable .evenrow td {background:#e2e4ff} | |
.tinytable .oddrow td {background:#ffffff} | |
.tinytable td.evenselected {background:#d3d6ff} | |
.tinytable td.oddselected {background:#eaebff} | |
.tinytable tfoot {background:#fff; font-weight:bold} | |
.tinytable tfoot td {padding:6px 8px 8px} | |
#tablefooter {height:15px; margin-top:20px} | |
#tablenav {float:left} | |
#tablenav img {cursor:pointer} | |
#tablenav div {float:left; margin-right:15px} | |
#tablelocation {float:right; font-size:12px} | |
#tablelocation select {margin-right:3px} | |
#tablelocation div {float:left; margin-left:15px} | |
.page {margin-top:2px; font-style:italic; margin-right:8px} | |
/*#selectedrow td {background:#c6d5e1}*/ | |
/* Tiny Scrollbar */ | |
#scrollbar1 { width: 520px; clear: both; margin: 20px 0 10px; } | |
#scrollbar1 .viewport { width: 500px; height: 200px; overflow: hidden; position: relative; } | |
#scrollbar1 .overview { list-style: none; position: absolute; left: 0; top: 0; } | |
#scrollbar1 .scrollbar, | |
#scrollbar1 .thumb .end, | |
#scrollbar1 .thumb { background: transparent url(../images/bg-scrollbar.png) no-repeat; } | |
#scrollbar1 .scrollbar { position: relative; background-position: 0 0; float: right; width: 15px; } | |
#scrollbar1 .track { background: transparent url(../images/bg-scrollbar-end.png) no-repeat 0 100%; height: 100%; width:13px; position: relative; padding: 0 1px; } | |
#scrollbar1 .thumb { background-position: 100% 100%; height: 20px; width: 13px; cursor: pointer; overflow: hidden; position: absolute; top: 0; } | |
#scrollbar1 .thumb .end { background-position: 100% 0; height: 5px; width: 13px; } | |
#scrollbar1 .disable { display: none; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment