revolucion
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
package Dojo::Model::Vuelo;
|
||||
use Mojo::File 'path';
|
||||
package Dojo::Model::Vuelo; use Mojo::File 'path';
|
||||
use Mojo::JSON qw(decode_json encode_json);
|
||||
use Dojo::Support qw{ log dmph merge_hash load_module get_names};
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
@@ -25,8 +24,9 @@ sub mod{
|
||||
|
||||
sub pang_md{
|
||||
my $c=shift;
|
||||
my %h = map {$_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp))}
|
||||
("pang","helen","benjamin");
|
||||
my %h = map {
|
||||
$_=> markdown(decode_utf8($data_path->child('pang/'.$_.'.md')->slurp))
|
||||
} ("pang","helen","benjamin");
|
||||
return \%h;
|
||||
}
|
||||
|
||||
@@ -50,13 +50,12 @@ sub tv_videos{
|
||||
sub tv_series{
|
||||
return _read ($data_path->child("/tv/qTable.q")->slurp); #name,order,group
|
||||
}
|
||||
sub podcast_txt{
|
||||
# return "Hemos desarrollado con mucho cariño ejercicios gratuitos y descargables que pueden ser practicados por cualquier persona aún antes de asistir a uno de los cursos de instrucción.";
|
||||
return decode_utf8(path("public/home/podcast/text.txt")->slurp);
|
||||
}
|
||||
sub podcast_infoHash{
|
||||
return decode_json path("public/home/podcast/jsonPod.json")->slurp;
|
||||
}
|
||||
sub podcast_txt{
|
||||
return decode_utf8($data_path->child("/podcast/text.txt")->slurp);
|
||||
}
|
||||
sub podcast_infoHash{
|
||||
return decode_json $data_path->child("/podcast/podcast.json")->slurp;
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
|
||||
@@ -64,7 +63,7 @@ sub tv_series{
|
||||
sub msg_heads{
|
||||
my ($self,@bind)=@_;
|
||||
my @empty;
|
||||
my $q= path("public/home/admin/mensajes/qEntries.q")->slurp;
|
||||
my $q= $data_path->child("/admin/mensajes/qEntries.q")->slurp;
|
||||
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::MSGDB.":".Dojo::Conf::MSGDB_H,Dojo::Conf::MSGDB_UR,Dojo::Conf::MSGDB_URP,{mysql_enable_utf8 => 1});
|
||||
return \@empty unless($dbh);
|
||||
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//"error";
|
||||
@@ -76,7 +75,7 @@ sub tv_series{
|
||||
sub msg{
|
||||
my ($c,@bind)=@_;
|
||||
my @empty;
|
||||
my $q= path("public/home/admin/mensajes/json/qGetInfo.q")->slurp;
|
||||
my $q= $data_path->child("/admin/mensajes/json/qGetInfo.q")->slurp;
|
||||
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::MSGDB.":".Dojo::Conf::MSGDB_H,Dojo::Conf::MSGDB_UR,Dojo::Conf::MSGDB_URP,{mysql_enable_utf8 => 1});
|
||||
return \@empty unless($dbh);
|
||||
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//\@empty;
|
||||
@@ -85,12 +84,12 @@ sub tv_series{
|
||||
return shift @$h;
|
||||
}
|
||||
sub courses{ return _read("select nombre as name, id from curso;")}
|
||||
sub course { return shift @{_read(path("public/home/admin/event/json/qCourse.q")->slurp,pop)}}
|
||||
sub course { return shift @{_read($data_path->child("/admin/event/json/qCourse.q")->slurp,pop)}}
|
||||
sub places { return _read("select nombre as name, id from lugar;")}
|
||||
sub place { return shift @{_read(path("public/home/admin/event/json/qPlace.q")->slurp,pop)}}
|
||||
sub place { return shift @{_read($data_path->child("/admin/event/json/qPlace.q")->slurp,pop)}}
|
||||
sub months { return _read("select nombre as name, id from mes;")};
|
||||
sub events { return _read(path("public/home/admin/event/qEprev.q")->slurp)}
|
||||
sub eventa { return shift @{_read(path("public/home/admin/event/json/qEvent.q")->slurp,pop)}}
|
||||
sub events { return _read($data_path->child("/admin/event/qEprev.q")->slurp)}
|
||||
sub eventa { return shift @{_read($data_path->child("/admin/event/json/qEvent.q")->slurp,pop)}}
|
||||
sub eimgList{ return [get_names("public/home/cal/img/")] }
|
||||
#==============================================================================
|
||||
# Write vdg user ==============================================================
|
||||
@@ -104,40 +103,40 @@ sub contact{
|
||||
}
|
||||
#==============================================================================
|
||||
# Write vdg admin ==============================================================
|
||||
sub umod{
|
||||
my $c=shift;
|
||||
my $q="update casa set contenido = ? where nombre = ? ;";
|
||||
return _write($q,@_);
|
||||
}
|
||||
sub umod{
|
||||
my $c=shift;
|
||||
my $q="update casa set contenido = ? where nombre = ? ;";
|
||||
return _write($q,@_);
|
||||
}
|
||||
|
||||
sub event_del { return _write("delete from evento where id = ?;",pop);}
|
||||
sub course_del{ return _write("delete from curso where id = ?;",pop); }
|
||||
sub place_del { return _write("delete from lugar where id = ?;",pop); }
|
||||
|
||||
sub event_up{
|
||||
my ($self,@bind)=@_;
|
||||
return _write(path("public/home/admin/event/add/qEup.q")->slurp,@bind);
|
||||
}
|
||||
sub course_up{
|
||||
my ($self,@bind)=@_;
|
||||
return _write(path("public/home/admin/event/add/qCup.q")->slurp,@bind);
|
||||
}
|
||||
sub place_up{
|
||||
my ($self,@bind)=@_;
|
||||
return _write(path("public/home/admin/event/add/qPup.q")->slurp,@bind);
|
||||
}
|
||||
sub event_ch{
|
||||
my ($self,@bind)=@_;
|
||||
return _write(path("public/home/admin/event/change/qEup.q")->slurp,@bind);
|
||||
}
|
||||
sub course_ch{
|
||||
my ($self,@bind)=@_;
|
||||
return _write(path("public/home/admin/event/change/qCup.q")->slurp,@bind);
|
||||
}
|
||||
sub place_ch{
|
||||
my ($self,@bind)=@_;
|
||||
return _write(path("public/home/admin/event/change/qPup.q")->slurp,@bind);
|
||||
}
|
||||
sub event_del { return _write("delete from evento where id = ?;",pop);}
|
||||
sub course_del{ return _write("delete from curso where id = ?;",pop); }
|
||||
sub place_del { return _write("delete from lugar where id = ?;",pop); }
|
||||
|
||||
sub event_up{
|
||||
my ($self,@bind)=@_;
|
||||
return _write($data_path->child("/admin/event/add/qEup.q")->slurp,@bind);
|
||||
}
|
||||
sub course_up{
|
||||
my ($self,@bind)=@_;
|
||||
return _write($data_path->child("/admin/event/add/qCup.q")->slurp,@bind);
|
||||
}
|
||||
sub place_up{
|
||||
my ($self,@bind)=@_;
|
||||
return _write($data_path->child("/admin/event/add/qPup.q")->slurp,@bind);
|
||||
}
|
||||
sub event_ch{
|
||||
my ($self,@bind)=@_;
|
||||
return _write($data_path->child("/admin/event/change/qEup.q")->slurp,@bind);
|
||||
}
|
||||
sub course_ch{
|
||||
my ($self,@bind)=@_;
|
||||
return _write($data_path->child("/admin/event/change/qCup.q")->slurp,@bind);
|
||||
}
|
||||
sub place_ch{
|
||||
my ($self,@bind)=@_;
|
||||
return _write($data_path->child("/admin/event/change/qPup.q")->slurp,@bind);
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user