paypaltst
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
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 Dojo::Support qw{ log dmph} ;
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
|
||||
|
||||
@@ -83,6 +83,22 @@ sub podcast_infoHash{
|
||||
$dbh->disconnect();
|
||||
return shift @$h;
|
||||
}
|
||||
|
||||
sub user_heads{
|
||||
return _readgrulla($data_path->child("admin/tienda/qUsers.q")->slurp);
|
||||
}
|
||||
|
||||
sub store_heads{
|
||||
return _readgrulla($data_path->child("admin/tienda/qStore.q")->slurp);
|
||||
}
|
||||
|
||||
sub user {
|
||||
return shift @{_readgrulla($data_path->child("admin/tienda/json/qUsers.q")->slurp,pop)}}
|
||||
|
||||
sub astore {
|
||||
return shift @{_readgrulla($data_path->child("/admin/tienda/json/qStore.q")->slurp,pop)}}
|
||||
|
||||
|
||||
sub courses{ return _read("select nombre as name, id from curso;")}
|
||||
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;")}
|
||||
@@ -94,9 +110,8 @@ sub podcast_infoHash{
|
||||
sub eimgList{
|
||||
my $dp = path('public/home/cal/img')->make_path;
|
||||
return [ map{ $_->basename} grep{/(jpg|png)$/i}@{$dp->list} ];
|
||||
|
||||
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# Write vdg user ==============================================================
|
||||
sub contact{
|
||||
@@ -104,7 +119,7 @@ sub contact{
|
||||
my $q="insert into entrada (nombre,correo,pagina,texto,fecha) values(?,?,?,?,now() )" ;
|
||||
my @a=@_;
|
||||
#simple method to ignore spam
|
||||
return _writemsg($q,@a) unless $a[3]=~m/http|website|\<a/;
|
||||
return _writemsg($q,@a) unless $a[3]=~m/http|website|\<a|feedback|forms|suscribe|advertise|newsletter|promotion|Madam/;
|
||||
return 0;
|
||||
}
|
||||
#==============================================================================
|
||||
@@ -189,6 +204,27 @@ sub _writemsg{
|
||||
log("db write: $h");
|
||||
return $h;
|
||||
}
|
||||
sub _readgrulla{
|
||||
my ($q,@bind)=@_;
|
||||
my @empty;
|
||||
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::GRULLADB.":".Dojo::Conf::GRULLADB_H,Dojo::Conf::GRULLADB_UR,Dojo::Conf::GRULLADB_URP, {mysql_enable_utf8 => 1});
|
||||
return \@empty unless($dbh);
|
||||
my $h=$dbh->selectall_arrayref($q,{ Slice => {} },@bind)//"error";
|
||||
$dbh->disconnect();
|
||||
#((col1=>d1,col2=>d1),(col1=>d2,col2=>d2))
|
||||
return $h;
|
||||
}
|
||||
|
||||
sub _writegrulla{
|
||||
my ($q,@bind)=@_;
|
||||
my (@empty);
|
||||
my $dbh = DBI->connect("DBI:mysql:".Dojo::Conf::GRULLADB.":".Dojo::Conf::GRULLADB_H,Dojo::Conf::GRULLADB_UW,Dojo::Conf::GRULLADB_UWP,{mysql_enable_utf8 => 1} );
|
||||
return 0 unless($dbh);
|
||||
my $h=$dbh->do($q,{ Slice => {} },@bind)//"error";
|
||||
$dbh->disconnect();
|
||||
log("db write: $h");
|
||||
return $h;
|
||||
}
|
||||
|
||||
sub load_md{
|
||||
return "" unless
|
||||
|
||||
Reference in New Issue
Block a user