Example #1
0
		$chkwourl = new Table;
		$chkwourl->setSQLType($fms_db->getSQLType());
		$chkwourl->setInstance($fms_db->getInstance());
		$chkwourl->setView("v_workordermaster");
		$chkwourl->setParam("WHERE url = '$sesid'");
		$chkwourl->doQuery("query");
		$num_chkurl = $chkwourl->getNumRows();
		$row_chkurl = $chkwourl->getLists();

		$wourl_status = $row_chkurl[0]['status'];

		// CHECK WORK ORDER
		$wo_dtl = new Table;
		$wo_dtl->setSQLType($fms_db->getSQLType());
		$wo_dtl->setInstance($fms_db->getInstance());
		$wo_dtl->setView("v_workorderdetail");
		$wo_dtl->setParam("WHERE woReferenceNo = '$worefno'");
		$wo_dtl->doQuery("query");
		$num_wo_dtl = $wo_dtl->getNumRows();
		$row_wo_dtl = $wo_dtl->getLists();

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

		if($num_chkwo == 0 || $num_chkurl == 0 || $wo_status != 1 || $wourl_status != 1){
			$url = BASE_URL;
			$msg = "Invalid URL!";

			$alert = new MessageAlert();
			$alert->setURL($url);
			$alert->setMessage($msg);
Example #2
0
	}
	// -- END SAVE NEW EQUIPMENT --

	// -- START DELETE EQUIPMENT --
	if(isset($_GET['delete']) && !empty($_GET['delete']) && $_GET['delete'] == 1 && !empty($_GET['id'])){
		$id = $_GET['id'];

		// 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("WHERE equipmentID = '$id'");
		$equipmentmst->doQuery("query");
		$row_equipmentmst = $equipmentmst->getLists();

		// DELETE EQUIPMENT
		$del_equipment = new Table;
		$del_equipment->setSQLType($fms_db->getSQLType());
		$del_equipment->setInstance($fms_db->getInstance());
		$del_equipment->setTable("equipmentmaster");
		$del_equipment->setParam("WHERE equipmentID = '$id'");
		$del_equipment->doQuery("delete");
		$res_equipment = $del_equipment->getError();

		// CLOSING FMS DB
		$fms_db->DBClose();
Example #3
0
<?
	// 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();
?>
Example #4
0
	}
	// -- END DELETE REMINDER --

	// -- START EDIT REMINDER --
	if(isset($_GET['edit']) && !empty($_GET['edit']) && $_GET['edit'] == 1 && !empty($_GET['id'])){
		$id = $_GET['id'];

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

		// SET REMINDER
		$reminders = new Table;
		$reminders->setSQLType($fms_db->getSQLType());
		$reminders->setInstance($fms_db->getInstance());
		$reminders->setView("v_remindermaster");
		$reminders->setParam("WHERE reminderID = '$id'");
		$reminders->doQuery("query");
		$row_reminders = $reminders->getLists();

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

		$status = $row_reminders[0]['status'];
	}
	// -- END EDIT REMINDER --

	// -- START UPDATE REMINDER --
	if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){
		$id = $_GET['id'];
		$title = $_POST['txtTitle'];
Example #5
0
	}
	// -- END DELETE CONTROL NO --

	// -- START EDIT CONTROL NO --
	if(isset($_GET['edit']) && !empty($_GET['edit']) && $_GET['edit'] == 1 && !empty($_GET['id'])){
		$id = $_GET['id'];

		// 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->setView("controlnomaster");
		$ctrlno->setParam("WHERE id = '$id'");
		$ctrlno->doQuery("query");
		$row_ctrlno = $ctrlno->getLists();

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

		$status = $row_ctrlno[0]['status'];
	}
	// -- END EDIT CONTROL NO --

	// -- START UPDATE CONTROL NO --
	if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){
		$id = $_GET['id'];
		$desc = $_POST['txtDescription'];
Example #6
0
	$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;
	}
