$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); } } } break; case 'get_calls': $data = array('calls' => getCalls()); break; case 'delete_file': mysql_query("DELETE FROM file WHERE id = {$delete_id}"); $increm = mysql_query("\tSELECT `name`,\r\n\t\t\t\t\t`rand_name`,\r\n\t\t\t\t\t`id`\r\n\t\t\t\t\tFROM \t`file`\r\n\t\t\t\t\tWHERE `incomming_call_id` = {$edit_id}\r\n\t\t\t\t\t"); $data1 = ''; while ($increm_row = mysql_fetch_assoc($increm)) { $data1 .= '<tr style="border-bottom: 1px solid #85b1de;"> <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td> <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
mysql_query("INSERT INTO \t`file`\r\n \t\t\t\t( \t`user_id`,\r\n \t\t\t\t`task_id`,\r\n \t\t\t\t\t`name`,\r\n \t\t\t\t\t`rand_name`\r\n \t\t\t\t\t)\r\n \t\t\t\t\tVALUES\r\n \t\t\t\t\t(\t'{$user}',\r\n \t\t\t\t\t'{$edit_id}',\r\n \t\t\t\t\t'{$file}',\r\n \t\t\t\t\t'{$rand_file}'\r\n \t\t\t\t);"); } $increm = mysql_query("\tSELECT `name`,\r\n \t\t\t\t`rand_name`,\r\n \t\t\t\t`id`\r\n \t\t\t\tFROM \t`file`\r\n \t\t\t\tWHERE `task_id` = {$edit_id}\r\n \t\t\t\t"); $data1 = ''; while ($increm_row = mysql_fetch_assoc($increm)) { $data1 .= '<tr style="border-bottom: 1px solid #85b1de;"> <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td> <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td> <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td> </tr>'; } $data = array('page' => $data1); break; case 'save_outgoing': $user_id = $_SESSION['USERID']; Savetask($task_id, $problem_comment, $file, $rand_file); break; case 'done_outgoing': $user_id = $_SESSION['USERID']; Savetask1($task_id, $problem_comment, $file, $rand_file); break; default: $error = 'Action is Null'; } $data['error'] = $error; echo json_encode($data); /* ****************************** * task Functions * ****************************** */ function checkgroup($user)
$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': mysql_query("DELETE FROM file WHERE id = {$delete_id}"); $increm = mysql_query("\tSELECT `name`,\r\n\t\t\t\t\t`rand_name`,\r\n\t\t\t\t\t`id`\r\n\t\t\t\t\tFROM \t`file`\r\n\t\t\t\t\tWHERE `incomming_call_id` = {$edit_id}\r\n\t\t\t\t\t"); $data1 = ''; while ($increm_row = mysql_fetch_assoc($increm)) { $data1 .= '<tr style="border-bottom: 1px solid #85b1de;"> <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td> <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td> <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
$incom_id = $_REQUEST['id']; $ast_incomming_id = $_REQUEST['ast_incomming_id']; $sbstr = substr($incom_id, 0, 1); if ($sbstr == 'u') { $task_ast_id = str_replace("u", "", $incom_id); $check_user = mysql_fetch_assoc(mysql_query("SELECT task.responsible_user_id,\r\n \t persons.`name`\r\n FROM task\r\n JOIN users ON users.id = task.responsible_user_id\r\n JOIN persons ON persons.id = users.person_id \r\n WHERE task.ast_incomming_id = '{$task_ast_id}'\r\n \t\t LIMIT 1")); if ($check_user[responsible_user_id] == '' || $check_user[responsible_user_id] == null) { Addtask($incom_id, $client_name, $phone, $call_content, $comment, $problem_coment); } else { global $error; $error = "ამ უპასუხო ზარზე უკვე მუშაობს {$check_user['name']}"; } } else { $check_user = mysql_fetch_assoc(mysql_query("SELECT task.responsible_user_id,\r\n \t\t persons.`name`\r\n \t\t FROM task\r\n \t\t JOIN users ON users.id = task.responsible_user_id\r\n \t\t JOIN persons ON persons.id = users.person_id\r\n \t\t WHERE task.id = '{$incom_id}'")); if ($check_user[responsible_user_id] == '' || $check_user[responsible_user_id] == null) { Savetask($incom_id, $phone, $ast_incomming_id); } else { global $error; $error = "ამ უპასუხო ზარზე უკვე მუშაობს {$check_user['name']}"; } } break; case 'save_noansver': $incom_id = $_REQUEST['id']; $task_status_id = $_REQUEST['task_status_id']; $task_type_id = $_REQUEST['task_type_id']; $persons_id = $_REQUEST['persons_id']; $sbstr = substr($incom_id, 0, 1); if ($sbstr == 'u') { $task_ast_id = str_replace("u", "", $incom_id); $check_user = mysql_fetch_assoc(mysql_query("SELECT task.responsible_user_id,\r\n \t persons.`name`\r\n \t FROM task\r\n \t JOIN users ON users.id = task.responsible_user_id\r\n \t JOIN persons ON persons.id = users.person_id\r\n \t WHERE task.ast_incomming_id = '{$task_ast_id}'\r\n \t LIMIT 1"));
* If you just want to use the basic configuration for DataTables with PHP * server-side, there is no need to edit below this line. */ //mysql_close(); require '../../../includes/ssp.class.php'; $where_param = " where `status` = 0 and user_id = {$user} "; $data = SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns, $where_param); break; case 'save_outgoing': $user_id = $_SESSION['USERID']; if (empty($task_id)) { $task_id = mysql_insert_id(); Addtask($cur_date, $done_start_time, $done_end_time, $task_type_id, $template_id, $task_department_id, $persons_id, $status); //Addsite_user($incomming_call_id, $personal_pin, $friend_pin, $personal_id); } else { Savetask($task_id, $cur_date, $done_start_time, $done_end_time, $task_type_id, $template_id, $task_department_id, $persons_id); //Savesite_user($incom_id, $personal_pin, $name, $personal_phone, $mail, $personal_id); } break; case 'get_responsible_person_add_page': $page = GetResoniblePersonPage(); $data = array('page' => $page); break; case 'save_task': // task_detail------------------------ $phone = $_REQUEST['p_phone']; $person_n = $_REQUEST['p_person_n']; $first_name = $_REQUEST['p_first_name']; $mail = $_REQUEST['p_mail']; $last_name = $_REQUEST['p_last_name']; $person_status = $_REQUEST['p_person_status'];
} } $data['aaData'][] = $row; } break; case 'save_outgoing': $user_id = $_SESSION['USERID']; if ($task_id == 0) { $task_id = mysql_insert_id(); Addtask($persons_id, $planned_start_date, $fact_end_date, $call_duration, $priority_id, $template_id, $phone, $comment, $problem_comment, $file, $rand_file, $hidden_inc); if ($personal_pin != 0) { $incomming_call_id = mysql_insert_id(); //Addsite_user($incomming_call_id, $personal_pin, $friend_pin, $personal_id); } } else { Savetask($task_id, $persons_id, $planned_start_date, $fact_end_date, $call_duration, $priority_id, $template_id, $phone, $comment, $problem_comment, $file, $rand_file); //Savesite_user($incom_id, $personal_pin, $name, $personal_phone, $mail, $personal_id); } break; case 'get_responsible_person_add_page': $page = GetResoniblePersonPage(); $data = array('page' => $page); break; case 'change_responsible_person': $letters = json_decode('[' . $_REQUEST['lt'] . ']'); $responsible_person = $_REQUEST['rp']; ChangeResponsiblePerson($letters, $responsible_person); break; case 'get_add_info': $pin = $_REQUEST['pin']; $data = array('info' => get_addition_all_info($pin));
$data = array("aaData" => array()); while ($aRow = mysql_fetch_array($rResult)) { $row = array(); $row1 = array(); for ($i = 0; $i < $count; $i++) { $row[] = $aRow[$i]; } $data['aaData'][] = $row; } break; case 'save_incomming': $incom_id = $_REQUEST['id']; if ($incom_id == '') { Addtask($persons_id, $c_date, $phone, $task_type_id, $priority_id, $task_department_id, $call_type_id, $category_parent_id, $category_id, $object_id, $problem_date, $call_status_id, $source, $comment, $rand_file, $file, $hidden_inc, $abonent_phone, $abonent_pin, $abonent_name, $abonent_responsibl_person, $abonent_address, $abonent_number, $abonent_status, $abonent_coment); } else { Savetask($incom_id, $persons_id, $c_date, $phone, $task_type_id, $template_id, $task_department_id, $call_type_id, $category_parent_id, $category_id, $problem_date, $call_status_id, $object_id, $source, $comment, $problem_comment, $priority_id, $rand_file, $file, $abonent_phone, $abonent_pin, $abonent_name, $abonent_responsibl_person, $abonent_address, $abonent_number, $abonent_status, $abonent_coment); } break; case 'get_calls': $data = array('calls' => getCalls()); break; case 'delete_file': mysql_query("DELETE FROM file WHERE id = {$delete_id}"); $increm = mysql_query("\tSELECT `name`,\n\t\t\t\t\t\t\t\t\t\t`rand_name`,\n\t\t\t\t\t\t\t\t\t\t`id`\n\t\t\t\t\t\t\t\tFROM \t`file`\n\t\t\t\t\t\t\t\tWHERE `task_id` = {$edit_id}\n\t\t\t\t\t\t\t "); $data1 = ''; while ($increm_row = mysql_fetch_assoc($increm)) { $data1 .= '<tr style="border-bottom: 1px solid #85b1de;"> <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td> <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td> <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td> </tr>';
while ($aRow = mysql_fetch_array($rResult)) { $row = array(); for ($i = 0; $i < $count; $i++) { $row[] = $aRow[$i]; } $data['aaData'][] = $row; } break; case 'save_incomming': $incom_id = $_REQUEST['id']; $hidden_user = $_REQUEST['hidden_user']; Saveincomming($phone, $hidden_user, $call_status, $client_name, $call_content); $result = mysql_query(" SELECT task.id\n\t\t\t\t\t\t\t\tFROM task\n\t\t\t\t\t\t\t\tWHERE task.incomming_call_id = {$incom_id} AND task.actived=1"); $check = mysql_num_rows($result); if ($department_id != 0 && $check > 0) { Savetask($incom_id, $task_type_id, $priority, $department_id, $persons_id, $out_phone, $problem_comment); } else { if ($department_id != 0 && $check == 0) { Addtask($incom_id, $task_type_id, $priority, $department_id, $persons_id, $out_phone, $problem_comment); } } break; default: $error = 'Action is Null'; } $data['error'] = $error; echo json_encode($data); /* ****************************** * Request Functions * ****************************** */
$row[] = $aRow[$i]; if ($i == $count - 1) { $row[] = '<input type="checkbox" id="' . $aRow[$hidden] . '" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />'; } } $data['aaData'][] = $row; } break; case 'save_action': if ($action_id == '') { Addaction($action_name, $start_date, $end_date, $action_content, $file, $rand_file, $edit_id); $task_id = mysql_insert_id(); Addtask($task_id, $task_type_id, $task_department_id, $priority_id, $comment); } else { saveaction($action_id, $action_name, $start_date, $end_date, $action_content); Savetask($action_id, $task_type_id, $task_department_id, $priority_id, $comment); } break; case 'delete_file': mysql_query("DELETE FROM file WHERE id = {$delete_id}"); $increm = mysql_query("\tSELECT `name`,\r\n\t\t\t\t\t`rand_name`,\r\n\t\t\t\t\t`id`\r\n\t\t\t\t\tFROM \t`file`\r\n\t\t\t\t\tWHERE `action_id` = {$edit_id}\r\n\t\t\t\t\t"); $data1 = ''; while ($increm_row = mysql_fetch_assoc($increm)) { $data1 .= '<tr style="border-bottom: 1px solid #85b1de;"> <td style="width:260px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td> <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td> <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td> </tr>'; } $data = array('page' => $data1); break;
$row[] = $aRow[$i]; } } else { $row[] = $aRow[$i]; } if ($i == $count - 1) { $row[] = '<input type="checkbox" id="' . $aRow[$hidden] . '" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />'; } } $data['aaData'][] = $row; } break; case 'save_outgoing': $user_id = $_SESSION['USERID']; $comment = $_REQUEST['comment']; Savetask($task_id, $client_name, $persons_id, $comment); break; case 'done_outgoing': $user_id = $_SESSION['USERID']; Savetask1($task_id, $ast_incomming_id, $persons_id, $comment); break; case 'get_add_info': $pin = $_REQUEST['pin']; $data = array('info' => get_addition_all_info($pin)); break; case 'get_add_info1': $personal_id = $_REQUEST['personal_id']; $data = array('info1' => get_addition_all_info1($personal_id)); break; default: $error = 'Action is Null';
$row[] = $aRow[$i]; } } else { $row[] = $aRow[$i]; } } $data['aaData'][] = $row; } break; case 'save_incomming': $incom_id = $_REQUEST['id']; if ($incom_id == '') { Addtask($persons_id, $control_id, $phone, $planned_date, $fact_end_date, $call_duration, $task_type_id, $priority_id, $task_department_id, $call_type_id, $category_parent_id, $category_id, $object_id, $pay_type_id, $bank_id, $card_type_id, $pay_aparat_id, $call_status_id, $source, $money, $comment, $rand_file, $file, $hidden_inc); $task_id = mysql_insert_id(); } else { Savetask($incom_id, $persons_id, $control_id, $planned_date, $fact_end_date, $call_duration, $call_status_id, $task_type_id, $priority_id, $task_department_id, $call_type_id, $category_id, $category_parent_id, $object_id, $pay_type_id, $bank_id, $card_type_id, $pay_aparat_id, $comment, $problem_comment, $source, $money, $rand_file, $file); } break; case 'get_calls': $data = array('calls' => getCalls()); break; case 'delete_file': mysql_query("DELETE FROM file WHERE id = {$delete_id}"); $increm = mysql_query("\tSELECT `name`,\r\n\t\t\t\t\t\t\t\t\t\t`rand_name`,\r\n\t\t\t\t\t\t\t\t\t\t`id`\r\n\t\t\t\t\t\t\t\tFROM \t`file`\r\n\t\t\t\t\t\t\t\tWHERE `task_id` = {$edit_id}\r\n\t\t\t\t\t\t\t "); $data1 = ''; while ($increm_row = mysql_fetch_assoc($increm)) { $data1 .= '<tr style="border-bottom: 1px solid #85b1de;"> <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td> <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td> <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td> </tr>';
$yvela = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS yvela\r\n \t FROM task\r\n \t WHERE actived = 1 AND ISNULL(task.ast_incomming_id) {$filter_yvela}\r\n \t AND date BETWEEN '{$startdate}' AND '{$enddate}'")); $chemi_task = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS chemi_task\r\n \t FROM task\r\n \t WHERE actived = 1 AND ISNULL(task.ast_incomming_id)\r\n \t AND task.user_id = {$user}\r\n \t AND DATE(date) BETWEEN '{$startdate}' AND '{$enddate}'")); $data = array('gauqmebuli' => $gauqmebuli[gauqmebuli], 'mogvarebuli' => $mogvarebuli[mogvarebuli], 'yvela' => $yvela[yvela], 'garkvevis_processhi' => $garkvevis_processhi[garkvevis_processhi], 'chemi_task' => $chemi_task[chemi_task]); break; case 'save_incomming': $incom_id = $_REQUEST['id']; $task_status_id = $_REQUEST['task_status_id']; $task_type_id = $_REQUEST['task_type_id']; $persons_id = $_REQUEST['persons_id']; $comment1 = $_REQUEST['comment1']; if ($incom_id == '') { Addtask($client_name, $task_type_id, $priority_id, $department_id, $phone, $call_content, $comment, $problem_coment, $task_status_id); } else { $row = mysql_fetch_assoc(mysql_query("SELECT task.incomming_call_id\r\n from task\r\n WHERE task.id={$incom_id}")); if ($row[incomming_call_id] != 0) { Savetask($incom_id, $persons_id, $task_type_id, $priority_id, $department_id, $task_status_id, $comment, $comment1); } else { Savetask1($incom_id, $client_name, $task_type_id, $priority_id, $department_id, $persons_id, $phone, $call_content, $comment1, comment1, $problem_coment, $task_status_id); } } break; case 'filt_task_type': $user = $_SESSION['USERID']; $dep_detail1_id = $_REQUEST['dep_detail1_id']; $task_type = Gettask_type1($dep_detail1_id); $data = array('task_type' => $task_type); break; case 'refresh': $data = array('date' => date('Y-m-d H:i:s')); break; default: