<? global $vis_language; 
$paging_list='';
   for($i=0;$i<$view_info['page_count'];$i++) $paging_list.='<option value="'.$i.'" '.(($attach_info['page']==$i)?'selected="selected"':'').'>'.($i+1).'</option>'; 
	if($attach_details==-1){   
		include(VIS_PATH_TEMPLATE.'no_record_yet.php'); 
	} else { ?>   
<div id="<?= $operation['section'];?>" class="tab-pane active">
<div class="wrapper">
 <form name="vis_<?php echo $operation['vis_operation']; ?>_form" id="vis_<?php echo $operation['vis_operation']; ?>_form">
   	<div class="row wrapper " id="view_action">
            <div  class="col-sm-12 text-right text-center-xs pull-right" id="paging">
               <select name="pageing" id="paging" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_details_list').visExecution('load_area',{'vis_module':'<?php echo $operation['vis_current_module']; ?>', 'vis_operation':'<?php echo $operation['vis_current_operation']; ?>', 'vis_page':this.value, 'vis_assets_id':'<?php echo $operation['vis_assets_id']; ?>'})">
               <? echo $paging_list;?>
               </select>
               <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
            </div>
         </div>
  <div class="row">
  <table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
   <thead class="table_head">
      <tr>
       <?  if($operation['section']=='ticket'){?>
             <th class="txt_nowrap"><? echo $vis_language['TXTTICKETHASH']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTTICKETTYPE']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTDEPARTMENT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTPRIORITY']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
       <?  }elseif($operation['section']=='changes'){?> 
             <th class="txt_nowrap"><? echo $vis_language['TXTCHANGEHASH']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTTYPE']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTDEPARTMENT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTIMPACT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTPRIORITY']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
       <?  }elseif($operation['section']=='problems'){?>              
             <th class="txt_nowrap"><? echo $vis_language['TXTPROBLEMHASH']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTDEPARTMENT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTIMPACT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTPRIORITY']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
        <?  }elseif($operation['section']=='contract'){?>              
             <th class="txt_nowrap"><? echo $vis_language['TXTCONTRACT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTTYPE']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTCONTRACTNUMBER']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTDEPARTMENT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
      <?  }elseif($operation['section']=='release'){ ?>              
             <th class="txt_nowrap"><? echo $vis_language['TXTRELEASE']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTTYPE']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTDEPARTMENT']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTPRIORITY']; ?></th>
             <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
       <?  }?>     
             	 
      
      </tr>
   </thead>
     <tbody>
      <? for($i=0;$i<count($attach_details);$i++) {?>
            <? if($operation['section']=='problems'){?>
               <tr>
                <td><?= $attach_details[$i]['problem_hash'].' : '.ucfirst($attach_details[$i]['subject']);?></td>
                <td><?= $attach_details[$i]['department_name'];?></td>
                <td><?= $attach_details[$i]['impact_name'];?></td>
                <td><?= $attach_details[$i]['priority_name'];?></td>
                <td><?= $attach_details[$i]['status_name'];?></td>
               </tr>
            <? }elseif($operation['section']=='changes'){?>
               <tr>
                <td><?= $attach_details[$i]['changes_hash'].' : '.ucfirst($attach_details[$i]['subject']);?></td>
                <td><?= $attach_details[$i]['type'];?></td>
                <td><?= $attach_details[$i]['department_name'];?></td>
                <td><?= $attach_details[$i]['impact_name'];?></td>
                <td><?= $attach_details[$i]['priority_name'];?></td>
                <td><?= $attach_details[$i]['status_name'];?></td>
               </tr>
            <? }elseif($operation['section']=='ticket'){?> 
               <tr>
                <td><?= $attach_details[$i]['ticket_hash'].' : '.ucfirst($attach_details[$i]['subject']);?></td>
                <td><?= $attach_details[$i]['type'];?></td>
                <td><?= $attach_details[$i]['department_name'];?></td>
                <td><?= $attach_details[$i]['priority_name'];?></td>
                <td><?= $attach_details[$i]['status_name'];?></td>
               </tr>
           <? }elseif($operation['section']=='contract'){?> 
               <tr>
                <td><?= $attach_details[$i]['name']?></td>
                <td><?= $attach_details[$i]['type'];?></td>
                <td><?= $attach_details[$i]['contract_number'];?></td>
                <td><?= $attach_details[$i]['department_name'];?></td>
				<?php if($attach_details[$i]['status']==0){ $status =$vis_language['TXTDRAFT'];$lbl='label-default'; } 
			 else if($attach_details[$i]['status']==1){ $status =$vis_language['TXTPENDING'];$lbl='vh-yellow-bg'; }
			 else if($attach_details[$i]['status']==2) { $status =$vis_language['TXTACTIVE']; $lbl='vh-green-bg';}
			 else if($attach_details[$i]['status']==3){ $status =$vis_language['TXTITILREJECTED']; $lbl='vh-red-bg';} 
			 else if($attach_details[$i]['status']==4){ $status =$vis_language['TXTITILCANCELED']; $lbl='vh-blue-bg';} 
			 else { $status =$vis_language['TXTITILEXPIRED'];$lbl='vh-red-bg';} ?>
                <td><span class="label<?=$lbl?>"><?=$status?></span></td>
               </tr>
            <?  }elseif($operation['section']=='release'){?> 
               <tr>
                <td><?= $attach_details[$i]['release_hash']?></td>
                <td><?= $attach_details[$i]['release_type'];?></td>
                <td><?= $attach_details[$i]['department_name'];?></td>
                <td><?= $attach_details[$i]['priority_name'];?></td>
                <td><?= $attach_details[$i]['status_name'];?></td>
               </tr>
            <? }
         } ?>
      </tbody>
    </table>         
    </div>
      <div class="row wrapper clr" id="view_action">
            <div  class="col-md-12 text-right text-center-xs" id="paging">
               <select name="pageing" id="paging" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_workpanel_div').visExecution('load_area',{'vis_module':'<?php echo $operation['vis_current_module']; ?>', 'vis_operation':'<?php echo $operation['vis_current_operation']; ?>', 'vis_page':this.value})">
               <? echo $paging_list;?>
               </select>
               <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
            </div>
      </div>
   </form>
    </div>
 </div>   
<? } ?>      
 <script type="text/javascript">
  /* $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({		
           "bPaginate" : false,	
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   		  	null,
   		  	null,
   		  	null,
			null,
			{ "bSortable": false }
   		]
   	});
   });*/
</script>