?>
Example #7
0
	}
	// -- END DELETE SERVICE TYPE --

	// -- START EDIT SERVICE TYPE --
	if(isset($_GET['edit']) && !empty($_GET['edit']) && $_GET['edit'] == 1 && !empty($_GET['id'])){
		$id = $_GET['id'];

		// 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->setView("v_servicetypemaster");
		$servicetype->setParam("WHERE serviceTypeID = '$id'");
		$servicetype->doQuery("query");
		$row_servicetype = $servicetype->getLists();

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

		$status = $row_servicetype[0]['status'];
	}
	// -- END EDIT SERVICE TYPE --

	// -- START UPDATE SERVICE TYPE --
	if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){
		$id = $_GET['id'];
		$desc = $_POST['txtDescription'];
Example #8
0
	}
	// -- END DELETE MAKE --

	// -- START EDIT MAKE --
	if(isset($_GET['edit']) && !empty($_GET['edit']) && $_GET['edit'] == 1 && !empty($_GET['id'])){
		$id = $_GET['id'];

		// 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->setView("v_makemaster");
		$make->setParam("WHERE makeID = '$id'");
		$make->doQuery("query");
		$row_make = $make->getLists();

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

		$status = $row_make[0]['status'];
	}
	// -- END EDIT CATEGORY --

	// -- START UPDATE MAKE --
	if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){
		$id = $_GET['id'];
		$makeName = $_POST['txtMakeName'];
Example #9
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();
?>
Example #10
0
<?
	// SET FMS DB
	$fms_db = new DBConfig;
	$fms_db->setFleetDB();

	// SET PARTS
	$partsmst = new Table;
	$partsmst->setSQLType($fms_db->getSQLType());
	$partsmst->setInstance($fms_db->getInstance());
	$partsmst->setView("v_partsmaster");
	$partsmst->setParam("ORDER BY partsID");
	$partsmst->doQuery("query");
	$row_partsmst = $partsmst->getLists();

	// CLOSING FMS DB 
	$fms_db->DBClose();
?>
Example #11
0
	}
	// -- END DELETE LOCATION --

	// -- START EDIT LOCATION --
	if(isset($_GET['edit']) && !empty($_GET['edit']) && $_GET['edit'] == 1 && !empty($_GET['id'])){
		$id = $_GET['id'];

		// 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->setView("v_locationmaster");
		$location->setParam("WHERE locationID = '$id'");
		$location->doQuery("query");
		$row_location = $location->getLists();

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

		$status = $row_location[0]['status'];
	}
	// -- END EDIT LOCATION --

	// -- START UPDATE LOCATION --
	if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){
		$id = $_GET['id'];
		$locName = $_POST['txtLocationName'];
Example #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();
?>
Example #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();
?>
Example #14
0
	}
	// -- END DELETE SUPPLIER --

	// -- START EDIT SUPPLIER --
	if(isset($_GET['edit']) && !empty($_GET['edit']) && $_GET['edit'] == 1 && !empty($_GET['id'])){
		$id = $_GET['id'];

		// 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->setView("v_suppliermaster");
		$supplier->setParam("WHERE supplierID = '$id'");
		$supplier->doQuery("query");
		$row_supplier = $supplier->getLists();

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

		$status = $row_supplier[0]['status'];
	}
	// -- END EDIT SUPPLIER --

	// -- START UPDATE SUPPLIER --
	if(isset($_POST['update']) && !empty($_POST['update']) && $_POST['update'] == 1){
		$id = $_GET['id'];
		$suppName = $_POST['txtSupplierName'];
Example #15
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();
?>
Example #16
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();
?>
Example #17
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();
?>
Example #18
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();

            $alert = new MessageAlert;
Example #19
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();
?>
Example #20
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();
?>
Example #21
0
		
		if($comp_exist == 0){
			$alert = new MessageAlert();
			$alert->setURL(BASE_URL . 'invoicing.php');
			$alert->setMessage("Invalid URL!11");
			$alert->Alert();
		}

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

		// SET MAKE
		$invoicingdtl = new Table;
		$invoicingdtl->setSQLType($fms_db->getSQLType());
		$invoicingdtl->setInstance($fms_db->getInstance());
		$invoicingdtl->setView("v_equipmentrepaireddetail");
		$invoicingdtl->setParam("WHERE companyID = '$id' ORDER BY woTransactionDate DESC");
		$invoicingdtl->doQuery("query");
		$row_invoicingdtl = $invoicingdtl->getLists();

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

	}else{
		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . 'invoicing.php');
		$alert->setMessage("Invalid URL!");
		$alert->Alert();
	}
?>