diff --git a/admin/displayappointments.php b/admin/displayappointments.php index 5075b583..db5dd924 100644 --- a/admin/displayappointments.php +++ b/admin/displayappointments.php @@ -58,19 +58,27 @@ $js_foot = array( "../js/bootstrap-confirmation.js", "../js/custom.js" ); - + //create new or update appointment if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['update'])) { $start = $db->qstr($_GET['start']); $end = $db->qstr($_GET['end']); - $contact_phone_id = bigintval($_GET['contact_phone_id']); + $case_id = bigintval($_GET['case_id']); $respondent_id = bigintval($_GET['respondent_id']); $require_operator_id = "NULL"; if ($_GET['require_operator_id'] > 1) $require_operator_id = bigintval($_GET['require_operator_id']); - if ($_GET['new'] == 'create'){ - $case_id = bigintval($_GET['case_id']); + //* add new number to db + if ( isset($_GET['addphonenumber']) && !empty($_GET['addphonenumber'])){ + add_contact_phone($case_id,$_GET['addphonenumber']); + $contact_phone_id = $db->Insert_ID(); + } + else { + $contact_phone_id = bigintval($_GET['contact_phone_id']); + } + + if (isset($_GET['new']) && $_GET['new'] == 'create'){ $operator_id = get_operator_id(); if ($operator_id == false) die(); $sql = "SELECT Time_zone_name FROM respondent WHERE respondent_id = '$respondent_id'"; @@ -104,14 +112,15 @@ if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['update'])) $db->Execute($sql); } - unset ($_GET['start'],$_GET['end'],$_GET['appointment_id'],$_GET['case_id'],$_GET['new'],$_GET['update']); + unset ($_GET['start'],$_GET['end'],$_GET['new'],$_GET['update'],$_GET['appointment_id'],$_GET['case_id'],$_GET['addphonenumber']); // } if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET['new']) && isset($_GET['case_id']))) { - $appointment_id = bigintval($_GET['appointment_id']); - $case_id = bigintval($_GET['case_id']); + if (isset($_GET['appointment_id'])) $appointment_id = bigintval($_GET['appointment_id']); else $appointment_id = ""; + if (isset($_GET['case_id'])) $case_id = bigintval($_GET['case_id']); + $require_operator_id = "NULL"; if (isset($_GET['delete'])) { @@ -121,27 +130,61 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[ xhtml_head(T_("Now modify case outcome"),true,$css,$js_head); - print "
" . T_("The appointment has been deleted. Now you must modify the case outcome") . "
+ print "" . T_("The appointment has been deleted. Now you must modify the case outcome") . "
" . T_("Modify case outcome") . "