en el moras

This commit is contained in:
mynah
2018-07-18 16:04:47 -05:00
parent 4f0061cd7d
commit 5a7566eaf7
21 changed files with 94 additions and 55 deletions

View File

@@ -17,11 +17,6 @@ sub mod{
return \@{_read($q)};
}
sub umod{
my $c=shift;
my $q="update casa set contenido = ? where nombre = 'mod' ;";
return _write($q,@_);
}
sub pang{
my ($c,$q)=@_;
return {map { basename($_,".md") => load_md("public/$_")}@{$q->{md}}};
@@ -58,6 +53,39 @@ sub radio{
return _read($q);
}
sub umod{
my $c=shift;
my $q="update casa set contenido = ? where nombre = ? ;";
return _write($q,@_);
}
sub urmod{
my $c=shift;
my $q="update casa set contenido = ? where nombre = ? ;";
return _write($q,@_);
}
sub rmsg{
my @empty;
my $q= path("public/home/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);
return \@empty unless($dbh);
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind);
#((col1=>d1,col2=>d1),(col1=>d2,col2=>d2))
$dbh->disconnect();
return $h;
}
sub rmsgid{
my ($c,@bind)=@_;
my @empty;
my $q= path("public/home/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);
return \@empty unless($dbh);
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind);
#((col1=>d1,col2=>d1),(col1=>d2,col2=>d2))
$dbh->disconnect();
return $h;
}
sub _read{
my ($q,@bind)=@_;
my (@empty,$arr);