<?php
$accion = $_GET["accion"];
$accion();


function impuestos(){
		include("config.php");
		$tr .= "<select id='impuestos' class='form-control  mb-2'>";
		$tr .= "<option value='0.00'>0.00</option>";
        $a = mysql_query("select * from impuestos order by id ");
        while($rs = mysql_fetch_array($a)){
			$nombre = $rs["nombre"];
			$id = $rs["id"];
           	$monto = $rs["monto"];
			$tr .= "<option value='$monto'>".$rs["nombre"]."(".$rs["monto"].")"."</option>";

        }
		$tr .= "</select>";
		echo $tr;
}

function clientes(){
		include("config.php");
		$tr .= "<select id='cliente' class='form-control mb-2'>";
		$tr .= "<option value=''>--Seleccione un cliente-</option>";
        $a = mysql_query("select * from clientes order by nombre ");
        while($rs = mysql_fetch_array($a)){
			$nombre = $rs["nombre"];
			$id = $rs["id_cliente"];
			$tr .= "<option value='$id'>".$rs["nombre"]."</option>";

        }
		$tr .= "</select>";
		echo $tr;
}


function categoria_productos(){
		include("config.php");
		$tr .= "<select id='categoria' class='form-control mb-2'>";
		$tr .= "<option value=''>--</option>";
        $a = mysql_query("select * from categoria order by descripcion");
        while($rs = mysql_fetch_array($a)){
			$nombre = $rs["descripcion"];
			$id = $rs["id_categoria"];
			$tr .= "<option value='$nombre'>".$rs["descripcion"]."</option>";

        }
		$tr .= "</select>";
		echo $tr;
}

function proveedores(){
		include("config.php");
		$tr .= "<select id='proveedores' class='form-control  mb-2'>";
		$tr .= "<option value=''>Seleccione proveedor</option>";
        $a = mysql_query("select * from proveedor order by nombre");
        while($rs = mysql_fetch_array($a)){
			$nombre = $rs["nombre"];
			$id = $rs["id"];
			$tr .= "<option value='$id'>".$rs["nombre"]."</option>";

        }
		$tr .= "</select>";
		echo $tr;
}

function medidas(){
		include("config.php");
		$tr .= "<select id='medida' class='form-control  mb-2'>";
		$tr .= "<option value=''>--</option>";
        $a = mysql_query("select * from medidas order by nombre");
        while($rs = mysql_fetch_array($a)){
			$nombre = $rs["nombre"];
			$id = $rs["id"];
			$tr .= "<option value='$nombre'>".$rs["nombre"]."</option>";

        }
		$tr .= "</select>";
		echo $tr;
}


function almacen(){
		include("config.php");
		$tr .= "<select id='almacen' class='form-control  mb-2'>";
		$tr .= "<option value=''>--</option>";
        $a = mysql_query("select * from almacen order by nombre");
        while($rs = mysql_fetch_array($a)){
			$nombre = $rs["nombre"];
			$id = $rs["id"];
			$tr .= "<option value='$nombre'>".$rs["nombre"]."</option>";

        }
		$tr .= "</select>";
		echo $tr;
}


?>
