public function __construct($name, $value)
 {
     parent::__construct($name, $value, 'Código:', 'number');
     parent::set_required();
     parent::set_size(13);
     parent::set_maxlength(13);
 }
 public function show()
 {
     $val = '';
     if (parent::get_value()) {
         $val = 'checked="checked';
     }
     print '<p><input type="checkbox" name="' . parent::get_name() . '" ' . $val . '" ' . parent::get_required() . ' ' . parent::get_readonly() . ' ' . parent::get_disabled() . ' ' . parent::get_parameters() . ' />' . parent::get_label() . '</p>';
 }
 public function show()
 {
     print '<label>' . parent::get_label() . '</label>';
     print '<select name="' . parent::get_name() . '" class="campo campo-entrada">';
     foreach ($this->options as $key => $value) {
         print '<option value="' . $key . '"' . ($this->selected[$key] ? ' selected="selected"' : '') . '>' . $value . '</option>';
     }
     print '</select>';
 }
Example #4
0
<link href="./css/bootstrap.css" rel="stylesheet">
<?php 
include './clases/Campo.class.php';
$campos = new Campo();
$id = $campos->buscarTodos();
?>
<div class="container span5">
	<div class="modal-header row span5">
	    <h4>Campos Actuales</h4>
	</div>
	<div class="modal-body row span5">
	    	<?php 
for ($i = 0; $i < count($id); $i++) {
    $campos->setId($id[$i]['id_campo']);
    $campos->buscar();
    echo '<blockquote><p class="text-info">' . $campos->getDescripcion() . '</p></blockquote><br/>';
}
?>
	</div>
</div>
Example #5
0
 public function ajax_agregar_campo($formulario_id, $tipo)
 {
     $formulario = Doctrine::getTable('Formulario')->find($formulario_id);
     if ($formulario->Proceso->cuenta_id != UsuarioBackendSesion::usuario()->cuenta_id) {
         echo 'Usuario no tiene permisos para agregar campos a este formulario.';
         exit;
     }
     $campo = Campo::factory($tipo);
     $campo->formulario_id = $formulario_id;
     $data['edit'] = false;
     $data['formulario'] = $formulario;
     $data['campo'] = $campo;
     $this->load->view('backend/formularios/ajax_editar_campo', $data);
 }
$ventas = new Ventas();
$venta = $ventas->get_row($_REQUEST['codigo']);
$url = new UrlUtil();
$formulario = new Formulario();
$formulario->set_action_uri($url->get_uri() . '&action=grabar_pago');
$campo_codigo = new Campo('codigo', Formatter::code_format($venta[0]), 'Código de la operación', 'text');
$campo_codigo->set_disabled();
$campo_fecha = new Campo('fecha', Formatter::datetime_format($venta[2]), 'Fecha de emisión:', 'text');
$campo_fecha->set_disabled();
$clientes = new Clientes();
$campo_cliente = new CampoOculto('cliente', $venta[3]);
$campo_razon_cliente = new Campo('cliente', $clientes->get_field(1, $venta[3]), 'Cliente:', 'text');
$campo_razon_cliente->set_disabled();
$campo_monto_factura = new Campo('monto_fac', $venta[6], 'Monto de la factura:', 'text');
$campo_monto_factura->set_disabled();
$campo_saldo_factura = new Campo('saldo_fac', $venta[7], 'Saldo de la factura:', 'text');
$campo_saldo_factura->set_disabled();
$monto = '0';
if (isset($monto_cuota)) {
    $monto = $monto_cuota;
}
$campo_monto = new CampoDecimal('monto', $monto, 'Monto a pagar:');
$fondos = new Fondos();
$campo_fondo = new CampoCombo('fondo', 'A acreditar en el fondo:');
$campo_fondo->add_option('Seleccione una opción...');
$campo_fondo->set_sql_options($fondos->get_result());
$campo_fondo->set_selected_option(0);
$boton_grabar = new BotonFlat('grabar-pago', 'Aceptar', 'aceptar-item');
$formulario->open();
?>
        $registro[0] = mysql_result($result, 0, 0);
    }
}
$action = 'edicion_lista_precios';
if (isset($_REQUEST['type'])) {
    $action = $_REQUEST['type'] . '_lista_precios';
}
include_once 'include/campo.php';
include_once 'include/campo_codigo.php';
include_once 'include/campo_oculto.php';
include_once 'include/boton.php';
$campo_cod_orig = new CampoOculto('codigo-original', $registro[0]);
$campo_include = new CampoOculto('include', 'articulos');
$campo_action = new CampoOculto('action', $action);
$campo_cod = new CampoCodigo('codigo', $registro[0]);
$campo_des = new Campo('descripcion', $registro[1], 'Descripción:', 'text');
$boton = new Boton('aceptar', 'Aceptar');
?>

