Пример #1
0
        }
    } else {
        if ($opt == 'u') {
            // edit
            $q = dbUpdate($dbtable, $inp, "replid='{$cid}'");
        } else {
            if ($opt == 'd') {
                // delete
                $t = mysql_query("SELECT pegawai FROM aka_guru WHERE replid='{$cid}'");
                $r = mysql_fetch_array($t);
                $q = dbDel($dbtable, "replid='{$cid}'");
                $q &= dbDel("admin", "pegawai='" . $r['pegawai'] . "'");
            }
        }
    }
    $fform->notif($q);
} else {
    // form process
    if ($opt == 'uf' || $opt == 'df') {
        // db operation for form : update , delete
        $r = dbSFA("*", $dbtable, "W/replid='{$cid}'");
        $r['departemen'] = gpost('departemen');
        $s = 'SELECT * FROM hrd_karyawan WHERE id=' . $r['pegawai'] . ' LIMIT 0,1';
        // var_dump($s);exit();
        $q = mysql_query($s);
        // $q=mysql_query("SELECT * FROM hrd_pegawai WHERE replid='".$r['pegawai']."' LIMIT 0,1");
        if (mysql_num_rows($q) > 0) {
            $h = mysql_fetch_array($q);
            $r['nama'] = $h['nama'];
        }
    } else {