コード例 #1
0
ファイル: fungsi.php プロジェクト: ibnoe/dinsosnaker2014
function no_register($id)
{
    return digitformat($id, 5);
}
コード例 #2
0
ファイル: fungsi.php プロジェクト: ibnoe/dinsosnaker2014
function nomor_nodin($id_level, $tahun)
{
    $res_l = mysql_query("SELECT * FROM myapp_reftable_levelpengguna WHERE id='" . $id_level . "'");
    $ds_l = mysql_fetch_array($res_l);
    $res_a = mysql_query("SELECT * FROM myapp_constable_notadinas WHERE id_level='" . $id_level . "' AND tahun='" . $tahun . "'");
    if (mysql_num_rows($res_a) == 0) {
        mysql_query("INSERT INTO myapp_constable_notadinas VALUES(null, '" . $id_level . "', '" . $tahun . "', 0)");
    }
    $res_b = mysql_query("SELECT * FROM myapp_constable_notadinas WHERE id_level='" . $id_level . "' AND tahun='" . $tahun . "'");
    $ds_b = mysql_fetch_array($res_b);
    $norut = $ds_b["nomor"] + 1;
    $nodin = digitformat($norut, 4) . "/" . $ds_l["kode_nota"] . "/" . $tahun;
    mysql_query("UPDATE myapp_constable_notadinas SET nomor = nomor + 1 WHERE id_level='" . $id_level . "' AND tahun='" . $tahun . "'");
    return $nodin;
}