Hi,
I have added a table to the calendar template and I am trying to make it into an attendance tracking app.
I have added a custom button into the advance list view with the following code, to update the EndTime using an if statement, but it keeps updating even when the field "Edited" is not null.
Server Tab
function OnServer($params, $result)
{
$record = $button->getNextSelectedRecord();
If ($params["Edited"]="")
{
$result["txt"] = "Punch already updated.";}
else{
$Time = now();
$sql = "update Attendance set Edited='1', EndTime='$Time' where ID=".$record["ID"];
DB::Exec($sql);
}
Any assistance will be appreciated, I keep going around in circles.