"; echo"
Maaf Resep Belum Diisi
"; echo ""; }else{ $max = $db->query("SELECT nomor FROM m_maxnorsp WHERE bulan=month(current_date()) and tahun=year(current_date())"); $data = $max->fetchAll()[0]; $maxnorsp=$data['nomor']; if(!$maxnorsp){ $maxnorsp = 1; $db->query("insert into m_maxnorsp (tahun,bulan,nomor) values( year(current_date()),month(current_date()),".$maxnorsp.")"); }else{ $maxnorsp = $maxnorsp+1; $db->query("update m_maxnorsp set nomor=".$maxnorsp." where bulan=month(current_date()) and tahun=year(current_date())"); } $sql = "INSERT INTO t_resep (IDXRESEP, IDXDAFTAR, NORESEP, TANGGAL, KDDOKTER, KDPOLY, NOMR, KDOBAT, NAMAOBAT, JUMLAH, ATURANPAKAI, KETERANGAN, NIP, STATUS, tgl_save) VALUES ('', '$_POST[id_admission]', '$maxnorsp', now(), '$_POST[kddokter]', '11', '$_POST[nomr]', '', '', '', '', '$_POST[resep]', '$_SESSION[NIP]', '0', now())"; $qry = $db->query($sql); echo "| No Resep | Tanggal | Resep |
|---|---|---|