<? global $vis_language; ?>
<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 ></th>
         <th ><? echo $vis_language['TXTTITLE']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTQUESTTYPE']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTSTAFFGROUP']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTSTARTDATE']; ?></th>
         <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
         <th></th>
         <th></th>
      </tr>
   </thead>
   <tbody>
      <?
         if($quest_details!=-1) for($i=0;$i<count($quest_details);$i++) 
         {
			  if($quest_details[$i]['quest_type'] == 1)$quest_type = $vis_language['TXTRESOLVINGTYPE']; 
			  else if($quest_details[$i]['quest_type'] == 2)$quest_type = $vis_language['TXTSELFHELFARTICLE'];
             if($quest_details[$i]['quest_status']==1){ $status = $vis_language['TXTENABLED'];$lbl='vh-green-bg';} else {$status = $vis_language['TXTDISABLED'];$lbl='label-default';}
             echo '<tr><td width="30"><label class="checkbox m-n i-checks"><input type="checkbox" name="vis_global_mass_chk_'.$i.'" id="vis_global_mass_chk_'.$i.'" value="'.$quest_details[$i]['quest_id'].'" /><i></i></label></td>';
             echo '<td width="50"><a href="#/setting/quest_details/'.str_replace('/', ' ', $quest_details[$i]['quest_title']).'/'.$quest_details[$i]['quest_id'].'"><div class="'.$quest_details[$i]['image_path'].'"></div></a></td>';
             echo '<td><a href="#/setting/quest_details/'.str_replace('/', ' ', $quest_details[$i]['quest_title']).'/'.$quest_details[$i]['quest_id'].'">'.$quest_details[$i]['quest_title'].'</a></td>';
              echo '<td><a href="#/setting/quest_details/'.str_replace('/', ' ', $quest_details[$i]['quest_title']).'/'.$quest_details[$i]['quest_id'].'">'.$quest_type.'</a></td>'; ?>
             
            <td>
                <div class="<?php if(count($quest_details[$i]['staff_group_name'])>5) echo 'dept_access'; ?>"><a href="#/setting/quest_details/<? echo str_replace('/', ' ', $quest_details[$i]['quest_title']) ;?>/<?php echo $quest_details[$i]['quest_id']; ?>">
                   <? if($quest_details[$i]['staff_group_name']!= -1) 
                    {
                       for($j=0;$j<count($quest_details[$i]['staff_group_name']);$j++) {
                          echo $quest_details[$i]['staff_group_name'][$j]['group_name'].'<br />';
                       } 
                   } ?></a>
                </div>
             </td>
            <? echo '<td><a href="#/setting/quest_details/'.str_replace('/', ' ', $quest_details[$i]['quest_title']).'/'.$quest_details[$i]['quest_id'].'">'.format_datetime($quest_details[$i]['quest_start_date']).'</a></td>';
             echo '<td><span class="label '.$lbl.'">'.$status.'</span></td>';
             echo '<td align="right"><a class="link" href="#/setting/clone_quest/'.$quest_details[$i]['quest_id'].'">'.$vis_language['TXTCLONE'].'</a></td>';
        ?>
      <td align="center"> <a class="text-muted" data-toggle="ajaxModal" data-modal-arguments="vis_module=setting&vis_operation=get_quest_delete&vis_quest_id=<? echo $quest_details[$i]['quest_id']; ?>&vis_static_area=vis_quest_delete_form&vis_page=<? echo $quest_info['page']; ?>"  title="<? echo $vis_language['TXTDELETE']; ?>" href="javascript:void(0);"><i class="vh vh-delete-round"></a></td>
        <?                                                                                                                          
         echo '</tr>';
        }
        ?>
   </tbody>
</table>
<script type="text/javascript">
   $(".selectpicker").selectpicker();
   $(document).ready(function() {    
   $('[data-ride="datatables"]').dataTable({        
           "bPaginate" : false,
           "sDom": 't', "bAutoWidth": false,
           "aoColumns": [
               { "bSortable": false },
               { "bSortable": false },
                 null,
                 null,  
                  null,  
                 null,
                 null, 
                 { "bSortable": false },
               { "bSortable": false }
           ]
       });
   });
</script>

