Esempio n. 1
0
/**
 * Construye un tag html <select> con todas las direcciones de entrega de un cliente dado.
 * @param integer $idCliente ID del cliente
 * @param string $nameSelect El Name del select
 * @param string $idSelect El Id del select
 * @return string Codigo html con el tag select
 */
function dEntregaCliente($idCliente, $nameSelect = '', $idSelect = '')
{
    $dEntrega = new ClientesDentrega();
    $rows = $dEntrega->fetchAll($idCliente);
    unset($dEntrega);
    if ($nameSelect == '') {
        $nameSelect = $_GET['nameselect'];
    }
    if ($idSelect == '') {
        $idSelect = $_GET['idselect'];
    }
    $ch = "<div class='Etiqueta'>Dirección de Entrega</div>";
    $ch .= "<select name='" . $nameSelect . "' id='" . $idSelect . "' class='Select350'>";
    foreach ($rows as $row) {
        $ch .= "<option value='" . $row['Id'] . "'>" . $row['Value'] . "</option>";
    }
    $ch .= "</select>";
    return $ch;
}