<?php
ob_start();
session_start();
include "../inc/config.php";

/*Get Table List*/
if(isset($_POST['type']) && $_POST['type']=='get_table'){ ?>
    <tr class="man_del">
		                               <td>
		                                   <span class="btn btn-danger btn-xs mr-2 remove_man_delete" contenteditable="false" style="cursor: pointer;"><i class="fa fa-trash"></i> Delete</span>
		                               </td>
		                               <td>
		                                   <input type="text" name="ids[]" value="0" class="form-control input-sm" />
		                               </td>
		                               <td style="width:30%"> 
		                                   <select name="origin_city[]" class="form-control select2">
        										<?php 
            							        $statement = $pdo->prepare("SELECT * FROM `pincode` where 1=1 GROUP by city ORDER by city ASC");
                    							$statement->execute();
                    							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
                        						 foreach($result as $rows) { ?>
        											<option value="<?=$rows['city'];?>"> <?=$rows['city']; ?></option>
        									    <?php } ?>
            								</select>
		                               
		                               </td>
		                               <td style="width:30%">
		                                    <select name="destination_city[]" class="form-control select2">
        										<?php 
            							        $statement = $pdo->prepare("SELECT * FROM `pincode` where 1=1 GROUP by city ORDER by city ASC");
                    							$statement->execute();
                    							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
                        						 foreach($result as $rows) { ?>
        											<option value="<?=$rows['city'];?>"> <?=$rows['city']; ?></option>
        									    <?php } ?>
            								</select>
		                               
		                               </td>
		                               <td class="slab_rate"><input name="min_weight[]" type="text" class="form-control input-sm slab_rate_txt" onkeypress="return isNumberKey(this, event);"/></td>
		                               <td class="slab_rate"><input name="max_weight[]" type="text" class="form-control input-sm slab_rate_txt" onkeypress="return isNumberKey(this, event);"/></td>
		                               <td><input type="text" name="per_kg_rate[]" class="form-control input-sm" onkeypress="return isNumberKey(this, event);" required/></td>
		                           </tr>
<?php }


?>
<script>
    $(document).ready(function(){
      $(".select2").select2();
    });
</script>
