当前位置: 首页>>代码示例>>PHP>>正文


PHP Cabinet::command_for_change_status_query_AJAX方法代码示例

本文整理汇总了PHP中Cabinet::command_for_change_status_query_AJAX方法的典型用法代码示例。如果您正苦于以下问题:PHP Cabinet::command_for_change_status_query_AJAX方法的具体用法?PHP Cabinet::command_for_change_status_query_AJAX怎么用?PHP Cabinet::command_for_change_status_query_AJAX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cabinet的用法示例。


在下文中一共展示了Cabinet::command_for_change_status_query_AJAX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: attach_client_to_request_AJAX


//.........这里部分代码省略.........
                 }
                 $query .= " WHERE `id` = '" . (int) $_POST['rt_list_id'] . "';";
                 $result = $mysqli->query($query) or die($mysqli->error);
                 // if($this->user_access != 5){
                 // 	echo '{"response":"OK","function2":"change_attache_manager","function":"echo_message","message_type":"system_message","message":"'.base64_encode($message).'"}';
                 // }else{
                 // 	echo '{"response":"OK","function":"reload_order_tbl"}';
                 // }
                 // echo '{"response":"OK","function":"change_attache_manager","rt_list_id":"'.$_POST['rt_list_id'].'", "manager_id":"'.$managers_arr[0]['id'].'","manager_name":"'.$managers_arr[0]['name'].' '.$managers_arr[0]['last_name'].'"}';
                 // $options['width'] = 1200;
                 // $this->responseClass->addSimpleWindow($query,"",$options);
                 $this->responseClass->addMessage($message, 'system_message');
                 // $this->responseClass->addResponseFunction('change_attache_manager',array('rt_list_id'=>$_POST['rt_list_id'],'manager_id'=>$managers_arr[0]['id'],'name'=>$manager));
                 $this->responseClass->addResponseFunction('reload_order_tbl');
                 break;
             default:
                 // если к клиенту присоединено несколько кураторов выполняем первый пункт по умолчанию, потом вызываем окно с выбором менеджера
                 /*
                 								
                 							***************************************************************
                 временно отключаем прикрепление первого менеджера автоматически
                 ***************************************************************
                 								global $mysqli;
                 								// прикрепить клиента и менеджера к запросу	
                 								$query ="UPDATE  `".RT_LIST."` SET  
                 									`manager_id` =  '".(int)$managers_arr[0]['id']."',
                 									`client_id` =  '".(int)$_POST['client_id']."', 
                 									`time_attach_manager` = NOW(),
                 									`status` = 'not_process'
                 									WHERE `id` = '".(int)$_POST['rt_list_id']."';";	
                 								$result = $mysqli->query($query) or die($mysqli->error);	
                 */
                 global $mysqli;
                 // прикрепить клиента
                 $query = "UPDATE  `" . RT_LIST . "` SET  \n\t\t\t\t\t\t\t\t`client_id` =  '" . (int) $_POST['client_id'] . "', \n\t\t\t\t\t\t\t\t`time_attach_manager` = NOW(),\n\t\t\t\t\t\t\t\t`status` = 'not_process'\n\t\t\t\t\t\t\t\tWHERE `id` = '" . (int) $_POST['rt_list_id'] . "';";
                 $result = $mysqli->query($query) or die($mysqli->error);
                 //////////////////////////
                 //	осбираем форму для выбора одного из кураторов
                 //
                 //////////////////////////
                 $html = '<div  id="chose_manager_tbl">';
                 $html .= '<table>';
                 for ($i = 0; $i < count($managers_arr); $i) {
                     $html .= '<tr>';
                     for ($j = 1; $j <= 3; $j++) {
                         if (isset($managers_arr[$i])) {
                             //$checked = ($managers_arr[$i]['id'] == $managers_arr[0]['id'])?'class="checked"':'';
                             $checked = '';
                             $name = trim($managers_arr[$i]['name']) == '' && trim($managers_arr[$i]['last_name']) == '' ? $managers_arr[$i]['nickname'] : $managers_arr[$i]['name'] . ' ' . $managers_arr[$i]['last_name'];
                             $html .= '<td ' . $checked . ' data-id="' . $managers_arr[$i]['id'] . '">' . $name . "</td>";
                         } else {
                             $html .= "<td></td>";
                         }
                         $i++;
                     }
                     $html .= '</tr>';
                 }
                 $html .= '</table>';
                 $html .= '<input type="hidden" value="attach_manager_to_request" name="AJAX">';
                 $html .= '<input type="hidden" value="' . (isset($_POST['manager_id']) ? $_POST['manager_id'] : '') . '" name="manager_id">';
                 $html .= '<input type="hidden" value="' . $_POST['rt_list_id'] . '" name="rt_list_id">';
                 $html .= '<input type="hidden" value="" name="client_id">';
                 $html .= '</div>';
                 // записываем на странице пользователя в строку с установленным клиентом имя первого куратора из списка
                 // затем даём выбрать из иставшихся
                 // echo '{"response":"show_new_window",
                 // 		"html":"'.base64_encode($html).'",
                 // 		"title":"Выберите куратора",
                 // 		"function":"change_attache_manager",
                 // 		"rt_list_id":"'.$_POST['rt_list_id'].'",
                 // 		"manager_id":"'.$managers_arr[0]['id'].'",
                 // 		"manager_name":"'.$managers_arr[0]['name'].' '.$managers_arr[0]['last_name'].'"
                 // 	}';
                 $this->responseClass->addPostWindow($html, 'Выберите куратора', array('width' => '1000'));
                 $this->responseClass->addResponseFunction('change_attache_manager', array('rt_list_id' => $_POST['rt_list_id'], 'manager_id' => $managers_arr[0]['id'], 'name' => $managers_arr[0]['name'] . ' ' . $managers_arr[0]['last_name']));
                 $this->responseClass->addResponseFunction('reload_order_tbl');
                 break;
         }
         if (isset($_POST['row_id']) && (int) $_POST['row_id'] > 0) {
             $this->Query = $this->get_query((int) $_POST['row_id']);
             // echo '<pre>';
             // print_r($this->Query);
             // echo '</pre>';
             // echo '<pre>';
             // print_r($_POST);
             // echo '</pre>';
             if (isset($_POST['query_status']) && $_POST['query_status'] != $this->Query['status']) {
                 if ((int) $_POST['client_id'] != $this->Query['client_id']) {
                     include_once 'cabinet_class.php';
                     $cabinet = new Cabinet();
                     $cabinet->responseClass = new responseClass();
                     $cabinet->command_for_change_status_query_AJAX();
                     // echo $this->responseClass->getResponse();
                     exit;
                 }
             }
         }
     }
     // exit;
 }
开发者ID:apelburg,项目名称:test,代码行数:101,代码来源:cabinet_general_class.php


注:本文中的Cabinet::command_for_change_status_query_AJAX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。