<?php
include_once("c_events_docs_card_db.php");
class c_page_cab_events_docs_card_check extends c_page_cab_events_docs_card_db
{
  public $h1='Проверка мероприятия по учету документов' ;

  function block_main()
  { $this->page_title('Проверка мероприятия по учету документов') ;
    $stats=execSQL('select t2.status,t1.source_obj,count(t1.pkey) as cnt 
				    from obj_site_docs t1
                    left join obj_site_scan t2 on t2.doc_id=t1.pkey 
				    where t1.report_code="'.$this->rec_event['doc_code'].'" and t1.sign_data>0 
				    group by t2.status,t1.source_obj') ;

    ?><table class="basic fz_small"><tr><th>Документ зарегистрирован в мероприятии</th><th>Скан документа</th><th>Число документов</th></tr><?
    if (_sizeof($stats)) foreach($stats as $rec)
    {  ?><tr><td><? echo ($rec['source_obj'])? 'Да':'-' ;?></td>
             <td><? echo (!$rec['status'])? '-':$_SESSION['ARR_status_scan'][$rec['status']] ;?></td>
             <td><? echo $rec['cnt']?></td>
         </tr><?
    }
	  ?></table><?
  /*
    $stats=execSQL('select t1.*,t2.pkey as scan_id,t2.status as scan_status 
				    from obj_site_docs t1
                    left join obj_site_scan t2 on t2.doc_id=t1.pkey 
				    where t1.report_code="'.$this->rec_event['doc_code'].'" and t1.sign_data>0 
				    order by t1.pkey desc 
				    limit 100',2) ;
    */
  }


}



?>
