Exemple #1
0
             $citacion["cliente_id"] = $var_userid;
         } elseif ($citacion["citacion_cliente"] == 2) {
             $citacion["cliente_id"] = $var_userid_dos;
         } else {
             // busco el cliente compuesto
             $citacion["cliente_id"] = citacionClienteCompuesto($citacion["citacion_cliente"]);
         }
         $citacionClass->guardarCitacion(array('citacion_tipo' => $citacion["citacion_tipo"], 'citacion_plantilla' => $citacion["citacion_plantilla"], 'ticket_id' => $var_insert_id, 'staff_id' => $var_staffid, 'cliente_id' => $citacion["cliente_id"]));
     }
 }
 // historial de derivar
 if ($derivar_sector != 0) {
     $historial = new Historial();
     $historial->guardarHistorial(array('ticket_id' => $var_ticketid, 'staff_id' => $var_staffid, 'descripcion' => 'El Trámite ha sido derivado', 'derivado' => $derivar_sector, 'show_in_ticket' => 1));
 }
 insertStattics($var_ticketid);
 //update reference number
 //	modified on 15-11-06 by roshith	for constant length ref.no.
 // 'zero' added for 2 digit companyid
 if ($var_compid < 10) {
     $var_compid = "0" . $var_compid;
 }
 $dept_id = $deptid;
 // to send mail
 // 'zero' added for 2 digit departmentid
 if ($deptid < 10) {
     $deptid = "0" . $deptid;
 }
 // 'zeros' added for 4 digit userid
 if ($var_userid < 10) {
     $var_userid = "000" . $var_userid;
 $sql = "Select nDeptId from sptbl_depts where nDeptParent='{$deptid}'";
 $rs = executeSelect($sql, $conn);
 if (mysql_num_rows($rs) > 0) {
     $var_continue_exec = false;
 }
 //End Modification
 if ($var_continue_exec == true) {
     //get ip address
     $varclip = getClientIP();
     //insert into ticket
     $sql_insert_ticket = "insert into sptbl_tickets(nTicketId,nDeptId,vRefNo,nUserId,vUserName,vTitle,tQuestion,vPriority,dPostDate,vMachineIP,dLastAttempted)";
     $sql_insert_ticket .= "values('','{$deptid}','1','{$var_userid}','" . mysql_real_escape_string($var_username) . "','" . mysql_real_escape_string($title) . "','";
     $sql_insert_ticket .= mysql_real_escape_string($qstion) . "','{$priority}',now(),'{$varclip}',now())";
     executeQuery($sql_insert_ticket, $conn);
     $var_insert_id = mysql_insert_id($conn);
     insertStattics($var_insert_id);
     //update reference number
     //	modified on 15-11-06 by roshith	for constatnt length ref.no.
     // 'zero' added for 2 digit companyid
     if ($var_compid < 10) {
         $var_compid = "0" . $var_compid;
     }
     $dept_id = $deptid;
     // to send mail
     // 'zero' added for 2 digit departmentid
     if ($deptid < 10) {
         $deptid = "0" . $deptid;
     }
     // 'zeros' added for 4 digit userid
     if ($var_userid < 10) {
         $var_userid = "000" . $var_userid;