public function __construct($request)
 {
     $comercial = new Agentes();
     $this->values['comerciales'] = $comercial->getComerciales('', '', false);
     $this->values['comerciales'][] = array('Id' => '', 'Value' => ':: Indique un comercial');
     unset($comercial);
     parent::__construct($request);
 }
 public function indexAction()
 {
     if ($this->values['permisos']['permisosModulo']['UP']) {
         $agentes = new Agentes();
         $zonas = new Zonas();
         $this->values['comerciales'] = $agentes->getComerciales('', $_SESSION['suc'], false);
         $this->values['zonas'] = $zonas->fetchAll($_SESSION['suc']);
         unset($agentes);
         unset($zonas);
         $template = $this->entity . '/index.html.twig';
     } else {
         $template = "_global/forbiden.html.twig";
     }
     return array('template' => $template, 'values' => $this->values);
 }
示例#3
0
/**
 * Construye un tag html <select> con todos los comerciales de la sucursal indicada
 * @param integer $idSucursal ID de la sucursal
 * @param string $nameSelect El Name del select
 * @param string $idSelect El Id del select
 * @return string Codigo html con el tag select
 */
function getComercialesSucursal($idSucursal, $nameSelect = '', $idSelect = '')
{
    if ($nameSelect == '') {
        $nameSelect = $_GET['nameselect'];
    }
    if ($idSelect == '') {
        $idSelect = $_GET['idselect'];
    }
    $comerciales = new Agentes();
    $rows = $comerciales->getComerciales($_SESSION['emp'], $idSucursal);
    unset($comerciales);
    $ch = "<div class='Etiqueta'>Comercial</div>";
    $ch .= "<select name='" . $nameSelect . "' id='" . $idSelect . "' class='Select'>";
    foreach ($rows as $row) {
        $ch .= "<option value='" . $row['Id'] . "'>" . $row['Value'] . "</option>";
    }
    $ch .= "</select>";
    return $ch;
}