<?
	session_start();
	if (!isset($_SESSION['username'])) {
		header("Location: index.php");
	}
	
	include "UctVw.php";
	$objAxpDB = new UctVw();
	
	if (!isset($_GET["form"])) {
		$objAxpDB->menuData("HRD");
	} else {
		$form = $_GET["form"];
		$page = $_GET["page"];
		$search = ParseSearch($_GET["q"]);
		$order_type = $_GET["order_type"];
		$order_field = $_GET["order_field"];
	
		switch($form)
		{
			case "pendidikan":
				$objAxpDB->ViewName("Daftar Pendidikan"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftEducation_Code, ftEducation_Name FROM ishrd.tleducation");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Pendidikan, Nama Pendidikan");
				
				$objAxpDB->FormName("Pendidikan"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftEducation_Code, ftEducation_Name FROM ishrd.tleducation");
				$objAxpDB->FormCaption("Cabang, Kode Pendidikan, Nama Pendidikan");
				$objAxpDB->FormPosition("TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			case "jabatan":
				$objAxpDB->ViewName("Daftar Jabatan"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftPosition_Code, ftPosition_Name, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.tlposition");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Jabatan, Nama Jabatan");
				
				$objAxpDB->FormName("Jabatan"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftPosition_Code, ftPosition_Name FROM ishrd.tlposition");
				$objAxpDB->FormCaption("Cabang, Kode Jabatan, Nama Jabatan");
				$objAxpDB->FormPosition("TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "departemen":
				$objAxpDB->ViewName("Daftar Departemen"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftDepartment_Code, ftDepartment_Name FROM ishrd.tldepartment");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Departemen, Nama Departemen");
				
				$objAxpDB->FormName("Departemen"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftDepartment_Code, ftDepartment_Name FROM ishrd.tldepartment");
				$objAxpDB->FormCaption("Cabang, Kode Departemen, Nama Departemen");
				$objAxpDB->FormPosition("TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;

			case "pph21":
				$objAxpDB->ViewName("Daftar PPH21"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftPPH21_Code, ftPPH21_Name, fnPPH21_Sex, fcAmount FROM ishrd.tlpph21");
				$objAxpDB->ViewCaption("ID, Cabang, Kode PPH21, Nama PPH21, Jenis Kelamin, Jumlah");
				
				$objAxpDB->FormName("PPH21"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftPPH21_Code, ftPPH21_Name, fnPPH21_Sex, fcAmount FROM ishrd.tlpph21");
				$objAxpDB->FormCaption("Cabang, Kode PPH21, Nama PPH21, Jenis Kelamin, Jumlah");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TL, TL, TL, TL, TL, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "tipe_shift":
				$objAxpDB->ViewName("Daftar Tipe Shift"); 
				$objAxpDB->ViewSQL("SELECT fnID, ftBranch_Code, ftShift_Code, ftShift_Name, fnIndex, ftShift_Day, fdShift_In, fdShift_Out, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.tlshift");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Tipe Shift, Nama Tipe Shift, Nama Kontak, Alamat, Telepon1, Status");
				
				$objAxpDB->FormName("Tipe Shift"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftShift_Code, ftShift_Name FROM ishrd.tlshift");
				$objAxpDB->FormCaption("Cabang, Kode Tipe Shift, Nama Tipe Shift");
				$objAxpDB->FormPosition("TL, TL, TL, TL");
				$objAxpDB->FormScript(0, "onKeyUp=\"this.value=this.value.toUpperCase();\"");
				$objAxpDB->FormScript(15, "onKeyUp=\"FormatNPWP(this)\"");

				$objAxpDB->GridSQL(0, "SELECT fnIndex, ftShift_Day, fdShift_In, fdShift_Out FROM ishrd.tlshift");
				$objAxpDB->GridCaption(0, "No., Hari, Jam Masuk, Jam Keluar");	
				//$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "tipe_catatan":
				$objAxpDB->ViewName("Daftar Tipe Catatan"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftNotes_Type_Code, ftNotes_Type_Name FROM ishrd.tlnotes_type");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Tipe Catatan, Nama Tipe Catatan");
				
				$objAxpDB->FormName("Tipe Catatan"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftNotes_Type_Code, ftNotes_Type_Name FROM ishrd.tlnotes_type");
				$objAxpDB->FormCaption("Cabang, Kode Tipe Catatan, Nama Tipe Catatan");
				$objAxpDB->FormPosition("TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "pegawai":
				$objAxpDB->ViewName("Daftar Pegawai"); 
				$objAxpDB->ViewSQL("SELECT 	fnId, ftBranch_Code, ftEmployee_Code, ftEmployee_Name, ftAddress, ftTelephone, ftShift_Code, fnStatus FROM ishrd.tlemployee");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Pegawai, Nama Pegawai, Alamat, Telepon, Shift, Status");
				
				$objAxpDB->FormName("Pegawai"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftEmployee_Code, ftEmployee_Name, ftNickname, fiPhoto, fdBirth_Date, ftBirth_Place, ftReligion, fnSex, ftTelephone, ftHandphone, ftKTP_No, ftAddress, ftCity, ftZip_Code, ftState, ftCountry, ftEducation_Code, fdStart_Date, fdLeave_Date, ftPosition_Code, ftDepartment_Code, fnStatus, ftPPH21_Code, fnMarried_Status, ftSpouse_Name, ftNotes, ftEmergency_Contact, ftEmergency_Affiliation, ftEmergency_Telephone, ftPermanent_Address, ftPermanent_City, ftPermanent_State, ftPermanent_Zip_Code, ftPermanent_Telephone, ftPayroll_Type_Code, fcBasic_Salary, fcFood_Money, fcTransport_Money, fcOvertime_Money, fcMaximum_Loan, ftShift_code, fnPayment_Status_Code, ftBank_Name, ftBank_Account, ftPayroll_Notes FROM ishrd.tlemployee");
				$objAxpDB->FormCaption("Cabang, Kode Pegawai, Nama Pegawai, Nama Panggilan, Foto, Tgl. Lahir, Tempat Lahir, Agama, Jenis Kelamin, Telepon, Handphone, No. KTP, Alamat, Kota, Kode Pos, Propinsi, Negara, Pendidikan, Tgl. Mulai Kerja, Tgl. Akumulasi Cuti, Jabatan, Departemen, Status, PPH 21, Status Menikah, Nama Suami/Istri, Catatan, Nama Kontak Darurat, Status Hubungan, Telepon Kontak Darurat, Alamat Permanen, Kota Permanen, Propinsi Permanen, Kode Pos Permanen, Telepon Permanen, Tipe Gaji, Gaji Pokok, Uang Makan, Uang Transport, Uang Lembur, Maksimum Pinjamani, Shift, Metode Pembayaran, Nama Bank, No. Rekening, Catatan Gaji");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TL, TL, TL, TL, TL, TL, TL, TL, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, TR, BL, BL, BL, BL, BL, BL, BL, BL, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR");
//				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");
				
				$objAxpDB->GridName(0, "Tanggungan");
				$objAxpDB->GridSQL(0, "SELECT fnIndex, ftLoad_Name, fdLoad_Birthday, ftLoad_Status FROM ishrd.tlemployee_load");
				$objAxpDB->GridCaption(0, "No., Nama Tanggungan, Tgl. Lahir Tanggungan, Status Tangungan");

				$objAxpDB->GridName(1, "Catatan");
				$objAxpDB->GridSQL(1, "SELECT fnIndex, fdNotes_Date, ftNotes_Type_Code, ftNotes_Type_name, ftNotes_Content	FROM ishrd.tlemployee_notes");
				$objAxpDB->GridCaption(1, "No., Tgl. Catatan, Kode Tipe Catatan, Nama Tipe Catatan, Isi Catatan");

				$objAxpDB->GridName(2, "Tunjangan");
				$objAxpDB->GridSQL(2, "SELECT fnIndex, ftAllowance_Type_Code, ftAllowance_Type_Name, ftAllowance_Type_Period, fcAllowance_Type_Amount FROM ishrd.tlpayroll_det");
				$objAxpDB->GridCaption(2, "No., Kode Tipe Tunjangan, Nama Tipe Tunjangan, Periode Tunjangan, Jumlah Tunjangan");

				$objAxpDB->GridName(3, "Gaji");
				$objAxpDB->GridSQL(3, "SELECT ftSalary_Code, fcAmount FROM ishrd.tlemployee_salary");
				$objAxpDB->GridCaption(3, "Kode Gaji, Jumlah Gaji");
				

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "lembur":
				$objAxpDB->ViewName("Daftar Lembur"); 
				$objAxpDB->ViewSQL("SELECT 	fnId, ftBranch_Code, ftOvertime_Code, fdOvertime_From, fdOvertime_To, fnOvertime_Formula FROM ishrd.tlovertime");
				$objAxpDB->ViewCaption("ID, abang, Kode Lembur, Periode Lembur Awal, Periode Lembur Akhir, Formula");
				
				$objAxpDB->FormName("Lembur"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftOvertime_Code, fdOvertime_From, fdOvertime_To, fnOvertime_Formula FROM ishrd.tlovertime");
				$objAxpDB->FormCaption("Cabang, Kode Lembur, Periode Lembur Awal, Periode Lembur Akhir, Formula");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"FormatNPWP(this)\"");

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "tipe_cuti":
				$objAxpDB->ViewName("Daftar Tipe Cuti"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftLeave_Type_Code, ftLeave_Type_Name, fnLeave_Type_Period, fnLeave_Type_Days FROM ishrd.tlleave_type");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Tipe Cuti, Nama Tipe Cuti, Periode Tipe Cuti (Tahun), Cuti Diperoleh (Hari)");
				
				$objAxpDB->FormName("Tipe Cuti"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftLeave_Type_Code, ftLeave_Type_Name, fnLeave_Type_Period, fnLeave_Type_Days FROM ishrd.tlleave_type");
				$objAxpDB->FormCaption("Cabang, Kode Tipe Cuti, Nama Tipe Cuti, Periode Tipe Cuti (Tahun), Cuti Diperoleh (Hari)");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "hari_libur":
				$objAxpDB->ViewName("Daftar Hari Libur"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftHoliday_Code, ftHoliday_Name, fdHoliday_Date FROM ishrd.tlholiday");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Hari Libur, Nama Hari Libur, Tgl. Hari Libur");
				
				$objAxpDB->FormName("Hari Libur"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftHoliday_Code, ftHoliday_Name, fdHoliday_Date FROM ishrd.tlholiday");
				$objAxpDB->FormCaption("Cabang, Kode Hari Libur, Nama Hari Libur, Tgl. Hari Libur");
				$objAxpDB->FormPosition("TL, TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;
			
			case "tipe_tunjangan":
				$objAxpDB->ViewName("Daftar Tipe Tunjangan"); 
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftAllowance_Type_Code, ftAllowance_Type_Name, ftAllowance_Type_Period, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.tlallowance_type");
				$objAxpDB->ViewCaption("ID, Cabang, Kode Tipe Tunjangan, Nama Tipe Tunjangan, Periode Tipe Tunjangan");
				
				$objAxpDB->FormName("Tipe Tunjangan"); 
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftAllowance_Type_Code, ftAllowance_Type_Name, ftAllowance_Type_Period FROM ishrd.tlallowance_type");
				$objAxpDB->FormCaption("Cabang, Kode Tipe Tunjangan, Nama Tipe Tunjangan, Periode Tipe Tunjangan");
				$objAxpDB->FormPosition("TL, TL, TL, TL");
				$objAxpDB->FormScript(1, "onKeyUp=\"this.value=this.value.toUpperCase();\"");

				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 9", "fnTrans_Status_Code", "ftTrans_Status_Name", 1, True);

				$objAxpDB->SetStatus("id, fnStatus");			
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("baru, cetak, tutup");
				elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->FormLocked("1, 0, 0");
					$objAxpDB->ButtonShow("reset, simpan, tutup");
				} elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->FormLocked("1, 1, 0");
					$objAxpDB->ButtonShow("update, hapus, tutup");
				}
				$objAxpDB->Process();
				break;

			case "absensi":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar Absensi");
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftEmployee_No, ftAttendance_No, ftEmployee_Name, fdAttendance_Date, ftAttendance_Day, fdEnter_Time, fdExit_Time, fnWorking_Hours, fdOvertime_Enter_Time, fdOvertime_Exit_Time, fnOvertime_Hours, FtNotes, ftShift_Code, ftStatusPegawai_code, fnWorking_Days_Status, fcUang_lembur, ftStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txattendance");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("Absensi");
				$objAxpDB->FormSQL("SELECT ftBranch_Code, ftEmployee_No, ftAttendance_No, ftEmployee_Name, fdAttendance_Date, ftAttendance_Day, fdEnter_Time, fdExit_Time, fnWorking_Hours, fdOvertime_Enter_Time, fdOvertime_Exit_Time, fnOvertime_Hours, FtNotes, ftShift_Code, ftStatusPegawai_code, fnWorking_Days_Status, fcUang_lembur, ftStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txattendance");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnId, ftBranch_Code, ftAttendance_No, fnIndex, ftEmployee_Code, ftEmployee_Name, fnEmployee_Status, ftShift_Code, fdWorking_Enter_Time, fdWorking_Exit_Date, fdWorking_Exit_Time, ftWorking_Hours, fdOvertime_Enter_Time, fdOvertime_Exit_Date, fdOvertime_Exit_Time, ftOvertime_Hours, fcOvertime, fnWorking_Days_Status, ftNotes, ftStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txattendance_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "cuti":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar Cuti");
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftLeave_No, ftEmployee_Code, fdTrans_Date, ftLeave_Type_Code, fdLeave_Start_Date, fdLeave_End_Date, fnLeave_Days, ftLeave_Notes, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txleave");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("Cuti");
				$objAxpDB->FormSQL("SELECT fnId, ftBranch_Code, ftLeave_No, ftEmployee_Code, fdTrans_Date, ftLeave_Type_Code, fdLeave_Start_Date, fdLeave_End_Date, fnLeave_Days, ftLeave_Notes, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txleave");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnIndex, ftItem_Code, ffQty, ffQty_In FROM txpurchase_order_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");	
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "uang_makan":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar Uang Makan");
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftFood_Money_No, fdTrans_Date, ftEmployee_Code, fcFood_Money, fcTransport_Money, fcDeduction, fcTotal, ftDescription, ftNotes, fdFood_Start_Date, fdFood_End_Date, fnFood_Days, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txfood_money");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("Uang Makan");
				$objAxpDB->FormSQL("SELECT fnId, ftBranch_Code, ftFood_Money_No, fdTrans_Date, ftEmployee_Code, fcFood_Money, fcTransport_Money, fcDeduction, fcTotal, ftDescription, ftNotes, fdFood_Start_Date, fdFood_End_Date, fnFood_Days, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txfood_money");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnID, ftBranch_Code, ftFood_Money_No, fnIndex, ftEmployee_Code, fnWorking_Days, fcFood_Money, fcFood_Amount, fcTransport_Money, fcTransport_Amount, fcDeduction, fcAmount, ftDescription, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txfood_money_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");	
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "thr":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar THR");
				$objAxpDB->ViewSQL("SELECT fnID, ftBranch_Code, ftTHR_No, fdTrans_Date, fdTHR_Start_Date, fdTHR_End_Date, ftNotes, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date	FROM ishrd.txthr_hdr");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("THR");
				$objAxpDB->FormSQL("SELECT fnID, ftBranch_Code, ftTHR_No, fdTrans_Date, fdTHR_Start_Date, fdTHR_End_Date, ftNotes, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date	FROM ishrd.txthr_hdr");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnID, ftBranch_Code, ftTHR_No, fnIndex, ftEmployee_Code, fnEffective_Days, fnTHR_Days, fcBasic_THR, fcTHR, fcRound, fcAmount, ftDescription, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date	FROM ishrd.txthr_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");	
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "pinjaman":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar Pinjaman");
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftLoan_No, ftEmployee_Code, fdTrans_Date, ftLoan_Type_Code, fdLoan_Period_From, fdLoan_Period_To, fcLoan_Max, fcLoan_Amount, fcLoan_Balance, fcLoan_Payment, ftLoan_Description, ftNotes, fnLoan_Payment_Status, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txloan");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("Pinjaman");
				$objAxpDB->FormSQL("SELECT fnId, ftBranch_Code, ftLoan_No, ftEmployee_Code, fdTrans_Date, ftLoan_Type_Code, fdLoan_Period_From, fdLoan_Period_To, fcLoan_Max, fcLoan_Amount, fcLoan_Balance, fcLoan_Payment, ftLoan_Description, ftNotes, fnLoan_Payment_Status, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txloan");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnIndex, ftItem_Code, ffQty, ffQty_In FROM txpurchase_order_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");	
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "pembayaran_pinjaman":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar Pembayaran Pinjaman");
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftLoan_Payment_No, ftEmployee_Code, ftEmployee_Name, fdTrans_Date, fcLoan_Payment_Amount, fcLoan_Payment_Description, ftNotes, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txloan_payment_hdr");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("Pembayaran Pinjaman");
				$objAxpDB->FormSQL("SELECT fnId, ftBranch_Code, ftLoan_Payment_No, ftEmployee_Code, ftEmployee_Name, fdTrans_Date, fcLoan_Payment_Amount, fcLoan_Payment_Description, ftNotes, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txloan_payment_hdr");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnId, ftBranch_Code, fnIndex, ftLoan_Payment_No, ftLoan_Type_Code, ftLoan_No, fdLoan_Date, fcLoan_Amount, fcLoan_Balance, fcLoan_Payment, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txloan_payment_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");	
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "rekapitulasi_hak_cuti":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar Rekapitulasi Hak Cuti");
				$objAxpDB->ViewSQL("SELECT fnid, ftBranch_Code, ftEmployee_Code, ftEmployee_Name, ftLeave_Type_Code, ftLeave_Type_name, fncuti, fnCutiTahunSebelum, fdBulan, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txleave_right");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("Rekapitulasi Hak Cuti");
				$objAxpDB->FormSQL("SELECT fnid, ftBranch_Code, ftEmployee_Code, ftEmployee_Name, ftLeave_Type_Code, ftLeave_Type_name, fncuti, fnCutiTahunSebelum, fdBulan, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txleave_right");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnIndex, ftItem_Code, ffQty, ffQty_In FROM txpurchase_order_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");	
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "slip_gaji":			
				// Deklarasi UctVw
				$objAxpDB->ViewName("Daftar Slip Gaji");
				$objAxpDB->ViewSQL("SELECT fnId, ftBranch_Code, ftPayroll_Slip_No, fdTrans_Date, fdStart_Date, fdEnd_Date, ftPayroll_Type, ftPayroll_Type_Code, ftNotes, fnStatus, ftCreated_User, fdCreated_Date, ftModified_User, fdModified_Date FROM ishrd.txpayroll_slip_hdr ");
				$objAxpDB->ViewCaption("ID, Tgl. PO, No. PO, Keterangan, Nama Supplier, Pegawai, Qty Sisa, Status Kirim, Status");
				$objAxpDB->ViewPeriod(TRUE);
				
				// Deklarasi Header & Footer
				$objAxpDB->FormName("Slip Gaji");
				$objAxpDB->FormSQL("SELECT fnCategory, ftPO_No, ftSupplier_Code, ftDescription, fdTrans_Date, ftStaff, fnShipment_Status, ftNotes, ffTotal_Qty, ffTotal_Qty_In, fnStatus FROM txpurchase_order_hdr");
				$objAxpDB->FormCaption("Cabang, Kategori, No. PO, Supplier, Keterangan, Tgl. PO, Pegawai, Status Pengiriman, Catatan, Total Qty, Total Qty Diterima, Status");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TR, TR, TR, BL, BR, BR, BR");
				$objAxpDB->FormScript(0, "onChange=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
				$objAxpDB->FormScript(4, "onFocus=\"ajax_do('getdata.php?code=2&obj1=' + fdTrans_Date.value + '&obj2=ftPO_No&obj3=' + fnCategory.value);\"");
		
				// Deklarasi Detail
				$objAxpDB->GridSQL(0, "SELECT fnIndex, ftItem_Code, ffQty, ffQty_In FROM txpurchase_order_det");
				$objAxpDB->GridCaption(0, "No., Kode Barang, Kuantitas, Kuantitas Diterima");	
				$objAxpDB->GridScript(0, 2, "onChange='RecalculateGrid_PO();'");		

				$objAxpDB->Lookup("fnCategory", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 15", "fnTrans_Status_Code", "ftTrans_Status_Name", -1, True);
				$objAxpDB->Lookup("ftSupplier_Code", "SELECT ftSupplier_Code, ftSupplier_Name FROM tlsupplier", "ftSupplier_Code", "ftSupplier_Name", -1, False);
				$objAxpDB->Lookup("fnStatus", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 2", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("fnShipment_Status", "SELECT fnTrans_Status_Code, ftTrans_Status_Name FROM tstransaction_status WHERE fnTrans_Group_Code = 12", "fnTrans_Status_Code", "ftTrans_Status_Name", 0, True);
				$objAxpDB->Lookup("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr", "ftItem_Code", "ftItem_Name", -1, False);
				//$objAxpDB->ScriptGlobal("ajax_do('getdata.php?code=2&obj1=" . date("d/m/Y") . "&obj2=ftPO_No');");
				
				$objAxpDB->SetStatus("id, fnShipment_Status, fnStatus");
				if ($objAxpDB->GetStatus("id") == "") {
					$objAxpDB->ButtonShow("baru, tutup");
				} elseif ($objAxpDB->GetStatus("id") == 0) {
					$objAxpDB->ButtonShow("reset, simpan, tutup");
					$objAxpDB->FormLocked("0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 0, 0, 1");

					$objAxpDB->FormValue(2, $_SESSION['supplier_code']);
					$objAxpDB->FormValue(5, $_SESSION['username']);

					$objAxpDB->GridAllowAddNew(0, TRUE);
					$objAxpDB->GridAllowDelete(0, TRUE);
				} elseif ($objAxpDB->GetStatus("fnStatus") == 1) {
					if($objAxpDB->GetStatus("fnShipment_Status") == 3)
						$objAxpDB->ButtonShow("cetak, batal, tutup, baru"); 
					else
						$objAxpDB->ButtonShow("cetak, final, batal, tutup, baru");

					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				} elseif ($objAxpDB->GetStatus("fnStatus") == 9) {
					$objAxpDB->ButtonShow("tutup");
					$objAxpDB->FormLocked("1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1");
					$objAxpDB->GridLocked(0, "1, 1, 1, 1");
				}
				
				$objAxpDB->Process();
				break;
			
			case "laporan_hrd":
				$objAxpDB->ViewName("Laporan HRD"); 
				$objAxpDB->ViewSQL("SELECT fnID, ftReport_Code, ftReport_Name FROM tlreport WHERE ftReport_Group = 'HRD'");
				$objAxpDB->ViewCaption("ID, Kode Laporan, Nama Laporan");
				//$objAxpDB->ViewAction("");

				$objAxpDB->FormName("Laporan HRD");
				$objAxpDB->FormSQL("SELECT ftReport_Code, ftReport_Name, ftReport_SQL, ftReport_Group, ftReport_Filter, ftReport_GroupBy, ftReport_Summary, ftReport_Mode FROM tlreport");
				$objAxpDB->FormCaption("Cabang, Kode Laporan, Nama Laporan, SQL Laporan, Group Laporan, Filter Laporan, GroupBy Laporan, Summary Laporan, Mode Laporan");
				$objAxpDB->FormPosition("TL, TL, TL, TL, TL, TL");
				$objAxpDB->FormMode("report");
				
				$objAxpDB->ReportFilter("ftCOA_Code", "SELECT ftCOA_Code, ftCOA_Name FROM TLCOA WHERE RIGHT(ftCOA_Code, 4) <> '0000' ORDER BY ftCOA_Code", "ftCOA_Code", "ftCOA_Name", "No. Perkiraan", False);
				$objAxpDB->ReportFilter("ftItem_Code", "SELECT ftItem_Code, ftItem_Name FROM tlstock_hdr ORDER BY ftItem_Code", "ftItem_Code", "ftItem_Name", "Barang", False);
				

				$objAxpDB->SetStatus("id, fnStatus");				
				if ($objAxpDB->GetStatus("id") == "")
					$objAxpDB->ButtonShow("tutup");
				elseif ($objAxpDB->GetStatus("id") != 0) {
					$objAxpDB->ButtonShow("generate, cetak2, export, zoom_out, zoom_in, first, previous, next, last, tutup"); 
					$objAxpDB->FormLocked("1, 1, 1, 1, 1");
				}
				$objAxpDB->Process();
				break;
		}
		
		if ($search == "")
			if ($page == "")
				$objAxpDB->WriteHtmlTable();
			else {
				$objAxpDB->listData($form, $search, $page, $order_field, $order_type);
				echo "|";
				$objAxpDB->pageData($form, $search, $page, $order_field, $order_type);
			}
		else {
			$objAxpDB->listData($form, $search, $page, $order_field, $order_type);
			echo "|";
			$objAxpDB->pageData($form, $search, $page, $order_field, $order_type);
		}
	}