<h1><?php 
if (isset($_REQUEST['type'])) {
    if ($_REQUEST['type'] == 'alta') {
        print "Alta de lista de precios";
    } elseif ($_REQUEST['type'] == 'clonar') {
        print "Clonaci&oacute;n de lista de precios";
    } else {
        print "Edici&oacute;n de lista de precios";
    }
} else {
    print "Edici&oacute;n de lista de precios";
}
}
$action = 'edicion_marca';
if (isset($_REQUEST['type'])) {
    $action = $_REQUEST['type'] . '_marca';
}
include_once 'include/imagen.php';
include_once 'include/campo.php';
include_once 'include/campo_codigo.php';
include_once 'include/campo_oculto.php';
include_once 'include/boton.php';
$campo_cod_orig = new CampoOculto('codigo-original', $registro[0]);
$campo_include = new CampoOculto('include', 'articulos');
$campo_action = new CampoOculto('action', $action);
$campo_cod = new CampoCodigo('codigo', $registro[0]);
$campo_des = new Campo('descripcion', $registro[1], 'Descripción:', 'text');
$campo_img = new Campo('imagen', $registro[2], 'Archivo de imagen:', 'file');
$boton = new Boton('aceptar', 'Aceptar');
$imagen = new Imagen($registro[2]);
?>

