Ejemplo n.º 1
0
             $row[] = $aRow[$i];
         }
         $data['aaData'][] = $row;
     }
     break;
 case 'save_incomming':
     $incom_id_check = $_REQUEST['id_h'];
     if ($incom_id_check == '') {
         Addincomming($c_date, $id_p, $phone, $person_name, $type, $results_id, $information_category_id, $information_sub_category_id, $content_id, $product_id, $forward_id, $connect, $results_comment, $content, $task_type_id, $task_department_id, $persons_id, $comment, $call_vote, $source_id);
     } else {
         Saveincomming($c_date, $id_p, $phone, $person_name, $type, $results_id, $information_category_id, $information_sub_category_id, $content_id, $product_id, $forward_id, $connect, $results_comment, $content, $task_type_id, $task_department_id, $persons_id, $comment, $call_vote, $source_id);
     }
     break;
 case 'send_mail':
     $c_date = $_REQUEST['c_date'];
     Sendmail($c_date, $phone, $results_id, $results_comment, $content, $product_id, $call_vote);
     break;
 case 'get_calls':
     $data = array('calls' => getCalls());
     break;
 case 'category_change':
     $information_category_id_check = $_REQUEST['information_category_id_check'];
     $data = array('cat' => Getinformation_sub_category('', $information_category_id_check));
     break;
 case 'set_task_type':
     $cat_id = $_REQUEST['cat_id'];
     $data = array('cat' => Getbank_object($cat_id));
     break;
 case 'get-info':
     $start1 = $_REQUEST['start'];
     $end1 = $_REQUEST['end'];
Ejemplo n.º 2
0
function Cancel($id, $currentcal, $cancelreason, $notifyusers, $cancelall)
{
    /* get appointment info before changing it */
    $sqlstring = "select a.*, b.calendar_name, c.project_name from calendar_appointments a left join calendars b on a.appt_calendarid = b.calendar_id left join calendar_projects c on a.appt_projectid = c.project_id where a.appt_id = '{$id}'";
    $result = mysql_query($sqlstring) or die("Query failed: " . mysql_error() . "<br><i>{$sqlstring}</i><br>");
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    $calid = $row['appt_calendarid'];
    $prjid = $row['appt_projectid'];
    $startdate = date('M j, Y', strtotime($row['appt_startdate']));
    $enddate = date('M j, Y', strtotime($row['appt_enddate']));
    $appttitle = $row['appt_title'];
    $calendar = $row['calendar_name'];
    $starttime = date('g:i a', strtotime($row['appt_startdate']));
    $endtime = date('g:i a', strtotime($row['appt_enddate']));
    if ($cancelall) {
        $sqlstring = "update calendar_appointments set appt_canceldate = now() where appt_groupid = '{$id}'";
    } else {
        $sqlstring = "update calendar_appointments set appt_canceldate = now() where appt_id = '{$id}'";
    }
    echo $sqlstring;
    $result = mysql_query($sqlstring) or die("Query failed: " . mysql_error() . "<br><i>{$sqlstring}</i><br>");
    /* send an email if necessary */
    if ($notifyusers != "") {
        $body = "The appointment titled '{$appttitle}' scheduled from {$starttime}-{$endtime} on {$startdate} has been cancelled from the {$calendar} calendar because {$cancelreason}";
        $subject = "{$calendar} cancellation {$startdate}";
        /* get a list of users who care about this calendar and send an email */
        $sqlstring = "select b.user_email 'email' from calendar_notifications a left join users b on a.not_userid = b.user_id where not_calendarid = {$calid}";
        $result = mysql_query($sqlstring) or die("Query failed: " . mysql_error() . "<br><i>{$sqlstring}</i><br>");
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            $recipients[] = $row['email'];
        }
        Sendmail($body, $recipients, $subject);
        /* get a list of users who care about this project and send an email */
    }
    ?>
		<br>
		Appointment cancelled. Redirecting to calendar.
		<?php 
}