Пример #1
0
 private function _guardarUsuario()
 {
     $mensaje = '';
     $nombre = $_POST['nombre'];
     $dni = $_POST['dni'];
     $fechaAlta = $_POST['fechaAlta'];
     $cuota = $_POST['cuota'];
     $socio = new Socio($dni, $nombre, $fechaAlta, $cuota);
     //mensaje se pasa por referencia (ver método $usuario->load())
     if ($socio->guardarUsuario($mensaje)) {
         Vista::setMensaje('Usuario guardado');
     } else {
         if ($mensaje) {
             Vista::setMensaje($mensaje);
         } else {
             Vista::setMensaje('No se ha podido guardar el usuario');
         }
     }
     Vista::setAccion('mensaje');
     Vista::retornarVista();
 }
 public function getIndex()
 {
     if (Auth::user()->nivel == 1 or Auth::user()->nivel == 3) {
         // socio y socio-comercio
         $nombre = Persona::nombreCompleto();
         $nrosocio = 'Socio: ' . Persona::numeroSocio();
         $cuentas = cuentasAhorro::socioCuentas();
         $prestamos = Prestamos::activos();
         $transitorias = Transitoria::activos();
         $cheques = Cheques::rechazados();
         $terminos = Termino::activos();
     }
     if (Auth::user()->nivel == 3 or Auth::user()->nivel == 2) {
         // comercio-socio - comercio
         $liqcomercio = TarjetaComercioMov::liqcomercio();
     } else {
         $liqcomercio = 'no';
     }
     if (Persona::usaTarjeta()) {
         $limites = Socio::limites(Persona::numeroSocio());
         $liqusuario = TarjetaUsuarioMov::liqusuario();
         if (count($liqusuario) > 0) {
             foreach ($liqusuario as $liq) {
                 $nro_liquidacion = $liq->nro_liquidacion;
             }
             $liqconsumos = TarjetasConsumos::consumos($nro_liquidacion);
         } else {
             $liqusuario = 'noliq';
             $liqconsumos = 'no';
         }
     } else {
         $liqusuario = 'no';
         $liqconsumos = 'no';
         $limites = '';
     }
     if (Auth::user()->nivel == 2) {
         // comercio
         $nombre = Persona::nombreComercio();
         $nrosocio = 'Comercio: ' . Persona::numeroComercio();
         $cuentas = 'no';
         $prestamos = 'no';
         $transitorias = 'no';
         $cheques = 'no';
         $terminos = 'no';
         $liqconsumos = 'no';
     }
     if (Formatos::esCelular()) {
         return View::make('usuario.celular.inicio')->with('nombrecompleto', $nombre)->with('nrosocio', $nrosocio)->with('cuentas', $cuentas)->with('prestamos', $prestamos)->with('transitorias', $transitorias)->with('cheques', $cheques)->with('terminos', $terminos)->with('liqcomercio', $liqcomercio)->with('liqusuario', $liqusuario)->with('liqconsumos', $liqconsumos)->with('limites', $limites);
     } else {
         return View::make('usuario.inicio')->with('nombrecompleto', $nombre)->with('nrosocio', $nrosocio)->with('cuentas', $cuentas)->with('prestamos', $prestamos)->with('transitorias', $transitorias)->with('cheques', $cheques)->with('terminos', $terminos)->with('liqcomercio', $liqcomercio)->with('liqusuario', $liqusuario)->with('liqconsumos', $liqconsumos)->with('limites', $limites);
     }
 }
Пример #3
0
<?php

$nombre = $_POST["nombre"];
$apellido = $_POST["apellido"];
$telefono_movil = $_POST["telefono_movil"];
$telefono_fijo = $_POST["telefono_fijo"];
//$fecha_nac = $_POST["fecha_nac"];
$mail = $_POST["mail"];
$user = $_POST["pass"];
//if (isset($_POST["sport"]) and $_POST["sport"]!=''){ $deporte=$_POST[""];}
//echo $deporte;
require_once '../class/classSocio.php';
$socio = new Socio(0, $nombre, $apellido, $telefono_movil, $telefono_fijo, $mail, $user);
$socio->guardarSocio();
echo $socio->getnombre() . ' se ha guardado correctamente con el id: ' . $nombre->getid_persona();
?>
 
Пример #4
0
<?php

if (empty($_POST)) {
    header("Location: index.html");
    exit;
}
require_once 'class/social-generator.class.php';
$social = new Socio(@$_POST['input']);
$social->generate();
Пример #5
0
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'gruposocio-form', 'enableAjaxValidation' => false));
?>

	<p class="help-block">Los campos con <span class="required">*</span> son requeridos.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<?php 
echo $form->textFieldRow($model, 'alias', array('class' => 'span5', 'maxlength' => 50));
?>
        
        
        <?php 
$memberFormConfig = array('elements' => array('numero_socio' => array('type' => 'dropdownlist', 'items' => CHtml::listData(Socio::model()->findAll(), 'numero_socio', 'numero_socio'), 'prompt' => 'Seleccione Numero Socio...')));
$this->widget('ext.multimodelform.MultiModelForm', array('id' => 'id_socio', 'formConfig' => $memberFormConfig, 'model' => $socioG, 'validatedItems' => $validatedMembers, 'data' => $socioG->findAll('grupo_id=:grupo_Id', array(':grupo_Id' => $model->id)), 'addItemText' => 'Agregar + Socio', 'removeText' => 'Borrar'));
?>
        
        
        
        
        

	<div class="form-actions">
		<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Create' : 'Save'));
?>
	</div>

<?php 
Пример #6
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Socio::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Пример #7
0
 /**
  * Filter the query by a related Socio object
  *
  * @param     Socio|PropelCollection $socio The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    AlquilerQuery The current query, for fluid interface
  */
 public function filterBySocio($socio, $comparison = null)
 {
     if ($socio instanceof Socio) {
         return $this->addUsingAlias(AlquilerPeer::SOCIO_ID, $socio->getId(), $comparison);
     } elseif ($socio instanceof PropelCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(AlquilerPeer::SOCIO_ID, $socio->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterBySocio() only accepts arguments of type Socio or PropelCollection');
     }
 }
Пример #8
0
function actualizarSucursalSocio($idSocio, $idSucursal)
{
    if (is_numeric($idSocio) and $idSocio > 0) {
        if (is_numeric($idSucursal) and $idSucursal > 0) {
            $socio = new Socio();
            $response = $socio->actualizarSucursalSocio($idSocio, $idSucursal);
        } else {
            $response["success"] = 7;
            $response["message"] = 'El id de la sucursal debe ser un dato valido';
        }
    } else {
        $response["success"] = 6;
        $response["message"] = 'El Id del socio debe ser un dato valido';
    }
    return $response;
}
Пример #9
0
 /**
  * Exclude object from result
  *
  * @param     Socio $socio Object to remove from the list of results
  *
  * @return    SocioQuery The current query, for fluid interface
  */
 public function prune($socio = null)
 {
     if ($socio) {
         $this->addUsingAlias(SocioPeer::ID, $socio->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Пример #10
0
 /**
  * Declares an association between this object and a Socio object.
  *
  * @param      Socio $v
  * @return     Comentario The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setSocio(Socio $v = null)
 {
     if ($v === null) {
         $this->setSocioId(NULL);
     } else {
         $this->setSocioId($v->getId());
     }
     $this->aSocio = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Socio object, it will not be re-added.
     if ($v !== null) {
         $v->addComentario($this);
     }
     return $this;
 }
Пример #11
0
 /**
  * Filter the query by a related Socio object
  *
  * @param     Socio $socio  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    TipoSocioQuery The current query, for fluid interface
  */
 public function filterBySocio($socio, $comparison = null)
 {
     if ($socio instanceof Socio) {
         return $this->addUsingAlias(TipoSocioPeer::ID, $socio->getTipoSocioId(), $comparison);
     } elseif ($socio instanceof PropelCollection) {
         return $this->useSocioQuery()->filterByPrimaryKeys($socio->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterBySocio() only accepts arguments of type Socio or PropelCollection');
     }
 }
 public static function validar()
 {
     $nro_tarjeta = str_replace('-', '', Input::get('nro_tarjeta'));
     $pago = Input::get('pago');
     $cuotas = Input::get('cuotas') * 1;
     $importe = str_replace(',', '.', Input::get('importe'));
     $cupon = Input::get('cupon');
     $fechahoy = Formatos::fechaHoraActual();
     //--- Validar tarjeta ---
     $datos = TarjetasPlasticos::validarTarjeta($nro_tarjeta);
     if (count($datos) == 0) {
         return 'Nro. de Tarjeta Inválido';
     }
     $fechahoy = Formatos::fechaHoraActual();
     //$nombre 			= Formatos::capital($datos[0]->nombre);
     $tarjeta_estado = $datos[0]->tarjeta_estado;
     $socio_estado = $datos[0]->socio_estado;
     $cuenta_estado = $datos[0]->cuenta_estado;
     $fecha_vencimiento = $datos[0]->fecha_vencimiento;
     $fecha_inicio = $datos[0]->fecha_inicio;
     if ($tarjeta_estado != 0) {
         return 'La tarjeta no está Activa';
     }
     if ($socio_estado != 'A') {
         return 'El socio no está activo';
     }
     if ($cuenta_estado != 0 && $cuenta_estado != 4) {
         return 'Cuenta inactiva';
     }
     $dt = new DateTime($fecha_vencimiento);
     if (date_format($dt, 'd-m-Y') < $fechahoy) {
         return 'Tarjeta Vencida ' . $fechahoy;
     }
     if ($fecha_inicio > $fechahoy) {
         return 'Fecha de Inicio posterior a hoy';
     }
     //--- Validar cantidad de cuotas
     if ($pago == 0 || $pago > 2) {
         return 'Forma de pago incorrecta';
     }
     if ($pago == 1) {
         $pago = 'contado';
     }
     if ($pago == 2) {
         $pago = 'cuotas';
     }
     if ($pago == 'cuotas' && $cuotas <= 1) {
         return 'Para pago en Cuotas, el mínimo de cuotas es 2';
     }
     if ($pago == 'contado' && $cuotas != 1) {
         return 'Para pago de Contado, la cantidad de cuotas debe ser 1';
     }
     $planes = TarjetasPlanes::validarCuotas($cuotas) * 1;
     if ($planes <= 0) {
         return 'Supera el límite de cuotas';
     }
     //--- Validar períodos de cuotas
     $numero_cuenta = TarjetasPlasticos::cuenta($nro_tarjeta);
     if (!TarjetasLiquidaciones::validarLiquidaciones($numero_cuenta, $cuotas)) {
         return 'Faltan cargar Períodos para éstas cuotas';
     }
     //--- Validar importe
     if ($importe * 1 <= 0) {
         return 'Importe Inválido';
     }
     try {
         $nro_socio = TarjetasPlasticos::find($nro_tarjeta)->numero_socio;
         $numero_cuenta = TarjetasPlasticos::find($nro_tarjeta)->numero_cuenta;
     } catch (Exception $e) {
         return 'Falta Validar Nro. de Tarjeta';
     }
     $datos = Socio::scoring($nro_socio);
     $pendiente = Socio::consumosPendiente($numero_cuenta, $pago);
     $saldo_contado = $datos[0]->saldo_contado - $pendiente;
     $saldo_cuotas = $datos[0]->saldo_cuotas - $pendiente;
     if ($pago == 'contado') {
         $resto = $saldo_contado - $importe;
     }
     if ($pago == 'cuotas') {
         $resto = $saldo_cuotas - $importe;
     }
     if ($resto < 0) {
         return 'No tiene saldo suficiente';
     }
     //--- Validar cupón
     if ($cupon * 1 <= 0) {
         return 'Nro de Cupón Inválido';
     }
     if (TarjetasCupones::validarCupon($cupon) <= 0) {
         return 'Cupón no válido, o ya fué usado';
     }
     //$codigo_autorizacion = ParametrosTarjeta::codigoAutorizacion($pago);
     $codigo_comercio = Persona::numeroComercio();
     DB::beginTransaction();
     $codigo_autorizacion_mostrar = ParametrosTarjeta::codigoAutorizacion($pago);
     if ($codigo_autorizacion_mostrar == 'error') {
         return 'No se pudo generar el Código de Autorización.';
     }
     $cod_aut = explode('/', $codigo_autorizacion_mostrar);
     $codigo_autorizacion = $cod_aut[0];
     $codigo_autorizacion_add = $cod_aut[1];
     $sql = "\n\t\t      insert into hb_autorizaciones\n\t\t      (\n\t\t        nro_empresa,\t\t        nro_sucursal,\n\t\t        codigo_tarjeta,\t\t        codigo_autorizacion,\n\t\t        codigo_autorizacion_add,    numero_cuenta,\n\n\t\t        numero_tarjeta,\t\t        fecha_autorizacion,\n\t\t        importe,\t\t        \tcant_cuotas,\n\t\t        numero_cupon,\t\t        codigo_comercio\n\t\t      )\n\t\t      values\n\t\t      (\n\t\t        1,\t\t        \t\t\t1,\n\t\t        1,\t\t        \t\t\t{$codigo_autorizacion},\n\t\t        '{$codigo_autorizacion_add}',\t'{$numero_cuenta}',\n\t\t        \n\t\t        '{$nro_tarjeta}',\t\t        '{$fechahoy}',\n\t\t        {$importe},\t\t        \t{$cuotas},\n\t\t        {$cupon},\t\t        \t\t{$codigo_comercio}\n\t\t      )\n\t\t    ";
     try {
         $grabar = DB::insert($sql);
     } catch (Exception $e) {
         DB::rollback();
         return 'No se pudo finalizar la operación. Reintentar.';
     }
     if ($grabar != 1) {
         DB::rollback();
         return 'No se pudo finalizar la operación. Reintentar.';
     }
     DB::commit();
     return 'Código de Autorización: ' . $codigo_autorizacion_mostrar;
 }
Пример #13
0
 /**
  * @param	Socio $socio The socio object to add.
  */
 protected function doAddSocio($socio)
 {
     $this->collSocios[] = $socio;
     $socio->setTipoSocio($this);
 }
Пример #14
0
 function __construct($nro_socio, $fecha_nac, $fecha_alta, $fecha_baja, $id_tipo_socio, $id_tipo_cuota, $id_deporte, $descuento, $estado, $user, $pass, $id_cargo, $id_periodo)
 {
     parent::__construct($nro_socio, $fecha_nac, $fecha_alta, $fecha_baja, $id_tipo_socio, $id_tipo_cuota, $id_deporte, $descuento, $estado, $user, $pass);
     $this->id_cargo = $id_cargo;
     $this->id_periodo = $id_periodo;
 }