<?php

include 'config.php';
include 'global.php';
$expath = "." . str_replace("\\", "/", str_replace(realpath("."), "", dirname(__FILE__))) . "/";
if ($_REQUEST['sender'] == 'set_nomor') {
    $no_sts = getNoPenyetoran($_REQUEST['tgl']);
    echo sprintf('%05d', $no_sts);
} elseif ($_REQUEST['sender'] == 'pilih') {
    $ID = 'penerimaan_pr_';
    $crudColumns = array('id' => 'penetapan_pr_id', 'nomor' => 'no_penetapan', 'tgl' => 'tgl_penetapan', 'setor' => 'tgl_setor', 'nominal' => 'nama');
    $crudTableName = 'penerimaan_pr';
    include $expath . 'handler_pilih_penerimaan.php';
} elseif ($_REQUEST['sender'] == 'daftar_sts') {
    $crudColumns = array('id' => 'sts_id', 'tanggal' => 'sts_tgl', 'nominal' => 'nama', 'keterangan' => 'keterangan');
    include $expath . 'handler_daftar_sts.php';
} elseif ($_REQUEST['sender'] == 'rincian_sts') {
    $crudColumns = array('id' => 'sts_content_id', 'kode' => 'kode_rekening', 'nama' => 'nama_rekening', 'nominal' => 'nominal');
    include $expath . 'handler_rincian_sts.php';
} elseif ($_REQUEST['sender'] == 'default') {
    echo '{"page":"1","total":0,"records":null}';
}
            $other_request = array('sts_id' => $_REQUEST['FK'], 'id_rekening' => $_REQUEST['id']);
            $a = $fbird->FBInsert('sts_content', $other_request, $exception);
            unset($exception);
            unset($other_request);
            if ($a && $_REQUEST['rows'] == $_REQUEST['count']) {
                ibase_commit();
            }
            if (!$a) {
                ibase_rollback();
            }
        } else {
            //echo 'insert header'."\n";
            //print_r($_REQUEST);
            list($day, $month, $year) = explode('/', $_REQUEST['tgl_setor']);
            $ID_HEADER = $fbird->setGenerator('GEN_STS');
            $exception = array();
            $sts_no = getNoPenyetoran();
            $other_request = array('sts_id' => $ID_HEADER, 'sts_no' => (int) $sts_no, 'sts_thn' => $year, 'sts_tgl' => $_REQUEST['tgl_setor'], 'nominal' => $_REQUEST['nominal_pajak']);
            ibase_trans();
            $a = $fbird->FBInsert('sts', $other_request, $exception);
            unset($exception);
            unset($other_request);
            if ($a) {
                updateNoPenyetoran($_REQUEST['tgl_setor']);
                echo $ID_HEADER;
            } else {
                echo '!';
            }
        }
    }
}
Esempio n. 3
0
 function submit()
 {
     $this->db->trans_start();
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
     } else {
         $arr['ID'] = $this->data_model->setID();
         $sts_no = getNoPenyetoran();
         $this->data_model->data = array('sts_id' => $arr['ID'], 'sts_no' => $sts_no, 'sts_thn' => date('Y', strtotime(prepare_date($this->input->post('tgl_setor')))), 'sts_tgl' => prepare_date($this->input->post('tgl_setor')), 'nominal' => str_replace(',', '', $this->input->post('nominal_pajak')), 'keterangan' => $this->input->post('keterangan'), 'logs' => 'NOW', 'user_id' => $this->session->userdata('SESS_USER_ID'), 'no_bukti' => $this->input->post('no_bukti'));
         $this->data_model->insert_data();
         $ii = 0;
         foreach ($_REQUEST['idrows'] as $idx => $value) {
             $this->data_model->data_rincian = array('sts_id' => $arr['ID'], 'id_rekening' => $value, 'nominal' => $_REQUEST['nominal_rek'][$ii]);
             $ii++;
             $hsl = $this->data_model->insert_rincian_data();
         }
         if ($hsl) {
             $this->result_msg = '<li>:: Data telah tersimpan ::</li>';
         } else {
             $this->result_msg = '<li>:: Error tersimpan data ::</li>';
         }
         echo $this->result_msg;
     }
     $this->db->trans_complete();
 }
	</div>
	
	<div id="tabs">
		<ul>
			<li><a href="#tabs-1">Input</a></li>
			<li><a href="#tabs-2">Data</a></li>
		</ul>
		<div id="tabs-1">
			<div style='padding:5px;'>
				<fieldset>
				<legend>Form Penyetoran</legend>
					<div>
						<div class="form_master">
							<fieldset class="form_frame">
								<div><label>No. Penyetoran</label><input type="text" name="nomor_reg" id='nomor_reg' size='10' value="<?php 
echo sprintf('%05d', getNoPenyetoran());
?>
" readonly/></div>
								<div><label>Tgl. Penyetoran<b class="wajib">*</b></label><input type="text" name="tgl_setor" title='Tgl. Penetapan' id="tgl_setor" value='<?php 
echo date('d/m/Y');
?>
' onchange="" size="10"/></div>
								<div><label>Keterangan</label><textarea name='keterangan' id='keterangan'></textarea></div>
								<div><label>&nbsp;</b></label><input type='button' id='proses' class='btn' value='Simpan'></input></div>
							</fieldset>
							<fieldset class="form_frame">
								<div><label><span style='font-weight:bold;font-size:22px'>Total</span></label><span style="font-weight:bold;font-size:25px;color:rgb(24,245,24);background-color:black;text-align:center;padding-right:0;margin-right:0;">Rp.</span><input type="text" style="font-weight: bold; font-size:25px; color: rgb(24, 245, 24); background-color: black; text-align: right; padding-left:0;margin-left:0" readonly="true" value='0.00' size="13" class="inputbox" id="nominal_pajak" name="nominal_pajak"></div>
							</fieldset>							
						</div>
						<div class="footer_space">&nbsp;</div>
					</div>