done cleaning
132
lib/Dojo.pm
@@ -6,86 +6,86 @@ use Dojo::Model::Users;
|
|||||||
use Dojo::Model::Vdgproc;
|
use Dojo::Model::Vdgproc;
|
||||||
|
|
||||||
# This method will run once at server start
|
# This method will run once at server start
|
||||||
sub startup {
|
sub startup {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $config = $self->plugin('Config'); #Config hash dojo.conf
|
my $config = $self->plugin('Config'); #Config hash dojo.conf
|
||||||
# $self->plugin('PODRenderer') if $config->{perldoc}; #doc
|
# $self->plugin('PODRenderer') if $config->{perldoc}; #doc
|
||||||
$self->secrets(['Mojojojo jojo']); #cookies
|
$self->secrets(['Mojojojo jojo']); #cookies
|
||||||
|
|
||||||
$self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new });
|
$self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new });
|
||||||
$self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new });
|
$self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new });
|
||||||
$self->helper(mproc => sub { state $mproc = Dojo::Model::Vdgproc->new });
|
$self->helper(mproc => sub { state $mproc = Dojo::Model::Vdgproc->new });
|
||||||
$self->defaults({%Dojo::Conf::def});
|
$self->defaults({%Dojo::Conf::def});
|
||||||
my $r = $self->routes; #router
|
my $r = $self->routes; #router
|
||||||
|
|
||||||
# de la pagina ===============================================================
|
# de la pagina ===============================================================
|
||||||
$r->any('/')->to('home#home_');
|
$r->any('/')->to('home#home_');
|
||||||
$r->any('/home')->to('home#home');
|
$r->any('/home')->to('home#home');
|
||||||
$r->any('/pod')->to('home#podcast');
|
$r->any('/pod')->to('home#podcast');
|
||||||
# $r->any('/store')->to('home#store');
|
# $r->any('/store')->to('home#store');
|
||||||
$r->any('/tv')->to('home#tv');
|
$r->any('/tv')->to('home#tv');
|
||||||
$r->any('/contact')->to('home#contact');
|
$r->any('/contact')->to('home#contact');
|
||||||
$r->any('/contact2')->to('home#contact2');
|
$r->any('/contact2')->to('home#contact2');
|
||||||
$r->any('/pang')->to('home#pang');
|
$r->any('/pang')->to('home#pang');
|
||||||
# json ==================
|
# json ==================
|
||||||
$r->any('/json/*dreq')->to('data#simple');
|
$r->any('/json/*dreq')->to('data#simple');
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# de la tienda ================================================================
|
# de la tienda ================================================================
|
||||||
$r->any('/cal')->to('proc#cal');
|
$r->any('/cal')->to('proc#cal');
|
||||||
$r->any('/event/:id'=> [id => qr/\d+/])->to('proc#event');
|
$r->any('/event/:id'=> [id => qr/\d+/])->to('proc#event');
|
||||||
$r->any('/spay/:class/:id' => [class => qr/\d+/, id => qr/\d+/])->to('proc#spay');
|
$r->any('/spay/:class/:id' => [class => qr/\d+/, id => qr/\d+/])->to('proc#spay');
|
||||||
$r->any('/spay/intentCreate')->to('proc#intentCreate');
|
$r->any('/spay/intentCreate')->to('proc#intentCreate');
|
||||||
$r->any('/spay/intentConfirm')->to('proc#intentConfirm');
|
$r->any('/spay/intentConfirm')->to('proc#intentConfirm');
|
||||||
$r->any('/spay/userCheck')->to('proc#userCheck');
|
$r->any('/spay/userCheck')->to('proc#userCheck');
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# candy =======================================================================
|
# candy =======================================================================
|
||||||
$r->any('/json/candy/:command')->to('data#candy');
|
$r->any('/json/candy/:command')->to('data#candy');
|
||||||
$r->any('/candy')->to('home#candy');
|
$r->any('/candy')->to('home#candy');
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# usuarios y accesos ==========================================================
|
# usuarios y accesos ==========================================================
|
||||||
$r->any('/reg')->to('users#reg');
|
$r->any('/reg')->to('users#reg');
|
||||||
|
|
||||||
# login guest ======
|
# login guest ======
|
||||||
$r->any('/login')->to('users#login');
|
$r->any('/login')->to('users#login');
|
||||||
$r->any('/logout')->to('users#logout');
|
$r->any('/logout')->to('users#logout');
|
||||||
|
|
||||||
my $logged_in = $r->under('/')->to('users#is_logged');
|
my $logged_in = $r->under('/')->to('users#is_logged');
|
||||||
$logged_in->get('/radio')->to('home#radio');
|
$logged_in->get('/radio')->to('home#radio');
|
||||||
# ===================
|
# ===================
|
||||||
|
|
||||||
# login user grulla =
|
# login user grulla =
|
||||||
# common grulla user
|
# common grulla user
|
||||||
my $user = $r->under('/')->to('users#is_grulla');
|
my $user = $r->under('/')->to('users#is_grulla');
|
||||||
$user->any('/ccast')->to('home#bcast');
|
$user->any('/ccast')->to('home#bcast');
|
||||||
# personal
|
# personal
|
||||||
my $guest = $r->under('/')->to('users#is_grulla_tmp');
|
my $guest = $r->under('/')->to('users#is_grulla_tmp');
|
||||||
$guest->any('/bcast')->to('home#bcast');
|
$guest->any('/bcast')->to('home#bcast');
|
||||||
# ===================
|
# ===================
|
||||||
|
|
||||||
# admin =======================================================================
|
# admin =======================================================================
|
||||||
my $admin = $r->under('/admin')->to('users#is_admin');
|
my $admin = $r->under('/admin')->to('users#is_admin');
|
||||||
$admin->any('')->to('admin#admin');
|
$admin->any('')->to('admin#admin');
|
||||||
$admin->any('home')->to('admin#admin');
|
$admin->any('home')->to('admin#admin');
|
||||||
$admin->any('radio')->to('admin#radio');
|
$admin->any('radio')->to('admin#radio');
|
||||||
$admin->any('eventos')->to('admin#eventos');
|
$admin->any('eventos')->to('admin#eventos');
|
||||||
$admin->any('eventos/:type'=> [type=>['e','p','c']])->to('admin#eventos');
|
$admin->any('eventos/:type'=> [type=>['e','p','c']])->to('admin#eventos');
|
||||||
$admin->any('mensajes')->to('admin#mensajes');
|
$admin->any('mensajes')->to('admin#mensajes');
|
||||||
$admin->any('tienda')->to('admin#tienda');
|
$admin->any('tienda')->to('admin#tienda');
|
||||||
$admin->any('json/:dreq/:id')->to('admin#json');
|
$admin->any('json/:dreq/:id')->to('admin#json');
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
# a not foud ==================================================================
|
# a not foud ==================================================================
|
||||||
|
|
||||||
$r->any('/*whatever' => {whatever => ''} => sub {
|
$r->any('/*whatever' => {whatever => ''} => sub {
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
my $whatever = $c->param('whatever');
|
my $whatever = $c->param('whatever');
|
||||||
$c->stash(layout=>'clean');
|
$c->stash(layout=>'clean');
|
||||||
$c->render(template=>'home/not_found', status=>404);
|
$c->render(template=>'home/not_found', status=>404);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|||||||
@@ -25,15 +25,23 @@ sub cal {
|
|||||||
sub event{
|
sub event{
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
my $data=$c->mproc->event($c->param('id'));
|
my $data=$c->mproc->event($c->param('id'));
|
||||||
$c->redirect_to('cal') unless ($data->{'cname'});
|
$c->redirect_to('cal') unless (defined $data->{'cname'});
|
||||||
$c->stash($data);
|
$c->stash($data);
|
||||||
$c->stash(layout=> "defaultContact");
|
$c->stash(layout=> "defaultContact");
|
||||||
}
|
}
|
||||||
|
|
||||||
sub store{
|
sub spay{
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
$c->stash( r=>$c->dbg->store);
|
my $data=$c->mproc->spay(1,$c->param('id'));
|
||||||
$c->stash(layout=> "defaultContact");
|
|
||||||
|
$c->redirect_to('cal') unless (defined $data->{'tid'});
|
||||||
|
if ($c->param('id') >= 80 && $c->param('id') <= 86 ){
|
||||||
|
$c->stash(layout=> "xpay");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$c->stash(layout=> "defaultContact");
|
||||||
|
}
|
||||||
|
$c->stash($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
#stripe appi function =============================================================================
|
#stripe appi function =============================================================================
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
select distinct
|
select distinct
|
||||||
month(tienda_evento.fecha_inicio) as month,
|
month(t.fecha_inicio) as month,
|
||||||
year(tienda_evento.fecha_inicio) as year,
|
year(t.fecha_inicio) as year,
|
||||||
date_format(tienda_evento.fecha_inicio,'%Y%m') as id
|
date_format(t.fecha_inicio,'%Y%m') as id
|
||||||
from tienda_evento
|
from curso_tienda as t
|
||||||
where estado=1 and estore = 1;
|
where estado=1 and estore = 1;
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
|
|
||||||
select
|
select
|
||||||
date_format(tienda_evento.fecha_inicio,'%Y%m') as bid,
|
date_format(t.fecha_inicio,'%Y%m') as bid,
|
||||||
tienda_evento.id as eeid,
|
t.id as eeid,
|
||||||
concat(lugar.municipio,", ",lugar.federativa) as ciudad,
|
concat(l.municipio,", ",l.federativa) as ciudad,
|
||||||
concat(lugar.nombre,". ") as lugar,
|
concat(l.nombre,". ") as lugar,
|
||||||
lugar.direccion as dir,
|
l.direccion as dir,
|
||||||
day(tienda_evento.fecha_inicio) as dini,
|
day(t.fecha_inicio) as dini,
|
||||||
day(tienda_evento.fecha_fin) as dfin,
|
day(t.fecha_fin) as dfin,
|
||||||
month(tienda_evento.fecha_inicio) as mini,
|
month(t.fecha_inicio) as mini,
|
||||||
month(tienda_evento.fecha_fin) as mfin,
|
month(t.fecha_fin) as mfin,
|
||||||
curso.nombre as nombre,
|
c.nombre as nombre,
|
||||||
tienda_evento.imagen_chica as imagen_chica
|
t.imagen_chica as imagen_chica
|
||||||
from tienda_evento
|
from curso_tienda as t
|
||||||
inner join lugar on tienda_evento.lugar_id=lugar.id
|
inner join curso_lugar as l on t.lugar_id=l.id
|
||||||
inner join curso on tienda_evento.curso_id=curso.id
|
inner join curso as c on t.curso_id=c.id
|
||||||
where tienda_evento.estado=1 and tienda_evento.estore=1
|
where t.estado=1 and t.estore=1
|
||||||
order by tienda_evento.fecha_inicio
|
order by t.fecha_inicio
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
|
|
||||||
select
|
select
|
||||||
|
|
||||||
curso.nombre as cname,
|
c.nombre as cname,
|
||||||
concat(lugar.municipio,', ',lugar.federativa) as place,
|
concat(l.municipio,', ',l.federativa) as place,
|
||||||
|
|
||||||
lugar.direccion as paddr,
|
l.direccion as paddr,
|
||||||
lugar.observacion as pobs,
|
l.observacion as pobs,
|
||||||
lugar.municipio as city,
|
l.municipio as city,
|
||||||
tienda_evento.precio as cost,
|
t.precio as cost,
|
||||||
tienda_evento.spay as spay,
|
t.spay as spay,
|
||||||
case tienda_evento.promo_estado when 1 then coalesce(tienda_evento.promocion,"") else "" end as promo,
|
case t.promo_estado when 1 then coalesce(t.promocion,"") else "" end as promo,
|
||||||
curso.temario as csubjects,
|
c.descripcion as cdescription,
|
||||||
curso.servicios as cservices,
|
c.temario as csubjects,
|
||||||
lugar.nombre as pname,
|
c.servicios as cservices,
|
||||||
day(tienda_evento.fecha_inicio) as dini,
|
l.nombre as pname,
|
||||||
day(tienda_evento.fecha_fin) as dend,
|
day(t.fecha_inicio) as dini,
|
||||||
month(tienda_evento.fecha_inicio) as mini,
|
day(t.fecha_fin) as dend,
|
||||||
month(tienda_evento.fecha_fin) as mend
|
month(t.fecha_inicio) as mini,
|
||||||
|
month(t.fecha_fin) as mend
|
||||||
|
|
||||||
from tienda_evento
|
from curso_tienda as t
|
||||||
inner join lugar on tienda_evento.lugar_id=lugar.id
|
inner join curso_lugar as l on t.lugar_id=l.id
|
||||||
inner join curso on tienda_evento.curso_id=curso.id
|
inner join curso as c on t.curso_id=c.id
|
||||||
where tienda_evento.estado=1
|
where t.estado=1
|
||||||
and tienda_evento.id = ?
|
and t.id = ?
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -1,14 +1,30 @@
|
|||||||
select
|
|
||||||
id,
|
select
|
||||||
objeto,
|
t.id as tid,
|
||||||
nombre,
|
c.nombre as nombre,
|
||||||
precio,
|
c.subnombre as subnombre,
|
||||||
subnombre,
|
c.descripcion as descripcion,
|
||||||
promocion,
|
c.maestro as maestro,
|
||||||
opcion,
|
c.imagen_a as cimga,
|
||||||
descripcion,
|
c.imagen_b as cimgb,
|
||||||
imagenb as "imagen",
|
c.imagen_c as cimgc,
|
||||||
existencia,
|
day(t.fecha_inicio) as dini,
|
||||||
entrega_id "entrega_id"
|
month(t.fecha_inicio) as mini,
|
||||||
from tienda where id=? and activo =1;
|
day(t.fecha_fin) as dfin,
|
||||||
|
month(t.fecha_fin) as mfin,
|
||||||
|
t.precio as precio,
|
||||||
|
t.promocion as promo,
|
||||||
|
t.promo_estado as promo_estado,
|
||||||
|
t.playera_estado as playera_estado,
|
||||||
|
t.cupo as cupo,
|
||||||
|
l.nombre as lnombre,
|
||||||
|
l.federativa as federativa,
|
||||||
|
l.pais as pais,
|
||||||
|
l.municipio as municipio
|
||||||
|
from curso_tienda as t
|
||||||
|
join curso as c on c.id = t.curso_id
|
||||||
|
join curso_lugar as l on l.id = t.lugar_id
|
||||||
|
|
||||||
|
where t.id=? and t.estado =1
|
||||||
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -36,14 +36,9 @@ sub event{
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub spay {
|
sub spay{
|
||||||
my ($c,$class,$id) = @_;
|
my ($c,$class,$id) = @_;
|
||||||
return _read ($data_path->child("spay/qIdStore.q")->slurp,$id)->[0];
|
my $r = shift @{ _read ($data_path->child("spay/qIdStore.q")->slurp,$id)};
|
||||||
}
|
|
||||||
|
|
||||||
sub store_id {
|
|
||||||
my ($c,$class,$id) = @_;
|
|
||||||
my $r = _read ($data_path->child("store/qEstore.q")->slurp,$id)->[0];
|
|
||||||
$r->{fecha} = mtxt( $r->{dini},$r->{mini},$r->{dfin},$r->{mfin});
|
$r->{fecha} = mtxt( $r->{dini},$r->{mini},$r->{dfin},$r->{mfin});
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
public/proc/spay/img/China.jpg
Executable file
|
After Width: | Height: | Size: 118 KiB |
BIN
public/proc/spay/img/libreta.jpg
Executable file
|
After Width: | Height: | Size: 27 KiB |
BIN
public/proc/spay/img/libro.jpg
Executable file
|
After Width: | Height: | Size: 58 KiB |
BIN
public/proc/spay/img/libro_old.jpg
Executable file
|
After Width: | Height: | Size: 34 KiB |
BIN
public/proc/spay/img/mapa.jpg
Executable file
|
After Width: | Height: | Size: 74 KiB |
BIN
public/proc/spay/img/momo.jpg
Executable file
|
After Width: | Height: | Size: 185 KiB |
BIN
public/proc/spay/img/playera.jpg
Executable file
|
After Width: | Height: | Size: 130 KiB |
BIN
public/proc/spay/img/separa.jpg
Executable file
|
After Width: | Height: | Size: 5.8 KiB |
@@ -14,7 +14,7 @@
|
|||||||
<a class="nav" href="/tv"><p>Vuelo de Grulla TV</p></a>
|
<a class="nav" href="/tv"><p>Vuelo de Grulla TV</p></a>
|
||||||
<a class="nav mhide" href="/pod"><p>Programas Grabados</p></a>
|
<a class="nav mhide" href="/pod"><p>Programas Grabados</p></a>
|
||||||
<a class="nav mhide" href="/contact"><p>Contacto</p></a>
|
<a class="nav mhide" href="/contact"><p>Contacto</p></a>
|
||||||
<a class="nav mhide" href="/store"><p>Tienda Virtual</p></a>
|
<!--<a class="nav mhide" href="/store"><p>Tienda Virtual</p></a>-->
|
||||||
<a class="nav mhide" href="/pang"><p>Nuestra Escuela</p></a>
|
<a class="nav mhide" href="/pang"><p>Nuestra Escuela</p></a>
|
||||||
<div id="menu" class="hamb mshow"></div>
|
<div id="menu" class="hamb mshow"></div>
|
||||||
</article>
|
</article>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<a class="nav" href="/tv"><p>Vuelo de Grulla TV</p></a>
|
<a class="nav" href="/tv"><p>Vuelo de Grulla TV</p></a>
|
||||||
<a class="nav mhide" href="/pod"><p>Programas Grabados</p></a>
|
<a class="nav mhide" href="/pod"><p>Programas Grabados</p></a>
|
||||||
<a class="nav mhide" href="/contact"><p>Contacto</p></a>
|
<a class="nav mhide" href="/contact"><p>Contacto</p></a>
|
||||||
<a class="nav mhide" href="/store"><p>Tienda Virtual</p></a>
|
<!--<a class="nav mhide" href="/store"><p>Tienda Virtual</p></a>-->
|
||||||
<a class="nav mhide" href="/pang"><p>Nuestra Escuela</p></a>
|
<a class="nav mhide" href="/pang"><p>Nuestra Escuela</p></a>
|
||||||
<div id="menu" class="hamb mshow"></div>
|
<div id="menu" class="hamb mshow"></div>
|
||||||
</article>
|
</article>
|
||||||
|
|||||||
@@ -16,16 +16,18 @@
|
|||||||
<p class = "dir"><%= $paddr %></p>
|
<p class = "dir"><%= $paddr %></p>
|
||||||
<p class = "obs"><%= $pobs %></p>
|
<p class = "obs"><%= $pobs %></p>
|
||||||
<p class = "city"><%= $city %></p>
|
<p class = "city"><%= $city %></p>
|
||||||
<% if ($spay== 1) { =%>
|
|
||||||
<p class = " pmed price"><%= $cost %></p>
|
|
||||||
<% } =%>
|
|
||||||
<p class="promo"><%= $promo %></p>
|
<p class="promo"><%= $promo %></p>
|
||||||
</article>
|
</article>
|
||||||
<article class="specs">
|
<article class="specs">
|
||||||
<p id="subt">Temario</p>
|
<%== $cdescription %>
|
||||||
<%== $csubjects %>
|
<% if ($csubjects) { =%>
|
||||||
<p id="subt">El evento incluye</p>
|
<p id="subt">Temario</p>
|
||||||
<%== $cservices %>
|
<%== $csubjects %>
|
||||||
|
<% } =%>
|
||||||
|
<% if ($cservices) { =%>
|
||||||
|
<p id="subt">El evento incluye</p>
|
||||||
|
<%== $cservices %>
|
||||||
|
<% } =%>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
<section class="map">
|
<section class="map">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<article class=iimage>
|
<article class=iimage>
|
||||||
<p class="txt"><%= $subnombre %></p>
|
<p class="txt"><%= $subnombre %></p>
|
||||||
<img class="small" src= "/proc/store/img/<%= $cimga %>">
|
<img class="small" src= "/proc/spay/img/<%= $cimga %>">
|
||||||
<p class="txt"><%= $descripcion %></p>
|
<p class="txt"><%= $descripcion %></p>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
|||||||