Exemple #1
0
     $count = $_REQUEST['count'];
     $hidden = $_REQUEST['hidden'];
     $rResult = mysql_query("SELECT\t`prod`.`id`,\n                                \t\t`prod`.`name`,\n                                \t\t(SELECT `name` FROM `tage` WHERE `id` = `prod`.`parent_id`)\n\t\t\t\t\t\t\t    FROM\t`tage` AS `prod`\n\t    \t\t\t\t\t\tWHERE\t`actived` = 1");
     $data = array("aaData" => array());
     while ($aRow = mysql_fetch_array($rResult)) {
         $row = array();
         for ($i = 0; $i < $count; $i++) {
             /* General output */
             $row[] = $aRow[$i];
         }
         $data['aaData'][] = $row;
     }
     break;
 case 'save_incomming':
     if ($id_h == '') {
         Addincomming($id_p, $phone, $person_name, $type_id, $call_type_id, $product_type_id, $card_id, $department_id, $information_category_id, $information_sub_category_id, $production_category_id, $genre_id, $production_id, $content, $sum_pirce, $shipping_id, $module_id, $call_comment, $call_status_id, $task_department_id, $source_id, $c_date, $persons_id, $priority_id, $done_start_time, $done_end_time, $comment, $task_type_id, $status_2, $status_1);
         $incomming_call_id = mysql_fetch_array(mysql_query("SELECT id FROM incomming_call WHERE phone = '{$phone}' ORDER BY date DESC LIMIT 1"));
         if ($task_type_id > 0) {
             AddTask($incomming_call_id[0], $task_type_id, $task_department_id, $c_date, $done_start_time, $done_end_time, $comment, $persons_id, $priority_id);
         }
     } else {
         $inc_task_ch = mysql_fetch_assoc(mysql_query("SELECT id FROM task WHERE incomming_call_id = '{$id_p}'"));
         if ($inc_task_ch['id'] == '' and $task_type_id > 0) {
             AddTask($id_p, $task_type_id, $task_department_id, $c_date, $done_start_time, $done_end_time, $comment, $persons_id, $priority_id);
         } else {
             $user = $_SESSION['USERID'];
             $r_user = realuser($persons_id);
             mysql_query("UPDATE `task` SET  `user_id`='{$user}',\n                                    `responsible_user_id`='{$r_user}',\n                                    `start_date`='{$done_start_time}',\n                                    `end_date`='{$done_end_time}',\n                                    `department_id`='{$task_department_id}',\n                                    `task_type_id`='{$task_type_id}',\n                                    `priority_id`='{$priority_id}',\n                                    `comment`='{$comment}'\n                              WHERE `incomming_call_id`='{$id_p}'");
         }
         Saveincomming($id_h, $phone, $person_name, $type_id, $call_type_id, $product_type_id, $card_id, $department_id, $information_category_id, $information_sub_category_id, $production_category_id, $genre_id, $production_id, $content, $sum_pirce, $shipping_id, $module_id, $call_comment, $call_status_id, $task_department_id, $source_id, $c_date, $persons_id, $priority_id, $done_start_time, $done_end_time, $comment, $task_type_id, $status_2, $status_1);
     }
