?>
     <?php if($rowCount == 0){?>
     <tr>
       <td align="left"><select name="prefix[]" id="prefix" class="textfield parent_prefix">
           <?php echo all_gateways_with_use_count($rowGateway->gateway_name, $rowGateway->prefix_sofia_id);?>
         </select>
         <span class="required">*</span></td>
       <td align="left"><input type="text" value="<?php echo $rowGateway->prefix;?>" onkeypress='validate(event)' name="pre[]" id="pre" maxlength="15" class="textfield"></td>
       <td align="left"><input type="text" value="<?php echo $rowGateway->suffix;?>" onkeypress='validate(event)' name="suffix[]" id="suffix" maxlength="15" class="textfield"></td>
       <td align="left"><input type="text" value="<?php echo $rowGateway->codec;?>" name="codec[]" id="codec" maxlength="50" class="textfield"></td>
       <td align="left"><img src="<?php echo base_url();?>assets/images/plus.gif" class="add_field" /></td>
     </tr>
     <?php } else { ?>
     <tr class="optional" id="<?php echo $rowCount;?>">
       <td align="left"><select name="prefix[]" id="prefix_<?php echo $rowCount;?>" class="textfield parent_prefix">
           <?php echo all_gateways_with_use_count($rowGateway->gateway_name, $rowGateway->prefix_sofia_id);?>
         </select></td>
       <td align="left"><input type="text" value="<?php echo $rowGateway->prefix;?>" onkeypress='validate(event)' name="pre[]" id="pre_<?php echo $rowCount;?>" maxlength="15" class="textfield"></td>
       <td align="left"><input type="text" value="<?php echo $rowGateway->suffix;?>" onkeypress='validate(event)' name="suffix[]" id="suffix_<?php echo $rowCount;?>" maxlength="15" class="textfield"></td>
       <td align="left"><input type="text" value="<?php echo $rowGateway->codec;?>" name="codec[]" id="codec_<?php echo $rowCount;?>" maxlength="50" class="textfield"></td>
       <td align="left"><img src="<?php echo base_url();?>assets/images/button_cancel.png" class="remove_field" /></td>
     </tr>
     <?php } ?>
     <?php 
                 $rowCount = $rowCount + 1;
             } 
         ?>
   </tbody>
 </table>
 <table cellspacing="3" cellpadding="2" border="0" width="95%" class="search_col">
   <tbody>
 <select  id="hidden_box_for_ajax" style="display:none;">
   <?php echo all_gateways_with_use_count();?>
 </select>
 <table cellspacing="3" cellpadding="2" border="0" width="95%" class="search_col">
   <thead>
     <tr>
       <th align="left">Gateway</th>
       <th align="left">Add Gateway Prefix</th>
       <th align="left">Add Gateway Suffix</th>
       <th align="left">Codec</th>
     </tr>
   </thead>
   <tbody id="dynamic">
     <tr>
       <td align="left"><select name="prefix[]" id="prefix" class="textfield parent_prefix">
           <?php echo all_gateways_with_use_count();?>
         </select>
         <span class="required">*</span></td>
       <td align="left"><input type="text" value="" onkeypress='validate(event)' name="pre[]" id="pre" maxlength="15" class="textfield"></td>
       <td align="left"><input type="text" value="" onkeypress='validate(event)' name="suffix[]" id="suffix" maxlength="15" class="textfield"></td>
       <td align="left"><input type="text" value="" name="codec[]" id="codec" maxlength="50" class="textfield"></td>
       <td align="left"><img src="<?php echo base_url();?>assets/images/plus.gif" class="add_field" /></td>
     </tr>
   </tbody>
 </table>
 <table cellspacing="3" cellpadding="2" border="0" width="95%" class="search_col">
   <tbody>
     <tr>
       <td align="center" colspan="2"><input border="0" id="submitaddCarrierForm" type="image" src="<?php echo base_url();?>assets/images/btn-submit.png"></td>
     </tr>
   </tbody>