<?php
if($_REQUEST['Save'])
  {

 for($i=0;$i<count($_REQUEST['titlename']);$i++)
 {
  if($_REQUEST['titlename'][$i]!='')
   {
   $data['serial_no'] =($i+1); 
   $data['title_code']=$_REQUEST['titleCode'][$i]; 
   $data['title_name']=$_REQUEST['titlename'][$i]; 
   $data['companyId']=$_SESSION['ACGCompanyId'];
   $data['created_by']=$_SESSION['UserID'];   
   $data['created_date']=date('Y-d-y');
   $s->RecordInsert('tbl_title_master', $data);
   }
  
 }	
	$s->pageLocation("index.php?route=ToolPlants/fixed_assets/sub_asset_title_master_index".$rurl);
}

?>


<div style="display:none" id="div_id">
</div>
<link rel="stylesheet" href="css/new_mxerp1.css">

<div class="body_contain">
<div class="tab_div">
<form action="" method="post">
<table width="100%" border="1" cellspacing="3" cellpadding="3" align="center">
  <tr class="row1">
    <td colspan="3" class="tabledata1"><h1><?php echo $s->GetFieldValue("modules_form","id='".$_REQUEST['frmid']."' and moduleid='".$_REQUEST['modid']."'","frm_name"); ?></h1></td>
  </tr>  
  <tr class="row1">  
    <td class="tabledata1">&nbsp;</td> 		
    <td class="tabledata1"><strong>No Of Title Required</strong><font color="#FF0000">*</font></td>
    <td class="tabledata1" ><input type="text" name="box_required" id="description" style="width:256px;" 
    	value="<?php echo $description; ?>" onkeyup="showtabledata(this.value)" ></td>    
   </tr>
   <tr class="row1">   
   <td  colspan="3" class="tabledata1" id="boxdata">
    <table width="100%" border="1" cellspacing="3" cellpadding="3" align="center">
     <tr>
     <td class="tabledata" style="color:blue;" colspan="3">Title Details</td> </tr>
     <td>Sr. No.</td>
     <td>Title Code</td>
     <td>Title Description</td>  
   <tr>
       <td>1.</td>
       <td><input type="text" name="titleCode[]" value="" style="width:145px" placeholder="Title"/></td>  
        <td><input type="text" name="titlename[]" value="" style="width:245px" placeholder="Title Description"/></td>
     
   </tr> 
    </table></td>
   
   </tr>
    
    </table>
    
    
   </td>
	   
  </tr>
     
  <tr class="row1">
    
    <td colspan="4" style="text-align:center"> 
	
      <input type="submit" name="Save" value="Save" class="search" >    </td>
  </tr>
</table>
</form>
</div></div>

<script>
 function showtabledata(i)
 {


 if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{		
			document.getElementById("boxdata").innerHTML=xmlhttp.responseText;
		
	}
	}
	xmlhttp.open("GET","ajax_dynamic_box_creation_title.php?str="+i,true);
	xmlhttp.send();
  }

 
 
  

</script> 

