<?php require_once(APPPATH.'/views/header.php'); ?>
<body>
    <div id="wrapper">
    <?php require_once(APPPATH.'/views/menu_user.php'); ?>
        <div id="page-wrapper">
            <div class="container-fluid">
                <fieldset class="admin-border">
                <fieldset class="scheduler-border">
                <legend class="scheduler-border"><?php echo $title;?> <a href="<?=base_url();?>adm/arhiva/intrare" class="btn btn-success"><i class="fa fa-sign-in"></i> Intrare</a> <a href="<?=base_url();?>adm/arhiva/iesire" class="btn btn-primary"><i class="fa fa-sign-out"></i> Iesire</a></legend>
                
                <div class="row">
                    <div>
                        <table class="table table-condensed" id="list"></table>
                        <div id="gridpager"></div> 
                        <div id="filterToolbar"></div>   
                                
                    </div>
                </div>
                <br/>
            </fieldset>
            </fieldset>
            </div>
        </div>
        <!-- /#page-wrapper -->
    </div>
    <div id="gif" class="modal fade loading-gif">
        <div class="modal-dialog">
            <div>
                <img src="<?=base_url()?>img/loading.gif">
            </div>
        </div>
    </div>
    <!-- /#wrapper -->
    <div id="link_modal_plata" class="modal fade">
       <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                   <h4 class="modal-title"><?='Informatii';?></h4>
               </div>
               <div class="modal-body"> 
                    <a target="_blank" id="a_info" ><span id="info_content"></span></a>
               </div>
               <div class="modal-footer">
                    <a id="trimite_email" class="btn btn-primary">Trimite pe email</a>
                    <button type="button" class="btn btn-default" data-dismiss="modal"><?='Inchide';?></button>
               </div>
            </div>
        </div>
    </div>
<?php require_once(APPPATH.'/views/footer.php'); ?> 
<script>
        $(document).ready(function(){

                jQuery("#list").jqGrid({
                  url:'<?=base_url()."adm/arhiva/loadData"?>',      //another controller function for generating data
                  mtype : "post",             //Ajax request type. It also could be GET
                  datatype: "json",            //supported formats XML, JSON or Arrray
                  colNames:<?=(isset($colNames) && $colNames)? $colNames : '';?>,       //Grid column headings
                  colModel:<?=(isset($colModel) && $colModel)? $colModel : '';?>,
                  rowNum:30,
                  width: null,
                  shrinkToFit: true,
                  autowidth: true,
                  height: null,
                  rowList:[5,10,20,30],
                  pager: '#gridpager',
                  sortname: 'id_document',
                  viewrecords: true,
                  sortorder: 'DESC',
                  rownumbers: true,
                  gridview: true
              }).navGrid('#gridpager',{edit:false,add:false,del:false,excel:true})
              .navButtonAdd('#gridpager',{
                caption:"",
                title:"Search", 
                buttonicon:"ui-icon-search", 
                onClickButton: function(){ 
                    jQuery("#list").jqGrid('searchGrid', 
                        {sopt:['cn','eq','ne'],
                        multipleSearch:true}
                    );
                }, 
                
                position:"center"
             });

             jQuery("#list").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn"});  
             $("#search_list").css('display','none');
    
        });
</script>      
</body>
</html>