function Group_Check_Weekly_Appointment_Overlap($group_id, $dayofweek, $beg_time, $end_time, $bd) { $members = List_Members($group_id, 0, $bd); $overlap = 0; for ($j = 0; $j < count($members) && !$overlap; $j++) { $current_w = Check_Weekly_Appointment_Overlap($members[$j][0], $dayofweek, $beg_time, $end_time, '', $bd); if ($current_w == 0) { $overlap = 0; } else { $overlap = 1; } } return $overlap; }
$result_xsl = "xsl/" . $default_xsl . "/sch_mod_week_app_pop1.xsl"; } if (!empty($_POST['submit_mod'])) { $description = $_POST['description']; $beg_time = $_POST['beg_time']; $end_time = $_POST['end_time']; $day = $_POST['day']; $url = $_POST['url']; $type = $_POST['type']; if (User_Validate_Simple_Field($_POST['description'], 100) <= 0) { $error[$num_errors++] = "The appointment description must be informed"; } if ($_POST['beg_time'] >= $_POST['end_time']) { $error[$num_errors++] = "The ending time must be greater than the beginning time"; } $check = Check_Weekly_Appointment_Overlap($account_id, $_POST['day'], $_POST['beg_time'], $_POST['end_time'], $app_id, $bd); if ($check) { $error[$num_errors++] = "There is another weekly appointment within this time span"; } if ($ins_at_master) { $apps_bef = List_Weekly_Appointments($account_id, '', '', '', '', '', '', '', '', $app_id, '', $cfg['time'], $array_type, $array_color, $array_image, $cfg['days'], $bd); $apps = List_Weekly_Appointments($owner, '', '', '', '', $apps_bef[0][15], $apps_bef[0][15], $apps_bef[0][7], $apps_bef[0][9], '', '', $cfg['time'], $array_type, $array_color, $array_image, $cfg['days'], $bd); if (!empty($apps)) { $app_id_owner = $apps[0][0]; $check = Check_Weekly_Appointments_Overlap($owner, $_POST['day'], $_POST['beg_time'], $_POST['end_time'], $app_id_owner, $bd); if ($check) { $error[$num_errors++] = "There is another weekly appointment on the owner's\n\t\t\t\t\t\t schedule within this time span"; } } } if (empty($error)) {
} $check = Check_Appointment_Overlap($account_id, $_POST['day'], $_POST['month'], $_POST['year'], $_POST['beg_time'], $_POST['end_time'], '', $bd); if ($check) { $error[$num_errors++] = "There is another appointment within this time span"; } if ($ins_at_master) { $check = Check_Appointment_Overlap($owner, $_POST['day'], $_POST['month'], $_POST['year'], $_POST['beg_time'], $_POST['end_time'], '', $bd); if ($check) { $error[$num_errors++] = "There is another appointment on the owner's schedule within this time span"; } } if (empty($error)) { $day_w = date('w', mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year'])); $check = $check = Check_Weekly_Appointment_Overlap($account_id, $day_w, $_POST['beg_time'], $_POST['end_time'], '', $bd); if ($ins_at_master) { $check1 = Check_Weekly_Appointment_Overlap($owner, $day_w, $_POST['beg_time'], $_POST['end_time'], '', $bd); } if (!$check1 && !$check) { Insert_Appointment($account_id, $_POST['description'], $_POST['type'], $_POST['year'] . "-" . $_POST['month'] . "-" . $_POST['day'], $_POST['beg_time'], $_POST['end_time'], $_POST['url'], $owner, 0, 0, 1, $bd); $alert[$num_alerts++] = "Appointment Inserted Successfully"; if ($ins_at_master) { Insert_Appointment($owner, $_POST['description'], $_POST['type'], $_POST['year'] . "-" . $_POST['month'] . "-" . $_POST['day'], $_POST['beg_time'], $_POST['end_time'], $_POST['url'], $owner, 0, 0, 1, $bd); $alert[$num_alerts++] = "Appointment Inserted Successfully at Owner's Schedule"; } if (!$is_pop) { include "scheduling.php"; exit; } else { $result_xsl = "xsl/" . $default_xsl . "/sch_pop_final.xsl"; } } else {
exit; } } elseif (!empty($_POST['submit_conf_no'])) { if ($conf == 'yes') { $alert[$num_alerts++] = "Appointment authorization cancelled."; } else { if ($conf == 'no') { $alert[$num_alerts++] = "Unauthorized Appointment removing cancelled."; } } include "sch_auth.php"; exit; } else { if ($conf == 'yes') { $apps = array(); $overlap_apps = Check_Weekly_Appointment_Overlap($account_id, $app[0][15], $app[0][7], $app[0][9], '', $bd); echo $app[0][15]; if ($overlap_apps) { for ($i = 0; $i < $bd->NumberOfRows($overlap_apps); $i++) { $cur_app = $bd->FetchResult($overlap_apps, $i, 'app_id'); $res_app = List_Weekly_Appointments($account_id, '', '', 1, '', '', '', '', $cur_app, '', $cfg['time'], $array_type, $array_color, $array_image, $cfg['days'], $bd); $apps = array_merge($apps, $res_app); } } if ($perio == 'common') { $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++) { $cur_app = $bd->FetchResult($overlap_apps, $i, 'app_id'); $res_app = List_Appointments($account_id, '', '', 1, '', '', '', '', $cur_app, '', $cfg['time'], $array_type, $array_color, $array_image, $cfg['days'], $bd); $apps = array_merge($apps, $res_app);