function Hapus($tabelname, $param, $hal) { $sql = "DELETE FROM " . $tabelname . " WHERE " . $param . " "; $command = hapusinput($sql); Zet($hal); return $command; }
$baris8 = mysql_fetch_row($hasil8); $ttltmb = $baris8[0]; if (empty($baris8[0])) { $ttltmb = 0; } $ttln = $jmlmsk + $ttltmb - ($ttla + $ttls + $ttlc + $ttli); if ($action != "CARI") { bukainput("insert into indekref values('{$baris['6']}','{$ttln}','{$total}')"); } } //insert data ke total index $hasilindex = bukaquery("select kdindex,n,ttl from indekref"); //untuk mencari nilai referensinya if ($action != "CARI") { hapusinput("delete from indextotal"); hapusinput("delete from tambahanpotongan"); } while ($barisindex = mysql_fetch_array($hasilindex)) { $_sql22 = "SELECT ({$barisindex['1']}/sum(n))*100 from indekref where kdindex='{$barisindex['0']}'"; $hasil22 = bukaquery($_sql22); $baris22 = mysql_fetch_array($hasil22); $indexjaga = $baris22[0]; $ttlindex = $barisindex[2] + $indexjaga; if ($action != "CARI") { bukainput("insert into indextotal values('{$barisindex['0']}','{$ttlindex}')"); } } while ($baristambahan = mysql_fetch_array($hasiltambahan)) { if ($baristambahan["pengurang"] > 0) { $masa_kerja = 0; if ($baristambahan[9] < 1) {
echo "<html><head><title></title><meta http-equiv='refresh' content='5;URL=?page=Input'></head><body></body></html>"; } } elseif (!empty($idcek)) { if (empty($urlnya)) { echo "<font size='9'>Pilih shift dulu !!!!!!!</font>"; } else { Ubah2(" temporary_presensi ", " jam_pulang=NOW(),\n durasi=(SEC_TO_TIME(unix_timestamp(now()) - unix_timestamp(jam_datang))) where id='{$idpeg}' "); $_sqlcek = "select id, shift, jam_datang, jam_pulang, status, keterlambatan, durasi, photo from temporary_presensi where id='{$idpeg}'"; $hasilcek = bukaquery($_sqlcek); $bariscek = mysql_fetch_array($hasilcek); $idcek = $bariscek["id"]; $shift = $bariscek["shift"]; $jam_datang = $bariscek["jam_datang"]; $jam_pulang = $bariscek["jam_pulang"]; $status = $bariscek["status"]; $keterlambatan = $bariscek["keterlambatan"]; $durasi = $bariscek["durasi"]; Tambah("rekap_presensi", "'{$idcek}','{$shift}','{$jam_datang}','{$jam_pulang}','{$status}','{$keterlambatan}','{$durasi}','','{$urlnya}'", " Presensi Pulang jam {$jam_pulang}"); hapusinput(" delete from temporary_presensi where id ='{$idcek}' "); echo "<html><head><title></title><meta http-equiv='refresh' content='5;URL=?page=Input'></head><body></body></html>"; } } } elseif (empty($idpeg) || empty($shift)) { echo "<b>ID Pegawai atau Jam Masuk ada yang salah, Silahkan pilih berdasarkan shift departemen anda</b>"; } } ?> </form> </div> </div>
$hasil8 = bukaquery($_sql8); $baris8 = mysql_fetch_row($hasil8); $ttltmb = $baris8[0]; if (empty($baris8[0])) { $ttltmb = 0; } $ttln = $jmlmsk + $ttltmb - ($ttla + $ttls + $ttlc + $ttli); if ($action != "CARI") { bukainput("insert into indekref values('{$baris['6']}','{$ttln}','{$total}')"); } } //insert data ke total index $hasilindex = bukaquery("select kdindex,n,ttl from indekref"); //untuk mencari nilai referensinya if ($action != "CARI") { hapusinput("delete from indextotal"); } while ($barisindex = mysql_fetch_array($hasilindex)) { $_sql22 = "SELECT ({$barisindex['1']}/sum(n))*100 from indekref where kdindex='{$barisindex['0']}'"; $hasil22 = bukaquery($_sql22); $baris22 = mysql_fetch_array($hasil22); $indexjaga = $baris22[0]; $ttlindex = $barisindex[2] + $indexjaga; if ($action != "CARI") { bukainput("insert into indextotal values('{$barisindex['0']}','{$ttlindex}')"); } } $ttlgapok = 0; $ttltnjjbtn = 0; $ttltnjtnj = 0; $ttltmbhjgmlm = 0;