예제 #1
0
 public static function getDelete()
 {
     $id = Input::get('id');
     $mesa = Mesa::find($id);
     $mesa->delete();
     return Redirect::to('/mesa');
 }
예제 #2
0
 public function indexAction()
 {
     $art_id = (int) Input::get('id', 0);
     if ($art_id) {
         $article = Article::find($art_id);
     } else {
         $article = Article::take(1)->skip(0);
     }
     $currarticle = $article->join('article_contents', 'article_contents.article_id', '=', 'articles.id')->get(['articles.*', 'article_contents.title', 'article_contents.content'])->first()->toArray();
     \Mesa::prr($currarticle, 55);
     $topicarr = Menu::find($currarticle['menu_id'])->topics()->orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
     $topics = $this->clubarr($topicarr);
     $allmenus = Menu::orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
     $menus = $this->clubarr($allmenus);
     $viewarr = array('article' => $currarticle, 'topics' => $topics, 'menus' => $menus);
     return view('civil.article.index')->with($viewarr);
 }
예제 #3
0
 public function filtrarConvidados()
 {
     try {
         $this->layout = 'null';
         $nome = Utils::sanitazeString($_POST['nome']);
         $registros = $this->Reserva->buscaConvidadoHostess($nome, date('Y-m-d'), $this->empresas_id);
         /**
          * listar as mesas por registro
          */
         $newRegistros = array();
         $ambienteModel = new Ambiente();
         $mesaModel = new Mesa();
         foreach ($registros as $registro) {
             /**
              * recupero as mesas
              */
             $ambientes = $ambienteModel->ambientesReservas($registro['reservas_id']);
             $mesas = $mesaModel->mesasReservas($registro['reservas_id']);
             $arrayMesas = array('mesas' => join(', ', $mesas), 'nome_ambiente' => join(', ', $ambientes));
             $arrayMesas = array_merge($arrayMesas, $this->Reserva->confirmadosParaEvento($registro['reservas_id']));
             $newRegistros[] = array_merge($registro, $arrayMesas);
         }
         $this->set('registros', $newRegistros);
         $this->render();
     } catch (Exception $ex) {
         print_r($ex->getTrace());
     }
 }
예제 #4
0
<?php

include "IncluirClases.php";
//si hace click sobre un registro llene el form modal con datos
if (isset($_GET['id'])) {
    $id = $_GET['id'];
}
//si hizo click en el envio
if (isset($_POST['submit'])) {
    //captura de datos
    $id = $_POST['id'];
    $descripcion = $_POST['descripcion'];
    $salonero = $_POST['salonero'];
    //instancia de la identidad
    $MesaE = new Mesa();
    $MesaE->setId($id);
    $MesaE->setDescripcion($descripcion);
    $MesaE->setIdSalonero($salonero);
    $MesaBLL = new MesaBLL();
    $MesaBLL->Agregar($MesaE);
    if ($MesaBLL->getHayError()) {
        $_SESSION['registrado'] = 'f2';
    } else {
        $_SESSION['registrado'] = 't1';
    }
    //sea cual sea el caso lo retorna a mantenimientos
    header("location:../Mantenimiento_Mesas.php");
}
?>

예제 #5
0
 /**
  * Declares an association between this object and a Mesa object.
  *
  * @param             Mesa $v
  * @return JugadorMesa The current object (for fluent API support)
  * @throws PropelException
  */
 public function setMesa(Mesa $v = null)
 {
     if ($v === null) {
         $this->setMesaId(NULL);
     } else {
         $this->setMesaId($v->getId());
     }
     $this->aMesa = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Mesa object, it will not be re-added.
     if ($v !== null) {
         $v->addJugadorMesa($this);
     }
     return $this;
 }
