publish
This commit is contained in:
@@ -2,7 +2,6 @@ package Dojo::Controller::Home;
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
use Mojo::Template;
|
||||
use Dojo::Support qw{ log dmph merge_hash load_module get_names};
|
||||
use Dojo::Conf;
|
||||
sub tst{
|
||||
my $c=shift;
|
||||
# $c->stash( merge_hash(
|
||||
@@ -60,6 +59,12 @@ sub tst{
|
||||
my $c = shift;
|
||||
if ($c->param("mup")){
|
||||
$c->flash(mname => $c->param("mname"));
|
||||
$c->dbv->contact(
|
||||
$c->param("mname"),
|
||||
$c->param("mail"),
|
||||
$c->match->stack->[-1]{action},
|
||||
$c->param("msg")
|
||||
);
|
||||
$c->redirect_to('contact2');
|
||||
}else{
|
||||
$c->stash((load_module("home/contact"))[0]);
|
||||
|
||||
@@ -88,6 +88,13 @@ sub new { bless {}, shift };
|
||||
sub eventa { return shift @{_read(path("public/home/admin/event/json/qEvent.q")->slurp,pop)}}
|
||||
sub eimgList{ return [get_names("public/home/cal/img/")] }
|
||||
#==============================================================================
|
||||
# Write vdg user ==============================================================
|
||||
sub contact{
|
||||
my $c=shift;
|
||||
my $q="insert into entrada (nombre,correo,pagina,texto,fecha) values(?,?,?,?,now() )" ;
|
||||
return _writemsg($q,@_);
|
||||
}
|
||||
#==============================================================================
|
||||
# Write vdg admin ==============================================================
|
||||
sub umod{
|
||||
my $c=shift;
|
||||
@@ -159,6 +166,17 @@ sub _write{
|
||||
return $h;
|
||||
}
|
||||
|
||||
sub _writemsg{
|
||||
my ($q,@bind)=@_;
|
||||
my (@empty);
|
||||
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::MSGDB.":".Dojo::Conf::MSGDB_H,Dojo::Conf::MSGDB_UW,Dojo::Conf::MSGDB_UWP);
|
||||
return 0 unless($dbh);
|
||||
my $h=$dbh->do($q,{ Slice => {} },@bind);
|
||||
$dbh->disconnect();
|
||||
log("db write: $h");
|
||||
return $h;
|
||||
}
|
||||
|
||||
sub load_md{
|
||||
return "" unless
|
||||
my $text = path(shift)->slurp;
|
||||
|
||||
Reference in New Issue
Block a user