<?php $tahun = date("y"); $qp = mysql_query("SELECT * FROM mr WHERE type='SPB'"); $rp = mysql_fetch_array($qp); $lastNO = $rp['full_no']; $tgl = substr($lastNO,8,2); if ($tgl == $tahun) { $count = $rp['next_no']; $no_req = getNextNo('SPB', 'content/mr_auto'); } else { $count = 1; $no_req = resetNo('SPB','content/mr_auto'); } /* if ($tgl == $tahun) { $temp = $rp['param_no']; $count = $temp + 1; } else { $temp = 1; $count = $temp; } $digit1 = (int) ($count % 10); $digit2 = (int) (($count % 100) / 10);
$spb_no = getSingleData("select spb_no from head_spb where id = $idSPB") ; $tahun = date("y"); //$qp= mysql_query("SELECT * FROM mr WHERE LAST_INSERT_ID(param_no) ORDER BY id DESC LIMIT 1"); $qp = mysql_query("SELECT * FROM mr WHERE type='PO'"); $rp = mysql_fetch_array($qp); $lastNO = $rp['full_no']; $isUse = $rp['in_use']; $tgl = substr($lastNO,8,2); if ($tgl == $tahun) { $count = $rp['next_no']; if ((empty($isUse))||($isUse==1)){ $no_req = getNextNo('PO', 'content/list_spb'); }else{ $count = 1; $no_req = resetNo('PO','content/list_spb'); } } } $param_no = $count; /* $digit1 = (int) ($count % 10); $digit2 = (int) (($count % 100) / 10); $digit3 = (int) (($count % 1000) / 100); $digit4 = (int) (($count % 10000) / 1000); $no_req = "PON/" . date("dmy"). "$digit4" . "$digit3" . "$digit2" . "$digit1"; */ ?> <table border="0" cellpadding="0" cellspacing="0" width="100%">