<?php $PageSecurity = 2;
include('includes/DefineSuppTransClass.php');
include('includes/DefinePOClass.php');
include('includes/SQL_CommonFunctions.inc');
include('includes/session.inc');
include('includes/function_lib.php');
$type=$_REQUEST['val'];

$data1='';
$data2='';

if($type=='O'){?>
  <tr class="row1">
        <td><input type="checkbox" name="chk"  /></td>  
                <td><input type="hidden" name="userId[]" id="userId" /></td>
        <td><input type="text" name="doc_name[]" id="doc_name"/></td>
                <td><select name="doc_type_mstr_id[]" id="doc_type_mstr_id">
                        <option value="0">--Select Type--</option>
                        <?php
                        $userqry="select * from dms_doc_type_mstr where company_id='".$_SESSION['ACGCompanyId']."'";
                        $userqryExec=DB_query($userqry,$db);
                        while($row=DB_fetch_array($userqryExec))
                        { ?>
                        <option value="<?php echo $row['id']; ?>"><?php echo $row['doc_type_name']; ?></option>
                      <?php  } ?>
                    </select></td>
        <td><input type="file" name="doc_file_name[]" id="docmnt" value="" tabindex="69"/></td>
                <td><select name="cariers[]" id="cariers" style="width:150px;">
                    <?php 
                $carqry="select * from dms_crrer_mstr where companyid='".$_SESSION['ACGCompanyId']."'";
                        $carqryExec=DB_query($carqry,$db);
                while($rowCar=DB_fetch_array($carqryExec))
                        { ?>
                <option value="<?php echo $rowCar['id']; ?>"<?php echo ($_REQUEST['cariers']==$rowCar['id']?'selected':'')?>><?php echo $rowCar['carrer_name'];?></option>
                <?php } ?>
                </select></td>
                <td><input type="text" name="tracking_no[]" /></td>
                <td id="fromDta"><select name="from[]" id="from" multiple onchange="getUsers(this,this.id);">
                        <option value="0">--Select Users--</option>
                        <?php 
                        $userqry="select * from www_users where companyid='".$_SESSION['ACGCompanyId']."'";
                        $userqryExec=DB_query($userqry,$db);
                        while($row=DB_fetch_array($userqryExec))
                        { ?>
                        <option value=<?php echo $row['id']?>><?php echo $row['realname']?></option>
                        <?php } ?>
                    </select></td>
                <td id="toDta"><input type="text" name="to[]" id="to" /></td>
                <td><textarea name="address[]"  style="width:100%;"></textarea></td>
                <td><input type="text" name="mobile[]" /></td>
                
             </tr>       
<?php }
if($type=='I'){?>
  
              <tr class="row1">  
        <td><input type="checkbox" name="chk"  /></td>  
                <td><input type="hidden" name="userId[]" id="userId" /></td>
        <td><input type="text" name="doc_name[]" id="doc_name"/></td>
                <td><select name="doc_type_mstr_id[]" id="doc_type_mstr_id">
                        <option value="0">--Select Type--</option>
                        <?php
                        $userqry="select * from dms_doc_type_mstr where company_id='".$_SESSION['ACGCompanyId']."'";
                        $userqryExec=DB_query($userqry,$db);
                        while($row=DB_fetch_array($userqryExec))
                        { ?>
                        <option value="<?php echo $row['id']; ?>"><?php echo $row['doc_type_name']; ?></option>
                      <?php  } ?>
                    </select></td>
        <td><input type="file" name="doc_file_name[]" id="docmnt" value="" tabindex="69"/></td>
                <td><select name="cariers[]" id="cariers" style="width:150px;">
                    <?php 
                $carqry="select * from dms_crrer_mstr where companyid='".$_SESSION['ACGCompanyId']."'";
                        $carqryExec=DB_query($carqry,$db);
                while($rowCar=DB_fetch_array($carqryExec))
                        { ?>
                <option value="<?php echo $rowCar['id']; ?>"<?php echo ($_REQUEST['cariers']==$rowCar['id']?'selected':'')?>><?php echo $rowCar['carrer_name'];?></option>
                <?php } ?>
                </select></td>
                <td><input type="text" name="tracking_no[]" /></td>
                <td id="fromDta"><input type="text" name="from[]" id="from" /></td>
                <td id="toDta"><select name="to[]" id="to" multiple onchange="getUsers(this,this.id);">
                        <option value="0">--Select Users--</option>
                        <?php
                        $userqry="select * from www_users where companyid='".$_SESSION['ACGCompanyId']."'";
                        $userqryExec=DB_query($userqry,$db);
                        while($row=DB_fetch_array($userqryExec))
                        { ?>
                        <option value="<?php echo $row['id']; ?>"><?php echo $row['realname']; ?></option>
                      <?php  } ?>
                    </select></td>
                <td><textarea name="address[]"  style="width:100%;"></textarea></td>
                <td><input type="text" name="mobile[]" /></td>
                
   </tr>
<?php }
?>
   