// NEW NO FOR ASSIGNEE COMPANY $newNum = getnewCtrlNo("assignee_company"); // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SAVE NEW USER MENU $ins_assigneecompany = new Table; $ins_assigneecompany->setSQLType($fms_db->getSQLType()); $ins_assigneecompany->setInstance($fms_db->getInstance()); $ins_assigneecompany->setTable("assigneemapper"); $ins_assigneecompany->setField("id,companyID,assigneeID,type,createdBy,createdDate"); $ins_assigneecompany->setValues("'$newNum','$companyid','$assigneeid','assignee_company','$sys_UserID','$today'"); $ins_assigneecompany->doQuery("save"); // CLOSING FMS DB $fms_db->DBClose(); // UPDATE CONTROL NO UpdateCtrlNo("assignee_company"); $url = BASE_URL . V_ASSIGNEECOMPANY . "?id=" . $assigneeid; $msg = "Company was successfully tagged to Assignee."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert();
if($curAssignee != $assignee){ // SAVE ASSIGNEE EQUIPMENT $ins_ass_equip = new Table; $ins_ass_equip->setSQLType($fms_db->getSQLType()); $ins_ass_equip->setInstance($fms_db->getInstance()); $ins_ass_equip->setTable("assigneeequipment"); $ins_ass_equip->setField("id,assigneeID,equipmentID,assignedStart"); $ins_ass_equip->setValues("'$newNum','$assignee','$id','$today'"); $ins_ass_equip->doQuery("save"); // UPDATE ASSIGNEE EQUIPMENT $upd_ass_equip = new Table; $upd_ass_equip->setSQLType($fms_db->getSQLType()); $upd_ass_equip->setInstance($fms_db->getInstance()); $upd_ass_equip->setTable("assigneeequipment"); $upd_ass_equip->setValues("assignedEnd = '$today', isCurrent = '0'"); $upd_ass_equip->setParam("WHERE assigneeID = '$curAssignee' AND equipmentID = '$id'"); $upd_ass_equip->doQuery("update"); } // CLOSING FMS DB $fms_db->DBClose(); // UPDATE CONTROL NO UpdateCtrlNo("assignee_equipment"); if($_FILES['txtEquipmentPhoto']['size'] > 0){ if (!is_dir($dir)) { mkdir($dir, 0777, true); } if(file_exists($dir . "/" . $oldPhoto)){
$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); $alert->setMessage($msg); $alert->Alert(); }
$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); $alert->setMessage($msg); $alert->Alert(); }
// 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; $msg = "Work Order successfully " . $statusDesc . ".";
<? if(isset($_GET['user_access_add']) && !empty($_GET['user_access_add']) && $_GET['user_access_add'] == '1'){ $menuid = $_GET['menuid']; $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("usermenu"); $ins_assignee->setField("userID,menuID,createdBy,createdDate"); $ins_assignee->setValues("'$userid','$menuid','$sys_UserID','$today'"); $ins_assignee->doQuery("save"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_USERACCESS . "?id=" . $userid; $msg = "Menu was successfully added."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); } if(isset($_GET['user_access_remove']) && !empty($_GET['user_access_remove']) && $_GET['user_access_remove'] == '1'){ $menuid = $_GET['menuid'];
// -- START UPDATE CATEGORY -- if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){ $id = $_GET['id']; $catName = $_POST['txtCategoryName']; $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET CATEGORY $category = new Table; $category->setSQLType($fms_db->getSQLType()); $category->setInstance($fms_db->getInstance()); $category->setTable("categorymaster"); $category->setValues("categoryName = '$catName', modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $category->setParam("WHERE categoryID = '$id'"); $category->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_CATEGORY; $msg = "Category successfully updated."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); } // -- END UPDATE CATEGORY --
// -- 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(); } // -- END UPDATE LOCATION --
// -- 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(); } // -- END UPDATE SERVICE TYPE --
$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(); } // --END USER CHANGE PASSWORD --
$id = $_GET['id']; $desc = $_POST['txtDescription']; $variant = $_POST['txtVariant']; $variantDesc = $_POST['txtVariantDesc']; $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET MODEL $model = new Table; $model->setSQLType($fms_db->getSQLType()); $model->setInstance($fms_db->getInstance()); $model->setTable("modelmaster"); $model->setValues("description = '$desc', variant = '$variant', variantDescription = '$variantDesc' , modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $model->setParam("WHERE modelID = '$id'"); $model->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_MODEL; $msg = "Model successfully updated."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); } // -- END UPDATE MODEL --
if($_FILES['txtAttachment']['size'] > 0){ $fAttachment = "attachment = '$attachment',"; } // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET ASSIGNEE $assignee = new Table; $assignee->setSQLType($fms_db->getSQLType()); $assignee->setInstance($fms_db->getInstance()); $assignee->setTable("assigneemaster"); $assignee->setValues("companyID = '$company',locationID = '$location',firstname = '$fName' ,lastname = '$lName',gender = '$gender',age = '$age',contactNo1 = '$contactNo1',contactNo2 = '$contactNo2' ,address = '$address',costCenter = '$costCenter',immediateHead = '$immediateHead' ,emailAddress = '$immediateEmailAddress', $fAttachment licenseNo = '$licenseNo' ,expirationDate = '$licenseExpirationDate',licenseAddress = '$licenseAddress' , modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $assignee->setParam("WHERE assigneeID = '$id'"); $assignee->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); if($_FILES['txtAttachment']['size'] > 0){ if (!is_dir($dir)) { mkdir($dir, 0777, true); } if(file_exists($dir . "/" . $oldAttachment)){ unlink($dir . "/" . $oldAttachment); }
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(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); }
$lowStockQty = str_replace(",","",$_POST['txtLowStockQty']); $price = str_replace(",","",$_POST['txtPrice']); $retailPrice = str_replace(",","",$_POST['txtRetailPrice']); $status = $_POST['txtStatus']; // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET PARTS $parts = new Table; $parts->setSQLType($fms_db->getSQLType()); $parts->setInstance($fms_db->getInstance()); $parts->setTable("partsmaster"); $parts->setValues("stockCode = '$stockCode', brand = '$brand', model = '$model', description = '$desc' , stockOnHand = '$stockOnHand', lowStockQty = '$lowStockQty', price = '$price', retailPrice = '$retailPrice' , modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $parts->setParam("WHERE partsID = '$id'"); $parts->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_PARTS; $msg = "Parts successfully updated."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); }
// -- 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(); } // -- END UPDATE MAKE --
if(isset($_GET['user_assignee_add']) && !empty($_GET['user_assignee_add']) && $_GET['user_assignee_add'] == '1'){ $assigneeid = $_GET['assigneeid']; $userid = $_GET['userid']; $newNum = getNewCtrlNo("user_assignee"); // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SAVE NEW USER MENU $ins_userassignee = new Table; $ins_userassignee->setSQLType($fms_db->getSQLType()); $ins_userassignee->setInstance($fms_db->getInstance()); $ins_userassignee->setTable("assigneemapper"); $ins_userassignee->setField("id,userID,assigneeID,type,createdBy,createdDate"); $ins_userassignee->setValues("'$newNum','$userid','$assigneeid','user_assignee',$sys_UserID','$today'"); $ins_userassignee->doQuery("save"); // CLOSING FMS DB $fms_db->DBClose(); // UPDATE CONTROL NO USER ASSIGNEE UpdateCtrlNo("user_assignee"); $url = BASE_URL . V_USERASSIGNEE . "?id=" . $userid; $msg = "User Assignee was successfully tagged."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert();
$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."; }else{ $url = BASE_URL . V_CONTROLNO; $msg .= "Control No successfully updated.";
$glyphicon = $_POST['txtGlyphicon']; }else{ $glyphicon = "glyphicons glyphicons-book"; } // SET FMS DB $fms_db = new DBConfig; $fms_db->setFleetDB(); // SET CONTROL NO $menu = new Table; $menu->setSQLType($fms_db->getSQLType()); $menu->setInstance($fms_db->getInstance()); $menu->setTable("menumaster"); $menu->setValues("menuName = '$menuName', menuController = '$menuController', glyphicon = '$glyphicon', isMenuMaintenance = '$isMaintenance', isMenuTransactions = '$isTransaction', isMenuReport = '$isReport', sortNo = '$sortNo', modifiedBy = '$sys_UserID', modifiedDate = '$today', status = '$status'"); $menu->setParam("WHERE menuID = '$id'"); $menu->doQuery("update"); // CLOSING FMS DB $fms_db->DBClose(); $url = BASE_URL . V_MENU; $msg = "Control No successfully updated."; $alert = new MessageAlert(); $alert->setURL($url); $alert->setMessage($msg); $alert->Alert(); }