diff --git a/bash b/bash deleted file mode 100644 index 6ffcae5..0000000 --- a/bash +++ /dev/null @@ -1 +0,0 @@ -ehco @o diff --git a/lib/Dojo.pm b/lib/Dojo.pm index 6698653..a035b95 100755 --- a/lib/Dojo.pm +++ b/lib/Dojo.pm @@ -6,86 +6,86 @@ use Dojo::Model::Users; use Dojo::Model::Vdgproc; # This method will run once at server start - sub startup { - my $self = shift; - my $config = $self->plugin('Config'); #Config hash dojo.conf - # $self->plugin('PODRenderer') if $config->{perldoc}; #doc - $self->secrets(['Mojojojo jojo']); #cookies +sub startup { + my $self = shift; + my $config = $self->plugin('Config'); #Config hash dojo.conf + # $self->plugin('PODRenderer') if $config->{perldoc}; #doc + $self->secrets(['Mojojojo jojo']); #cookies - $self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new }); - $self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new }); - $self->helper(mproc => sub { state $mproc = Dojo::Model::Vdgproc->new }); + $self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new }); + $self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new }); + $self->helper(mproc => sub { state $mproc = Dojo::Model::Vdgproc->new }); $self->defaults({%Dojo::Conf::def}); - my $r = $self->routes; #router + my $r = $self->routes; #router -# de la pagina =============================================================== - $r->any('/')->to('home#home_'); - $r->any('/home')->to('home#home'); - $r->any('/pod')->to('home#podcast'); - # $r->any('/store')->to('home#store'); - $r->any('/tv')->to('home#tv'); - $r->any('/contact')->to('home#contact'); - $r->any('/contact2')->to('home#contact2'); - $r->any('/pang')->to('home#pang'); -# json ================== - $r->any('/json/*dreq')->to('data#simple'); -# ============================================================================= + # de la pagina =============================================================== + $r->any('/')->to('home#home_'); + $r->any('/home')->to('home#home'); + $r->any('/pod')->to('home#podcast'); + # $r->any('/store')->to('home#store'); + $r->any('/tv')->to('home#tv'); + $r->any('/contact')->to('home#contact'); + $r->any('/contact2')->to('home#contact2'); + $r->any('/pang')->to('home#pang'); + # json ================== + $r->any('/json/*dreq')->to('data#simple'); + # ============================================================================= -# de la tienda ================================================================ - $r->any('/cal')->to('proc#cal'); - $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/intentCreate')->to('proc#intentCreate'); - $r->any('/spay/intentConfirm')->to('proc#intentConfirm'); - $r->any('/spay/userCheck')->to('proc#userCheck'); -# ============================================================================= + # de la tienda ================================================================ + $r->any('/cal')->to('proc#cal'); + $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/intentCreate')->to('proc#intentCreate'); + $r->any('/spay/intentConfirm')->to('proc#intentConfirm'); + $r->any('/spay/userCheck')->to('proc#userCheck'); + # ============================================================================= -# candy ======================================================================= - $r->any('/json/candy/:command')->to('data#candy'); - $r->any('/candy')->to('home#candy'); -# ============================================================================= + # candy ======================================================================= + $r->any('/json/candy/:command')->to('data#candy'); + $r->any('/candy')->to('home#candy'); + # ============================================================================= -# usuarios y accesos ========================================================== - $r->any('/reg')->to('users#reg'); - -# login guest ====== - $r->any('/login')->to('users#login'); - $r->any('/logout')->to('users#logout'); + # usuarios y accesos ========================================================== + $r->any('/reg')->to('users#reg'); - my $logged_in = $r->under('/')->to('users#is_logged'); - $logged_in->get('/radio')->to('home#radio'); -# =================== + # login guest ====== + $r->any('/login')->to('users#login'); + $r->any('/logout')->to('users#logout'); -# login user grulla = - # common grulla user - my $user = $r->under('/')->to('users#is_grulla'); - $user->any('/ccast')->to('home#bcast'); - # personal - my $guest = $r->under('/')->to('users#is_grulla_tmp'); - $guest->any('/bcast')->to('home#bcast'); -# =================== - -# admin ======================================================================= - my $admin = $r->under('/admin')->to('users#is_admin'); - $admin->any('')->to('admin#admin'); - $admin->any('home')->to('admin#admin'); - $admin->any('radio')->to('admin#radio'); - $admin->any('eventos')->to('admin#eventos'); - $admin->any('eventos/:type'=> [type=>['e','p','c']])->to('admin#eventos'); - $admin->any('mensajes')->to('admin#mensajes'); - $admin->any('tienda')->to('admin#tienda'); - $admin->any('json/:dreq/:id')->to('admin#json'); + my $logged_in = $r->under('/')->to('users#is_logged'); + $logged_in->get('/radio')->to('home#radio'); + # =================== -# ============================================================================= + # login user grulla = + # common grulla user + my $user = $r->under('/')->to('users#is_grulla'); + $user->any('/ccast')->to('home#bcast'); + # personal + my $guest = $r->under('/')->to('users#is_grulla_tmp'); + $guest->any('/bcast')->to('home#bcast'); + # =================== + + # admin ======================================================================= + my $admin = $r->under('/admin')->to('users#is_admin'); + $admin->any('')->to('admin#admin'); + $admin->any('home')->to('admin#admin'); + $admin->any('radio')->to('admin#radio'); + $admin->any('eventos')->to('admin#eventos'); + $admin->any('eventos/:type'=> [type=>['e','p','c']])->to('admin#eventos'); + $admin->any('mensajes')->to('admin#mensajes'); + $admin->any('tienda')->to('admin#tienda'); + $admin->any('json/:dreq/:id')->to('admin#json'); + + # ============================================================================= + + # a not foud ================================================================== -# a not foud ================================================================== - $r->any('/*whatever' => {whatever => ''} => sub { - my $c = shift; - my $whatever = $c->param('whatever'); - $c->stash(layout=>'clean'); - $c->render(template=>'home/not_found', status=>404); -}); + my $c = shift; + my $whatever = $c->param('whatever'); + $c->stash(layout=>'clean'); + $c->render(template=>'home/not_found', status=>404); + }); } 1; diff --git a/lib/Dojo/Controller/Proc.pm b/lib/Dojo/Controller/Proc.pm index c47a5c6..7c07a39 100644 --- a/lib/Dojo/Controller/Proc.pm +++ b/lib/Dojo/Controller/Proc.pm @@ -25,15 +25,23 @@ sub cal { sub event{ my $c = shift; 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(layout=> "defaultContact"); } -sub store{ +sub spay{ my $c = shift; - $c->stash( r=>$c->dbg->store); - $c->stash(layout=> "defaultContact"); + my $data=$c->mproc->spay(1,$c->param('id')); + + $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 ============================================================================= diff --git a/lib/Dojo/Model/Data/cal/q1Block.q b/lib/Dojo/Model/Data/cal/q1Block.q index 618d5e5..4472b7c 100755 --- a/lib/Dojo/Model/Data/cal/q1Block.q +++ b/lib/Dojo/Model/Data/cal/q1Block.q @@ -1,6 +1,6 @@ select distinct - month(tienda_evento.fecha_inicio) as month, - year(tienda_evento.fecha_inicio) as year, - date_format(tienda_evento.fecha_inicio,'%Y%m') as id -from tienda_evento + month(t.fecha_inicio) as month, + year(t.fecha_inicio) as year, + date_format(t.fecha_inicio,'%Y%m') as id +from curso_tienda as t where estado=1 and estore = 1; diff --git a/lib/Dojo/Model/Data/cal/q3Event.q b/lib/Dojo/Model/Data/cal/q3Event.q index b1ce140..bc055c1 100755 --- a/lib/Dojo/Model/Data/cal/q3Event.q +++ b/lib/Dojo/Model/Data/cal/q3Event.q @@ -1,20 +1,20 @@ select - date_format(tienda_evento.fecha_inicio,'%Y%m') as bid, - tienda_evento.id as eeid, - concat(lugar.municipio,", ",lugar.federativa) as ciudad, - concat(lugar.nombre,". ") as lugar, - lugar.direccion as dir, - day(tienda_evento.fecha_inicio) as dini, - day(tienda_evento.fecha_fin) as dfin, - month(tienda_evento.fecha_inicio) as mini, - month(tienda_evento.fecha_fin) as mfin, - curso.nombre as nombre, - tienda_evento.imagen_chica as imagen_chica -from tienda_evento - inner join lugar on tienda_evento.lugar_id=lugar.id - inner join curso on tienda_evento.curso_id=curso.id -where tienda_evento.estado=1 and tienda_evento.estore=1 -order by tienda_evento.fecha_inicio + date_format(t.fecha_inicio,'%Y%m') as bid, + t.id as eeid, + concat(l.municipio,", ",l.federativa) as ciudad, + concat(l.nombre,". ") as lugar, + l.direccion as dir, + day(t.fecha_inicio) as dini, + day(t.fecha_fin) as dfin, + month(t.fecha_inicio) as mini, + month(t.fecha_fin) as mfin, + c.nombre as nombre, + t.imagen_chica as imagen_chica +from curso_tienda as t + inner join curso_lugar as l on t.lugar_id=l.id + inner join curso as c on t.curso_id=c.id +where t.estado=1 and t.estore=1 +order by t.fecha_inicio ; diff --git a/lib/Dojo/Model/Data/event/qEvent.q b/lib/Dojo/Model/Data/event/qEvent.q index 38b04e9..f8e3907 100755 --- a/lib/Dojo/Model/Data/event/qEvent.q +++ b/lib/Dojo/Model/Data/event/qEvent.q @@ -1,26 +1,27 @@ select - curso.nombre as cname, - concat(lugar.municipio,', ',lugar.federativa) as place, + c.nombre as cname, + concat(l.municipio,', ',l.federativa) as place, - lugar.direccion as paddr, - lugar.observacion as pobs, - lugar.municipio as city, - tienda_evento.precio as cost, - tienda_evento.spay as spay, - case tienda_evento.promo_estado when 1 then coalesce(tienda_evento.promocion,"") else "" end as promo, - curso.temario as csubjects, - curso.servicios as cservices, - lugar.nombre as pname, - day(tienda_evento.fecha_inicio) as dini, - day(tienda_evento.fecha_fin) as dend, - month(tienda_evento.fecha_inicio) as mini, - month(tienda_evento.fecha_fin) as mend + l.direccion as paddr, + l.observacion as pobs, + l.municipio as city, + t.precio as cost, + t.spay as spay, + case t.promo_estado when 1 then coalesce(t.promocion,"") else "" end as promo, + c.descripcion as cdescription, + c.temario as csubjects, + c.servicios as cservices, + l.nombre as pname, + day(t.fecha_inicio) as dini, + day(t.fecha_fin) as dend, + month(t.fecha_inicio) as mini, + month(t.fecha_fin) as mend -from tienda_evento - inner join lugar on tienda_evento.lugar_id=lugar.id - inner join curso on tienda_evento.curso_id=curso.id - where tienda_evento.estado=1 - and tienda_evento.id = ? +from curso_tienda as t + inner join curso_lugar as l on t.lugar_id=l.id + inner join curso as c on t.curso_id=c.id + where t.estado=1 + and t.id = ? ; diff --git a/lib/Dojo/Model/Data/spay/qIdStore.q b/lib/Dojo/Model/Data/spay/qIdStore.q index 239532d..4ca0c12 100755 --- a/lib/Dojo/Model/Data/spay/qIdStore.q +++ b/lib/Dojo/Model/Data/spay/qIdStore.q @@ -1,14 +1,30 @@ -select - id, - objeto, - nombre, - precio, - subnombre, - promocion, - opcion, - descripcion, - imagenb as "imagen", - existencia, - entrega_id "entrega_id" -from tienda where id=? and activo =1; + +select + t.id as tid, + c.nombre as nombre, + c.subnombre as subnombre, + c.descripcion as descripcion, + c.maestro as maestro, + c.imagen_a as cimga, + c.imagen_b as cimgb, + c.imagen_c as cimgc, + day(t.fecha_inicio) as dini, + month(t.fecha_inicio) as mini, + 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 +; diff --git a/lib/Dojo/Model/Vdgproc.pm b/lib/Dojo/Model/Vdgproc.pm index f53046e..f5dba26 100644 --- a/lib/Dojo/Model/Vdgproc.pm +++ b/lib/Dojo/Model/Vdgproc.pm @@ -36,14 +36,9 @@ sub event{ return $r; } -sub spay { +sub spay{ my ($c,$class,$id) = @_; - return _read ($data_path->child("spay/qIdStore.q")->slurp,$id)->[0]; -} - -sub store_id { - my ($c,$class,$id) = @_; - my $r = _read ($data_path->child("store/qEstore.q")->slurp,$id)->[0]; + my $r = shift @{ _read ($data_path->child("spay/qIdStore.q")->slurp,$id)}; $r->{fecha} = mtxt( $r->{dini},$r->{mini},$r->{dfin},$r->{mfin}); return $r; } diff --git a/public/proc/spay/img/China.jpg b/public/proc/spay/img/China.jpg new file mode 100755 index 0000000..870d653 Binary files /dev/null and b/public/proc/spay/img/China.jpg differ diff --git a/public/proc/spay/img/libreta.jpg b/public/proc/spay/img/libreta.jpg new file mode 100755 index 0000000..a49ec19 Binary files /dev/null and b/public/proc/spay/img/libreta.jpg differ diff --git a/public/proc/spay/img/libro.jpg b/public/proc/spay/img/libro.jpg new file mode 100755 index 0000000..5266c74 Binary files /dev/null and b/public/proc/spay/img/libro.jpg differ diff --git a/public/proc/spay/img/libro_old.jpg b/public/proc/spay/img/libro_old.jpg new file mode 100755 index 0000000..bdfb4d7 Binary files /dev/null and b/public/proc/spay/img/libro_old.jpg differ diff --git a/public/proc/spay/img/mapa.jpg b/public/proc/spay/img/mapa.jpg new file mode 100755 index 0000000..d6271fc Binary files /dev/null and b/public/proc/spay/img/mapa.jpg differ diff --git a/public/proc/spay/img/momo.jpg b/public/proc/spay/img/momo.jpg new file mode 100755 index 0000000..898ee76 Binary files /dev/null and b/public/proc/spay/img/momo.jpg differ diff --git a/public/proc/spay/img/playera.jpg b/public/proc/spay/img/playera.jpg new file mode 100755 index 0000000..3954ff3 Binary files /dev/null and b/public/proc/spay/img/playera.jpg differ diff --git a/public/proc/spay/img/separa.jpg b/public/proc/spay/img/separa.jpg new file mode 100755 index 0000000..b175eb9 Binary files /dev/null and b/public/proc/spay/img/separa.jpg differ diff --git a/templates/home/htmlNav.html.ep b/templates/home/htmlNav.html.ep index c2103e2..8e9b2a6 100755 --- a/templates/home/htmlNav.html.ep +++ b/templates/home/htmlNav.html.ep @@ -14,7 +14,7 @@

