<?php
include "include/db.php";
include "include/auth.php";

if(isset($_REQUEST["cat_id"]) && isset($_REQUEST["cl_id"])){
    $cat_id = $_REQUEST["cat_id"];
    $client_id = $_REQUEST["cl_id"];
    
if(strlen($cat_id)!=0 && strlen($client_id)!=0) {
     

         
       $query00 = "SELECT * FROM maps WHERE client_id = $client_id AND cat_id = $cat_id AND maps_is_delete IS NULL AND maps_approved = 1";
       $run00 = mysqli_query($conn,$query00);

       if(mysqli_num_rows($run00)>0){?>
        <label for="maps_name_parent">Choose Parent Item</label>          
     <select name="maps_name_parent" id="maps_name_parent" onChange = "showChildCat();" required> 
             
      <option value="" disabled="disabled" selected="selected">Select Product </option>
       <?php 
       
       while($row00 = mysqli_fetch_array($run00)){                     
            echo "<option value='".$row00['maps_id']."'>". $row00['maps_name']."</option>";              
        }
        echo '</select>';
       }else{
        echo '<label for="">That category has no items</label>';
       }  
       ?>

<?php
 } }
/* isset */ 
?>

