<?php
include_once("c_debug.php");
class c_page_cab_debug_log_mo extends c_page_cab_debug
{
  public $h1='Лог событий' ;

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

 function panel_log_mo()
 {
     ?><div id=panel_search_member class="float_left">
              <form>
                   <span class="title">Текст в результате,операции:</span>
                   <input type="text" name="text"><input type="submit" class="v2 fa fa-search" cmd="aspmo_debug/set_filter_debug_log" value="Искать" validate="form">&nbsp;&nbsp;&nbsp;
                   <span class="title">Операция:</span>
                   <select name="req_cmd" class="v2" cmd="aspmo_debug/set_filter_debug_log"><option value=""></option>
                           <? $recs=execSQL_line('select distinct(obj_name) from '.ENGINE()->table_mo_log.' where obj_name!="" order by obj_name') ;
                             if (_sizeof($recs)) foreach($recs as $value) {?><option value="<?echo $value?>" <?if ($_SESSION['filter']['debug']['cmd']==$value) echo 'selected'?>><?echo $value?></option><?}?>
                   </select>&nbsp;&nbsp;&nbsp;
                   <span class="title">Терминал:</span>
                   <select name="terminal_id" class="v2" cmd="aspmo_debug/set_filter_debug_log"><option value=""></option>
                           <? $recs=execSQL_line('select distinct(terminal_id) from '.ENGINE()->table_mo_log.' where terminal_id!="" order by terminal_id') ;
                             if (_sizeof($recs)) foreach($recs as $value) {?><option value="<?echo $value?>" <?if ($_SESSION['filter']['debug']['terminal_id']==$value) echo 'selected'?>><?echo $value?></option><?}?>
                   </select>&nbsp;&nbsp;&nbsp;
                  <span class="title">Персонал:</span>
                    <select name="member_id" class="v2" cmd="aspmo_debug/set_filter_debug_log"><option value=""></option>
                            <? $recs=execSQL_line('select distinct(member_id) from '.ENGINE()->table_mo_log.' where member_id!="" order by member_id') ;
                               if (_sizeof($recs)) $recs_personal=execSQL_row('select pkey,obj_name from '.ACCOUNTS()->table_account.' where pkey in ('.implode(',',$recs).') order by obj_name') ;
                              if (_sizeof($recs_personal)) foreach($recs_personal as $id=>$value) {?><option value="<?echo $id?>" <?if ($_SESSION['filter']['debug']['personal_id']==$value) echo 'selected'?>><?echo $value?></option><?}?>
                    </select>&nbsp;&nbsp;&nbsp;

              </form>
           </div><br><br><?
   ?><div id="panel_log"><?
   $list_log=LOGS()->get_log_events() ;
   if (_sizeof($list_log)) print_template($list_log,'aspmo_debug/list_logs_events') ;
   ?></div><?
 }

}



?>
