本文整理汇总了PHP中tambahNol函数的典型用法代码示例。如果您正苦于以下问题:PHP tambahNol函数的具体用法?PHP tambahNol怎么用?PHP tambahNol使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tambahNol函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tambahNol
</tr>
<tr>
<td>Sampai</td>
<td>
<select name="tgl_end" id="tgl_end" style="width: 50px;" onkeypress="focusNext( 'bln_end', event, 'thn_start', this)" class="inputan">
<? for($i=1;$i<32;$i++) {
$tgl = tambahNol($i, 2);
if($tgl==($tgl_skr)) $sel = "selected";
else $sel = "";
?>
<option value="<?=$tgl?>" <?=$sel?> ><?=$i?></option>
<? } ?>
</select>
<select name="bln_end" id="bln_end" style="width: 100px;" onkeypress="focusNext( 'thn_end', event, 'tgl_end', this)" class="inputan">
<? for($i=1;$i<13;$i++) {
$bln = tambahNol($i, 2);
if($bln==$bln_skr) $sel = "selected";
else $sel = "";
?>
<option value="<?=$bln?>" <?=$sel?> ><?=bulanIndo($i, "F")?></option>
<? } ?>
</select>
<select name="thn_end" id="thn_end" style="width: 70px;" onkeypress="focusNext( 'tampil', event, 'bln_end', this)" class="inputan">
<? for($i=$thn;$i<=$thn_skr;$i++) {
if($i==$thn_skr) $sel = "selected";
else $sel = "";
?>
<option value="<?=$i?>" <?=$sel?> ><?=$i?></option>
<? } ?>
</select>
</td>
示例2: get_pasien
function get_pasien($id) {
$kon = new Konek;
//$kon->sql = "SELECT p.id as id, p.nama as nama, p.tempat_lahir as tempat_lahir, p.tgl_lahir as tgl_lahir, p.gol_darah as gol_darah, p.alamat as alamat, p.rt as rt, p.rw as rw, p.desa_id as des_id, kec.id as kec_id, kab.id as kab_id, prop.id as prop_id, p.telp as telp, p.agama as agama, p.sex as sex, p.pendidikan_id as pendidikan_id, p.pekerjaan_id as pekerjaan_id, p.status_nikah as status_nikah, p.tgl_daftar as tgl_daftar FROM pasien p JOIN ref_desa des ON (des.id = p.desa_id) JOIN ref_kecamatan kec ON (kec.id = des.kecamatan_id) JOIN ref_kabupaten kab ON (kab.id = kec.kabupaten_id) JOIN ref_propinsi prop ON (prop.id = kab.propinsi_id) WHERE p.id = '".$id."'";
$kon->sql = "CALL pendaftaran_get_pasien('".$id."')";
$kon->execute();
$data = $kon->getOne();
$objResponse = new xajaxResponse();
$objResponse->addScriptCall("show_hide_form", "form_tambah");
$objResponse->addAssign("propinsi_id", "value", $data[prop_id]);
$objResponse->addScriptCall("xajax_ref_get_kabupaten", "kabupaten_id", $data[prop_id],
$data[kab_id], true);
$objResponse->addScriptCall("xajax_ref_get_kecamatan", "kecamatan_id", $data[kab_id],
$data[kec_id], true);
$objResponse->addScriptCall("xajax_ref_get_desa", "desa_id", $data[kec_id], $data[des_id], true);
$tgl_lahir = explode("-", $data[tgl_lahir]);
$skr = date("Y-m-d");
$usia = hitungUmur($data[tgl_lahir], $skr);
//$objResponse->addAssign("debug", "innerHTML", $tgl_lahir[2] . ":" . $tgl_lahir[1] . ":" . $tgl_lahir[0]);
//jika data ditemukan
if(!empty($data)) {
$objResponse->addAssign("id", "value", $data[id]);
$objResponse->addAssign("test_id", "value", $data[id]);
$objResponse->addAssign("id_pasien", "value", $data[id]);
$objResponse->addAssign("nama", "value", $data[nama]);
$objResponse->addAssign("usia_tahun", "value", $usia[tahun]);
$objResponse->addAssign("usia_bulan", "value", $usia[bulan]);
$objResponse->addAssign("usia_hari", "value", $usia[hari]);
$objResponse->addAssign("tempat_lahir", "value", $data[tempat_lahir]);
$objResponse->addAssign("tgl_lahir_tgl", "value", $tgl_lahir[2]);
$objResponse->addAssign("tgl_lahir_bln", "value", $tgl_lahir[1]);
$objResponse->addAssign("tgl_lahir_thn", "value", $tgl_lahir[0]);
$objResponse->addAssign("gol_darah_id", "value", $data[gol_darah]);
$objResponse->addAssign("alamat", "value", $data[alamat]);
$objResponse->addAssign("rt", "value", $data[rt]);
$objResponse->addAssign("rw", "value", $data[rw]);
$objResponse->addAssign("telp", "value", $data[telp]);
$objResponse->addAssign("agama", "value", $data[agama]);
$objResponse->addAssign("sex", "value", $data[sex]);
$objResponse->addAssign("pendidikan_id", "value", $data[pendidikan_id]);
$objResponse->addAssign("pekerjaan_id", "value", $data[pekerjaan_id]);
$objResponse->addAssign("status_nikah", "value", $data[status_nikah]);
$objResponse->addAssign("nama_ayah", "value", $data[nama_ayah]);
$objResponse->addAssign("nama_ibu", "value", $data[nama_ibu]);
$objResponse->addAssign("nama_suami", "value", $data[nama_suami]);
$objResponse->addAssign("nama_istri", "value", $data[nama_istri]);
$objResponse->addAssign("no_ktp_sim", "value", $data[no_ktp_sim]);
/*
get data kunjungan sebelumnya
untuk mendapatkan data penanggung jawab
dan nomor askes
*/
$kon = new Konek;
$sql = "
SELECT
kk.id,
kk.cara_bayar,
kk.jenis_askes,
kk.perusahaan_id,
kk.nomor,
kk.pj_nama,
kk.pj_alamat,
kk.pj_telp,
kk.pj_hubungan_keluarga
FROM
kunjungan k
JOIN kunjungan_kamar kk ON (kk.kunjungan_id = k.id)
WHERE
k.pasien_id = '".$data[id]."'
AND kk.pj_nama <>''
GROUP BY kk.id
ORDER BY kk.id DESC
LIMIT 1
";
$kon->sql = $sql;
//$objResponse->addAssign("debug", "innerHTML", $sql);
$kon->execute();
$pj = $kon->getOne();
$objResponse->addScriptCall("showNomor", $pj[cara_bayar]);
$objResponse->addScriptCall("xajax_ref_get_jenis_askes", "jenis_askes", $pj[cara_bayar],
$pj[jenis_askes]);
$objResponse->addScriptCall("xajax_ref_get_perusahaan", "perusahaan_id", $pj[cara_bayar],
$pj[perusahaan_id]);
$objResponse->addAssign("cara_bayar", "value", $pj[cara_bayar]);
$objResponse->addAssign("nomor", "value", $pj[nomor]);
$objResponse->addAssign("pj_nama", "value", $pj[pj_nama]);
$objResponse->addAssign("pj_alamat", "value", $pj[pj_alamat]);
$objResponse->addAssign("pj_telp", "value", $pj[pj_telp]);
$objResponse->addAssign("pj_hubungan_keluarga", "value", $pj[pj_hubungan_keluarga]);
$objResponse->addScriptCall("fokus", "tgl_periksa_tgl");
} else {
//jika tidak ada data pasien dengan no rm $id
$id = (int)$id;
if($id) $no = tambahNol($id, 8);
$objResponse->addScript("document.tambah_pasien.reset()");
$objResponse->addAssign("id", "value", $no);
$objResponse->addScriptCall("fokus", "nama");
}
//.........这里部分代码省略.........
示例3: tambahNol
<? for($i=0;$i<25;$i++) :
$jam = tambahNol($i, 2);
?>
<option value="<?=$jam?>"><?=$jam?></option>
<? endfor; ?>
</select>
<select name="input_tgl_keluar_mnt" id="input_tgl_keluar_mnt" style="width: 50px;" onkeypress="focusNext( 'input_tgl_keluar_dtk', event, 'input_tgl_keluar_jam', this)" class="inputan">
<? for($i=0;$i<60;$i++) :
$mnt = tambahNol($i, 2);
?>
<option value="<?=$mnt?>"><?=$mnt?></option>
<? endfor; ?>
</select>
<select name="input_tgl_keluar_dtk" id="input_tgl_keluar_dtk" style="width: 50px;" onkeypress="focusNext( 'input_kelanjutan', event, 'input_tgl_keluar_mnt', this)" class="inputan">
<? for($i=0;$i<60;$i++) :
$dtk = tambahNol($i, 2);
?>
<option value="<?=$dtk?>"><?=$dtk?></option>
<? endfor; ?>
</select>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Data Status Pemeriksaan</legend>
<table cellpadding="0" cellspacing="5" border="0" class="form">
<tr>
<td style="width: 150px;">Kelanjutan*</td>
示例4: simpan_langsung_bayar
function simpan_langsung_bayar($val) {
$kon = new Konek;
$objResponse = new xajaxResponse;
$kon->sql = "SELECT kb.id as id, kb.bayar_bhp as bayar_bhp, kb.bayar_jasa as bayar_jasa, kb.mampu_bayar_bhp as mampu_bayar_bhp, kb.mampu_bayar_jasa as mampu_bayar_jasa FROM kunjungan_bayar kb JOIN kunjungan_kamar kk ON (kk.id = kb.kunjungan_kamar_id) JOIN kwitansi_detil kwd ON (kwd.kunjungan_bayar_id = kb.id) WHERE kk.kunjungan_id = '".$val[lb_id_kunjungan]."' AND kwd.kwitansi_id = '".$val[lb_id_kwitansi]."'";
$kon->execute();
$data = $kon->getAll();
if(!empty($data)) {
if($val[lb_mampu_bayar] < $val[lb_kurang]) $status = "ANGSUR";
else $status = "LUNAS";
$id_kwitansi = bikinKwitansi("KASIR", $val[lb_mampu_bayar], $status);
$mampu = round($val[lb_mampu_bayar]/$val[lb_kurang], 2);
//$objResponse->addAppend("debug", "innerHTML", $mampu . "<br />");
$tot = 0;
for($i=0;$i<sizeof($data);$i++) {
$data[$i][angsuran_bhp] = round($data[$i][bayar_bhp] * $mampu);
$data[$i][angsuran_jasa] = round($data[$i][bayar_jasa] * $mampu);
$data[$i][pertambahan_bhp] += $data[$i][angsuran_bhp]-$data[$i][mampu_bayar_bhp];
$data[$i][pertambahan_jasa] += $data[$i][angsuran_jasa]-$data[$i][mampu_bayar_jasa];
$tot += $data[$i][angsuran_bhp] + $data[$i][angsuran_jasa];
//$objResponse->addAppend("debug", "innerHTML", $data[$i][angsuran_bhp] . " - " . $data[$i][angsuran_jasa] . ", tot : ".$tot."<br />");
}
$selisih = ($val[lb_mampu_bayar]+$val[lb_sudah_dibayar]) - $tot;
//$objResponse->addAppend("debug", "innerHTML", "selisih : " . $selisih . ", mampu bayar : " .$val[lb_mampu_bayar]. ", tot : ".$tot."<br />");
if($data[0][angsuran_jasa]) {
$data[0][angsuran_jasa] += $selisih;
} else {
$data[0][angsuran_bhp] += $selisih;
}
for($i=0;$i<sizeof($data);$i++) {
$sql = "UPDATE kunjungan_bayar kb, kwitansi_detil kwd SET kb.mampu_bayar_bhp = '".$data[$i][angsuran_bhp]."', kb.mampu_bayar_jasa = '".$data[$i][angsuran_jasa]."' WHERE kwd.kunjungan_bayar_id = kb.id AND kb.id = '".$data[$i][id]."' AND kwd.kwitansi_id = '".$val[lb_id_kwitansi]."'";
//$objResponse->addAppend("debug", "innerHTML", nl2br($sql) . "<br />");
$kon->sql = $sql;
$kon->execute();
//pembayaran angsuran
$sql = "INSERT INTO kwitansi_detil(kunjungan_bayar_id, kwitansi_id, angsuran_bhp, angsuran_jasa) VALUES ('".$data[$i][id]."', '".$id_kwitansi."', '".$data[$i][pertambahan_bhp]."', '".$data[$i][pertambahan_jasa]."')";
//$objResponse->addAppend("debug", "innerHTML", nl2br($sql) . "<br />");
$kon->sql = $sql;
$kon->execute();
}
$id_kwitansi = tambahNol($id_kwitansi, 20);
$objResponse->addScriptCall("cetak_kwitansi", "KASIR-" . $id_kwitansi);
$objResponse->addScriptCall("show_status_simpan");
} else {
$objResponse->addAlert("Data Pembayaran Tidak Dapat Dirubah, karena : \n1. Kwitansi Sudah Dibuat atau\n2. Belum Terjadi Transaksi!");
}
$objResponse->addScriptCall("tutup_modal_lb");
//$objResponse->addAssign("debug", "innerHTML", $sql);
return $objResponse;
}
示例5: simpan_langsung_bayar
function simpan_langsung_bayar($val) {
$kon = new Konek;
$objResponse = new xajaxResponse;
$kon->sql = "SELECT kb.id as id, kb.bayar_bhp as bayar_bhp, kb.bayar_jasa as bayar_jasa FROM kunjungan_bayar kb LEFT JOIN kwitansi_detil kwd ON (kwd.kunjungan_bayar_id = kb.id) WHERE kb.kunjungan_kamar_id = '".$val[lb_id_kunjungan_kamar]."' AND kwd.kwitansi_id IS NULL";
$kon->execute();
$data = $kon->getAll();
if(!empty($data)) {
if($val[lb_mampu_bayar] < $val[lb_kurang]) $status = "ANGSUR";
else $status = "LUNAS";
$id_kwitansi = bikinKwitansi("IRD", $val[lb_mampu_bayar], $status);
$mampu = round($val[lb_mampu_bayar]/$val[lb_kurang], 2);
$tot = 0;
for($i=0;$i<sizeof($data);$i++) {
$data[$i][mampu_bayar_bhp] = round($data[$i][bayar_bhp] * $mampu);
$data[$i][mampu_bayar_jasa] = round($data[$i][bayar_jasa] * $mampu);
$tot += $data[$i][mampu_bayar_bhp] + $data[$i][mampu_bayar_jasa];
}
$selisih = $val[lb_mampu_bayar] - $tot;
if($data[0][mampu_bayar_jasa]) $data[0][mampu_bayar_jasa] += $selisih;
else $data[0][mampu_bayar_bhp] += $selisih;
for($i=0;$i<sizeof($data);$i++) {
$kon->sql = "UPDATE kunjungan_bayar SET mampu_bayar_bhp = '".$data[$i][mampu_bayar_bhp]."', mampu_bayar_jasa = '".$data[$i][mampu_bayar_jasa]."', kwid = '".$id_kwitansi."' WHERE id = '".$data[$i][id]."'";
$kon->execute();
//pembayaran angsuran
$kon->sql = "INSERT INTO kwitansi_detil(kunjungan_bayar_id, kwitansi_id, angsuran_bhp, angsuran_jasa) VALUES ('".$data[$i][id]."', '".$id_kwitansi."', '".$data[$i][mampu_bayar_bhp]."', '".$data[$i][mampu_bayar_jasa]."')";
$kon->execute();
}
$id_kwitansi = tambahNol($id_kwitansi, 20);
$objResponse->addScriptCall("cetak_kwitansi", "IRD-" . $id_kwitansi);
$objResponse->addScriptCall("show_status_simpan");
} else {
$objResponse->addAlert("Data Pembayaran Tidak Dapat Dirubah, karena : \n1. Kwitansi Sudah Dibuat atau\n2. Belum Terjadi Transaksi!");
}
$objResponse->addScriptCall("tutup_modal_lb");
//$objResponse->addAssign("debug", "innerHTML", $sql);
return $objResponse;
}
示例6: date
$jam_skr = date("H");
$mnt_skr = date("i");
$dtk_skr = date("s");
?>
<select name="input_tgl_keluar_jam" id="input_tgl_keluar_jam" style="width: 50px;" onkeypress="focusNext( 'input_tgl_keluar_mnt', event, 'input_dokter_id', this)" class="inputan">
<? for($i=0;$i<25;$i++) :
$jam = tambahNol($i, 2);
if($jam==$jam_skr) $sel = "selected";
else $sel = "";
?>
<option value="<?=$jam?>" <?=$sel?> ><?=$jam?></option>
<? endfor; ?>
</select>
<select name="input_tgl_keluar_mnt" id="input_tgl_keluar_mnt" style="width: 50px;" onkeypress="focusNext( 'input_simpan', event, 'input_tgl_keluar_jam', this)" class="inputan">
<? for($i=0;$i<60;$i++) :
$mnt = tambahNol($i, 2);
if($mnt==$mnt_skr) $sel = "selected";
else $sel = "";
?>
<option value="<?=$mnt?>" <?=$sel?> ><?=$mnt?></option>
<? endfor; ?>
</select>
</td>
</tr>
</table>
</fieldset>
</td>
<td style="width:50%">
<fieldset class="fieldset_modal">
<legend>Diagnosa Utama</legend>
<div style="margin-left:40px;"><span id="input_diagnosa_utama_nama"> </span></div>