% if ($painel){ % }else{ % if ($message){ <& /_shared/templates/messages/small.html, contents=>$message, bgcolor=>'#f6ffc6', style=>'ticker', bbar=>'#9ea093' &> % } %#
<% $labels{categoria} %> <% $labels{registos} %>
%# %# % } %#
% } % my $total_credits = 0; % my $i = 0; % while (my @row = $sth->fetchrow){ % my $style = ($i++ % 2 == 0) ? "gen-shadow-light":"gen-shadow-dark"; % my ($id, $username, $reqkey, $records, $credits, $reqdate) = @row; % $total_credits += $credits; % my ($data,$hora) = split / /,$reqdate; % my $datestr = $m->comp("/_shared/procs/utils/getdatestr.m",data=>$data, hora=>$hora, short=>1, painel=>1); % #$datestr =~ s/\,/
/g; % my ($demo,$qrcd,$zone,$zcod,$zdsc,$net1,$agnlist,$agnand) = $m->comp("procs/parsereqkey.m",reqkey=>$reqkey); % my $titulo; % my $filterstr; % my ($tipo_item, $itemid) = $m->comp("/_shared/procs/utils/parseqrcd.m", qrcd=>$qrcd); % if ($qrcd =~ '^vrfy'){ % $titulo = ($painel) ? "verificação":"verificação de base de dados"; # FIXME texto inglês % }else{ % ($titulo) = $m->comp("/_shared/procs/getitemtitle.m", itemid=>$itemid, tipo_item=>$tipo_item); % if ($painel && length($titulo) > 10){ % $titulo =~ s/^([^\s]*).*/$1.../; % } % my $filters = $m->comp('/_shared/procs/getfilters.m', srchargs=>{net1=>$net1, net2=>undef, zone=>$zone, zcod=>$zcod, zdsc=>$zdsc, agnlist=>$agnlist, agnand=>$agnand}); % $zdsc = $filters->{zdsc}; % $zcod = $filters->{zcod}; % $agnlist = $filters->{agnlist}; % $filterstr = $filters->{str}; % $filterstr = '
' . $filterstr if $filterstr; % } % if ($tipo_item eq 'G'){ % $titulo = $m->comp("/_shared/procs/utils/localize.m", str=>"grupo") . ": ". $titulo; % } % if ($painel){ % }else{ % % } % } % #----------------------------------------------------------- % # Crédito de Downloads para este cliente % #----------------------------------------------------------- % if (!$painel){
<%$titulo%> <%$records%>
<%$datestr%>
<%$titulo%><%$filterstr%>
<%$records%> <%$credits%> % #----------------------------------------------------------- % # verificar update % #----------------------------------------------------------- % my $updtdate = $m->comp("procs/getupdtdate.m",updt=>$id); % if ($updtdate){ % my ($data,$hora) = split / /,$updtdate; % my $datestr = $m->comp("/_shared/procs/utils/getdatestr.m",data=>$data, hora=>$hora, short=>1, painel=>1); <%$datestr%> % }else{ % % # FIXME - basta usar chave como em baixo? % if ($qrcd =~ '^vrfy'){ % % my $ids = $m->comp("procs/getextrainfo.m",reqkey=>$reqkey); % $ids =~ s/\,/\r\n/g;
% % }else{ % % % % }
% }
%#
% if (0 && !$painel && ($user !~ /^nug/)){

 reiniciar demo

% } <%ARGS> $user=>undef $painel=>undef $cn=>0 <%init> my %messages = ( actualizar => $m->comp("/_shared/procs/utils/localize.m", str=>'actualizar'), mais_creditos => $m->comp("/_shared/procs/utils/localize.m", str=>"contacte-nos para adquirir mais créditos"), ); my $message; my $dbh = $m->comp("/_shared/procs/utils/dbi_connect.m", database=>'guianet'); my $sth = $dbh->prepare("select * from tdownloads_history where username='$user' order by reqdate desc"); $sth->execute; my $dateformat = $painel; my ($user_credits, $used_credits) = $m->comp("procs/getusercredits.m",user=>$user); if (($user_credits == 0) || ($user_credits < $cn)){ $message = "" . $messages{mais_creditos} . ""; } <%shared> my %labels = ( data => $m->comp("/_shared/procs/utils/localize.m", str=>'data'), categoria => $m->comp("/_shared/procs/utils/localize.m", str=>'categoria'), opcoes => $m->comp("/_shared/procs/utils/localize.m", str=>'opções'), registos => $m->comp("/_shared/procs/utils/localize.m", str=>'reg.'), creditos => $m->comp("/_shared/procs/utils/localize.m", str=>'cred.'), actualizacao => $m->comp("/_shared/procs/utils/localize.m", str=>'actualização'), creditos_usados => $m->comp("/_shared/procs/utils/localize.m", str=>'créditos utilizados'), creditos_disp => $m->comp("/_shared/procs/utils/localize.m", str=>'créditos disponíveis'), ); <%method header> <%init> my $title = $m->comp("/_shared/procs/utils/localize.m", str=>'Histórico de Downloads'); <& /_shared/templates/messages/default.html, contents=>$title &> %####################################################################################### %# NEW METHODS %#====================================================================================== %#-------------------------------------------------------------------------------------- <%method main_ctrl> %#--------------------------------------------------------------------------------------
% my $user = $m->caller_args(0)->{user}; % if ($user){
<% $labels{categoria} %> <% $labels{registos} %> <% $labels{creditos} %> <% $labels{actualizacao} %>
% }
%#====================================================================================== <%method section_tabs> %#-------------------------------------------------------------------------------------- <& PARENT:section_tabs, stab=>2 &> %#====================================================================================== <%method form_start> %#-------------------------------------------------------------------------------------- %#====================================================================================== <%method form_end> %#--------------------------------------------------------------------------------------