Example #1
0
 protected function get_manager_lis_for_curator_AJAX()
 {
     $query = "SELECT * FROM " . MANAGERS_TBL . " ORDER BY  `name` ASC ";
     $requesit = array();
     $result = $this->mysqli->query($query) or die($this->mysqli->error);
     if ($result->num_rows > 0) {
         while ($row = $result->fetch_assoc()) {
             $managers[] = $row;
         }
     }
     $num_rows = floor(count($managers) / 3);
     $client_id = $_GET['client_id'];
     //получаем список менеджеров прикреплённых к клиенту
     $curators_arr = Client::get_relate_managers($client_id);
     $num = 0;
     $html = '';
     foreach ($managers as $key => $value) {
         if (trim($value['name']) != "" || trim($value['last_name']) != "") {
             // перебираем всех менеджеров
             // если менеджер прикреплён добавляем ему класс enabled
             $enable = '';
             foreach ($curators_arr as $k => $v) {
                 if ($v['id'] == $value['id']) {
                     $enable = 'enabled';
                 }
             }
             $str = '<span data-id="' . $value['id'] . '" class="chose_curators ' . $enable . '">' . $value['name'] . ' ' . $value['last_name'] . '</span>';
             if ($num == 0) {
                 $str = '<div class="column_chose_window">' . $str;
             } else {
                 if ($num == $num_rows) {
                     $str = $str . '</div>';
                     $num = -1;
                 }
             }
             $html .= $str;
             $num++;
         }
     }
     echo $html;
     exit;
 }
Example #2
0
if ($client == 0) {
    
    //такого клиента не существует
    $quick_button = '<div class="quick_button_div"><a href="http://' . $_SERVER['SERVER_NAME'] . '/os/?page=clients&section=clients_list" id="" class="button ">Показать всех</a></div>';
    include ('./skins/tpl/clients/client_folder/client_card/default.tpl');
} 
else {
    
    // получаем рейтинг компании
    $clientRating = Client::get_reiting($client_id, $client['rate']);
    // echo $client_id;
    // получаем реквизиты компании
    $requisites = Client::get_requisites($client_id);
    
    // кураторы
    $manager_names_arr = Client::get_relate_managers($client_id);
    $manager_names = '';
    
    foreach ($manager_names_arr as $men_id => $value) {
        $del = (isset($_GET['client_edit']))?'<span class="del_curator">X</span>':'';
        $manager_names.= '<span class="add_del_curator curator_names" data-id="' . $value['id'] . '"><span>' . $value['name'] . ' ' . $value['last_name'] . '</span>'.$del.'</span>';
    }    
    $manager_names.= (isset($_GET['client_edit']))?'<span class="add_del_curator" id="add_curator"> + </span>':'';
    


    $contact_faces_contacts = Client::cont_faces($client_id);
    
    $client_address = Client::get_addres($client_id);
    
    $edit_show = (isset($_GET['client_edit'])) ? 'admin_' : '';