<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;
}
.tabSelected{background-color: #ccc;}
</style>
<script type="text/javascript">
 function setSelected(obj)
 {
   $('li').removeClass('tabSelected');
   $(obj).addClass('tabSelected');
 }
</script>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<h1>Work Indent Approval</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.parent_id WHERE M.company_id='".$_SESSION['ACGCompanyId']."' ORDER BY C.sr_no";
    
    
      $purchase_approval=DB_query("SELECT M.id AS mainID,M.app_req,C.approval_name,C.id AS childID,C.approval_by
       FROM conf_work_indent AS M INNER JOIN conf_work_indent_details AS C ON M.id=C.parent_id 
       WHERE M.company_id='".$_SESSION['ACGCompanyId']."' AND M.site='COE' ORDER BY C.seq_no ASC",$db);
      
      $i=0;  $totalCount=0;
      if(DB_num_rows($purchase_approval)>0){
      while($purchase_result=DB_fetch_array($purchase_approval)){
         $totalCount++;
        $Headlist=explode(",",$purchase_result['approval_by']);
        
        if($_SESSION['UserType']=='SuperAdmin')
         {
         $flag=0;   
        }
        else
        {
         $flag=1;
        }
        if(in_array($_SESSION['UserID'],$Headlist) || $flag==0 )
        {
      //print_r($Headlist);
        ?>
	<li><a  href="index.php?route=ToolPlants/work_indent_approval&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&tab=<?php echo $i;?>&type=ToolPlants/work_indent_approval_head&id=<?php echo $purchase_result['childID'];?>"><?php echo $purchase_result['approval_name']?></a></li>
        <?php $i++;
         }
      }

     }?>
      <div style="clear:both;"></div>
	</ul>
	</div>
	<!--End of Inside tab-->
</div>
<div style="height:3px;"></div>

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

	<?php  
  //include("pr_head_approval.php");
        if($_REQUEST['tab']!='')
	{
	include("work_indent_approval_head.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']);
?>
</div>
</div>