I am currently evaluating scriptcase and I need to build a time stamp system so our employees could enter their working time every day.
So far, I built a control application which verifies both the name and password in the appropriate table. I also managed to direct one user to the form where his time is recorded.
My problem is that I need to restrict access for each employee to only have access to his own data.
So far I wrote an onValidate envent :
$usr = {nom};
$pwd = {nip};
$sql = “SELECT
nom,
nip
FROM
personnes
WHERE
(nom = '”.$usr."’) AND
(nip = ‘".$pwd."’)";
sc_lookup(ds, $sql);
if (isset({ds[0][0]}))
{
sc_redir(form_temps);
}
else
{
echo “erreur nom ou nip”;
}
Then I added a Where condition : no_employe in the form_temps, but that does not restrict access so I don’t think this is the right way to do it.
I am hoping someone could help me with this. Also, since we have 65 employees, I’d rather not have to do a table for each employee…
As I specified, I am new to scriptcase and still fairly new to MySQL. Also, as you could guess, I am not a native english speaker, so do not hesitate to ask if anything is unclear.