set start_date_and_user_exists_p [db_string unique_check "
select count(*)
from im_user_absences
where start_date = :start_date
and owner_id = :owner_id
"]
if{$start_date_and_user_exists_p}{
ad_return_complaint 1 [lang::message::lookup "" intranet-timesheet2.Entry_alread_exists_for_same_start_date "<b>Duplicate Absence Error</b>:<br>There is already an entry for you for the same Start Date. Please choose another start date for your absence."]
return
}
if{"" != $submit_del}{
if {$absence_id > 0}{
...
...
@@ -79,9 +67,14 @@ if {"" != $submit_del} {
}
}
if{"" != $submit_save}{
set exists [db_string absence_exists "select count(*) from im_user_absences where absence_id = :absence_id"]