<? global $vis_language; 
$status_array= array(1=>$vis_language['TXTSUCCESS'],2=>$vis_language['TXTMAILQUEUENOTEXIST'],3=>$vis_language['TXTCLIENTEMAILNOTVERIFIED'],4=>$vis_language['TXTREGISTRATIONREQUIRED'],5=>$vis_language['TXTCONTACTACCESS'],6=>$vis_language['TXTCLIENTREGISTRATIONERROR'],7=>$vis_language['TXTBANCLIENT'],8=>$vis_language['TXTAPPROVALPENDING'],9=>$vis_language['TXTIGNOREEMAIL'],10=>$vis_language['TXTSTAFFACCESS'],11=>$vis_language['TXTTICKETCREATIONERROR']);
if($parserlog_details==-1){   
	include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	echo '<script> $("#view_action").hide(); $("#vis_parserlog_form .panel-footer").hide(); $("#vis_parserlog_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_parserlog_form .panel-footer").show(); $("#vis_parserlog_list").show(); </script>
 <table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
               <thead class="table_head">		   
                  <tr>
                     <th>
                        <div class="btn-group">
                           <label class="checkbox m-n m-r-sm i-checks"  style="float: left;"><input type="checkbox"><i></i></label>		
                        </div>
                     </th>
                     <th class="txt_nowrap"><? echo $vis_language['TXTSUBJECT']; ?></th>
                     <th class="txt_nowrap"><? echo $vis_language['TXTFROM']; ?></th>
                     <th class="txt_nowrap"><? echo $vis_language['TXTTO']; ?></th>
                     <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>					 
                     <th class="txt_nowrap"><? echo $vis_language['TXTDATE']; ?></th>
                  </tr>
               </thead>		   
               <tbody>
                  <?
                      if($parserlog_details!=-1) for($i=0;$i<count($parserlog_details);$i++) {
						if($parserlog_details[$i]['status']!=1){ 
						 $status = $vis_language['TXTFAILED'];$lbl='label-default';}else if($parserlog_details[$i]['ticket_id'] == NULL){$status = $vis_language['TXTFAILED'];$lbl='label-default';}else {$status = $vis_language['TXTSUCCESS'];$lbl='vh-green-bg';}  
						 $vis_title = (($parserlog_details[$i]['ticket_id'] == NULL || $parserlog_details[$i]['ticket_id'] == 0) && $parserlog_details[$i]['status']==1)?$status_array[11]:$status_array[$parserlog_details[$i]['status']];
                         echo '<tr><td width="30" id="checkbox_data"><label class="checkbox m-n i-checks"><input type="checkbox" name="vis_global_mass_chk_'.$i.'" id="vis_global_mass_chk_'.$i.'" value="'.$parserlog_details[$i]['parserlog_id'].'" /><i></i></label></td>';
						 echo '<td><a href="#/setting/parserlog_details/'.$vis_language['MSGPARSERDETAILS'].'/'.$parserlog_details[$i]['parserlog_id'].'">'.stripslashes($parserlog_details[$i]['subject']).'</a></td>';
                         echo '<td><a href="#/setting/parserlog_details/'.$vis_language['MSGPARSERDETAILS'].'/'.$parserlog_details[$i]['parserlog_id'].'">'.htmlentities($parserlog_details[$i]['from_email']).'</a></td>';
                         echo '<td><a href="#/setting/parserlog_details/'.$vis_language['MSGPARSERDETAILS'].'/'.$parserlog_details[$i]['parserlog_id'].'">'.htmlentities($parserlog_details[$i]['to_email']).'</a></td>';
                         echo '<td><span class="label '.$lbl.'" title="'.$vis_title.'">'.$status.'</span></td>';
						 echo '<td class="txt_nowrap"><a href="#/setting/parserlog_details/'.$vis_language['MSGPARSERDETAILS'].'/'.$parserlog_details[$i]['parserlog_id'].'">'.format_datetime($parserlog_details[$i]['entry_date']).'</a></td></tr>';
                     } ?>
               </tbody>
            </table><? } ?>
<script type="text/javascript">
	$(".selectpicker").selectpicker();
   $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({
   	 "bPaginate" : false,				
          "paginate": false,
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   			{ "bSortable": false },
   		  	null,
   		  	null,
   		  	null,
   		  	null,												
   		  	null
   		]
   	});
   });
</script>
