$companyid = $_GET['companyid'];


		// 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);
						,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){
			// 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();
		$suppEmailAddress = $_POST['txtSupplierEmailAddress'];
		$suppContactNo = $_POST['txtSupplierContactNo'];
		$suppContactPerson = $_POST['txtSupplierContactPerson'];
		$suppTIN = $_POST['txtSupplierTIN'];
		$newNum = getNewCtrlNo("supplier");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW SUPPLIER
		$ins_category = new Table;
		$ins_category->setSQLType($fms_db->getSQLType());
		$ins_category->setInstance($fms_db->getInstance());
		$ins_category->setTable("suppliermaster");
		$ins_category->setField("supplierID,supplierName,supplierAddress,supplierEmailAddress,supplierContactNo,contactPerson
							,TIN,createdBy,createdDate");
		$ins_category->setValues("'$newNum','$suppName','$suppAddress','$suppEmailAddress','$suppContactNo','$suppContactPerson'
							,'$suppTIN','$sys_UserID','$today'");
		$ins_category->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO SUPPLIER
		UpdateCtrlNo("supplier");

		$url = BASE_URL . V_SUPPLIER;
		$msg = "New Supplier successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
		$category = $_POST['txtCategory'];
		$desc = $_POST['txtDescription'];
		$startDate = $_POST['txtStartDate'] . ' ' . date("h:i:s");
		$dueDate = $_POST['txtDueDate']  . ' ' . date("h:i:s");
		$newNum = getNewCtrlNo("reminder");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW REMINDER
		$ins_reminder = new Table;
		$ins_reminder->setSQLType($fms_db->getSQLType());
		$ins_reminder->setInstance($fms_db->getInstance());
		$ins_reminder->setTable("remindermaster");
		$ins_reminder->setField("reminderID,title,description,location,category,startDate,dueDate
							,createdBy,createdDate");
		$ins_reminder->setValues("'$newNum','$title','$desc','$location','$category','$startDate','$dueDate'
							,'$sys_UserID','$today'");
		$ins_reminder->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO REMINDER
		UpdateCtrlNo("reminder");

		$url = BASE_URL . V_REMINDERS;
		$msg = "New Reminder successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
		$del_wodtl->setSQLType($fms_db->getSQLType());
		$del_wodtl->setInstance($fms_db->getInstance());
		$del_wodtl->setTable("workorderdetail");
		$del_wodtl->setParam("WHERE woReferenceNo = '$id'");
		$del_wodtl->doQuery("delete");

		// SAVE NEW WORK ORDER DTL
		if(!empty($arrParts)){
			$partsItem = explode("|",$arrParts);
			for($i=0;$i<count($partsItem);$i++){
				$pItem = explode("::",$partsItem[$i]);
				$ins_wodtl = new Table;
				$ins_wodtl->setSQLType($fms_db->getSQLType());
				$ins_wodtl->setInstance($fms_db->getInstance());
				$ins_wodtl->setTable("workorderdetail");
				$ins_wodtl->setField("woReferenceNo,partsID,partsPrice,qty");
				$ins_wodtl->setValues("'$id','$pItem[0]','$pItem[3]','$pItem[4]'");
				$ins_wodtl->doQuery("save");

				// $sql .= "INSERT INTO workorderdetail(woReferenceNo,partsID,partsPrice,qty)
				// 		VALUES('$newNum','$pItem[0]','$pItem[3]','$pItem[4]'); ";
			}
		}

		// SET WORK ORDER
		$getWorkOrder = new Table;
		$getWorkOrder->setSQLType($fms_db->getSQLType());
		$getWorkOrder->setInstance($fms_db->getInstance());
		$getWorkOrder->setView("v_workordermaster");
		$getWorkOrder->setParam("WHERE woReferenceNo = '$id'");
		$getWorkOrder->doQuery("query");
<?
	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 SAVE NEW CATEGORY --
	if(isset($_POST['save']) && !empty($_POST['save']) && $_POST['save'] == 1){
		$catName = $_POST['txtCategoryName'];
		$newNum = getNewCtrlNo("category");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW CATEGORY
		$ins_category = new Table;
		$ins_category->setSQLType($fms_db->getSQLType());
		$ins_category->setInstance($fms_db->getInstance());
		$ins_category->setTable("categorymaster");
		$ins_category->setField("categoryID,categoryName,createdBy,createdDate");
		$ins_category->setValues("'$newNum','$catName','$sys_UserID','$today'");
		$ins_category->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO CATEGORY
		UpdateCtrlNo("category");

		$url = BASE_URL . V_CATEGORY;
		$msg = "New Category successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
		$alert->setMessage($msg);
<?
	// -- START SAVE NEW LOCATION --
	if(isset($_POST['save']) && !empty($_POST['save']) && $_POST['save'] == 1){
		$locName = $_POST['txtLocationName'];
		$newNum = getNewCtrlNo("location");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW LOCATION
		$ins_location = new Table;
		$ins_location->setSQLType($fms_db->getSQLType());
		$ins_location->setInstance($fms_db->getInstance());
		$ins_location->setTable("locationmaster");
		$ins_location->setField("locationID,locationName,createdBy,createdDate");
		$ins_location->setValues("'$newNum','$locName','$sys_UserID','$today'");
		$ins_location->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO LOCATION
		UpdateCtrlNo("location");

		$url = BASE_URL . V_LOCATION;
		$msg = "New Location successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
		$alert->setMessage($msg);
<?
	// -- START SAVE NEW SERVICE TYPE --
	if(isset($_POST['save']) && !empty($_POST['save']) && $_POST['save'] == 1){
		$desc = $_POST['txtDescription'];
		$newNum = getNewCtrlNo("service_type");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW SERVICE TYPE
		$ins_servicetype = new Table;
		$ins_servicetype->setSQLType($fms_db->getSQLType());
		$ins_servicetype->setInstance($fms_db->getInstance());
		$ins_servicetype->setTable("servicetypemaster");
		$ins_servicetype->setField("serviceTypeID,description,createdBy,createdDate");
		$ins_servicetype->setValues("'$newNum','$desc','$sys_UserID','$today'");
		$ins_servicetype->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO SERVICE TYPE
		UpdateCtrlNo("service_type");

		$url = BASE_URL . V_SERVICETYPE;
		$msg = "New Service Type successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
		$alert->setMessage($msg);
Exemple #10
0
		$chk_user = new Table;
		$chk_user->setSQLType($fms_db->getSQLType());
		$chk_user->setInstance($fms_db->getInstance());
		$chk_user->setView("v_usermaster");
		$chk_user->setParam("WHERE userID = '$userID'");
		$chk_user->doQuery("query");
		$num_chkuser = $chk_user->getNumRows();

		if($num_chkuser == 0){
			// SAVE NEW USER
			$ins_user = new Table;
			$ins_user->setSQLType($fms_db->getSQLType());
			$ins_user->setInstance($fms_db->getInstance());
			$ins_user->setTable("usermaster");
			$ins_user->setField("userID,userPass,firstname,lastname,userType,accessLevel,userPic,createdBy,createdDate");
			$ins_user->setValues("'$userID','$password','$fName','$lName','$userType','$accessLvl','$fileName','$sys_UserID','$today'");
			$ins_user->doQuery("save");

			if($_FILES['txtUserPic']['size'] > 0){
				if (!file_exists($dir . "/" . $fileName)) {
					mkdir($dir, 0777, true);
				}
				move_uploaded_file($_FILES['txtUserPic']['tmp_name'], $dir . '/' . $fileName);
			}

			$url = BASE_URL . V_USER;
			$msg = "New User successfully saved.";
		}else{
			$url = BASE_URL . V_USERADD;
			$msg = "Sorry! User ID is already existed. Please enter an unexisted user ID.";
Exemple #11
0
	if(isset($_POST['save']) && !empty($_POST['save']) && $_POST['save'] == 1){
		$desc = $_POST['txtDescription'];
		$variant = $_POST['txtVariant'];
		$variantDesc = $_POST['txtVariantDesc'];
		$newNum = getNewCtrlNo("model");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW MODEL
		$ins_make = new Table;
		$ins_make->setSQLType($fms_db->getSQLType());
		$ins_make->setInstance($fms_db->getInstance());
		$ins_make->setTable("modelmaster");
		$ins_make->setField("modelID,description,variant,variantDescription,createdBy,createdDate");
		$ins_make->setValues("'$newNum','$desc','$variant','$variantDesc','$sys_UserID','$today'");
		$ins_make->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO MODEL
		UpdateCtrlNo("model");

		$url = BASE_URL . V_MODEL;
		$msg = "New Model successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
		$alert->setMessage($msg);
Exemple #12
0
		$licenseAddress = $_POST['txtLicenseAddress'];
		$newNum = getNewCtrlNo("assignee");

		$dir = ASSIGNEEATTACHMENTS . $newNum;

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW ASSIGNEE
		$ins_assignee = new Table;
		$ins_assignee->setSQLType($fms_db->getSQLType());
		$ins_assignee->setInstance($fms_db->getInstance());
		$ins_assignee->setTable("assigneemaster");
		$ins_assignee->setField("assigneeID,companyID,locationID,firstname,lastname,gender,age,contactNo1,contactNo2,address
							,costCenter,immediateHead,emailAddress,attachment,licenseNo,expirationDate,licenseAddress
							,createdBy,createdDate");
		$ins_assignee->setValues("'$newNum','$company','$location','$fName','$lName','$gender','$age','$contactNo1','$contactNo2'
							,'$address','$costCenter','$immediateHead','$immediateEmailAddress','$attachment','$licenseNo'
							,'$licenseExpirationDate','$licenseAddress'
							,'$sys_UserID','$today'");
		$ins_assignee->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO ASSIGNEE
		UpdateCtrlNo("assignee");

		if($_FILES['txtAttachment']['size'] > 0){
			if (!file_exists($dir . "/" . $attachment)) {
		}else{
			$attachmentfld = null;
			$attachmentval = null;
		}

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW PURCHSE ORDER
		$ins_po = new Table;
		$ins_po->setSQLType($fms_db->getSQLType());
		$ins_po->setInstance($fms_db->getInstance());
		$ins_po->setTable("poreceiving");
		$ins_po->setField("poReferenceNo,woReferenceNo,poTransactionDate
							,labor,miscellaneous,parts,discount,tax,Amount
							$attachmentfld
							,createdBy,createdDate");
		$ins_po->setValues("'$newNum','$wo','$today'
							,'$labor','$misc','$parts','$disc','$tax','$totalCost'
							$attachmentval
							,'$sys_UserID','$today'");
		$ins_po->doQuery("save");

		// CLOSING PURCHSE DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO PURCHSE ORDER
		UpdateCtrlNo("po_receiving");

		if($_FILES['txtAttachment']['size'] > 0){
			if (!file_exists($dirPOAttachment . "/" . $attachment)) {
Exemple #14
0
		$stockOnHand = str_replace(",","",$_POST['txtStockOnHand']);
		$lowStockQty = str_replace(",","",$_POST['txtLowStockQty']);
		$price = str_replace(",","",$_POST['txtPrice']);
		$retailPrice = str_replace(",","",$_POST['txtRetailPrice']);
		$newNum = getNewCtrlNo("parts");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW PARTS
		$ins_parts = new Table;
		$ins_parts->setSQLType($fms_db->getSQLType());
		$ins_parts->setInstance($fms_db->getInstance());
		$ins_parts->setTable("partsmaster");
		$ins_parts->setField("partsID,stockCode,brand,model,description,stockOnHand,lowStockQty,price,retailPrice
							,createdBy,createdDate");
		$ins_parts->setValues("'$newNum','$stockCode','$brand','$model','$desc','$stockOnHand','$lowStockQty','$price','$retailPrice'
							,'$sys_UserID','$today'");
		$ins_parts->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO PARTS
		UpdateCtrlNo("parts");

		$url = BASE_URL . V_PARTS;
		$msg = "New Parts successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
Exemple #15
0
<?
	// -- START SAVE NEW MAKE --
	if(isset($_POST['save']) && !empty($_POST['save']) && $_POST['save'] == 1){
		$makeName = $_POST['txtMakeName'];
		$newNum = getNewCtrlNo("make");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW MAKE
		$ins_make = new Table;
		$ins_make->setSQLType($fms_db->getSQLType());
		$ins_make->setInstance($fms_db->getInstance());
		$ins_make->setTable("makemaster");
		$ins_make->setField("makeID,makeName,createdBy,createdDate");
		$ins_make->setValues("'$newNum','$makeName','$sys_UserID','$today'");
		$ins_make->doQuery("save");

		// CLOSING FMS DB
		$fms_db->DBClose();

		// UPDATE CONTROL NO MAKE
		UpdateCtrlNo("make");

		$url = BASE_URL . V_MAKE;
		$msg = "New Make successfully saved.";

		$alert = new MessageAlert();
		$alert->setURL($url);
		$alert->setMessage($msg);
<?
	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);
		$desc = $_POST['txtDescription'];
		$type = $_POST['txtControlType'];
		$code = $_POST['txtControlCode'];
		$noofdigit = $_POST['txtNoOfDigit'];
		$lastdigit = $_POST['txtLastDigit'];

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW CONTROL NO
		$ins_ctrlno = new Table;
		$ins_ctrlno->setSQLType($fms_db->getSQLType());
		$ins_ctrlno->setInstance($fms_db->getInstance());
		$ins_ctrlno->setTable("controlnomaster");
		$ins_ctrlno->setField("description,type,code,lastDigit,noOfDigit,createdBy,createdDate");
		$ins_ctrlno->setValues("'$desc','$type','$code','$lastdigit','$noofdigit','$sys_UserID','$today'");
		$ins_ctrlno->doQuery("save");
		$res_ctrlno = $ins_ctrlno->getError();

		// CLOSING FMS DB
		$fms_db->DBClose();

		$msg = null;
		if($res_ctrlno > 0){
			$url = BASE_URL . V_CONTROLNOADD;
			$msg .= "Sorry! There has been an error in saving your control no. Please check the data and save it again.";
		}else{
			$url = BASE_URL . V_CONTROLNO;
			$msg .= "New Control No successfully saved.";
		}
Exemple #18
0
			$glyphicon = $_POST['txtGlyphicon'];
		}else{
			$glyphicon = "glyphicons glyphicons-book";
		}
		$newNum = getNewCtrlNo("menu");

		// SET FMS DB
		$fms_db = new DBConfig;
		$fms_db->setFleetDB();

		// SAVE NEW MENU
		$ins_menu = new Table;
		$ins_menu->setSQLType($fms_db->getSQLType());
		$ins_menu->setInstance($fms_db->getInstance());
		$ins_menu->setTable("menumaster");
		$ins_menu->setField("menuID,menuName,menuController,isMenuMaintenance,isMenuTransactions,isMenuReport,SortNo
						,createdBy,createdDate");
		$ins_menu->setValues("'$newNum','$menuName','$menuController','$isMaintenance','$isTransaction','$isReport','$sortNo'
						,'$sys_UserID','$today'");
		$ins_menu->doQuery("save");

		// UPDATE CONTROL NO MENU
		$upd_ctrlno = new Table;
		$upd_ctrlno->setSQLType($fms_db->getSQLType());
		$upd_ctrlno->setInstance($fms_db->getInstance());
		$upd_ctrlno->setTable("controlnomaster");
		$upd_ctrlno->setValues("lastDigit = (lastDigit + 1)");
		$upd_ctrlno->setParam("WHERE type = 'menu'");
		$upd_ctrlno->doQuery("update");

		// CLOSING FMS DB
		$fms_db->DBClose();