<?php use_helper('Object', 'Validation'); ?>

<?php $tbldocuments = $pager->getResult() ?>
<?php echo form_tag('document/insert', array('id'=>'docInsert')) ?>
  <div class="docgroup document">
    <h2>Danh sách các tư liệu của tôi</h2>
    <div style="height:5px"></div>
    <div class="content">
      <?php $baseLink = '/document/create?cat_id=' . $cat_id ?>
      <div class="clear"></div>
      <?php echo showPageNav13($pager, $baseLink.'&createMethod=select', 'main-create') ?>
      <script>
        document.submitInsert = function(doc_id) {
          $('doc_id').value = doc_id;
          $('docInsert').submit();
          return false;
        }
      </script>
      <?php include_component('entry', 'selectfolder'); ?>
      <?php echo input_hidden_tag('doc_id', '') ?>
      <?php echo input_hidden_tag('page', $page) ?>
      <?php echo input_hidden_tag('createMethod', 'select') ?>
      <?php echo form_error('selection') ?>
      <?php foreach ($tbldocuments as $tbldocument): ?>
      	<?php echo $tbldocument->getObject()->getHtmlThumb('javascript:return document.submitInsert('.$tbldocument->getDocId().')') ?>
      <?php endforeach ?>
      <div class="clear"></div>
      <?php echo showPageNav13($pager, $baseLink.'&createMethod=select', 'main-create') ?>
    </div>
  </div>
</form>