<link rel="stylesheet" href="css/new_mxerp_contentstable.css">

<div class="body_contain">
<div class="tab_div">
<!--<h1 style="font-size:16px;"><?php //echo $s->getField('modules','id',$modid,'modulename')?></h1>-->
<?php 
$modid=$_REQUEST['modid'];
$formarray=array();
$formarray1=array();

         $sql_form=DB_query("select frm_moduleid from  company_profile where 
					 roll_id='".$_SESSION['ACGRoleId']."'",$db);
					while($roledata=DB_fetch_array($sql_form))
					{
					$formarray[]=$roledata['frm_moduleid'];
					}
					//print_r($formarray);
                                        //if($formarray!='')
					$selected_moduleid=implode("','",$formarray); //moduleid='".$_REQUEST['modid']."'  and					
					
              $sql_form1=DB_query("SELECT module_form_category_id FROM modules_form where id in('".$selected_moduleid."')
			                    and   moduleid=$modid",$db);
					while($roledata1=DB_fetch_array($sql_form1))
					{
					$formarray1[]=$roledata1['module_form_category_id'];
					}
					//print_r($formarray);
                                       // if($formarray1!='')
					$selected_moduleid1=implode("','",$formarray1);

 $categories="Select * from module_form_categories where module_id=$modid and id in('".$selected_moduleid1."') and status='Y' order by sequence ASC";
$categories_res=DB_query($categories,$db);
$colspan=DB_num_rows($categories_res);
?>

<table width="100%" border="0" cellpadding="3" cellspacing="0" class="tab-bg">
<tr>
 <td style="font-size:14px; text-align:center;" valign="top">
   <div id="tab-cont">    
      <div class="modwrapper">          
         <div id="modchild"> 
            <?php if(DB_num_rows($categories_res)==0){ ?>
            <div style="padding:10px; text-align:center;">No Permission Found.</div>
            <?php } ?>
            <?php 
            while($category_row=DB_fetch_array($categories_res)){
            ?>
                    <div class="modchildin">
                    <h2><?php echo $category_row['cat_desc'];?></h2>                           
                        <ul>
                            <?php   
                               $forms="Select * from modules_form where  moduleid=$modid and id in('".$selected_moduleid."') and module_form_category_id='".$category_row['id']."' and status='Y' order by sequence ASC";
                              $forms_result=DB_query($forms,$db);
                              while($forms_row=DB_fetch_array($forms_result))
                              {                                
                            ?>
                            <li><a href="index.php?route=<?php echo $forms_row['frm_url'];?>&modid=<?php echo $modid;?>&frmid=<?php echo $forms_row['id']; ?>" class="tablelink"><?php echo $forms_row['frm_name'];?></a></li>
                            <?php }?>
                        </ul>
                    </div>
 <?php }?>
           </div>       
        </div>	
  </div>
  <div class="wrapbody">
    <?php echo $content_for_layout; ?>
  </div>
	</td>  
  </tr>
</table>

</div>
</div>
<style type="text/css">
    #tab-cont{ background-color: #fbfae3; border: none; margin: 0; width: 100%; }
    .modwrapper, #modchild{width:100%; height:auto; float:left;}
    /*.modwrapper{margin-bottom:10px;}*/
    .modchildin{margin-bottom:10px;}
    .modwrapper{border:rgba(149,199,250,0.6) 1px solid; background-color: rgba(149,199,250,0.2);}
    .modwrapper h1, #modchild h2{
        background-color: rgba(149,199,250,0.4);
    border-bottom: 1px solid #1362a5;
    border-radius:0;
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
    margin: 0 0 8px;
    padding: 5px 10px;
}
#modchild{background-color: rgba(255,255,255,1.0); border:rgba(149,199,250,0.2) 1px solid; padding:3px;}
.modchildin{width:18%; height:auto; float:left; margin:3px; min-height: 150px; border: 1px solid rgba(92, 156, 221, 0.5);}
#modchild h2{/*padding:2px 6px; font-size: 14px; font-weight: 400; border-bottom: 1px solid rgba(19,98,165,0.5); background-color: rgba(149,199,250,0.2);*/ background-color: rgba(11, 126, 242, 0.2);
    border-bottom: 1px solid #5c9cdd;
    font-size: 12px;
    font-weight: bold;
    line-height:30px;
    text-align: center; margin: 0; text-transform: uppercase;}
#modchild ul{list-style: none; margin:0; padding: 0;}
#modchild ul li{display: block; position: relative;/* padding:2px 10px 2px 15px;*/ border-bottom: 1px solid #5c9cdd; padding:1px;}
#modchild ul li:last-child{border-bottom:0;}
#modchild ul li a{display: block; position: relative; padding:2px 6px; line-height: 20px; color: #242424;}
#modchild ul li:before{content: '';}
/*#modchild ul li:before{position: absolute; top:1px; left:3px; font-family:"FontAwesome"; content:'\f0da'; font-size: 13px; color: #718fa8;}
#modchild ul li:first-child:before{content:'\f0da';}*/
#modchild ul li a:hover{ background-color: #bad9f9; text-decoration: none;}
#modchild a.child-active{
  color: #0b8b38; font-weight:bold;
}
#tab-cont{ min-height: auto;}
</style>
