<style type="text/css">
.new_tab .inside_tab {
    background-image: url("../../images/tab_1_img.jpg");
    background-repeat: repeat-x;
    height: 32px;
    margin-left: 2px;
    margin-right: 2px;
    margin-top: 2px;
    padding: 0;
}
.inside_tab ul {
    list-style-type: none;
    margin: 0;
    padding-bottom: 5px;
    padding-left: 5px;
    padding-top: 4px;
}
.inside_tab li {
    float: left;
    margin: 0;
    padding: 0;
}
.inside_tab ul a {
    background-image: url("../../images/tab_2_img.jpg");
    background-repeat: repeat-x;
    border: 1px solid #666666;
    color: #000000;
    display: block;
    margin: 0 1px 0 0;
    padding: 3px 10px 4px;
    text-decoration: none;
}
.inside_tab ul a:hover {
    background-image: url("../../images/tab_2_img_hover.jpg");
    background-repeat: repeat-x;
    color: #000000;
    display: block;
    margin: 0 1px 0 0;
    padding: 6px 10px;
    text-decoration: none;
}
</style>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1><?php echo $page_title; ?></h1>
<div class="new_tab">
  <!--Inside tab-->
  <div class="inside_tab">
  <ul>
      <?php  
      //echo "SELECT M.id AS mainID,M.no_of_assignee,C.approval_name,C.id AS childID,C.approval_by FROM conf_purch_approval AS M INNER JOIN conf_purch_app_details AS C ON M.id=C.purch_approval_id WHERE M.company_id='".$_SESSION['ACGCompanyId']."' AND M.doc_type='LA' ORDER BY C.seq_no";
      $purchase_approval=DB_query("SELECT M.id AS mainID,M.no_of_assignee,C.approval_name,C.id AS childID,C.approval_by FROM conf_purch_approval AS M INNER JOIN conf_purch_app_details AS C ON M.id=C.purch_approval_id WHERE M.company_id='".$_SESSION['ACGCompanyId']."' AND M.doc_type='AA' ORDER BY C.seq_no",$db);
   //echo "SELECT M.id AS mainID,M.no_of_assignee,C.approval_name,C.id AS childID,C.approval_by FROM conf_purch_approval AS M INNER JOIN conf_purch_app_details AS C ON M.id=C.purch_approval_id WHERE M.company_id='".$_SESSION['ACGCompanyId']."' AND M.doc_type='AA' ORDER BY C.seq_no";
      $i=0;
      if(DB_num_rows($purchase_approval)>0){
      while($purchase_result=DB_fetch_array($purchase_approval)){
        $Headlist=explode(",",$purchase_result['approval_by']);
       
        if($_SESSION['UserType']=='SuperAdmin')
         {
         $flag=0;   
        }
        else
        {
         $flag=1;
        }
        if(in_array($_SESSION['UserID'],$Headlist) || $flag==0 )
        {
     
        ?>
  <li><a href="index.php?route=HRModule/Master/monthly_attandance_justification_add&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&tab=<?php echo $i;?>&type=HRModule/Master/AttandanceApproval&id=<?php echo $purchase_result['childID'];?>"><?php echo $purchase_result['approval_name']?></a></li>
        <?php }
     $i++; }
     }else{
      ?>
      
      
      <?php }?>
                <div style="clear:both;"></div>
  </ul>
  </div>
  <!--End of Inside tab-->
</div>
<div style="height:3px;"></div>

<div style="width:100%; ">
      

  <?php
    
        if($_REQUEST['tab']!='')
  {
   
  include("AttandanceApproval.php");
  }
//        
//  if($_REQUEST['tab']=='')
//  {
//  include("pend_issued_index.php");
//  }
  ?>
</div>
<?php if(isset($_SESSION['success_msg']))
{ ?>
  <script> alert("<?php echo ($_SESSION['success_msg']);?>");</script>
<?php 
} unset($_SESSION['success_msg']);
?>
<script>
    
// $.noConflict();
// $(function() {
// $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' ,changeMonth: true,
//     changeYear: true,
//     yearRange: '-80:+20'});
// });
</script>
</div>
</div>