예제 #1
0
function listaPublicidad()
{
    include_once '../php/clases/Publicidad.class.php';
    $publicidad = new Publicidad(1);
    $respuesta = $publicidad->listaPublicidad();
    if (sizeof($respuesta)) {
        $exito = 1;
        $code = "";
        $msg = "Lista de Publicidad";
        $datos = array("exito" => $exito, "code" => $code, "msg" => $msg, "datos" => $respuesta);
    } else {
        $exito = 1;
        $code = "";
        $msg = "Lista de Publicidad no encontrada";
        $datos = array("exito" => $exito, "code" => $code, "msg" => $msg);
    }
    echo json_encode($datos);
}
예제 #2
0
 public function getPropaganda()
 {
     //lo mandamos jarcodeado deberiamos ver como implementar sobre q
     //publicidad se va a buscar en q momento
     $id = $this->getId();
     if ($id != null) {
         global $config;
         $servidor = $config['db']['servidor'];
         $usuario = $config['db']['usuario'];
         $pwd = $config['db']['pwd'];
         $bd = $config['db']['DBGlobal'];
         dataIO::conectar($servidor, $usuario, $pwd, $bd);
         $publicidad = new Publicidad();
         $query = $publicidad->getPublicidadByid($id);
         try {
             $result = dataIO::executeQuery($query);
             $fila = mysqli_fetch_assoc($result);
             $publicidad = new Publicidad($fila);
             echo json_encode($publicidad->getJSon());
         } catch (Exception $e) {
             echo json_encode(null);
         }
     }
 }
예제 #3
0
<?php

$this->breadcrumbs = array('Ver Local' => array('local/verLocalCliente', 'id' => $id_local), Yii::t('app', 'Manage'));
Yii::app()->clientScript->registerScript('search', "\r\n\$('.search-button').click(function(){\r\n\t\$('.search-form').toggle();\r\n\treturn false;\r\n});\r\n\$('.search-form form').submit(function(){\r\n\t\$.fn.yiiGridView.update('recarga-grid', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n");
?>
<pre>
  <?php 
$publicidad = Publicidad::model()->random()->find();
echo $publicidad->mensaje;
?>
</pre>

<h1><?php 
echo Yii::t('app', 'Historial de Recargas');
?>
</h1>


<?php 
/*echo GxHtml::link(Yii::t('app', 'Busqueda Avanzada'), '#', array('class' => 'search-button')); ?>
<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); */
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbExtendedGridView', array('id' => 'recarga-grid', 'dataProvider' => new CArrayDataProvider($model, array('pagination' => array('pageSize' => 50))), 'type' => 'striped bordered condensed', 'template' => "{extendedSummary}\n{items}{pager}", 'columns' => array(array('name' => 'user_id', 'value' => 'GxHtml::valueEx($data->user)', 'filter' => GxHtml::listDataEx(User::model()->findAllAttributes(null, true))), array('name' => 'local_id', 'value' => 'GxHtml::valueEx($data->local)', 'filter' => GxHtml::listDataEx(Local::model()->findAllAttributes(null, true))), 'celular', 'fecha', 'compania', 'monto', 'comentario', 'estado'), 'extendedSummary' => array('title' => 'TOTAL RECARGAS', 'columns' => array('monto' => array('label' => '$', 'class' => 'TbSumOperation'))), 'extendedSummaryOptions' => array('class' => 'well pull-right')));
예제 #4
0
 public function getPubli()
 {
     $publicidad = Publicidad::actual()->get();
     return Response::json($publicidad);
 }
