Ejemplo n.º 1
0
    }
    $fform->notif($q);
} else {
    if ($opt == 'uf' || $opt == 'df') {
        // Prepocessing form
        $r = dbSFA("*", $dbtable, "W/replid='{$cid}'");
        $jtrans = $r['jenis'];
    } else {
        $r = array('rekkas' => 0);
        $r['tanggal'] = date("Y-m-d");
        $jtrans = JT_INCOME;
        $no = transaksi_newnomer();
        $r['nomer'] = $no['nomer'];
        $r['ct'] = $no['ct'];
        $pid = gpost('pembayaran');
        $pemb = pembayaran_getdata($pid);
        $r['rekkas'] = $pemb['rekkas'];
        $r['rekitem'] = $pemb['rekitem'];
        echo "rekitem:" . $pemb['rekitem'];
        $r['uraian'] = $pemb['uraian'];
        $r['nominal'] = $pemb['cicilan'];
    }
    $rekening = rekening_opt();
    $rekasbank = rekening_kasbank_opt();
    if ($opt != 'df') {
        $fform->title_style = 'background:#00c804;color:#fff;height:18px !important;padding:5px 10px 10px 10px !important;margin-bottom:5px';
    }
    if ($jtrans == JT_INCOME) {
        $fform->idata = 'transaksi pemasukan';
    } else {
        if ($jtrans == JT_OUTCOME) {
Ejemplo n.º 2
0
function pembayaran_cek($pid=0){
	//log_print("pembayaran_cek(".$pid.")");
	if($pid!=0){
		$pemb =pembayaran_getdata($pid,0);
		
		$t=mysql_query("SELECT nominal FROM keu_transaksi WHERE pembayaran='$pid'");
		$bayar=0;
		while($r=mysql_fetch_array($t)){
			$bayar+=$r['nominal'];
		}
		//log_print("bayar:".$bayar." of nominal:".$nominal);
		
		if($bayar>=$pemb['nominal'])$lunas=1;
		else $lunas=0;
		//log_print("Lunas:".$lunas);
		$q=dbUpdate("keu_pembayaran",array('lunas'=>$lunas),"replid='$pid'");
		
		if($pemb['modul']['reftipe']==RT_PSB){
			dbUpdate("psb_calonsiswa",array('bayar'=>$lunas),"replid='".$pemb['siswa']."'");
		}
	}
}