<?php 
ob_start();
$PageSecurity = 4;
include('includes/session.inc');
include('includes/function_lib.php');
$data='';
if($_REQUEST['num']!=''){
$data='<table cellpadding="0" cellspacing="0" width="100%" margin-top="0"><tr class="row1"><td class="tabledata">Sequence Number</td><td class="tabledata">Approval Name</td><td class="tabledata">From Range</td><td class="tabledata">To Range</td><td class="tabledata">Approval By</td></tr>';
for($i=0;$i<$_REQUEST['num'];$i++)
{ 
    $k=$i+1;
     $data.='<tr class="row1"><td class="tabledata1"><input type="text" value='.$k.' name=sequence['.$i.'] size="5" readonly="true"></td>
                 <td class="tabledata1"><input type="text" name="approval_name['.$i.']"></td>
                     <td class="tabledata1"><input type="text" name="from_range['.$i.']"></td>
                         <td class="tabledata1"><input type="text" name="to_range['.$i.']"></td>
                     <td class="tabledata1"><select style="width:180px;" name="approved_by['.$i.'][]" multiple>';
                  $UserName=DB_query("SELECT * FROM www_users WHERE companyid='".$_SESSION['ACGCompanyId']."'",$db);
                   while($UserRow=DB_fetch_array($UserName))
			{ 
                   $data.= '<option style="font-size:11px;" value="'.$UserRow['id'].'">'.$UserRow['realname'].'</option>';
                    }
                '</select></td>
                </tr>';
} ?>
<?php  $data.='<tr><td><input type="submit" name="po_approval" value="Save" class="search" /></td></tr></table>'; 
}
echo $data;
?>