<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); if(isset($_GET['type']) && !empty($_GET['type'])){ $type = $_GET['type']; $id = $_GET['id']; switch($type){ case "e": $where = "equipmentID = '$id'"; // SET ASSIGNEE $assigneemst = new Table; $assigneemst->setSQLType($fms_db->getSQLType()); $assigneemst->setInstance($fms_db->getInstance()); $assigneemst->setView("v_assigneemaster"); $assigneemst->setParam("ORDER BY assigneeID"); $assigneemst->doQuery("query"); $row_assigneemst = $assigneemst->getLists(); break; case "a": $where = "assigneeID = '$id'"; // SET EQUIPMENT $equipmentmst = new Table; $equipmentmst->setSQLType($fms_db->getSQLType()); $equipmentmst->setInstance($fms_db->getInstance()); $equipmentmst->setView("v_equipmentmaster"); $equipmentmst->setParam("ORDER BY equipmentID"); $equipmentmst->doQuery("query");
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET CONTROL NO $menumst = new Table; $menumst->setSQLType($fms_db->getSQLType()); $menumst->setInstance($fms_db->getInstance()); $menumst->setView("v_menumaster"); $menumst->setParam("ORDER BY menuID"); $menumst->doQuery("query"); $row_menumst = $menumst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
$alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); } if(isset($_GET['user_assignee_remove']) && !empty($_GET['user_assignee_remove']) && $_GET['user_assignee_remove'] == '1'){ $assigneeid = $_GET['assigneeid']; $userid = $_GET['userid']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SAVE NEW USER MENU $ins_assignee = new Table; $ins_assignee->setSQLType($fms_db->getSQLType()); $ins_assignee->setInstance($fms_db->getInstance()); $ins_assignee->setTable("assigneemapper"); $ins_assignee->setParam("WHERE userID = '$userid' AND assigneeID = '$assigneeid' AND type = 'user_assignee'"); $ins_assignee->doQuery("delete"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_USERASSIGNEE . "?id=" . $userid; $msg = "User Assignee was successfully untagged."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); }
$alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); } if(isset($_GET['assignee_company_remove']) && !empty($_GET['assignee_company_remove']) && $_GET['assignee_company_remove'] == '1'){ $assigneeid = $_GET['id']; $companyid = $_GET['companyid']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SAVE NEW USER MENU $upd_assigneecompany = new Table; $upd_assigneecompany->setSQLType($fms_db->getSQLType()); $upd_assigneecompany->setInstance($fms_db->getInstance()); $upd_assigneecompany->setTable("assigneemapper"); $upd_assigneecompany->setParam("WHERE companyID = '$companyid' AND assigneeID = '$assigneeid' AND type = 'assignee_company'"); $upd_assigneecompany->doQuery("delete"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_ASSIGNEECOMPANY . "?id=" . $assigneeid; $msg = "Company was successfully untagged to Assignee."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); }
$id = $_GET['id']; $desc = $_POST['txtDescription']; $type = $_POST['txtControlType']; $code = $_POST['txtControlCode']; $noofdigit = $_POST['txtNoOfDigit']; $lastdigit = $_POST['txtLastDigit']; $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET CONTROL NO $ctrlno = new Table; $ctrlno->setSQLType($fms_db->getSQLType()); $ctrlno->setInstance($fms_db->getInstance()); $ctrlno->setTable("controlnomaster"); $ctrlno->setValues("description = '$desc', type = '$type', code = '$code', noOfDigit = '$noofdigit' , lastDigit = '$lastdigit', modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $ctrlno->setParam("WHERE id = '$id'"); $ctrlno->doQuery("update"); $row_ctrlno = $ctrlno->getLists(); $res_ctrlno = $ctrlno->getError(); // CLOSING FMS DB $fms_db->DBClose(); $msg = null; if($res_ctrlno > 0){ $url = BASE_URL . V_CONTROLNOEDIT . "edit=1&id=" . $id; $msg .= "Sorry! There has been an error in updating your control no. Please check the data and update it again.";
// -- END WORK ORDER FOR APPROVAL // APPROVED WORK ORDER if(isset($_POST['approved']) && !empty($_POST['approved']) && $_POST['approved'] == 1){ $apprRemarks = $_POST['txtApproverRemarks']; $status = $_POST['txtStatus']; $id = $worefno; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET WORK ORDER $workorder = new Table; $workorder->setSQLType($fms_db->getSQLType()); $workorder->setInstance($fms_db->getInstance()); $workorder->setTable("workordermaster"); $workorder->setValues("approverRemarks = '$apprRemarks', status = '$status', approvedDate = '$today'"); $workorder->setParam("WHERE woReferenceNo = '$id'"); $workorder->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); switch($status){ case 2: $statusDesc = 'approved'; break; case 7: $statusDesc = 'disapproved'; break; default: break; } $url = BASE_URL;
$suppName = $_POST['txtSupplierName']; $suppAddress = $_POST['txtSupplierAddress']; $suppEmailAddress = $_POST['txtSupplierEmailAddress']; $suppContactNo = $_POST['txtSupplierContactNo']; $suppContactPerson = $_POST['txtSupplierContactPerson']; $suppTIN = $_POST['txtSupplierTIN']; $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET SUPPLIER $supplier = new Table; $supplier->setSQLType($fms_db->getSQLType()); $supplier->setInstance($fms_db->getInstance()); $supplier->setTable("suppliermaster"); $supplier->setValues("supplierName = '$suppName',supplierAddress = '$suppAddress',supplierEmailAddress = '$suppEmailAddress' ,supplierContactNo = '$suppContactNo',contactPerson = '$suppContactPerson',TIN = '$suppTIN' ,modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $supplier->setParam("WHERE supplierID = '$id'"); $supplier->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_SUPPLIER; $msg = "Supplier successfully updated."; $alert = new MessageAlert(); $alert->setURL($url);
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET MODEL $modelmst = new Table; $modelmst->setSQLType($fms_db->getSQLType()); $modelmst->setInstance($fms_db->getInstance()); $modelmst->setView("v_modelmaster"); $modelmst->setParam("ORDER BY modelID"); $modelmst->doQuery("query"); $row_modelmst = $modelmst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET COMPANY $companymst = new Table; $companymst->setSQLType($fms_db->getSQLType()); $companymst->setInstance($fms_db->getInstance()); $companymst->setView("v_companymaster"); $companymst->setParam("ORDER BY companyID"); $companymst->doQuery("query"); $row_companymst = $companymst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET REMINDERS $remindersmst = new Table; $remindersmst->setSQLType($fms_db->getSQLType()); $remindersmst->setInstance($fms_db->getInstance()); $remindersmst->setView("v_remindermaster"); $remindersmst->setParam("WHERE status = '0' ORDER BY reminderID"); $remindersmst->doQuery("query"); $row_remindersmst = $remindersmst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET WORK ORDER $workordermst = new Table; $workordermst->setSQLType($fms_db->getSQLType()); $workordermst->setInstance($fms_db->getInstance()); $workordermst->setView("v_workordermaster"); $workordermst->setParam("WHERE status NOT IN('6','7','8') ORDER BY status ASC, woReferenceNo DESC, woTransactionDate DESC"); $workordermst->doQuery("query"); $row_workordermst = $workordermst->getLists(); // SET SERVICE TYPE $servicetypemst = new Table; $servicetypemst->setSQLType($fms_db->getSQLType()); $servicetypemst->setInstance($fms_db->getInstance()); $servicetypemst->setView("v_servicetypemaster"); $servicetypemst->setParam("WHERE status = '1'"); $servicetypemst->doQuery("query"); $row_servicetypemst = $servicetypemst->getLists(); // SET EQUIPMENT $equipmentmst = new Table; $equipmentmst->setSQLType($fms_db->getSQLType()); $equipmentmst->setInstance($fms_db->getInstance()); $equipmentmst->setView("v_equipmentmaster"); $equipmentmst->setParam("WHERE status = '1'"); $equipmentmst->doQuery("query"); $row_equipmentmst = $equipmentmst->getLists();
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET USER $usermst = new Table; $usermst->setSQLType($fms_db->getSQLType()); $usermst->setInstance($fms_db->getInstance()); $usermst->setView("v_usermaster"); $usermst->setParam("ORDER BY userID"); $usermst->doQuery("query"); $row_usermst = $usermst->getLists(); // GET USER $getuser = new Table; $getuser->setSQLType($fms_db->getSQLType()); $getuser->setInstance($fms_db->getInstance()); $getuser->setView("v_usermaster"); $getuser->setParam("WHERE userID = '$sys_UserID'"); $getuser->doQuery("query"); $row_getuser = $getuser->getLists(); $userPass = $row_getuser[0]['userPass']; // CLOSING FMS DB $fms_db->DBClose(); function generatePassword($password){ $salt = 'FleetManagementSystem'; $newpass = md5(sha1($salt.$password));
$alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); } // GENERATE NEW PASSWORD ENTERED $newpass = generatePassword(strtoupper($new)); // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET USER $user = new Table; $user->setSQLType($fms_db->getSQLType()); $user->setInstance($fms_db->getInstance()); $user->setTable("usermaster"); $user->setValues("userPass = '******'"); $user->setParam("WHERE userID = '$id'"); $user->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_USERCHANGEPASSWORD; $msg = "Password successfully changed."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert();
$subTotal = ($labor + $misc + $parts) - $disc; $totalCost = str_replace(",","",number_format($subTotal + $tax,2)); $status = $_POST['txtStatus']; if(!empty($attachment)){ $attachmentval = ",attachment = '$attachment'"; } // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET PURCHASE ORDER $poreceiving = new Table; $poreceiving->setSQLType($fms_db->getSQLType()); $poreceiving->setInstance($fms_db->getInstance()); $poreceiving->setTable("poreceiving"); $poreceiving->setValues("woReferenceNo = '$wo',labor = '$labor',miscellaneous = '$misc',parts = '$parts' ,discount = '$disc',tax = '$tax',Amount = '$totalCost' $attachment ,status = '$status' , modifiedBy = '$sys_UserID', modifiedDate = '$today'"); $poreceiving->setParam("WHERE poReferenceNo = '$id'"); $poreceiving->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_PORECEIVINGEDIT . "?edit=1&id=" . $id; $msg = "Purchase Order successfully updated."; $alert = new MessageAlert();
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET PURCHASE ORDER $poreceivingmst = new Table; $poreceivingmst->setSQLType($fms_db->getSQLType()); $poreceivingmst->setInstance($fms_db->getInstance()); $poreceivingmst->setView("v_poreceiving"); $poreceivingmst->setParam("WHERE status = '0' ORDER BY status ASC, poReferenceNo DESC, poTransactionDate DESC"); $poreceivingmst->doQuery("query"); $row_poreceivingmst = $poreceivingmst->getLists(); // SET WORK ORDER $workordermst = new Table; $workordermst->setSQLType($fms_db->getSQLType()); $workordermst->setInstance($fms_db->getInstance()); $workordermst->setView("v_workordermaster"); $workordermst->setParam("WHERE status NOT IN('5','6','7','8') ORDER BY status ASC, woReferenceNo DESC, woTransactionDate DESC"); $workordermst->doQuery("query"); $row_workordermst = $workordermst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
// -- END EDIT LOCATION -- // -- START UPDATE LOCATION -- if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){ $id = $_GET['id']; $locName = $_POST['txtLocationName']; $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET LOCATION $location = new Table; $location->setSQLType($fms_db->getSQLType()); $location->setInstance($fms_db->getInstance()); $location->setTable("locationmaster"); $location->setValues("locationName = '$locName', modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $location->setParam("WHERE locationID = '$id'"); $location->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_LOCATION; $msg = "Location successfully updated."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert();
$title = $_POST['txtTitle']; $location = $_POST['txtLocation']; $category = $_POST['txtCategory']; $desc = $_POST['txtDescription']; $startDate = $_POST['txtStartDate'] . ' ' . date("h:i:s"); $dueDate = $_POST['txtDueDate'] . ' ' . date("h:i:s"); $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET REMINDER $parts = new Table; $parts->setSQLType($fms_db->getSQLType()); $parts->setInstance($fms_db->getInstance()); $parts->setTable("remindermaster"); $parts->setValues("title = '$title', description = '$desc', location = '$location', category = '$category' , startDate = '$startDate', dueDate = '$dueDate' , modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $parts->setParam("WHERE reminderID = '$id'"); $parts->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_REMINDERS; $msg = "Reminder successfully updated."; $alert = new MessageAlert(); $alert->setURL($url);
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET MAKE $invoicing = new Table; $invoicing->setSQLType($fms_db->getSQLType()); $invoicing->setInstance($fms_db->getInstance()); $invoicing->setView("v_equipmentrepairedmaster"); $invoicing->setParam("WHERE noOfTransactions > 0 ORDER BY companyName "); $invoicing->doQuery("query"); $row_invoicing = $invoicing->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
$registrationCost = str_replace(",","",$_POST['txtRegistrationCost']); $depresitionValue = str_replace(",","",$_POST['txtDepresitionValue']); $status = $_POST['txtStatus']; $dir = EQUIPMENTPICS . $id; // NEW NO FOR ASSIGNEE EQUIPMENT $newNum = getnewCtrlNo("assignee_equipment"); // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET EQUIPMENT $equipment = new Table; $equipment->setSQLType($fms_db->getSQLType()); $equipment->setInstance($fms_db->getInstance()); $equipment->setTable("equipmentmaster"); $equipment->setValues("$ePhoto assigneeID = '$assignee',companyID = '$company',categoryID = '$category',makeID = '$make' ,locationID = '$location',modelID = '$model',color = '$color' ,mileageStart = '$mileageStart',mileageEnd = '$mileageEnd' ,gasolineAllocationInLiters = '$gasolineAllocationInLiters',gasolineAllocationInCash = '$gasolineAllocationInCash' ,insuranceAppliedDate = '$insuranceAppliedDate',insuranceExpirationDate = '$insuranceExpirationDate' ,insuranceReminderInDays = '$insuranceReminderInDays',purchaseDate = '$purchaseDate' ,conductionSticker = '$conductionSticker',year = '$year',plateNo = '$plateNo',engineNo = '$engineNo' ,chassisNo = '$chassisNo',serialNo = '$serialNo',acquisitionCost = '$acquisitionCost' ,insuranceCost = '$insuranceCost',registrationCost = '$registrationCost',depresitionValue = '$depresitionValue' , modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $equipment->setParam("WHERE equipmentID = '$id'"); $equipment->doQuery("update"); if($curAssignee != $assignee){
// -- END EDIT SERVICE TYPE -- // -- START UPDATE SERVICE TYPE -- if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){ $id = $_GET['id']; $desc = $_POST['txtDescription']; $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET SERVICE TYPE $servicetype = new Table; $servicetype->setSQLType($fms_db->getSQLType()); $servicetype->setInstance($fms_db->getInstance()); $servicetype->setTable("servicetypemaster"); $servicetype->setValues("description = '$desc', modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $servicetype->setParam("WHERE serviceTypeID = '$id'"); $servicetype->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_SERVICETYPE; $msg = "Service Type successfully updated."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert();
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET USER ACCESS $usermenu = new Table; $usermenu->setSQLType($fms_db->getSQLType()); $usermenu->setInstance($fms_db->getInstance()); $usermenu->setView("v_usermenu"); $usermenu->setParam("WHERE userID = '$sys_UserID'"); $usermenu->doQuery("query"); $row_usermenu = $usermenu->getLists(); // SET USER ACCESS $menumst = new Table; $menumst->setSQLType($fms_db->getSQLType()); $menumst->setInstance($fms_db->getInstance()); $menumst->setView("v_menumaster"); $menumst->setParam("WHERE menuID NOT IN(SELECT menuID FROM v_usermenu)"); $menumst->doQuery("query"); $row_menumst = $menumst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
<? $id = $_GET['id']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET USER ACCESS $userassignee = new Table; $userassignee->setSQLType($fms_db->getSQLType()); $userassignee->setInstance($fms_db->getInstance()); $userassignee->setView("v_userassigneemapper"); $userassignee->setParam("WHERE userID = '$id'"); $userassignee->doQuery("query"); $row_userassignee = $userassignee->getLists(); $num_userassignee = $userassignee->getNumRows(); // SET USER ACCESS $assigneemst = new Table; $assigneemst->setSQLType($fms_db->getSQLType()); $assigneemst->setInstance($fms_db->getInstance()); $assigneemst->setView("v_assigneemaster"); $assigneemst->setParam("WHERE assigneeID NOT IN(SELECT assigneeID FROM v_userassigneemapper)"); $assigneemst->doQuery("query"); $row_assigneemst = $assigneemst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
// -- END EDIT CATEGORY -- // -- START UPDATE MAKE -- if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){ $id = $_GET['id']; $makeName = $_POST['txtMakeName']; $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET MAKE $make = new Table; $make->setSQLType($fms_db->getSQLType()); $make->setInstance($fms_db->getInstance()); $make->setTable("makemaster"); $make->setValues("makeName = '$makeName', modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $make->setParam("WHERE makeID = '$id'"); $make->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_MAKE; $msg = "Make successfully updated."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert();
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET CONTROL NO $usermenu_access = new Table; $usermenu_access->setSQLType($fms_db->getSQLType()); $usermenu_access->setInstance($fms_db->getInstance()); $usermenu_access->setView("v_usermenu"); $usermenu_access->setParam("WHERE userID = '$sys_UserID'"); $usermenu_access->doQuery("query"); $row_usermenu_access = $usermenu_access->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET CATEGORY $categorymst = new Table; $categorymst->setSQLType($fms_db->getSQLType()); $categorymst->setInstance($fms_db->getInstance()); $categorymst->setView("v_categorymaster"); $categorymst->setParam("ORDER BY categoryID"); $categorymst->doQuery("query"); $row_categorymst = $categorymst->getLists(); // CLOSING FMS DB $fms_db->DBClose(); ?>
<? // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET EQUIPMENT $equipmentmst = new Table; $equipmentmst->setSQLType($fms_db->getSQLType()); $equipmentmst->setInstance($fms_db->getInstance()); $equipmentmst->setView("v_equipmentmaster"); $equipmentmst->setParam("ORDER BY equipmentID"); $equipmentmst->doQuery("query"); $row_equipmentmst = $equipmentmst->getLists(); // SET ASSIGNEE $assigneemst = new Table; $assigneemst->setSQLType($fms_db->getSQLType()); $assigneemst->setInstance($fms_db->getInstance()); $assigneemst->setView("v_assigneemaster"); $assigneemst->setParam("WHERE status = '1' ORDER BY assigneeName"); $assigneemst->doQuery("query"); $row_assigneemst = $assigneemst->getLists(); // SET COMPANY $companymst = new Table; $companymst->setSQLType($fms_db->getSQLType()); $companymst->setInstance($fms_db->getInstance()); $companymst->setView("v_companymaster"); $companymst->setParam("WHERE status = '1' ORDER BY companyName"); $companymst->doQuery("query"); $row_companymst = $companymst->getLists();