예제 #6
0
 /**
  * Exclude object from result
  *
  * @param   Mesa $mesa Object to remove from the list of results
  *
  * @return MesaQuery The current query, for fluid interface
  */
 public function prune($mesa = null)
 {
     if ($mesa) {
         $this->addUsingAlias(MesaPeer::ID, $mesa->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
예제 #7
0
 public function cadastroPrimeirasConfiguracoes()
 {
     try {
         $salaoId = 0;
         $ambienteId = 0;
         $mesaId = 0;
         $_POST = Utils::sanitazeArray($_POST);
         $this->Empresa->data = array_merge($this->Empresa->data, $_POST['Mesa']);
         $this->Empresa->validate = $this->Empresa->validate_primeiras_config;
         if ($this->Empresa->validates()) {
             $SalaoModel = new Salao();
             $salaoId = $SalaoModel->genericInsert(array('empresas_id' => Session::read('Empresa.empresas_id'), 'nome' => 'Salão - (Teste)', 'status' => TRUE));
             $AmbienteModel = new Ambiente();
             $ambienteId = $AmbienteModel->genericInsert(array('saloes_id' => (int) $salaoId, 'empresas_id' => (int) Session::read('Empresa.empresas_id'), 'nome' => 'Ambiente - (Teste)', 'capacidade' => (int) $_POST['Mesa']['quantidade'] * 2, 'status' => TRUE));
             /**
              * criar um metodo que gerer mesas apartir de um inteiro
              */
             $MesaModel = new Mesa();
             $MesaModel->inserirMesasCadastroSite((int) Session::read('Empresa.empresas_id'), $_POST['Mesa']['quantidade'], (int) $ambienteId);
             $_SESSION = array_merge($_SESSION, $_POST);
             /**
              * envio de email ao terminar
              */
             $parameters = array('destinatario' => $_SESSION['Pessoa']['email'], 'nome_destinatario' => $_SESSION['Pessoa']['nome'], 'assunto' => 'Cadastro de empresa - my night', 'layout' => 'email_cadastro');
             $parameters = array_merge($parameters, $_SESSION['Pessoa']);
             $parameters = array_merge($parameters, $_SESSION['Empresa']);
             $parameters = array_merge($parameters, $_SESSION['Endereco']);
             CurlStatic::send($parameters, 'json', Enum::URL_SERVIDOR_DE_EMAIL, 'POST');
             echo json_encode(array('erro' => false, 'mensagem' => 'Seu cadastro foi realizado com sucesso, enviamos um e-mail com os dados agora é só se logar e experimentar o software!', 'div' => '#PrimeiroCadastroForm'));
         } else {
             echo json_encode(array('erro' => true, 'mensagem' => $this->Empresa->refactoryError($this->Empresa->validateErros), 'div' => '#PrimeiroCadastroForm'));
         }
     } catch (Exception $ex) {
         echo json_encode(array('erro' => true, 'mensagem' => $ex->getMessage(), 'div' => '#PrimeiroCadastroForm'));
     }
 }
예제 #8
0
 /**
  * Filter the query by a related Mesa object
  *
  * @param   Mesa|PropelObjectCollection $mesa The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return   JugadorMesaQuery The current query, for fluid interface
  * @throws   PropelException - if the provided filter is invalid.
  */
 public function filterByMesa($mesa, $comparison = null)
 {
     if ($mesa instanceof Mesa) {
         return $this->addUsingAlias(JugadorMesaPeer::MESA_ID, $mesa->getId(), $comparison);
     } elseif ($mesa instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(JugadorMesaPeer::MESA_ID, $mesa->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByMesa() only accepts arguments of type Mesa or PropelCollection');
     }
 }
예제 #9
0
 /**
  * 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      Mesa $obj A Mesa object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         MesaPeer::$instances[$key] = $obj;
     }
 }
예제 #10
0
include "IncluirClases.php";
//si hace click sobre un registro llene el form modal con datos
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $Mesa = new MesaBLL();
    $vMesa = $Mesa->ConsultarRegistro($id);
}
//si hizo click en el envio
if (isset($_POST['submit'])) {
    //captura de datos
    $id = $_POST['idHidden'];
    $descripcion = $_POST['descripcion'];
    $salonero = $_POST['salonero'];
    //instancia de la identidad
    $MesaE = new Mesa();
    $MesaE->setId($id);
    $MesaE->setDescripcion($descripcion);
    $MesaE->setIdSalonero($salonero);
    $MesaBLL = new MesaBLL();
    $MesaBLL->Modificar($MesaE);
    //$_SESSION['v']=$MesaE;
    if ($MesaBLL->getHayError()) {
        $_SESSION['registrado'] = 'f';
    } else {
        $_SESSION['registrado'] = 't';
    }
    //sea cual sea el caso lo retorna a mantenimientos
    header("location:../Mantenimiento_Mesas.php");
}
?>