Ejemplo n.º 1
0
		$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);
Ejemplo n.º 2
0
	// -- 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;
Ejemplo n.º 3
0
		$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();

		// UPDATE CONTROL NO
		UpdateCtrlNo("assignee_equipment");

		if($_FILES['txtEquipmentPhoto']['size'] > 0){
			if (!is_dir($dir)) {
				mkdir($dir, 0777, true);
Ejemplo n.º 4
0
	$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));
		return $newpass;
	}
Ejemplo n.º 5
0
		$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);
Ejemplo n.º 6
0
	// -- 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();
Ejemplo n.º 7
0
		$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.";
Ejemplo n.º 8
0
	// -- 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();
Ejemplo n.º 9
0
<?
	$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();
?>
Ejemplo n.º 10
0
	// -- 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();
Ejemplo n.º 11
0
<?
	// 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();
?>
Ejemplo n.º 12
0
<?
	// 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();
?>
Ejemplo n.º 13
0
<?
	// 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();
?>
Ejemplo n.º 14
0
<?
	// 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();
?>
Ejemplo n.º 15
0
<?
	// 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();
?>
Ejemplo n.º 16
0
<?
	// 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();
?>
Ejemplo n.º 17
0
		$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();
	}
Ejemplo n.º 18
0
		$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();
	}
Ejemplo n.º 19
0
        if($row_user[0]['userPass'] == $password){
            $_SESSION['SYS_USERID'] = $username;
            $_SESSION['SYS_UNAME'] = $row_user[0]['userName'];
            $_SESSION['SYS_AVATAR'] = USERPICS . $username . '/' . $row_user[0]['userPic'];
            $_SESSION['SYS_USERTYPE'] = $row_user[0]['userType'];
            $_SESSION['SYS_USERLVL'] = $row_user[0]['accessLevel'];

            // 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 = '$username'");
            $userassignee->doQuery("query");
            $row_userassignee = $userassignee->getLists();
            $num_userassignee = $userassignee->getNumRows();

            // GET ASSIGNEE ID
            $assigneeID = $row_userassignee[0]['assigneeID'];

            // SET ASSIGNEE TO SESSION
            $_SESSION['SYS_ASSIGNEE'] = $assigneeID;

            // CLOSING FMS DB
            $fms_db->DBClose();
Ejemplo n.º 20
0
					$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");
					$row_equipmentmst = $equipmentmst->getLists();
				break;
			default: break;
		}
	}

	// SET ASSIGNEE
	$assigneeequipment = new Table;
	$assigneeequipment->setSQLType($fms_db->getSQLType());
	$assigneeequipment->setInstance($fms_db->getInstance());
	$assigneeequipment->setView("v_assigneeequipment");
	$assigneeequipment->setParam("WHERE $where ORDER BY isCurrent DESC,assignedStart DESC");
	$assigneeequipment->doQuery("query");
	$row_assigneeequipment = $assigneeequipment->getLists();

	// CLOSING FMS DB 
	$fms_db->DBClose();
?>
Ejemplo n.º 21
0
<?
	// 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();
?>
Ejemplo n.º 22
0
		$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();