コード例 #1
0
ファイル: makeController.php プロジェクト: rogerapras/fms
	// -- START DELETE MAKE --
	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();

		// DELETE MAKE
		$del_make = new Table;
		$del_make->setSQLType($fms_db->getSQLType());
		$del_make->setInstance($fms_db->getInstance());
		$del_make->setTable("makemaster");
		$del_make->setParam("WHERE makeID = '$id'");
		$del_make->doQuery("delete");
		$res_make = $del_make->getError();

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

		$msg = null;
		if($res_make > 0){
			$msg .= "Sorry! There has been an error in deleting your Make. Please contact the Web Administrator.";
		}else{
			$msg .= "Make successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_MAKE);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #2
0
		// 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.";
		}

		$alert = new MessageAlert();
		$alert->setURL($url);
コード例 #3
0
		$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();

		$dir = EQUIPMENTPICS . $id;

		if(file_exists($dir . "/" . $row_equipmentmst[0]['photo'])){
			unlink($dir . "/" . $row_equipmentmst[0]['photo']);
			rmdir($dir);
		}

		$msg = null;
		if($res_equipment > 0){
			$msg .= "Sorry! There has been an error in deleting your Equipment. Please contact the Web Administrator.";
		}else{
コード例 #4
0
ファイル: supplierController.php プロジェクト: rogerapras/fms
	// -- START DELETE SUPPLIER --
	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();

		// DELETE SUPPLIER
		$del_supplier = new Table;
		$del_supplier->setSQLType($fms_db->getSQLType());
		$del_supplier->setInstance($fms_db->getInstance());
		$del_supplier->setTable("suppliermaster");
		$del_supplier->setParam("WHERE supplierID = '$id'");
		$del_supplier->doQuery("delete");
		$res_category = $del_supplier->getError();

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

		$msg = null;
		if($res_category > 0){
			$msg .= "Sorry! There has been an error in deleting your Supplier. Please contact the Web Administrator.";
		}else{
			$msg .= "Supplier successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_SUPPLIER);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #5
0
	// -- START DELETE REMINDER --
	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();

		// DELETE REMINDER
		$del_rem = new Table;
		$del_rem->setSQLType($fms_db->getSQLType());
		$del_rem->setInstance($fms_db->getInstance());
		$del_rem->setTable("remindermaster");
		$del_rem->setParam("WHERE reminderID = '$id'");
		$del_rem->doQuery("delete");
		$res_del_rem = $del_rem->getError();

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

		$msg = null;
		if($res_parts > 0){
			$msg .= "Sorry! There has been an error in deleting your Reminder. Please contact the Web Administrator.";
		}else{
			$msg .= "Reminder successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_REMINDERS);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #6
0
		$getwo = new Table;
		$getwo->setSQLType($fms_db->getSQLType());
		$getwo->setInstance($fms_db->getInstance());
		$getwo->setView("v_workordermaster");
		$getwo->setParam("WHERE woReferenceNo = '$id'");
		$getwo->doQuery("query");
		$row_getwo = $getwo->getLists();

		// DELETE WORKORDER MST
		$del_womst = new Table;
		$del_womst->setSQLType($fms_db->getSQLType());
		$del_womst->setInstance($fms_db->getInstance());
		$del_womst->setTable("workordermaster");
		$del_womst->setParam("WHERE woReferenceNo = '$id'");
		$del_womst->doQuery("delete");
		$res_wo = $del_womst->getError();

		// DELETE WORKORDER DTL
		$del_wodtl = new Table;
		$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");

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

		$msg = null;
		if($res_wo > 0){
			$msg .= "Sorry! There has been an error in deleting your Work Order. Please contact the Web Administrator.";
コード例 #7
0
	// -- START DELETE SERVICE TYPE --
	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();

		// DELETE SERVICE TYPE
		$del_servicetype = new Table;
		$del_servicetype->setSQLType($fms_db->getSQLType());
		$del_servicetype->setInstance($fms_db->getInstance());
		$del_servicetype->setTable("servicetypemaster");
		$del_servicetype->setParam("WHERE serviceTypeID = '$id'");
		$del_servicetype->doQuery("delete");
		$res_servicetype = $del_servicetype->getError();

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

		$msg = null;
		if($res_servicetype > 0){
			$msg .= "Sorry! There has been an error in deleting your Service Type. Please contact the Web Administrator.";
		}else{
			$msg .= "Service Type successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_SERVICETYPE);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #8
0
ファイル: categoryController.php プロジェクト: rogerapras/fms
	// -- START DELETE CATEGORY --
	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();

		// DELETE CATEGORY
		$del_category = new Table;
		$del_category->setSQLType($fms_db->getSQLType());
		$del_category->setInstance($fms_db->getInstance());
		$del_category->setTable("categorymaster");
		$del_category->setParam("WHERE categoryID = '$id'");
		$del_category->doQuery("delete");
		$res_category = $del_category->getError();

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

		$msg = null;
		if($res_category > 0){
			$msg .= "Sorry! There has been an error in deleting your Category. Please contact the Web Administrator.";
		}else{
			$msg .= "Category successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_CATEGORY);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #9
0
ファイル: modelController.php プロジェクト: rogerapras/fms
	// -- START DELETE MODEL --
	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();

		// DELETE MODEL
		$del_model = new Table;
		$del_model->setSQLType($fms_db->getSQLType());
		$del_model->setInstance($fms_db->getInstance());
		$del_model->setTable("modelmaster");
		$del_model->setParam("WHERE modelID = '$id'");
		$del_model->doQuery("delete");
		$res_model = $del_model->getError();

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

		$msg = null;
		if($res_model > 0){
			$msg .= "Sorry! There has been an error in deleting your Model. Please contact the Web Administrator.";
		}else{
			$msg .= "Model successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_MODEL);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #10
0
ファイル: locationController.php プロジェクト: rogerapras/fms
	// -- START DELETE LOCATION --
	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();

		// DELETE LOCATION
		$del_location = new Table;
		$del_location->setSQLType($fms_db->getSQLType());
		$del_location->setInstance($fms_db->getInstance());
		$del_location->setTable("locationmaster");
		$del_location->setParam("WHERE locationID = '$id'");
		$del_location->doQuery("delete");
		$res_location = $del_location->getError();

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

		$msg = null;
		if($res_location > 0){
			$msg .= "Sorry! There has been an error in deleting your Location. Please contact the Web Administrator.";
		}else{
			$msg .= "Location successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_LOCATION);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #11
0
ファイル: userController.php プロジェクト: rogerapras/fms
		$getuser = new Table;
		$getuser->setSQLType($fms_db->getSQLType());
		$getuser->setInstance($fms_db->getInstance());
		$getuser->setView("v_usermaster");
		$getuser->setParam("WHERE userID = '$id'");
		$getuser->doQuery("query");
		$row_getuser = $getuser->getLists();

		// DELETE USER
		$del_user = new Table;
		$del_user->setSQLType($fms_db->getSQLType());
		$del_user->setInstance($fms_db->getInstance());
		$del_user->setTable("usermaster");
		$del_user->setParam("WHERE userID = '$id'");
		$del_user->doQuery("delete");
		$res_user = $del_user->getError();

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

		$msg = null;
		if($res_user > 0){
			$msg .= "Sorry! There has been an error in deleting your User. Please contact the Web Administrator.";
		}else{
			$dir = USERPICS . strtoupper($id);
			
			unlink($dir . "/" . $row_getuser[0]['userPic']);
			rmdir($dir);
			$msg .= "User successfully deleted.";
		}
コード例 #12
0
ファイル: assigneeController.php プロジェクト: rogerapras/fms
		$assignee = new Table;
		$assignee->setSQLType($fms_db->getSQLType());
		$assignee->setInstance($fms_db->getInstance());
		$assignee->setView("v_assigneemaster");
		$assignee->setParam("WHERE assigneeID = '$id'");
		$assignee->doQuery("query");
		$row_assignee = $assignee->getLists();

		// DELETE ASSIGNEE
		$del_assignee = new Table;
		$del_assignee->setSQLType($fms_db->getSQLType());
		$del_assignee->setInstance($fms_db->getInstance());
		$del_assignee->setTable("assigneemaster");
		$del_assignee->setParam("WHERE assigneeID = '$id'");
		$del_assignee->doQuery("delete");
		$res_assignee = $del_assignee->getError();

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

		$dir = ASSIGNEEATTACHMENTS . $id;

		if(file_exists($dir . "/" . $row_assignee[0]['attachment'])){
			unlink($dir . "/" . $row_assignee[0]['attachment']);
			rmdir($dir);
		}

		$msg = null;
		if($res_assignee > 0){
			$msg .= "Sorry! There has been an error in deleting your Assignee. Please contact the Web Administrator.";
		}else{
コード例 #13
0
		$getpo = new Table;
		$getpo->setSQLType($fms_db->getSQLType());
		$getpo->setInstance($fms_db->getInstance());
		$getpo->setView("v_poreceiving");
		$getpo->setParam("WHERE poReferenceNo = '$id'");
		$getpo->doQuery("query");
		$row_getpo = $getpo->getLists();
		
		// DELETE WORKORDER
		$del_po = new Table;
		$del_po->setSQLType($fms_db->getSQLType());
		$del_po->setInstance($fms_db->getInstance());
		$del_po->setTable("poreceiving");
		$del_po->setParam("WHERE poReferenceNo = '$id'");
		$del_po->doQuery("delete");
		$res_po = $del_po->getError();

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

		if(count($row_getpo) == 0){
			$alert = new MessageAlert();
			$alert->setURL(BASE_URL . V_PORECEIVING);
			$alert->setMessage("Invalid URL!");
			$alert->Alert();
		}

		$dirPOAttachment = POATTACHMENTS . $id;

		if(file_exists($dirPOAttachment . "/" . $row_getpo[0]['attachment'])){
			unlink($dirPOAttachment . "/" . $row_getpo[0]['attachment']);
コード例 #14
0
ファイル: partsController.php プロジェクト: rogerapras/fms
	// -- START DELETE PARTS --
	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();

		// DELETE PARTS
		$del_parts = new Table;
		$del_parts->setSQLType($fms_db->getSQLType());
		$del_parts->setInstance($fms_db->getInstance());
		$del_parts->setTable("partsmaster");
		$del_parts->setParam("WHERE partsID = '$id'");
		$del_parts->doQuery("delete");
		$res_parts = $del_parts->getError();

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

		$msg = null;
		if($res_parts > 0){
			$msg .= "Sorry! There has been an error in deleting your Parts. Please contact the Web Administrator.";
		}else{
			$msg .= "Parts successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_PARTS);
		$alert->setMessage($msg);
		$alert->Alert();
コード例 #15
0
ファイル: menuController.php プロジェクト: rogerapras/fms
	// -- START DELETE MENU --
	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();

		// DELETE MENU
		$del_menu = new Table;
		$del_menu->setSQLType($fms_db->getSQLType());
		$del_menu->setInstance($fms_db->getInstance());
		$del_menu->setTable("menumaster");
		$del_menu->setParam("WHERE menuID = '$id'");
		$del_menu->doQuery("delete");
		$res_menu = $del_menu->getError();

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

		$msg = null;
		if($res_menu > 0){
			$msg .= "Sorry! There has been an error in deleting your Menu. Please contact the Web Administrator.";
		}else{
			$msg .= "Menu successfully deleted.";
		}

		$alert = new MessageAlert();
		$alert->setURL(BASE_URL . V_MENU);
		$alert->setMessage($msg);
		$alert->Alert();