Add validation to prevent duplicate NIK entries in user data
This commit is contained in:
@ -368,6 +368,14 @@
|
|||||||
sectionname='$sectionname',iddept='$iddept',deptname='$departmentname',uby='".$_SESSION['nik']."',udt=now()
|
sectionname='$sectionname',iddept='$iddept',deptname='$departmentname',uby='".$_SESSION['nik']."',udt=now()
|
||||||
where id='$id'";
|
where id='$id'";
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$qrychk="select id from ".DB_APORTIL.".tbl_employee where nik='$nik' and isdeleted=0 order by id asc limit 1";
|
||||||
|
if($this->fn_row_isexists($qrychk))
|
||||||
|
{
|
||||||
|
echo "failed|Error Found : Nik <b>$nik</b> already exists";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($this->executequery($qry)){echo "ok|";return true;}
|
if($this->executequery($qry)){echo "ok|";return true;}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user