<h1><?php 
if (isset($_REQUEST['type'])) {
    if ($_REQUEST['type'] == 'alta') {
        print "Alta de marca";
    } elseif ($_REQUEST['type'] == 'clonar') {
        print "Clonaci&oacute;n de marca";
    } else {
        print "Edici&oacute;n de marca";
    }
} else {
    print "Edici&oacute;n de marca";
 protected function getCampoOrCreate($id_campo = 'id_campo')
 {
     if (!$this->getRequestParameter($id_campo)) {
         $empresa = $this->getEmpresaOr404();
         $campo = new Campo();
         $campo->setIdEmpresa($empresa->getPrimaryKey());
         $campo->setOrden($empresa->getPosicionSiguienteCampo());
         if ($this->getRequestParameter('id_tabla')) {
             $campo->setEsGeneral(false);
         } else {
             $campo->setEsGeneral(true);
         }
     } else {
         $c = $this->getCriterio();
         $c->addAnd(CampoPeer::ID_CAMPO, $this->getRequestParameter($id_campo));
         $campo = CampoPeer::doSelectOne($c);
         $this->forward404Unless($campo);
     }
     return $campo;
 }
include_once 'include/formulario.php';
include_once 'include/table_handler.php';
include_once 'include/tabla.php';
include_once 'include/campo.php';
include_once 'include/campo_oculto.php';
include_once 'include/campo_combo.php';
include_once 'include/boton.php';
include_once 'include/boton_flat.php';
include_once 'include/proveedores/proveedores.php';
include_once 'include/configuracion/tipos_facturas.php';
include_once 'include/configuracion/condiciones_venta.php';
include_once 'include/fondos/fondos.php';
$formulario = new Formulario('compras', 'form_compra', 'grabar_compra');
$campo_proveedor = new CampoCombo('proveedor', 'Proveedor:');
$campo_tipo = new CampoCombo('operacion', 'Tipo de operación:');
$campo_factura = new Campo('factura', '', 'Número de factura:', 'number');
$campo_condicion = new CampoCombo('condicion', 'Condición de compra:');
$campo_fondo = new CampoCombo('fondo', 'Fondo de pago:');
$proveedores = new Proveedores();
$campo_proveedor->add_option('Seleccione un proveedor...');
$campo_proveedor->set_sql_options($proveedores->get_result());
$campo_proveedor->set_selected_option(0);
$tipos = new TiposFacturas();
$campo_tipo->add_option('Seleccione una opción...');
$campo_tipo->set_sql_options($tipos->get_result());
$campo_tipo->set_selected_option(0);
$condiciones = new CondicionesVenta();
$campo_condicion->add_option('Seleccione una opción...');
$campo_condicion->set_sql_options($condiciones->get_result());
$campo_condicion->set_selected_option(0);
$fondos = new Fondos();
Example #11
0
             <span class="badge badge-info">Punto' . ($k + 1) . '</span>
             <br />
             <br />';
 $cp = new CamposPunto('', '', '');
 if ($punto->getSolicitud() == NULL) {
     $cp->setPunto($punto->getId());
     $data = $cp->buscar();
     echo '<h4>Asunto:</h4>
                 <p>' . $data[0]['contenido'] . '</p>';
 } else {
     $ts = new TipoSolicitud($punto->getSolicitud(), '');
     $ts->buscar();
     echo '<h4>' . $ts->getDescripcion() . ':</h4>';
     $cp->setPunto($punto->getId());
     $data = $cp->buscar();
     $campo = new Campo('', '');
     echo '<p>';
     for ($h = 0; $h < count($data); $h++) {
         $campo->setId($data[$h]['id_campo']);
         $campo->buscar();
         echo ' <b>' . $campo->getDescripcion() . ':</b> ' . $data[$h]['contenido'];
     }
     echo '</p>';
 }
 echo '<br />
             <div class="span6" style="margin-left: 0px">';
 if ($punto->getDetalle() != '') {
     echo '<h4>Detalles:</h4>
                 <p>' . $punto->getDetalle() . '</p>';
 }
 if ($punto->getDecision() != '') {
<?php

include '../clases/Campo.class.php';
include '../clases/CampoSolicitud.class.php';
if ($_POST['tipo_solicitud'] == 'otro') {
    echo '<label class="control-label" >Descripcion:</label>
            <div class="controls" id="aread">
                <textarea class="textarea span5 campo" id="desc_punto" name="desc_punto" placeholder="Escriba la descripción del punto ..." style="height: 200px"></textarea>
            </div>';
} else {
    $cs = new CampoSolicitud($_POST['tipo_solicitud'], '');
    $idCampos = $cs->buscarCampos();
    $campo = new Campo('', '');
    for ($i = 0; $i < count($idCampos); $i++) {
        $campo->setId($idCampos[$i]['id_campo']);
        $campo->buscar();
        echo '<div class="control-group">
				<label class="control-label" >' . $campo->getDescripcion() . ':</label>
				<div class="controls offset1" id="aread">
					 <input class="span4 campo" type="text" name="campo_' . $campo->getId() . '"/>
				</div>
			</div>';
    }
}
<?php

include '../clases/Campo.class.php';
$campo = new Campo('', $_POST['campo']);
$existe = $campo->buscarDescripcion();
if (isset($existe[0])) {
    echo '<div id="errorCampo" class="alert alert-error">
			    <button type="button" class="close" data-dismiss="alert">×</button>
			    <strong>Ops!</strong> El campo ya existe.
			</div>';
} else {
    $campo->insertar();
    echo '<div id="existe" class="alert alert-success">
		    <button type="button" class="close" data-dismiss="alert">×</button>
		   <strong>Excelente!</strong> El campo se ha agregado exitosamente.
		</div>';
}
$formulario->set_action_uri($url->get_uri());
$campo_codigo_orig = new CampoOculto('codigo-original', $registro[0]);
$campo_include = new CampoOculto('include', 'proveedores');
$campo_action = new CampoOculto('action', $action);
$campo_codigo = new CampoCodigo('codigo', $registro[0]);
$campo_razon = new Campo('razon', $registro[1], 'Razón social:', 'text');
$campo_cuit = new Campo('cuit', $registro[2], 'CUIT:', 'text');
$campo_nombre = new Campo('nombre', $registro[3], 'Nombre:', 'text');
$campo_domicilio = new Campo('domicilio', $registro[4], 'Domicilio:', 'text');
$campo_telefono = new Campo('telefono', $registro[5], 'Teléfono:', 'text');
$campo_provincia = new CampoCombo('provincia', 'Provincia:');
$campo_localidad = new CampoCombo('localidad', 'Localidad:');
$campo_cp = new Campo('cp', $registro[8], 'Código Postal:', 'text');
$campo_contacto = new Campo('contacto', $registro[9], 'Contacto:', 'text');
$campo_pagina = new Campo('pagina', $registro[10], 'Página:', 'text');
$campo_correo = new Campo('correo', $registro[11], 'Correo:', 'text');
$campo_saldo = new Campo('saldo', $registro[12], 'Saldo:', 'text');
$campo_total = new Campo('total', $registro[13], 'Total:', 'text');
$campo_imagen = new Campo('imagen', $registro[14], 'Archivo de imagen:', 'file');
$boton = new Boton('aceptar', 'Guardar cambios');
$imagen = new Imagen($registro[14]);
$provincias = new Provincias();
$campo_provincia->add_option('Seleccione una provincia...');
$campo_provincia->set_sql_options($provincias->get_provincias());
$campo_provincia->set_selected_option($registro[6]);
if (!empty($registro[6])) {
    $localidades = new Localidades($registro[6]);
    $campo_localidad->set_sql_options($localidades->get_localidades());
    $campo_localidad->set_selected_option($registro[7]);
} else {
    $campo_localidad->add_option('Seleccione una ciudad...');
                padding: 4px;
            }
        </style>
    </head>
    <body>
        <?php 
include_once 'system/include/formulario.php';
include_once 'system/include/campo.php';
include_once 'system/include/boton.php';
$formulario = new Formulario();
$formulario->set_action_uri('system/');
$campo_nombre = new Campo('grovi', '', '', 'text');
$campo_nombre->add_class('campo-square');
$campo_nombre->set_placeholder('Ingrese su nombre de usuario');
$campo_nombre->set_required();
$campo_pass = new Campo('redemp', '', '', 'password');
$campo_pass->add_class('campo-square');
$campo_pass->set_placeholder('Ingrese su clave de acceso');
$campo_pass->set_required();
$boton = new Boton('aceptar', 'Ingresar');
$boton->add_class('boton-flat-square');
?>
        <div class="header">
            <ul>
                <li>
                    <a href="">&raquo; Contacto</a>
                </li>
                <li>
                    <a href="">&raquo; Olvid&eacute; mi contrase&ntilde;a</a>
                </li>
            </ul>
Example #16
0
 function __construct($nombreCampo, $esCampoObligatorio, $expRegValidaCampo)
 {
     parent::__construct($nombreCampo, $esCampoObligatorio);
     $this->expRegValidaCampo = $expRegValidaCampo;
 }
include_once 'include/url_util.php';
$formulario = new Formulario();
$url = new UrlUtil();
$formulario->set_action($url->get_uri());
$campo_codigo_orig = new CampoOculto('codigo-original', $registro[0]);
$campo_include = new CampoOculto('include', 'articulos');
$campo_action = new CampoOculto('action', $action);
$campo_codigo = new CampoCodigo('codigo', $registro[0]);
$campo_descripcion = new Campo('descripcion', $registro[1], 'Descripción:', 'text');
$campo_categoria = new CampoCombo('categoria', 'Categoría:');
$campo_proveedor = new CampoCombo('proveedor', 'Proveedor:');
$campo_marca = new CampoCombo('marca', 'Marca:');
$campo_costo = new Campo('costo', $registro[5], 'Costo:', 'text');
$campo_precio = new Campo('precio', $registro[6], 'Precio de referencia:', 'text');
$campo_alicuota = new CampoCombo('alicuota', 'Alícuota:');
$campo_imagen = new Campo('imagen', $registro[9], 'Archivo de imagen:', 'file');
$campo_resumen = new CampoTexto('resumen', 'Resumen:');
$campo_resumen->set_text($registro[10]);
$boton = new Boton('aceptar', 'Guardar cambios');
$imagen = new Imagen($registro[9]);
$categorias = new Categorias();
$campo_categoria->set_sql_options($categorias->get_categorias());
$campo_categoria->set_selected_option($registro[2]);
$proveedores = new Proveedores();
$campo_proveedor->set_sql_options($proveedores->get_result());
$campo_proveedor->set_selected_option($registro[3]);
$marcas = new Marcas();
$campo_marca->set_sql_options($marcas->get_marcas());
$campo_marca->set_selected_option($registro[4]);
$alicuotas = new Alicuotas();
$campo_alicuota->set_sql_options($alicuotas->get_result());
Example #18
0
 public function backendExtraValidate()
 {
     parent::backendExtraValidate();
     $CI =& get_instance();
     $CI->form_validation->set_rules('documento_id', 'Documento', 'required');
 }
include_once 'include/campo_oculto.php';
include_once 'include/campo_combo.php';
include_once 'include/boton.php';
include_once 'include/configuracion/provincias.php';
$form = new Formulario();
$form->set_param('action', $action);
$form->set_param('codigo-original', $registro[0]);
$form->set_param('include', 'configuracion');
$campo_cod = new CampoCodigo('codigo', $registro[0]);
$campo_cod->set_required();
$campo_prov = new CampoCombo('provincia', 'Provincia:');
$campo_prov->set_required();
$campo_prov->add_option('Seleccione una provincia...');
$campo_prov->set_sql_options($provincias->get_provincias());
$campo_prov->set_selected_option($registro[1]);
$campo_des = new Campo('descripcion', $registro[2], 'Descripción:', 'text');
$campo_des->set_required();
$boton = new Boton('aceptar', 'Aceptar');
?>

<h1><?php 
if (isset($_REQUEST['type'])) {
    if ($_REQUEST['type'] == 'alta') {
        print "Alta";
    } elseif ($_REQUEST['type'] == 'clonar') {
        print "Clonaci&oacute;n";
    } else {
        print "Edici&oacute;n";
    }
} else {
    print "Edici&oacute;n";
	<legend><strong>Nombre de la Solicitud</strong></legend>
    <div class="control-group">
        <label class="control-label"><b>Nombre:</b></label>
        <div class="controls">
        	<input type="text" class="span4" id="solicitud"  name="solicitud" placeholder="Nombre del nuevo tipo de solicitud">
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <a class="btn span3" onclick="javascript:window.open('tipoSolicitudActuales.php','tipos de Solicitud Actuales','width=400,height=500')">Consultar Solicitudes Existentes</a>
        </div>
    </div>
     <legend><strong>Campos de la Solicitud</strong></legend>
     <div class="control-group">
    		<?php 
$campo = new Campo();
$idcampos = $campo->buscarTodos();
$filas = 0;
for ($i = 0; $i < count($idcampos); $i++) {
    $campo->setId($idcampos[$i]['id_campo']);
    $campo->buscar();
    $filas = $filas + 1;
    if ($i % 10 == 0) {
        echo '<div class="span3">';
        $filas = 1;
    }
    echo '<label class="checkbox">
							<input type="checkbox" name="campos[]" value="' . $campo->getId() . '">' . $campo->getDescripcion() . '
						</label>';
    if ($filas == 10) {
        echo '</div>';
Example #21
0
 /**
  * Saves a address into the database
  * @return void
  */
 public function store(Request $request)
 {
     $retoData = $request->all();
     try {
         //if(empty($_POST['mensaje'])) array_push($error,"Ingrese un mensaje.");
         if (!checkdate($retoData['mes'], $retoData['dia'], $retoData['ano'])) {
             return ResponseMessage::dateNotValid();
         }
         if ($retoData['ano'] . "-" . $retoData['mes'] . "-" . $retoData['dia'] == date("Y-m-d") && $retoData['hora'] <= date("H")) {
             return ResponseMessage::hourNotValid();
         }
         if ($retoData['ano'] . "-" . $retoData['mes'] . "-" . $retoData['dia'] < date("Y-m-d")) {
             return ResponseMessage::dateNotValid();
         }
         $equipo = $this->equiposRepository->find($retoData['id_equipo']);
         $retador = $this->equiposRepository->find($retoData['id_retador']);
         $tienePartidos = DB::table("partidos_equipos")->join("partidos", "partidos_equipos.id_partido", "=", "partidos.id_partido")->where("id_equipo", "=", $retoData['id_equipo'])->where("fecha", "=", $retoData['ano'] . "-" . $retoData['mes'] . "-" . $retoData['dia'])->where("horario", "=", $retoData['hora'] . ":" . $retoData['minutos'] . ":00")->count();
         if ($tienePartidos > 0) {
             return ResponseMessage::teamNotAvailable($equipo["data"]["equipo"]);
         }
         $tengoPartidos = DB::table("partidos_equipos")->join("partidos", "partidos_equipos.id_partido", "=", "partidos.id_partido")->where("id_equipo", "=", $retoData['id_retador'])->where("fecha", "=", $retoData['ano'] . "-" . $retoData['mes'] . "-" . $retoData['dia'])->where("horario", "=", $retoData['hora'] . ":" . $retoData['minutos'] . ":00")->count();
         if ($tengoPartidos > 0) {
             return ResponseMessage::notAvailable();
         }
         \JWTAuth::parseToken();
         $user = \JWTAuth::parseToken()->authenticate();
         $equiposCapitan = $this->JugadoresEquiposRepository->findWhere(['id_jugador' => $user->id_jugador, 'capitan' => 't', 'id_equipo' => $retoData['id_retador']]);
         if (count($equiposCapitan) == 0) {
             return ResponseMessage::invalidPermission();
         }
         //consultar capita  n del equipo retado
         $capitanretado = DB::table('jugadores_equipos')->wherein("capitan", array("t", "s"))->where("id_equipo", "=", $retoData['id_equipo'])->join("jugadores", "jugadores.id_jugador", "=", "jugadores_equipos.id_jugador")->get();
         $fechaReto = $retoData['ano'] . "-" . $retoData['mes'] . "-" . $retoData['dia'];
         $horaReto = $retoData['hora'] . ":" . $retoData['minutos'] . ":00";
         $arrayReto = array('id_equipo' => $equipo["data"]["id"], 'id_retador' => $retador["data"]["id"], 'mensaje' => isset($retoData['mensaje']) ? $retoData['mensaje'] : '', 'tipo' => $retoData['tipo'], 'fecha' => $fechaReto, 'hora' => $horaReto, 'lugar' => $retoData['lugar']);
         $reto = $this->repository->create($arrayReto);
         foreach ($capitanretado as $destinatario) {
             /*$datos['destinatario']=$destinatario;
               $datos['equipo']=$equipo;
               $datos['retador']=$retador;
               $datos['reto']=$reto;
               $datos['cadena']=base64_encode("aceptarreto||".$equipo->id_equipo."||".$retador->id_equipo."||".$destinatario->id_jugador."||".$reto->id_reto);
               if($_POST['tipo']=='a') $datos['tipo']="Amistoso"; else $datos['tipo']="Competitivo"; 
               $datos['mensaje']=$_POST['mensaje'];
               Mail::send('mails.reto', $datos, function($message) use ($destinatario) {
                   $message->to($destinatario->email)->subject('Tu equipo ha sido retado');
               });*/
             $alertaArray = array('id_jugador' => $destinatario->id_jugador, 'estado' => 'a', 'id_tipo_alerta' => 2, 'id_referencia' => $reto["data"]["id"]);
             $alerta = $this->AlertasRepository->create($alertaArray);
             if (getenv('APP_ENV') == "production") {
                 $url = 'http://pruebas.quepartido.com/front/public/';
             } else {
                 $url = 'http://quepartido.com/';
             }
             $alerta_text = '<div onclick="window.open(' . $url . 'equipos/perfil?id_equipo=' . $retador["data"]["id"] . '\')" class="orange">' . strtoupper($retador["data"]["equipo"]) . '</div><span class="message" > quiere enfrentar a tu equipo ' . strtoupper($equipo["data"]["equipo"]) . ' el d&iacute;a ' . $reto["data"]["fecha"] . ' a las ' . date("H:i", strtotime($reto["data"]["fecha"] . " " . $reto["data"]["fecha"])) . '</span><br><input name="button" type="button" class="send4" onclick="responderAlerta(' . $alerta["data"]["id"] . ',' . $reto["data"]["id"] . ',\'t\')" style="height: 30" id="button" value=" ACEPTAR "><input name="button" type="button" class="send3" style="height: 30" id="button" onclick="responderAlerta(' . $alerta["data"]["id"] . ',' . $reto["data"]["id"] . ',\'f\')" value=" RECHAZAR ">';
             $alerta_app = strtoupper($retador["data"]["equipo"]) . ' quiere enfrentar a tu equipo ' . strtoupper($equipo["data"]["equipo"]) . ' el d&iacute;a ' . $reto["data"]["fecha"] . ' a las ' . date("H:i", strtotime($reto["data"]["fecha"] . " " . $reto["data"]["hora"]));
             $updateArray = array('alerta' => $alerta_text, 'alerta_app' => $alerta_app);
             $alerta = $this->AlertasRepository->update($updateArray, $alerta["data"]["id"]);
         }
         //Realizar reserva si viene
         if (isset($retoData['id_campo'])) {
             $campo = Campo::where("id_campo", "=", $retoData['id_campo'])->join("canchas", "campos.id_cancha", "=", "canchas.id_cancha")->first();
             $fechado = explode("-", $reto->fecha);
             $traddia['1'] = "Lunes";
             $traddia['2'] = "Martes";
             $traddia['3'] = "Miercoles";
             $traddia['4'] = "Jueves";
             $traddia['5'] = "Viernes";
             $traddia['6'] = "Sabado";
             $traddia['7'] = "Domingo";
             $tradMes['01'] = "Enero";
             $tradMes['02'] = "Febrero";
             $tradMes['03'] = "Marzo";
             $tradMes['04'] = "Abril";
             $tradMes['05'] = "Mayo";
             $tradMes['06'] = "Junio";
             $tradMes['07'] = "Julio";
             $tradMes['08'] = "Agosto";
             $tradMes['09'] = "Septiembre";
             $tradMes['10'] = "Octubre";
             $tradMes['11'] = "Noviembre";
             $tradMes['12'] = "Diciembre";
             $fechaformat = strtr(date("N", strtotime($reto->fecha)), $traddia) . ", " . $fechado[2] . " de " . strtr($fechado[1], $tradMes) . " de " . $fechado[0];
             $reserva = new Reserva();
             $reserva->id_cancha = $campo->id_cancha;
             $reserva->fecha = $reto->fecha;
             $reserva->hora = $retoData['horareserva'] . ":00:00";
             $reserva->id_jugador = $usuario->id_jugador;
             $reserva->id_campo = $campo->id_campo;
             $reserva->total_horas = $retoData['horas'];
             $reserva->save();
         }
         return response()->json($reto);
     } catch (\Exception $e) {
         if ($e instanceof ValidatorException) {
             return response()->json($e->toArray(), 400);
         } else {
             return response()->json($e->getMessage(), 500);
         }
     }
 }
 $tipoAgenda = new tipoAgenda($idAgenda, $_POST['sel_dependencia'], $_POST['sel_tipo']);
 $tipoAgenda->insertar();
 $punto = new punto('', $idAgenda, '1', '', '');
 $cp = new CamposPunto('', '', '');
 for ($i = 0; $i < count($_SESSION['puntos']); $i++) {
     $punto->setSubasunto($_SESSION['puntos'][$i]['id']);
     if ($_SESSION['puntos'][$i]['otro'] == 'false') {
         $punto->setSolicitud($_SESSION['puntos'][$i]['id_tipo_solicitud']);
         $punto->setOtro('false');
         if (isset($_SESSION['puntos'][$i]['detalle'])) {
             $punto->setDetalle($_SESSION['puntos'][$i]['detalle']);
         }
         $idPunto = $punto->insertar();
         $cs = new CampoSolicitud($_SESSION['puntos'][$i]['id_tipo_solicitud'], '');
         $idCampos = $cs->buscarCampos();
         $campo = new Campo('', '');
         $cp->setPunto($idPunto);
         for ($j = 0; $j < count($idCampos); $j++) {
             $campo->setId($idCampos[$j]['id_campo']);
             $campo->buscar();
             $cp->setCampo($idCampos[$j]['id_campo']);
             $cp->setContenido($_SESSION['puntos'][$i][$campo->getDescripcion()]);
             $cp->insertar();
         }
     } else {
         if (isset($_SESSION['puntos'][$i]['detalle'])) {
             $punto->setDetalle($_SESSION['puntos'][$i]['detalle']);
         }
         $punto->setOtro('true');
         $punto->setSolicitud('NULL');
         $idPunto = $punto->insertar();
 public function __construct($name, $value, $label)
 {
     parent::__construct($name, $value, $label, 'number');
     parent::set_parameters('step="1" min="0"');
 }
Example #24
0
 function __construct($nombreCampo, $valorCampo, $expRegValidaCampo, $campoObligatorio, $estado)
 {
     parent::__construct($nombreCampo, $valorCampo, $expRegValidaCampo, $campoObligatorio, $estado);
 }
Example #25
0
 /**
  * Declares an association between this object and a Campo object.
  *
  * @param      Campo $v
  * @return     Tarea The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setCampo(Campo $v = null)
 {
     if ($v === null) {
         $this->setIdCampo(NULL);
     } else {
         $this->setIdCampo($v->getIdCampo());
     }
     $this->aCampo = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Campo object, it will not be re-added.
     if ($v !== null) {
         $v->addTarea($this);
     }
     return $this;
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Campo $value A Campo object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Campo $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getIdCampo();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
         }
     }
     break;
 case '2':
     //**********************************************************************************    BUSCAR Y EDITAR PUNTO
     for ($i = 0; $i < count($_SESSION['puntos']); $i++) {
         if ($_SESSION['puntos'][$i]['contador'] == $_POST['cont']) {
             if (isset($_POST['otro'])) {
                 $_SESSION['puntos'][$i]['descripcion'] = $_POST['desc_punto'];
                 if (isset($_POST['det_punto'])) {
                     $_SESSION['puntos'][$i]['detalle'] = $_POST['det_punto'];
                 }
             } else {
                 $cs = new CampoSolicitud($_POST['id_tipo_solicitud'], '');
                 $idCampos = $cs->buscarCampos();
                 $campo = new Campo('', '');
                 for ($j = 0; $j < count($idCampos); $j++) {
                     $campo->setId($idCampos[$j]['id_campo']);
                     $campo->buscar();
                     $_SESSION['puntos'][$i][$campo->getDescripcion()] = $_POST['campo_' . $campo->getId()];
                 }
             }
         }
     }
     break;
 case '3':
     for ($i = 0; $i < count($_SESSION['puntos']); $i++) {
         if ($_SESSION['puntos'][$i]['contador'] == $_POST['cont']) {
             unset($_SESSION['puntos'][$i]);
             $_SESSION['puntos'] = array_values($_SESSION['puntos']);
         }
    return $string;
}
switch ($operacion) {
    case '1':
    case '2':
        //**********************************************************************************     INSERTAR EN ARREGLO TEMP
        //print_r($_SESSION['puntos']);
        if ($solicitud == 'otro' && $_POST['desc_punto'] != '' || $solicitud != 0) {
            $contador = !isset($_SESSION['contador']) ? 0 : $_SESSION['contador'] + 1;
            if ($_POST['sel_solicitud'] == 'otro') {
                $punto = array('contador' => $contador, 'id' => $idSubasunto, 'descripcion' => $descripcion, 'detalle' => $detalle, 'otro' => 'true');
                //datos
            } else {
                $cs = new CampoSolicitud($_POST['sel_solicitud'], '');
                $idCampos = $cs->buscarCampos();
                $campo = new Campo('', '');
                $punto = array();
                //datos
                $cont = array('contador' => $contador);
                $punto = $punto + $cont;
                $id_sub = array('id' => $_POST['subasunto']);
                $punto = $punto + $id_sub;
                $otro = array('otro' => 'false');
                $punto = $punto + $otro;
                for ($i = 0; $i < count($idCampos); $i++) {
                    $campo->setId($idCampos[$i]['id_campo']);
                    $campo->buscar();
                    $ar_campo = array($campo->getDescripcion() => $_POST['campo_' . $idCampos[$i]['id_campo']]);
                    $punto = $punto + $ar_campo;
                }
                $ti_sol = array('id_tipo_solicitud' => $_POST['sel_solicitud']);
Example #29
0
 function setUp()
 {
     parent::setUp();
     $this->setTableName("campo");
 }
 public function show()
 {
     print '<input type="hidden" name="' . parent::get_name() . '" value="' . parent::get_value() . '" />';
 }