done cleaning

This commit is contained in:
mynah
2020-01-20 18:19:38 -06:00
parent 7dfd107c04
commit f16d579996
19 changed files with 165 additions and 144 deletions

1
bash
View File

@@ -1 +0,0 @@
ehco @o

View File

@@ -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;

View File

@@ -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 =============================================================================

View File

@@ -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;

View File

@@ -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
;

View File

@@ -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 = ?
;

View File

@@ -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
;

View File

@@ -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;
}

BIN
public/proc/spay/img/China.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
public/proc/spay/img/libreta.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
public/proc/spay/img/libro.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
public/proc/spay/img/mapa.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
public/proc/spay/img/momo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

BIN
public/proc/spay/img/playera.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
public/proc/spay/img/separa.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -14,7 +14,7 @@
<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="/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>
<div id="menu" class="hamb mshow"></div>
</article>
@@ -37,7 +37,7 @@
<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="/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>
<div id="menu" class="hamb mshow"></div>
</article>

View File

@@ -16,16 +16,18 @@
<p class = "dir"><%= $paddr %></p>
<p class = "obs"><%= $pobs %></p>
<p class = "city"><%= $city %></p>
<% if ($spay== 1) { =%>
<p class = " pmed price"><%= $cost %></p>
<% } =%>
<p class="promo"><%= $promo %></p>
</article>
<article class="specs">
<p id="subt">Temario</p>
<%== $csubjects %>
<p id="subt">El evento incluye</p>
<%== $cservices %>
<%== $cdescription %>
<% if ($csubjects) { =%>
<p id="subt">Temario</p>
<%== $csubjects %>
<% } =%>
<% if ($cservices) { =%>
<p id="subt">El evento incluye</p>
<%== $cservices %>
<% } =%>
</article>
</section>
<section class="map">

View File

@@ -12,7 +12,7 @@
<article class=iimage>
<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>
</article>