<?php
require_once("../config/conexion.php");
require_once("../models/Canton.php");
$canton = new Canton();
switch ($_GET["op"]) {
    case "combo":
        $datos=$canton->Consultar($_POST["prov_id"]);
        if(is_array($datos)==true and count($datos)>0){
            $html.= "<option value=''></option>";
            foreach($datos as $row){
                $html.= "<option value='".$row['can_codigo']."'>".$row['can_descripcion']."</option>";
            }
            echo $html;
        }
        break;
    case "comboCanton":
        $datos=$canton->ConsultarCantones($_POST["prov_id"]);
        if(is_array($datos)==true and count($datos)>0){
            $html.= "<option value=''></option>";
            foreach($datos as $row){
                $html.= "<option value='".$row['can_codigo']."'>".$row['can_descripcion']."</option>";
            }
            echo $html;
        }
        break;        
}
?>