<? global $vis_language; 
if($articles==-1){
	echo '<script>$("#paging").hide();$("footer").hide();$("#vis_article_list").prev().hide();</script>';
	$operation['no_record']=1;
	include(VIS_PATH_TEMPLATE.'no_record_yet.php');
	//echo '<script> $("#view_action").hide(); $("#vis_article_search_form .panel-footer").hide(); $("#vis_article_list").hide(); $(".fullFrame").removeClass("b-t").addClass("m-t-lg m-b-lg"); </script>';
 } else { ?>
<script> $("#view_action").show(); $("#vis_article_search_form .panel-footer").show(); $("#vis_article_list").show();$("#paging").show();$("footer").show();$("#vis_article_list").prev().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><? echo $vis_language['TXTARTICLE']; ?></th>
                     <th class="txt_nowrap"><? echo $vis_language['TXTAUTHOR']; ?></th>
                     <th class="txt_nowrap"><? echo $vis_language['TXTCATEGORY']; ?></th>
                     <th class="txt_nowrap"><? echo $vis_language['TXTDOMAIN']; ?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTPOSTON']; ?></th>
					 <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
					 <th><? echo $vis_language['TXTRATING']; ?></th>
					 <th></th>
      <th></th>
                  </tr>
               </thead>
               <tbody>
                  <?
				  
                     if($articles!=-1) for($i=0;$i<count($articles);$i++) {
						 if(strlen($articles[$i]['article_title'])>35)
						 {
							 $selfhelp_title = substr($articles[$i]['article_title'], 0, 35);
							 $selfhelp_title.='...';
						 }
						 else $selfhelp_title=$articles[$i]['article_title'];
						 if($articles[$i]['is_enabled']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} else {$status = $vis_language['TXTDISABLED'];$lbl='label-default';}
                         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="'.$articles[$i]['article_id'].'" /><i></i></label></td><td ><a id="test" href="#/selfhelp/view_article/'.addslashes(str_replace(array('"', "'", '/', '\\'), '',$articles[$i]['article_url'])).'/'.$articles[$i]['article_id'].'">'.$selfhelp_title.'</a></td>';
                         echo '<td><a href="#/selfhelp/view_article/'.$articles[$i]['article_url'].'/'.$articles[$i]['article_id'].'">'.$articles[$i]['author_name'].'</a></td>';
                         echo '<td class="txt_nowrap"><a href="#/selfhelp/view_article/'.$articles[$i]['article_url'].'/'.$articles[$i]['article_id'].'">'.$articles[$i]['selfhelp_title'].'</a></td>';
						 echo '<td class="txt_nowrap"><a href="#/selfhelp/view_article/'.$articles[$i]['article_url'].'/'.$articles[$i]['article_id'].'">'.$articles[$i]['domain_name'].'</a></td>';
						 echo '<td class="txt_nowrap"><a href="#/selfhelp/view_article/'.$articles[$i]['article_url'].'/'.$articles[$i]['article_id'].'">'.format_datetime($articles[$i]['entry_date']).'</a></td>';
						 echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>';
						?> <td>
						 <div>
       <span>
       <span title="Like"><i class="vh vh-thumbs-up fsize-18"></i> (<? echo $articles[$i]['art_likes']; ?>)&nbsp;&nbsp;</span>
       <span title="Unlike"><i class="vh vh-thumbs-up fsize-18 vh-rotate-180"></i> (<? echo abs($articles[$i]['art_likes'] - $articles[$i]['like_count']); ?>)</span>
       </span>
							  
						  </div>
						</td>
      <td align="center"><a class="link" data-toggle="ajaxModal" data-modal-arguments="vis_module=selfhelp&vis_operation=clone_article&vis_article_id=<? echo $articles[$i]['article_id']; ?>&vis_category_id=<? echo $articles[$i]['parent_id']; ?>&vis_domain_id=<? echo $articles[$i]['domain_id']; ?>" title="<? echo $vis_language['TXTCLONE']; ?>" href="javascript:void(0);" ><? echo $vis_language['TXTCLONE']; ?></a></td>	
      
					  <td align="center">
						 <a class="text-muted" href="javascript:void(0);"  data-toggle="ajaxModal" data-modal-arguments="vis_module=selfhelp&vis_operation=confirm_delete&vis_static_area=vis_article_delete1_area&vis_area=1&vis_article_id=<? echo $articles[$i]['article_id']; ?>&vis_form=vis_<?php echo $operation['vis_operation']; ?>_form&vis_page=<? echo $articles_info['page']; ?>" title="<? echo $vis_language['TXTDELETE']; ?>"><i class="vh vh-delete-round"></i></a>
					  </td>
						</tr>
                    <? } ?>
               </tbody>
            </table> <? } ?>
<script type="text/javascript">
  $(document).ready(function() {
   $('[data-ride="datatables"]').dataTable({
   	 "bPaginate" : false,
          "paginate": false,
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   			{ "bSortable": false },
   		  	null,
   		  	null,
   		  	null,
   		  	null,
   		  	null,
   		  	null,
			{ "bSortable": false },
   		  	{ "bSortable": false },
   		  	{ "bSortable": false },
   		]
   	});
   });
</script>



