echo open_body(); include 'master_mainMenu.php'; OPEN_BOX(); ?> <script language=javascript src='js/zMaster.js'></script> <script language=javascript src='js/setup_kud.js'></script> <link rel=stylesheet type=text/css href=style/zTable.css> <?php # Lokasi Tugas if ($_SESSION['empl']['tipelokasitugas'] == 'HOLDING') { $tmpOpt = makeOption($dbname, 'organisasi', 'kodeorganisasi,namaorganisasi', "tipe='KEBUN'"); } elseif ($_SESSION['empl']['tipelokasitugas'] == 'KEBUN') { $tmpOpt = makeOption($dbname, 'organisasi', 'kodeorganisasi,namaorganisasi', "kodeorganisasi='" . $_SESSION['empl']['lokasitugas'] . "'"); } else { $tmpOpt = getOrgBelow($dbname, $_SESSION['empl']['lokasitugas'], false, 'kebunonly'); } # Kebun Berdasarkan Lokasi Tugas $sKebun = array('' => ''); foreach ($tmpOpt as $key => $row) { $sKebun[$key] = $row; } # Form Cari Data Kebun $searchEls = $_SESSION['lang']['kebun'] . " "; $searchEls .= makeElement('sKebun', 'select', '', array('onchange' => "getAfdeling(this,'sAfdeling')", 'style' => 'width:150px'), $sKebun) . " "; $searchEls .= $_SESSION['lang']['afdeling'] . " "; $searchEls .= makeElement('sAfdeling', 'select', '', array('style' => 'width:150px'), array()) . " "; $searchEls .= makeElement('searchIt', 'button', $_SESSION['lang']['find'], array('onclick' => 'showData()')) . " "; # Render Search Element echo "<fieldset id='search' style='margin-bottom:10px;float:left;clear:both'>"; echo "<legend><b>" . $_SESSION['lang']['searchdata'] . "</b></legend>";
if ($bulan < 10) { $bulan = '0' . $bulan; } $tanggalM = $tahun . "-" . $bulan . "-01"; # Current Periode if ($currBulan < 10) { $currBulan = '0' . $currBulan; } $currPeriod = $currTahun . $currBulan; switch ($level) { case '0': # Data # Afdeling dan Blok $afd = substr($param['kodeorg'], 0, 6); $kodeorg = substr($param['kodeorg'], 0, 4); $optBelow = getOrgBelow($dbname, $kodeorg); # Mutasi Blok if ($_SESSION['language'] == 'EN') { $zz = 'namakegiatan1 as namakegiatan'; } else { $zz = 'namakegiatan'; } $cols = "mat.notransaksi,akt.tanggal,keg." . $zz . ",mat.kodeorg,mat.kodebarang,mat.kwantitas,mat.hargasatuan,per.hasilkerja,keg.kodekegiatan"; $where = "left(mat.notransaksi,6)='" . $currPeriod . "' and " . "left(mat.kodeorg,4)='" . $kodeorg . "' and " . "akt.jurnal=1"; $query = "select " . $cols . " from `" . $dbname . "`.`kebun_pakaimaterial` as mat \r\n join `" . $dbname . "`.`kebun_aktifitas` as akt on akt.notransaksi=mat.notransaksi \r\n join `" . $dbname . "`.`kebun_perawatan_vw` as per on per.notransaksi=mat.notransaksi \r\n join `" . $dbname . "`.`setup_kegiatan` as keg on keg.kodekegiatan=per.kodekegiatan \r\n where " . $where; $tmpRes = fetchData($query); if (empty($tmpRes)) { echo 'Warning : No data found'; exit; } //echo $query; exit;
function formHeader($mode, $data) { global $dbname; # Default Value if (empty($data)) { $data['kodeorg'] = ''; $data['bulan'] = date('m'); $data['tahun'] = date('Y'); } # Disabled Primary if ($mode == 'edit') { $disabled = 'disabled'; } else { $disabled = ''; } # Options $optAfd = getOrgBelow($dbname, $_SESSION['empl']['lokasitugas'], false, 'afdeling'); $optBulan = optionMonth(substr($_SESSION['language'], 0, 1), 'long'); $els = array(); $els[] = array(makeElement('period', 'label', $_SESSION['lang']['periode']), makeElement('bulan', 'select', $data['bulan'], array(), $optBulan) . " / " . makeElement('tahun', 'text', $data['tahun'], array('style' => 'width:50px'))); $els[] = array(makeElement('kodeorg', 'label', $_SESSION['lang']['kodeorg']), makeElement('kodeorg', 'select', $data['kodeorg'], array('style' => 'width:150px', $disabled => $disabled), $optAfd)); $els['btn'] = array(makeElement('showDetBtn', 'btn', $_SESSION['lang']['detail'], array('onclick' => "showDetail()"))); return genElementMultiDim($_SESSION['lang']['control'], $els); }
function renderFormDetail($data, $mode = 'add', $num = 0) { global $dbname; # Prepare Options $holding = getHolding($dbname, $data['kodeorg']); if ($holding != false) { $kelompok = array('' => ''); $tmpKel = makeOption($dbname, 'setup_klpkegiatan', 'kodeklp,namakelompok', "kodeorg='" . $holding['kode'] . "'"); foreach ($tmpKel as $key => $row) { $kelompok[$key] = $row; } } else { $kelompok = array(); } $optCashFlow = makeOption($dbname, 'keu_5mesinlaporandt', 'nourut,keterangandisplay', "tipe='Detail' and namalaporan='CASH FLOW DIRECT'"); $whereKeg = "(substr(noakun,1,2)='52' or substr(noakun,1,2)='64') and detail=1"; $kegiatan = makeOption($dbname, 'keu_5akun', 'noakun,namaakun', $whereKeg, 1); if (!isset($_SESSION['org']['below'])) { $_SESSION['org']['below'] = getOrgBelow($dbname, $data['kodeorg']); } $orgBelow = $_SESSION['org']['below']; # Prepare Field if ($mode == 'add') { $disabled = ''; } else { $disabled = 'disabled'; } $els = array(); $els[] = array(makeElement('kodebagian', 'label', $_SESSION['lang']['kodebagian']), makeElement('kodebagian', 'select', $data['kodebagian'], array('style' => 'width:250px', $disabled => $disabled), $orgBelow)); $els[] = array(makeElement('kelompok', 'label', $_SESSION['lang']['kelompok']), makeElement('kelompok', 'select', $data['kelompok'], array('style' => 'width:250px', 'onchange' => "getKegiatan(this,'kodekegiatan')", 'disabled' => 'disabled'), $kelompok)); $els[] = array(makeElement('kodekegiatan', 'label', $_SESSION['lang']['posbiaya']), makeElement('kodekegiatan', 'select', $data['kodekegiatan'], array('style' => 'width:250px', $disabled => $disabled), $kegiatan)); $els[] = array(makeElement('noaruskas', 'label', $_SESSION['lang']['noaruskas']), makeElement('noaruskas', 'select', $data['noaruskas'], array('style' => 'width:250px'), $optCashFlow)); $els[] = array(makeElement('kodebarang', 'label', $_SESSION['lang']['kodebarang']), makeElement('kodebarang', 'searchBarang', $data['kodebarang'], array('style' => 'width:70px', 'maxlength' => '10', 'onkeypress' => 'return tanpa_kutip(event)', 'readonly' => 'readonly', $disabled => $disabled))); /*$els[] = array( makeElement('revisi','label',$_SESSION['lang']['revisi']), makeElement('revisi','textnum',$data['revisi'],array('style'=>'width:70px','maxlength'=>'2', 'onkeypress'=>'return angka_doang(event)',$disabled=>$disabled)) );*/ $els[] = array(makeElement('hargasatuan', 'label', $_SESSION['lang']['hargasatuan']), makeElement('hargasatuan', 'textnum', $data['hargasatuan'], array('style' => 'width:70px', 'readonly' => 'readonly'))); $els[] = array(makeElement('jumlah', 'label', $_SESSION['lang']['jumlah']), makeElement('jumlah', 'textnum', $data['jumlah'], array('style' => 'width:70px', 'readonly' => 'readonly'))); $els2 = array(); $els2[] = array(makeElement('jan', 'label', $_SESSION['lang']['jan']), makeElement('jan', 'textnum', $data['jan'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('peb', 'label', $_SESSION['lang']['peb']), makeElement('peb', 'textnum', $data['peb'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('mar', 'label', $_SESSION['lang']['mar']), makeElement('mar', 'textnum', $data['mar'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('apr', 'label', $_SESSION['lang']['apr']), makeElement('apr', 'textnum', $data['apr'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('mei', 'label', $_SESSION['lang']['mei']), makeElement('mei', 'textnum', $data['mei'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('jun', 'label', $_SESSION['lang']['jun']), makeElement('jun', 'textnum', $data['jun'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('jul', 'label', $_SESSION['lang']['jul']), makeElement('jul', 'textnum', $data['jul'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('agt', 'label', $_SESSION['lang']['agt']), makeElement('agt', 'textnum', $data['agt'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('sep', 'label', $_SESSION['lang']['sep']), makeElement('sep', 'textnum', $data['sep'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('okt', 'label', $_SESSION['lang']['okt']), makeElement('okt', 'textnum', $data['okt'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('nov', 'label', $_SESSION['lang']['nov']), makeElement('nov', 'textnum', $data['nov'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $els2[] = array(makeElement('dec', 'label', $_SESSION['lang']['dec']), makeElement('dec', 'textnum', $data['dec'], array('style' => 'width:90px', 'maxlength' => '13', 'onkeypress' => 'return angka_doang(event)', 'onkeyup' => 'updateQty()'))); $fieldStr = "##kodebagian##kodekegiatan##kelompok##revisi##kodebarang##hargasatuan" . "##jumlah##jan##peb##mar##apr##mei##jun##jul##agt##sep##okt##nov##dec"; if ($mode == 'add') { $btn = makeElement('addDataDetailB', 'button', $_SESSION['lang']['save'], array('onclick' => 'addDataDetail()', 'style' => 'float:left;clear:both;')); } else { $btn = makeElement('editDataDetailB', 'button', $_SESSION['lang']['save'], array('onclick' => 'editDataDetail(' . $num . ')', 'style' => 'float:left;clear:both;')); } # Make Layout $form = genElTitle('Form Detail', $els); $form .= genElementMultiDim('Rincian Sebaran', $els2, 3); $form .= $btn; return $form; }
$headFrame = array($_SESSION['lang']['prestasi'], $_SESSION['lang']['absensi'], $_SESSION['lang']['material']); $contentFrame = array(); // Tanggal $tmpTgl = explode('-', $param['tanggal']); $tahun = $tmpTgl[2]; # Options $tanggalx = substr($param['notransaksi'], 0, 4) . '-' . substr($param['notransaksi'], 4, 2) . '-' . substr($param['notransaksi'], 6, 2); #============== KHT, KHL dan Kontrak ====================== $whereKary = "lokasitugas='" . $_SESSION['empl']['lokasitugas'] . "' and " . "tipekaryawan in (2,3,4,6) and (tanggalkeluar = '0000-00-00' or tanggalkeluar > '" . $tanggalx . "')"; #============== KHT, KHL dan Kontrak ====================== $whereKeg = "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and "; $whereKeg .= "kelompok='PNN'"; $optKary = makeOption($dbname, 'datakaryawan', 'karyawanid,nik,subbagian,namakaryawan', $whereKary, '6'); $optKeg = makeOption($dbname, 'setup_kegiatan', 'kodekegiatan,namakegiatan', $whereKeg); #$optOrg = makeOption($dbname,'organisasi','kodeorganisasi,namaorganisasi',$whereOrg); $optOrg = getOrgBelow($dbname, $param['afdeling'], false, 'blok'); $optThTanam = makeOption($dbname, 'setup_blok', 'kodeorg,tahuntanam', "kodeorg='" . key($optOrg) . "'"); $optBin = array('1' => 'Ya', '0' => 'Tidak'); $thTanam = $optThTanam[key($optOrg)]; // Validasi Empty if (empty($optKary)) { exit("Warning: Data Karyawan KHT dan KHL tidak ada." . "\nTransaksi panen tidak dapat dilanjutkan"); } #=============================== Get UMR ============================== $firstKary = getFirstKey($optKary); $qUMR = selectQuery($dbname, 'sdm_5gajipokok', 'sum(jumlah) as nilai', "karyawanid=" . $firstKary . " and tahun=" . $tahun . " and idkomponen in (1,31)"); $Umr = fetchData($qUMR); $umrHarian = $Umr[0]['nilai'] / 25; #=============================== Get UMR ============================== #================ Prestasi ============================= # Get Data
<link rel=stylesheet type=text/css href='style/zTable.css'> <?php #=== Init === $tipe = 'tipetransaksi'; $tipeVal = 'PNN'; $whereCont = "tipetransaksi='PNN'"; $whereContArr = array(); #=== Prep Control & Search $ctl = array(); # Control $tmpWhere = json_encode($whereContArr); $jsWhere = str_replace('"', "'", $tmpWhere); $ctl[] = "<div align='center'><img class=delliconBig src=images/" . $_SESSION['theme'] . "/addbig.png title='" . $_SESSION['lang']['new'] . "' onclick=\"showAdd()\"><br><span align='center'>" . $_SESSION['lang']['new'] . "</span></div>"; $ctl[] = "<div align='center'><img class=delliconBig src=images/" . $_SESSION['theme'] . "/list.png title='" . $_SESSION['lang']['list'] . "' onclick=\"defaultList()\"><br><span align='center'>" . $_SESSION['lang']['list'] . "</span></div>"; # Options $optAfd = getOrgBelow($dbname, $_SESSION['empl']['lokasitugas'], false, 'afdeling'); #$optAfd = makeOption($dbname,'organisasi','kodeorganisasi,namaorganisasi', # "kodeorganisasi='".$_SESSION['empl']['lokasitugas']."'"); $optBulan = optionMonth(substr($_SESSION['language'], 0, 1), 'long'); # Search $ctl[] = "<fieldset><legend><b>" . $_SESSION['lang']['find'] . "</b></legend>" . makeElement('sAfdeling', 'label', $_SESSION['lang']['afdeling']) . makeElement('sAfdeling', 'select', '', array(), $optAfd) . " " . makeElement('sPeriode', 'label', $_SESSION['lang']['periode']) . makeElement('sBulan', 'select', '', array(), $optBulan) . "/" . makeElement('sTahun', 'text', date('Y'), array('style' => 'width:50px')) . makeElement('sFind', 'btn', $_SESSION['lang']['find'], array('onclick' => "searchTrans('" . $tipe . "','" . $tipeVal . "')")) . "</fieldset>"; #=== Table Aktivitas # Header $header = array($_SESSION['lang']['afdeling'], $_SESSION['lang']['blok'], $_SESSION['lang']['tanggal'], $_SESSION['lang']['bulan'], $_SESSION['lang']['tahun'], $_SESSION['lang']['jumlah'], $_SESSION['lang']['jumlahha'], $_SESSION['lang']['jumlahpremi'], $_SESSION['lang']['jumlahpokok']); # Content $optNamaOrg = makeOption($dbname, 'organisasi', 'kodeorganisasi,namaorganisasi'); $cols = "kodeorg,kodeblok,tanggal,bulan,tahun,jumlah,jumlahha,jumlahpremi,jumlahpokok"; $query = selectQuery($dbname, 'kebun_rencanapanen', $cols, "left(kodeorg,4)='" . $_SESSION['empl']['lokasitugas'] . "'", "", false, 10, 1); $data = fetchData($query); $totalRow = getTotalRow($dbname, 'kebun_rencanapanen'); foreach ($data as $key => $row) {