Exemple #2
0
     $rResult = mysql_query("SELECT \t`client`.`id`,\r\n\t\t\t\t\t\t\t\t\t\t`client`.`id`,\r\n\t\t\t\t\t\t\t\t\t\t`client`.`code`,\r\n\t\t\t\t\t\t\t\t\t\t`legal_status`.`name`,\r\n\t\t\t\t\t\t\t\t\t\t`client`.`name`,\r\n\t\t\t\t\t\t\t\t\t\t`client`.`phone`,\r\n\t\t\t\t\t\t\t\t\t\t`client`.`mail`,\r\n\t\t\t\t\t\t\t\t\t\t`client`.`name`,\r\n\t\t\t\t\t\t\t\t\t\t`client`.`name`,\r\n\t  \t\t\t\t\t\t\t\t\t`client`.`name`\r\n\t\t\t\t\t\t\t\tFROM \t`client`\r\n\t\t\t\t\t\t\t\tJOIN \t`legal_status` ON `client`.`legal_status_id` = `legal_status`.`id`");
     $data = array("aaData" => array());
     while ($aRow = mysql_fetch_array($rResult)) {
         $row = array();
         for ($i = 0; $i < $count; $i++) {
             /* General output */
             $row[] = $aRow[$i];
         }
         $data['aaData'][] = $row;
     }
     break;
 case 'save_incomming':
     $incom_id = $_REQUEST['id'];
     $task_type_id = $_REQUEST['task_type_id'];
     if ($incom_id == '') {
         Addincomming($phone, $call_type_id, $category_id, $category_parent_id, $object_id, $pay_type_id, $bank_id, $card_type_id, $pay_aparat_id, $problem_date, $call_content, $file, $rand_file, $hidden_inc);
         $incomming_call_id = mysql_insert_id();
         if ($task_type_id != 0) {
             Addtask($incomming_call_id, $persons_id, $task_type_id, $priority_id, $task_department_id, $comment);
         }
         Addsite_user($incomming_call_id, $personal_pin, $friend_pin, $personal_id);
     } else {
         Saveincomming($call_type_id, $phone, $category_id, $category_parent_id, $object_id, $pay_type_id, $bank_id, $card_type_id, $pay_aparat_id, $problem_date, $call_content, $file, $rand_file);
         Savetask($incom_id, $persons_id, $task_type_id, $priority_id, $task_department_id, $comment);
         //Savesite_user($incom_id, $personal_pin, $name, $personal_phone, $mail,  $personal_id);
     }
     break;
 case 'get_calls':
     $data = array('calls' => getCalls());
     break;
 case 'delete_file':
                     $row[] = '<div style="background: #FF5555; WIDTH: 150%;">' . $aRow[$i] . '</div>';
                 } else {
                     $row[] = $aRow[$i];
                 }
             } else {
                 $row[] = $aRow[$i];
             }
         }
         $data['aaData'][] = $row;
     }
     break;
 case 'save_incomming':
     $incom_id = $_REQUEST['hidden_checker'];
     $task_type_id = $_REQUEST['task_type_id'];
     if ($incom_id == '') {
         Addincomming($call_date, $call_phone, $category_parent_id, $category_id, $sub_category, $call_problem_date, $call_status_id, $call_object_id, $call_source_id, $call_content, $abonent_phone, $abonent_pin, $abonent_name, $abonent_responsibl_person, $abonent_address, $abonent_number, $abonent_status, $abonent_coment, $file, $rand_file, $hidden_inc);
         $incomming_call_id = mysql_insert_id();
         if ($task_type_id != 0) {
             Addtask($incomming_call_id, $persons_id, $task_type_id, $priority_id, $task_department_id, $call_date, $call_phone, $category_parent_id, $category_id, $sub_category, $call_problem_date, $call_status_id, $call_object_id, $call_source_id, $call_content, $abonent_phone, $abonent_pin, $abonent_name, $abonent_responsibl_person, $abonent_address, $abonent_number, $abonent_status, $abonent_coment);
         }
     } else {
         Saveincomming($call_date, $call_phone, $category_parent_id, $category_id, $sub_category, $call_problem_date, $call_status_id, $call_object_id, $call_source_id, $call_content, $abonent_phone, $abonent_pin, $abonent_name, $abonent_responsibl_person, $abonent_address, $abonent_number, $abonent_status, $abonent_coment, $file, $rand_file, $hidden_inc);
         $check_task = mysql_fetch_assoc(mysql_query("SELECT id FROM task WHERE incomming_call_id = '{$incom_id}'"));
         if ($task_type_id != 0) {
             if ($check_task == '') {
                 Addtask($incom_id, $persons_id, $task_type_id, $priority_id, $task_department_id, $call_date, $call_phone, $category_parent_id, $category_id, $sub_category, $call_problem_date, $call_status_id, $call_object_id, $call_source_id, $call_content, $abonent_phone, $abonent_pin, $abonent_name, $abonent_responsibl_person, $abonent_address, $abonent_number, $abonent_status, $abonent_coment);
             } else {
                 Savetask($check_task[id], $persons_id, $task_type_id, $priority_id, $task_department_id, $call_date, $call_phone, $category_parent_id, $category_id, $sub_category, $call_problem_date, $call_status_id, $call_object_id, $call_source_id, $call_content, $abonent_phone, $abonent_pin, $abonent_name, $abonent_responsibl_person, $abonent_address, $abonent_number, $abonent_status, $abonent_coment);
             }
         }
     }
Exemple #4
0
     $end = $_REQUEST['end'];
     $rResult = mysql_query("select  \t\tincomming_call.id,           \n\t\t\t\t\t\t\t\t\t\t\t\tincomming_call.id,\n\t\t\t\t\t\t\t\t\t\t\t  \tDATE_FORMAT(incomming_call.`date`,'%y-%m-%d %H:%i:%s'),\n\t\t\t\t\t\t\t\t\t\t\t\tinfo_category.`name`,\n\t\t\t\t\t\t\t\t\t\t\t\tIF(incomming_call.phone != '',incomming_call.phone,'ჩატი'),\n\t  \t\t\t\t\t\t\t\t\t\t\tincomming_call.content\n\t\t\t\t\t\t\t\tFROM \t\t\tincomming_call\n\t\t\t\t\t\t\t\tLEFT JOIN \t\tinfo_category  ON incomming_call.information_category_id=info_category.id\n\t  \t\t\t\t\t\t\tWHERE \t\t\tincomming_call.actived = 1 and DATE(date)  BETWEEN  date('{$start}')  And date('{$end}')");
     $data = array("aaData" => array());
     while ($aRow = mysql_fetch_array($rResult)) {
         $row = array();
         for ($i = 0; $i < $count; $i++) {
             /* General output */
             $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;