noche, actualiza tablas eventos

This commit is contained in:
mynah
2018-07-19 03:45:46 -05:00
parent 5a7566eaf7
commit e25fc46010
31 changed files with 207 additions and 258 deletions

View File

@@ -1,7 +1,7 @@
package Dojo::Model::Vuelo;
use Mojo::File 'path';
use Mojo::JSON qw(decode_json encode_json);
use Dojo::Support qw{ dmph merge_hash load_module };
use Dojo::Support qw{ dmph merge_hash load_module get_names};
use File::Basename;
use Text::Markdown qw{ markdown };
@@ -53,12 +53,13 @@ sub radio{
return _read($q);
}
sub umod{
my $c=shift;
my $q="update casa set contenido = ? where nombre = ? ;";
return _write($q,@_);
}
# admin =================================0
sub urmod{
my $c=shift;
my $q="update casa set contenido = ? where nombre = ? ;";
@@ -85,7 +86,36 @@ sub rmsgid{
$dbh->disconnect();
return $h;
}
sub admevent{
my $h = {
ecourse=>_read("select nombre as name, id from curso;"),
eplace =>_read("select nombre as name, id from lugar;"),
emini =>_read("select nombre as name, id from mes;"),
ilist => [get_names("public/home/cal/img/")],
eprev =>_read(path("public/home/admin/event/qEprev.q")->slurp),
};
return $h
}
# json ======
sub ecourse{
my ($c,@id)=@_;
return _read(path("public/home/admin/event/json/qEvent.q")->slurp,@id);
}
sub qcourse{
my ($c,@id)=@_;
return _read(path("public/home/admin/event/json/qCourse.q")->slurp,@id);
}
sub qplace{
my ($c,@id)=@_;
return _read(path("public/home/admin/event/json/qPlace.q")->slurp,@id);
}
#============
#Change =====
#============
#ayudas =====================================
sub _read{
my ($q,@bind)=@_;
my (@empty,$arr);