<?php

require ('../../conexion.php');

$cdgcli=$_POST['cdgcli'];




	   if ($result = $mysqli->query("SELECT cdgveh,numpla FROM vehiculos WHERE cdgcli = '$cdgcli' AND estveh='ACTIVO' "  )) {
  $nrs = $result->num_rows;
   
   $result->close();
}


if( $nrs>0){
	
	
$consulta="SELECT cdgveh,numpla FROM vehiculos WHERE cdgcli = '$cdgcli' AND estveh='ACTIVO' ORDER BY cdgveh DESC";
								
			$query = mysqli_query($mysqli, $consulta)or die('error: '.mysqli_error($mysqli));
			
			$html='';
			while ($data = mysqli_fetch_assoc($query)) { 
			$html.= '<option  value="'.$data['numpla'].'">'.$data['numpla'].'</option>';
			}
			
			echo $html;	
	
}

else {
	   echo "0";
	}
?>