예제 #5
0
 public function showIndex($id = null)
 {
     if (!is_null($id)) {
         $dep = Department::find($id);
     }
     $title = "Inicio | pasillo24.com";
     if (!is_null($id)) {
         $lider = Publicaciones::join('usuario', 'usuario.id', '=', 'publicaciones.user_id')->where('publicaciones.status', '=', 'Aprobado')->where('publicaciones.ubicacion', '=', 'Principal')->where('publicaciones.tipo', '=', 'Lider')->where('publicaciones.pag_web', '!=', "")->where('publicaciones.fechFin', '>=', date('Y-m-d', time()))->where('publicaciones.deleted', '=', 0)->orderBy('publicaciones.fechFin', 'desc')->get($this->toReturn);
         $habitual = Publicaciones::join('usuario', 'usuario.id', '=', 'publicaciones.user_id')->where(function ($query) use($id) {
             /*Busco las habituales*/
             $query->where('publicaciones.tipo', '=', 'Habitual')->where(function ($query) {
                 /*Que vayan en la principal*/
                 $query->where('publicaciones.ubicacion', '=', 'Principal')->orWhere('publicaciones.ubicacion', '=', 'Ambos')->where('publicaciones.status', '=', 'Aprobado');
             })->where(function ($query) {
                 /*y que sigan activas*/
                 $query->where('publicaciones.fechFin', '>=', date('Y-m-d', time()))->where('publicaciones.status', '=', 'Aprobado');
             })->where('publicaciones.departamento', '=', $id);
         })->where('publicaciones.deleted', '=', 0)->orWhere(function ($query) use($id) {
             $query->where('publicaciones.tipo', '=', 'Lider')->where('publicaciones.ubicacion', '=', 'Principal')->where('publicaciones.pag_web', '=', "")->where('publicaciones.status', '=', 'Aprobado')->where('publicaciones.departamento', '=', $id);
         })->orderBy('publicaciones.fechFin', 'desc')->get($this->toReturn);
         $casual = Publicaciones::join('usuario', 'usuario.id', '=', 'publicaciones.user_id')->where('publicaciones.tipo', '=', 'Casual')->where('publicaciones.fechFin', '>=', date('Y-m-d', time()))->where('publicaciones.status', '=', 'Aprobado')->where('publicaciones.departamento', '=', $id)->where('publicaciones.deleted', '=', 0)->get($this->toReturn);
     } else {
         $lider = Publicaciones::join('usuario', 'usuario.id', '=', 'publicaciones.user_id')->where('publicaciones.status', '=', 'Aprobado')->where('publicaciones.ubicacion', '=', 'Principal')->where('publicaciones.tipo', '=', 'Lider')->where('publicaciones.pag_web', '!=', "")->where('publicaciones.fechFin', '>=', date('Y-m-d', time()))->where('publicaciones.deleted', '=', 0)->orderBy('publicaciones.fechFin', 'desc')->get($this->toReturn);
         $habitual = Publicaciones::join('usuario', 'usuario.id', '=', 'publicaciones.user_id')->where(function ($query) {
             /*Busco las habituales*/
             $query->where('publicaciones.tipo', '=', 'Habitual')->where(function ($query) {
                 /*Que vayan en la principal*/
                 $query->where('publicaciones.ubicacion', '=', 'Principal')->orWhere('publicaciones.ubicacion', '=', 'Ambos')->where('publicaciones.status', '=', 'Aprobado');
             })->where(function ($query) {
                 /*y que sigan activas*/
                 $query->where('publicaciones.fechFin', '>=', date('Y-m-d', time()))->where('publicaciones.status', '=', 'Aprobado');
             });
         })->where('publicaciones.deleted', '=', 0)->orWhere(function ($query) {
             $query->where('publicaciones.tipo', '=', 'Lider')->where('publicaciones.ubicacion', '=', 'Principal')->where('publicaciones.pag_web', '=', "")->where('publicaciones.status', '=', 'Aprobado');
         })->orderBy('publicaciones.fechFin', 'desc')->get($this->toReturn);
         $casual = Publicaciones::join('usuario', 'usuario.id', '=', 'publicaciones.user_id')->where('publicaciones.tipo', '=', 'Casual')->where('publicaciones.fechFin', '>=', date('Y-m-d', time()))->where('publicaciones.status', '=', 'Aprobado')->where('publicaciones.deleted', '=', 0)->get($this->toReturn);
     }
     $categories = Categorias::where('deleted', '=', 0)->where('tipo', '=', 1)->orderBy('nombre')->get();
     $otros = new StdClass();
     foreach ($categories as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros->id = $c->id;
             $otros->nombre = $c->nombre;
         }
     }
     if (!isset($otros->id)) {
         $otros->id = '1000';
         $otros->nombre = 'Otros';
     }
     $servicios = Categorias::where('deleted', '=', 0)->where('tipo', '=', 2)->orderBy('nombre')->get();
     $otros2 = new StdClass();
     foreach ($servicios as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros2->id = $c->id;
             $otros2->nombre = $c->nombre;
         }
     }
     if (!isset($otros2->id)) {
         $otros2->id = '1000';
         $otros2->nombre = 'Otros';
     }
     $departamentos = Department::get();
     $publi = Publicidad::get();
     if (!is_null($id)) {
         return Response::json(array('pubLider' => $lider, 'pubHabitual' => $habitual, 'pubCasual' => $casual, 'categorias' => $categories, 'servicios' => $servicios, 'departamentos' => $departamentos, 'publi' => $publi, 'depFilter' => $dep->id));
     } else {
         return Response::json(array('pubLider' => $lider, 'pubHabitual' => $habitual, 'pubCasual' => $casual, 'categorias' => $categories, 'servicios' => $servicios, 'departamentos' => $departamentos, 'publi' => $publi));
     }
 }