Vuelo de Grulla TV

Programas Grabados

Contacto

-

Tienda Virtual

+

Nuestra Escuela

@@ -37,7 +37,7 @@

Vuelo de Grulla TV

Programas Grabados

Contacto

-

Tienda Virtual

+

Nuestra Escuela

diff --git a/templates/proc/event.html.ep b/templates/proc/event.html.ep index d06c923..cb95770 100755 --- a/templates/proc/event.html.ep +++ b/templates/proc/event.html.ep @@ -16,16 +16,18 @@

<%= $paddr %>

<%= $pobs %>

<%= $city %>

- <% if ($spay== 1) { =%> -

<%= $cost %>

- <% } =%>

<%= $promo %>

-

Temario

- <%== $csubjects %> -

El evento incluye

- <%== $cservices %> + <%== $cdescription %> + <% if ($csubjects) { =%> +

Temario

+ <%== $csubjects %> + <% } =%> + <% if ($cservices) { =%> +

El evento incluye

+ <%== $cservices %> + <% } =%>
diff --git a/templates/proc/spay.html.ep b/templates/proc/spay.html.ep index 967b9bf..c15c6f3 100755 --- a/templates/proc/spay.html.ep +++ b/templates/proc/spay.html.ep @@ -12,7 +12,7 @@

<%= $subnombre %>

- +

<%= $descripcion %>