<?php

include_once("c_client_setting.php");
class c_page_cab_client_setting_tech extends c_page_cab_client_setting
{
    public $h1='Дополнительные параметры' ;

    function block_main()
    { $this->page_title() ;
      $this->panel_tech_edit() ;
    }

    function panel_tech_edit()
       {   ?><div id="panel_client_edit"><form enctype="multipart/form-data">
             <table class="info">
               <tr><td>URL для PUSH:</td><td><input type="text" name="member_edit[ext_info][url_push]" class="big" value="<?echo htmlspecialchars(MEMBER()->info['_ext_info']['url_push'])?>"></td></tr>
               <tr><td>логин для BASIC-авторизации:</td><td><input type="text" name="member_edit[ext_info][basic_login]" class="big" value="<?echo htmlspecialchars(MEMBER()->info['_ext_info']['basic_login'])?>"></td></tr>
               <tr><td>пароль для BASIC-авторизации:</td><td><input type="hidden" name="member_edit[ext_info][basic_pass]" class="big" value="<?echo htmlspecialchars(MEMBER()->info['_ext_info']['basic_pass'])?>"></td></tr>
               <tr><td>Отправлять на PUSH события МО</td><td>
                       <select name="member_edit[ext_info][send_to_push_event_mo]">
                           <option value="0" <?if (MEMBER()->info['_ext_info']['send_to_push_event_mo']==0) echo 'selected'?>>Нет</option>
                           <option value="1" <?if (MEMBER()->info['_ext_info']['send_to_push_event_mo']==1) echo 'selected'?>>Базовый пакет</option>
                           <option value="2" <?if (MEMBER()->info['_ext_info']['send_to_push_event_mo']==2) echo 'selected'?>>Детальный пакет</option>
                       </select>
                    </td>
               </tr>
               <tr><td></td><td><input type="submit" class=v1 cmd="save_member" value="Сохранить" validate="form"></td></tr>
             </table></form>
             </div>
           <?
           //damp_array(MEMBER()->info,1,-1) ;
       }

       function CMD_save_member()
          { $res=ACCOUNTS()->member_save(MEMBER()->id,$_POST['member_edit']) ;
            if (!$res) echo '<div class="red">Изменений не обнаружено</div>' ;
            else echo '<div class="green">Данные сохранены</div>' ;
            ACCOUNTS()->update_member_info(MEMBER()) ; // данные аккаунта будут заново прочитаны из базу
          }

}



?>