Example #1
0
         $result_xsl = "xsl/" . $default_xsl . "/sch_del_app1.xsl";
     } else {
         $result_xsl = "xsl/" . $default_xsl . "/sch_del_app_pop1.xsl";
     }
 } else {
     if (!empty($_POST['submit_conf_yes']) || !empty($_POST['submit_conf_no'])) {
         if (!empty($_POST['submit_conf_yes'])) {
             Delete_Appointment($account_id, $_POST['app_id'], $bd);
             $alert[$num_alerts++] = 'Appointment deleted successfully';
             if (!empty($_POST['master_del'])) {
                 // Find similar owner's appointments to be deleted
                 $apps = List_Appointments($account_id, 0, '', '', '', '', '', '', $_POST['app_id'], '', $cfg['time'], $array_type, $array_color, $array_image, $cfg['days'], $bd);
                 $date = $apps[0][6] . "-" . $apps[0][5] . "-" . $apps[0][4];
                 $apps1 = List_Appointments(0, $owner, '', '', $date, $date, $apps[0][7], $apps[0][9], '', '', $cfg['time'], $array_type, $array_color, $array_time, $cfg['days'], $bd);
                 if (!empty($apps1)) {
                     Delete_Appointment($owner, $apps1[0][0], $bd);
                     $alerts[$num_alerts++] = "Appointment in Owner Schedule Deleted";
                 }
             }
         } else {
             $alert[$num_alerts++] = 'Appointment deletion cancelled';
         }
         if (!$is_pop) {
             include "scheduling.php";
             exit;
         } else {
             $result_xsl = "xsl/" . $default_xsl . "/sch_pop_final.xsl";
         }
     } else {
         $apps = List_Appointments($account_id, 0, '', '', '', '', '', '', '', '', $cfg['time'], $array_type, $array_color, $array_image, $cfg['days'], $bd);
         $result_xsl = "xsl/" . $default_xsl . "/sch_del_app.xsl";
Example #2
0
function delAppointment($complete_sess_id, $app_id)
{
    if (!Validate_Session($complete_sess_id, $_SERVER['REMOTE_ADDR'], $GLOBALS['bd'])) {
        return "Invalid session ID!";
    }
    // Get the user account ID
    $sess_id = substr($complete_sess_id, 32);
    Get_Account_Id($sess_id, $account_id, $GLOBALS['bd']);
    // Delete it
    Delete_Appointment($account_id, $app_id, $GLOBALS['bd']);
    return 1;
}
             $alert[$num_alerts++] = "Appointment authorized successfully";
         } else {
             if ($conf == 'no') {
                 $update = "DELETE FROM weekly_appointments WHERE app_id = " . $app[0][0];
                 $alert[$num_alerts++] = "Unauthorized Appointment removed successfully";
             }
         }
         $bd->Query($update);
         include "sch_auth.php";
         exit;
     } else {
         $overlap_apps = Check_Appointment_Overlap($account_id, $app[0][4], $app[0][5], $app[0][6], $app[0][7], $app[0][9], '', $bd);
         if ($overlap_apps) {
             for ($i = 0; $i < $bd->NumberOfRows($overlap_apps); $i++) {
                 $overlap_app_id = $bd->FetchResult($overlap_apps, $i, 'app_id');
                 Delete_Appointment($account_id, $overlap_app_id, $bd);
             }
         }
         if ($conf == 'yes') {
             $update = "UPDATE appointments SET authorized = 1 WHERE\n\t\t\t\t\tapp_id = " . $app[0][0];
             $alert[$num_alerts++] = "Appointment authorized successfully.";
         } else {
             $update = "DELETE FROM appointments WHERE app_id = " . $app[0][0];
             $alert[$num_alerts++] = "Unauthorizied Appointment removed successfully.";
         }
         $bd->Query($update);
         include "sch_auth.php";
         exit;
     }
 } elseif (!empty($_POST['submit_conf_no'])) {
     if ($conf == 'yes') {