예제 #6
0
 public function actionGeneratePdf()
 {
     $session = new CHttpSession();
     $session->open();
     if (isset($session['Publicidad_model_search'])) {
         $model = $session['Publicidad_model_search'];
         $model = Publicidad::model()->findAll($model->search()->criteria);
     } else {
         $model = Publicidad::model()->findAll();
     }
     $this->toExcel($model, array('id', 'user', 'mensaje', 'estado'), date('Y-m-d-H-i-s'), array(), 'PDF');
 }
예제 #7
0
 public function aumentarP()
 {
     $publicidad = Publicidad::where('id', '=', Input::get('id'))->first();
     $publicidad->contador = $publicidad->contador + 1;
     $publicidad->save();
     return Response::json('success');
 }
 public function postElimSlides()
 {
     if (Request::ajax()) {
         $id = Input::get('id');
         $st = Input::get('status');
         $publi = Publicidad::find($id);
         if ($st == 1) {
             $publi->activo = 0;
         } else {
             $publi->activo = 1;
         }
         if ($publi->save()) {
             return Response::json(array('type' => 'success', 'msg' => 'Slide eliminado satisfactoriamente'));
         } else {
             return Response::json(array('type' => 'danger', 'msg' => 'Error al eliminar el slide'));
         }
     }
 }
 public function estadisticas()
 {
     $id = Auth::user()->id_restaurante;
     $restaurante = Restaurantes::find(Auth::user()->id_restaurante);
     $restaurantes = Pedidos::estadisticasRestaurante($id)->get();
     $restaurantes2 = Pedidos::estadisticasRestauranteE($id)->get();
     $publicidad = Publicidad::cuentasp(Auth::user()->id_restaurante)->get();
     $pedidos = Pedidos::pedidos(Auth::user()->id_restaurante);
     $reservaciones = Reservaciones::res(Auth::user()->id_restaurante);
     // $pedidos=Pedidos::pagadas($id)->count();
     // $credito = Estadisticas::where('id_restaurante', '=', $id)->where('tipo', '=','tarjeta')->get();
     // $efectivo = Estadisticas::where('id_restaurante', '=', $id)->where('tipo', '=','efectivo')->get();
     // $restaurante = Restaurantes::find(Auth::user()->id_restaurante);
     // if($pedidos==0){
     // 		return View::make('Restaurante.estadisticas2');
     // 	}
     // 	else{
     // 		$cantidad = Pedidos::cantidad()->get();
     return View::make('Restaurante.estadisticas', compact('restaurante', 'restaurantes', 'restaurantes2', 'publicidad', 'pedidos', 'reservaciones'));
 }
예제 #10
0
 public function finanzasPu()
 {
     $restaurantes = Restaurantes::find(Input::get('id'));
     $restaurantes->con_telefono = 0;
     $restaurantes->con_direccion = 0;
     $restaurantes->save();
     // $publicidad = Publicidad::where('id_restaurante','=',Input::get('id'))->first();
     Publicidad::where('id_restaurante', '=', Input::get('id'))->update(['contador' => 0]);
     // $publicidad->contador = 0;
     // $publicidad->save();
     return Redirect::to('admin/estadisticas')->with('message', 'Pago guardado');
 }
예제 #11
0
파일: index.php 프로젝트: rapbore/rch2
<?php

$this->breadcrumbs = array(Publicidad::label(2), Yii::t('app', 'Index'));
$this->menu = array(array('label' => Yii::t('app', 'Create') . ' ' . Publicidad::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Manage') . ' ' . Publicidad::label(2), 'url' => array('admin')));
?>

<h1><?php 
echo GxHtml::encode(Publicidad::label(2));
?>
</h1>

<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
예제 #12
0
 public function getAddDelItemProm($id)
 {
     $title = "Agregar/Quitar items";
     $prom = Publicidad::find($id);
     $b = Items::where('deleted', '=', '0')->where(function ($query) use($id) {
         $query->where('item_prom', '=', 0)->orWhere('item_prom', '=', $id);
     })->get(array('item_cod', 'id', 'item_prom'));
     $item = array();
     $i = 0;
     foreach ($b as $a) {
         $aux = Misc::where('item_id', '=', $a->id)->where('deleted', '=', 0)->first();
         $b->img[$i] = Images::where('misc_id', '=', $aux->id)->where('deleted', '=', 0)->pluck('image');
         $item[$i] = $b;
         $i++;
     }
     return View::make('admin.mdfPromItem')->with('title', $title)->with('prom', $prom)->with('items', $item);
 }
예제 #13
0
 public function showIndex($id = null)
 {
     if (!is_null($id)) {
         $dep = Department::find($id);
     }
     $title = "Inicio | pasillo24.com";
     if (!is_null($id)) {
         $lider = Publicaciones::where('status', '=', 'Aprobado')->where('ubicacion', '=', 'Principal')->where('tipo', '=', 'Lider')->where('publicaciones.pag_web', '!=', "")->where('fechFin', '>=', date('Y-m-d', time()))->where('publicaciones.deleted', '=', 0)->orderBy('fechFin', 'desc')->get(array('publicaciones.img_1', 'publicaciones.titulo', 'publicaciones.precio', 'publicaciones.moneda', 'publicaciones.id'));
         $habitual = Publicaciones::where(function ($query) use($id) {
             /*Busco las habituales*/
             $query->where('tipo', '=', 'Habitual')->where(function ($query) {
                 /*Que vayan en la principal*/
                 $query->where('ubicacion', '=', 'Principal')->orWhere('ubicacion', '=', 'Ambos')->where('status', '=', 'Aprobado');
             })->where(function ($query) {
                 /*y que sigan activas*/
                 $query->where('fechFin', '>=', date('Y-m-d', time()))->where('status', '=', 'Aprobado');
             })->where('departamento', '=', $id);
         })->where('deleted', '=', 0)->orWhere(function ($query) use($id) {
             $query->where('tipo', '=', 'Lider')->where('ubicacion', '=', 'Principal')->where('pag_web', '=', "")->where('status', '=', 'Aprobado')->where('departamento', '=', $id);
         })->orderBy('fechFin', 'desc')->get();
         $casual = Publicaciones::where('tipo', '=', 'Casual')->where('fechFin', '>=', date('Y-m-d', time()))->where('status', '=', 'Aprobado')->where('departamento', '=', $id)->where('deleted', '=', 0)->get();
     } else {
         $lider = Publicaciones::where('status', '=', 'Aprobado')->where('ubicacion', '=', 'Principal')->where('tipo', '=', 'Lider')->where('pag_web', '!=', "")->where('fechFin', '>=', date('Y-m-d', time()))->where('deleted', '=', 0)->orderBy('fechFin', 'desc')->get();
         $habitual = Publicaciones::where(function ($query) {
             /*Busco las habituales*/
             $query->where('tipo', '=', 'Habitual')->where(function ($query) {
                 /*Que vayan en la principal*/
                 $query->where('ubicacion', '=', 'Principal')->orWhere('ubicacion', '=', 'Ambos')->where('status', '=', 'Aprobado');
             })->where(function ($query) {
                 /*y que sigan activas*/
                 $query->where('fechFin', '>=', date('Y-m-d', time()))->where('status', '=', 'Aprobado');
             });
         })->orWhere(function ($query) {
             $query->where('tipo', '=', 'Lider')->where('ubicacion', '=', 'Principal')->where('pag_web', '=', "")->where('status', '=', 'Aprobado');
         })->where('deleted', '=', 0)->orderBy('fechFin', 'desc')->get();
         $casual = Publicaciones::where('tipo', '=', 'Casual')->where('fechFin', '>=', date('Y-m-d', time()))->where('status', '=', 'Aprobado')->where('deleted', '=', 0)->get();
     }
     $categories = Categorias::where('deleted', '=', 0)->where('tipo', '=', 1)->orderBy('nombre')->get();
     $otros = new StdClass();
     foreach ($categories as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros->id = $c->id;
             $otros->nombre = $c->nombre;
         }
     }
     if (!isset($otros->id)) {
         $otros->id = '1000';
         $otros->nombre = 'Otros';
     }
     $servicios = Categorias::where('deleted', '=', 0)->where('tipo', '=', 2)->orderBy('nombre')->get();
     $otros2 = new StdClass();
     foreach ($servicios as $c) {
         if (strtolower($c->nombre) == 'otros') {
             $otros2->id = $c->id;
             $otros2->nombre = $c->nombre;
         }
     }
     if (!isset($otros2->id)) {
         $otros2->id = '1000';
         $otros2->nombre = 'Otros';
     }
     $departamentos = Department::get();
     $publi = Publicidad::get();
     if (!is_null($id)) {
         return View::make('index')->with('title', $title)->with('publi', $publi)->with('lider', $lider)->with('categories', $categories)->with('departamentos', $departamentos)->with('habitual', $habitual)->with('casual', $casual)->with('otros', $otros)->with('otros2', $otros2)->with('servicios', $servicios)->with('depFilter', $dep->id);
     } else {
         return View::make('index')->with('title', $title)->with('publi', $publi)->with('lider', $lider)->with('categories', $categories)->with('departamentos', $departamentos)->with('habitual', $habitual)->with('casual', $casual)->with('otros', $otros)->with('otros2', $otros2)->with('servicios', $servicios);
     }
 }