From 013703c4b240857e7b131869e4866fb09093b7bb Mon Sep 17 00:00:00 2001 From: Kilian Saffran Date: Mon, 8 Jul 2019 13:58:41 +0200 Subject: [PATCH] users and vouchers --- backoffice/api/lib/dksdb.pm | 30 ++++---- backoffice/api/lib/session.pm | 6 +- backoffice/api/process.cgi | 20 +++++- backoffice/index.cgi | 9 ++- backoffice/js/backoffice.js | 69 ++++++++++++++++++- backoffice/js/fieldsave.js | 4 +- backoffice/js/hoverable-collapse.js | 25 ------- backoffice/js/off-canvas.js | 8 --- backoffice/js/photoupload.js | 40 ----------- backoffice/js/template.js | 57 --------------- backoffice/tmpl/block/javascript.tt | 2 - backoffice/tmpl/block/sidebar.tt | 2 +- backoffice/tmpl/module/js/modules_global.js | 12 ++-- backoffice/tmpl/module/users/form_users.js | 6 +- backoffice/tmpl/module/users/form_users.tt | 10 ++- backoffice/tmpl/module/users/index.tt | 7 +- .../tmpl/module/vouchers/form_voucher.js | 48 +++++++++++++ .../tmpl/module/vouchers/form_voucher.tt | 32 +++++++++ backoffice/tmpl/module/vouchers/index.js | 3 + backoffice/tmpl/module/vouchers/index.tt | 37 ++++++++++ backoffice/tmpl/module/vouchers/javascript.tt | 3 + backoffice/tmpl/skeleton/login.tt | 2 +- 22 files changed, 260 insertions(+), 172 deletions(-) delete mode 100644 backoffice/js/hoverable-collapse.js delete mode 100644 backoffice/js/off-canvas.js delete mode 100644 backoffice/js/photoupload.js delete mode 100644 backoffice/js/template.js create mode 100644 backoffice/tmpl/module/vouchers/form_voucher.js create mode 100644 backoffice/tmpl/module/vouchers/form_voucher.tt diff --git a/backoffice/api/lib/dksdb.pm b/backoffice/api/lib/dksdb.pm index d0a6221..baeb564 100644 --- a/backoffice/api/lib/dksdb.pm +++ b/backoffice/api/lib/dksdb.pm @@ -14,7 +14,7 @@ use URI::Encode qw(uri_encode uri_decode); use Encode; use dksconfig qw($sitecfg); use Text::Unidecode; - +use Data::Dumper; sub new { my $class = shift; @@ -37,9 +37,9 @@ sub dbquery(){ my $retdata = undef; my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1}) or return $retdata->{error} = "dbquery Connection Error!".$!; $stat = encode("utf8", $stat); - # open FILE,">>tmp/sql.log"; - # print FILE "$stat\n"; - # close FILE; + open FILE,">>tmp/sql.log"; + print FILE "$stat\n"; + close FILE; my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbquery".$dbh->errstr. "- SQL: ".$stat;; @@ -65,9 +65,9 @@ sub dbquerybykey(){ my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1}) or return $retdata->{error} = "dbquery Connection Error!".$!; # $stat = encode("utf8", $stat); - # open FILE,">>sql.log"; - # print FILE "$stat\n"; - # close FILE; + open FILE,">>sql.log"; + print FILE "$stat\n"; + close FILE; my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbquery: ".$stat; $sth->execute() or return $retdata->{error} = "dbquery: ".$stat; while(my $data = $sth->fetchrow_hashref()) @@ -96,9 +96,9 @@ sub dbquerysorted(){ my $retdata; my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1}) or return $retdata->{error} = "dbquery Connection Error!".$!; # $stat = encode("utf8", $stat); - # open FILE,">>tmp/sql.log"; - # print FILE "\n==\n$stat\n==\n"; - # close FILE; + open FILE,">>tmp/sql.log"; + print FILE "\n==\n$stat\n==\n"; + close FILE; my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbquerysorted ".$dbh->errstr. "- SQL: ".$stat;; @@ -135,9 +135,9 @@ sub dbexec(){ my $retdata; my $dbh = DBI->connect($sitecfg->{dsn},$sitecfg->{dbuser},$sitecfg->{dbpassword},{PrintError=>0,RaiseError=>0,AutoCommit=>1}) or return $retdata->{error} = "dbquery Connection Error!".$!; # $stat = decode("UTF-8", $stat); - # open FILE,">>tmp/sql.log"; - # print FILE "\n==\n$stat\n==\n"; - # close FILE; + open FILE,">>tmp/sql.log"; + print FILE "\n==\n$stat\n==\n"; + close FILE; my $sth = $dbh->prepare($stat) or return $retdata->{error} = "dbexec ".$dbh->errstr. "- SQL: ".$stat;; $retdata->{success} = $dbh->do($stat) or return $retdata->{error} = "dbexec ".$dbh->errstr. "- SQL: ".$stat; $dbh->disconnect(); @@ -353,7 +353,9 @@ sub create_cnt_statement(){ } push(@ddl,"SELECT count(*) as cnt from ".$tb." WHERE ".join(" AND ",@sqlcond).";"); } - + open FILE,">>tmp/sql.log"; + print FILE "\n==\n".join("\n",@ddl)."\n==\n"; + close FILE; return @ddl; } diff --git a/backoffice/api/lib/session.pm b/backoffice/api/lib/session.pm index f9b6c64..df10717 100644 --- a/backoffice/api/lib/session.pm +++ b/backoffice/api/lib/session.pm @@ -105,13 +105,15 @@ sub registeruser(){ sub getsession($){ my $self = shift; my $sid = shift; - my $sql ="select se.idsession,us.id,us.username,us.prename,us.surname,ug.usergroup from sessions se + my $sql ="select se.idsession,us.id,us.username,us.prename,us.surname,ug.usergroup,string_agg(distinct(aug.usergroup),',') as othergroups from sessions se join users us on (us.id=se.id_user) join usergroups ug on (us.id_usergroup=ug.id) +left join useringroups uig on (us.id=uig.id_user) +left join usergroups aug on (aug.id=uig.id_group) left join appaccess ac on (us.id=ac.id_user) where se.idsession= '".$self->{db}->securetext($sid)."' and se.remote_addr= '".$ENV{REMOTE_ADDR}."' -and se.user_agent='".$ENV{HTTP_USER_AGENT}."' and us.blocked is null;"; +and se.user_agent='".$ENV{HTTP_USER_AGENT}."' and us.blocked is null group by se.id,us.id,ug.id;"; my $res= $self->{db}->dbquerysorted($sql); my $ret = undef; if (keys(%{$res}) > 0){ diff --git a/backoffice/api/process.cgi b/backoffice/api/process.cgi index 75fa0bb..23d6ce6 100644 --- a/backoffice/api/process.cgi +++ b/backoffice/api/process.cgi @@ -58,6 +58,20 @@ if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){ $html->{result} = $res->{0}; } } + elsif ($p->{fn} eq "generatevouchers"){ + if ($sess->{othergroups} =~ /admin/){ + my $sql = "INSERT INTO vouchers (voucher, id_price, used, percentdiscount, expiration) VALUES (substring(md5(random()::text),1,9), ".$p->{id_price}.", false, ".$p->{discount}.", date('".$p->{expiration}."'));"; + foreach (my $i=0..$p->{num}){ + $db->dbexec($sql); + } + $html->{result}->{p} = $p; + $html->{result}->{sql} = $sql; + $html->{result}->{gen} = "OK"; + }else { + $html->{result}->{gen} = "NOT OK"; + } + + } elsif ($p->{fn} eq "activateapp"){ $html->{result} = undef; @@ -128,8 +142,10 @@ if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){ } if (($idexists == 0) && ($type eq "upd")){ my @sqlcnt = $db->create_cnt_statement($p); - my $rnums = 0; - + my $rnums = (); + open FILE,">>tmp/process.log"; + print FILE "\n==\n".Dumper(@sqlcnt)."\n==\n"; + close FILE; foreach my $s (@sqlcnt){ diff --git a/backoffice/index.cgi b/backoffice/index.cgi index 4ac06b0..4b00316 100644 --- a/backoffice/index.cgi +++ b/backoffice/index.cgi @@ -5,7 +5,7 @@ use lib ('api/lib/perl5'); use lib ('api/lib'); use File::Basename qw/dirname basename/; use Template; -# use Template::Constants qw( :debug ); +use Template::Constants qw( :debug ); use CGI; use CGI::Carp qw(fatalsToBrowser); use CGI::Cookie; @@ -133,8 +133,8 @@ if ($vars->{suffix} eq ".js"){ print $cgi->header(-type=>$ctype, -charset=>"utf-8",-cookie => $cookie); # print dirname($ENV{"SCRIPT_FILENAME"}); -my $template = Template->new({INCLUDE_PATH => [dirname($ENV{"SCRIPT_FILENAME"}).'/tmpl']}); -#, DEBUG => DEBUG_ALL} +my $template = Template->new({INCLUDE_PATH => [dirname($ENV{"SCRIPT_FILENAME"}).'/tmpl'], DEBUG => DEBUG_PLUGINS}); +#} my @lv = split(/\//,$vars->{filepath}); my $absnum = scalar(@lv)-1; @@ -173,9 +173,12 @@ $template->process($skl,$vars) || die "Template process failed: ", $template->er # } # print Dumper($vars); +if ($ENV{"HTTP_HOST"} eq "localhost"){ print "/*"; +; # # print Dumper($p); print Dumper($vars); # # print Dumper($sess); print "*/"; +} diff --git a/backoffice/js/backoffice.js b/backoffice/js/backoffice.js index 4c68290..7369ae9 100644 --- a/backoffice/js/backoffice.js +++ b/backoffice/js/backoffice.js @@ -38,4 +38,71 @@ var backoffice = { async:true }); } -} \ No newline at end of file +} + +$( document ).ready(function() { + var body = $('body'); + var contentWrapper = $('.content-wrapper'); + var scroller = $('.container-scroller'); + // var footer = $('.footer'); + var sidebar = $('.sidebar'); + + //Add active class to nav-link based on url dynamically + //Active class can be hard coded directly in html file also as required + + function addActiveClass(element) { + if (current === "") { + //for root url + if (element.attr('href').indexOf("index.html") !== -1) { + element.parents('.nav-item').last().addClass('active'); + if (element.parents('.sub-menu').length) { + element.closest('.collapse').addClass('show'); + element.addClass('active'); + } + } + } else { + //for other url + if (element.attr('href').indexOf(current) !== -1) { + element.parents('.nav-item').last().addClass('active'); + if (element.parents('.sub-menu').length) { + element.closest('.collapse').addClass('show'); + element.addClass('active'); + } + if (element.parents('.submenu-item').length) { + element.addClass('active'); + } + } + } + } + + var current = location.pathname.split("/").slice(-1)[0].replace(/^\/|\/$/g, ''); + $('.nav li a', sidebar).each(function() { + var $this = $(this); + addActiveClass($this); + }) + + //Close other submenu in sidebar on opening any + + // sidebar.on('show.bs.collapse', '.collapse', function() { + // sidebar.find('.collapse.show').collapse('hide'); + // }); + + + //Change sidebar + + // $('[data-toggle="minimize"]').on("click", function() { + // body.toggleClass('sidebar-icon-only'); + // }); + + //checkbox and radios + // $(".form-check label,.form-radio label").append(''); +}); + +(function($) { + 'use strict'; + $(function() { + $('[data-toggle="offcanvas"]').on("click", function() { + $('.sidebar-offcanvas').toggleClass('active') + }); + }); +})(jQuery); \ No newline at end of file diff --git a/backoffice/js/fieldsave.js b/backoffice/js/fieldsave.js index c6ff2cf..2765fc1 100644 --- a/backoffice/js/fieldsave.js +++ b/backoffice/js/fieldsave.js @@ -8,7 +8,7 @@ function savefield(objid){ field[$("#" +objid).attr('name')] = $("#" + objid).html(); } else if ($("#" + objid)[0].tagName == "SELECT"){ //console.log("is a select field"); - console.log($("#" + objid).selectpicker()); + //console.log($("#" + objid).selectpicker()); // if ($("#" + objid)[0].dataset.select2Id){ // // console.log("is a select2 field!\n"); // console.log($("#" +objid).attr('name') + "-> " + $("#" +objid).val() ); @@ -16,7 +16,7 @@ function savefield(objid){ // } // else { field[$("#" +objid).attr('name')] = $("#" + objid).val(); - console.log(field[$("#" +objid).attr('name')]); + //console.log(field[$("#" +objid).attr('name')]); // } // }if ($("#" + objid)[0].select2Id){ diff --git a/backoffice/js/hoverable-collapse.js b/backoffice/js/hoverable-collapse.js deleted file mode 100644 index 0e13d1f..0000000 --- a/backoffice/js/hoverable-collapse.js +++ /dev/null @@ -1,25 +0,0 @@ -// (function($) { -// 'use strict'; -// //Open submenu on hover in compact sidebar mode and horizontal menu mode -// $(document).on('mouseenter mouseleave', '.sidebar .nav-item', function(ev) { -// var body = $('body'); -// var sidebarIconOnly = body.hasClass("sidebar-icon-only"); -// var sidebarFixed = body.hasClass("sidebar-fixed"); -// if (!('ontouchstart' in document.documentElement)) { -// if (sidebarIconOnly) { -// if (sidebarFixed) { -// if (ev.type === 'mouseenter') { -// body.removeClass('sidebar-icon-only'); -// } -// } else { -// var $menuItem = $(this); -// if (ev.type === 'mouseenter') { -// $menuItem.addClass('hover-open') -// } else { -// $menuItem.removeClass('hover-open') -// } -// } -// } -// } -// }); -// })(jQuery); \ No newline at end of file diff --git a/backoffice/js/off-canvas.js b/backoffice/js/off-canvas.js deleted file mode 100644 index 4bda3b1..0000000 --- a/backoffice/js/off-canvas.js +++ /dev/null @@ -1,8 +0,0 @@ -(function($) { - 'use strict'; - $(function() { - $('[data-toggle="offcanvas"]').on("click", function() { - $('.sidebar-offcanvas').toggleClass('active') - }); - }); -})(jQuery); \ No newline at end of file diff --git a/backoffice/js/photoupload.js b/backoffice/js/photoupload.js deleted file mode 100644 index 63cf4fb..0000000 --- a/backoffice/js/photoupload.js +++ /dev/null @@ -1,40 +0,0 @@ -// (function($) { -// 'use strict'; -// $(function() { -// $('.file-upload-browse').on('click', function() { -// var file = $(this).parent().parent().parent().find('.file-upload-default'); -// file.trigger('click'); -// }); -// $('.file-upload-default').on('change', function() { -// $(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, '')); -// }); -// }); -// })(jQuery); - -function handleFileSelect(evt) { - var files = evt.target.files; - var utype = ""; - if ($("form").attr('id') == "dksrdv_catalog"){ - $("form").prepend(''); - for (var i = 0, f; f = files[i]; i++) { - if (!f.type.match('image.*')) { - continue; - } - var reader = new FileReader(); - reader.onload = (function(theFile) { - return function(e) { - $("#preview").attr("src",e.target.result); - $("#"+utype+"photo").val(e.target.result); - }; - })(f); - reader.readAsDataURL(f); - } -} -} - -function removephoto(utype){ - $("#preview").attr("src",defaultphoto); - if (!$("#"+utype+"photo")){ - $("form").prepend(''); - } -} \ No newline at end of file diff --git a/backoffice/js/template.js b/backoffice/js/template.js deleted file mode 100644 index e4cd611..0000000 --- a/backoffice/js/template.js +++ /dev/null @@ -1,57 +0,0 @@ -$( document ).ready(function() { - var body = $('body'); - var contentWrapper = $('.content-wrapper'); - var scroller = $('.container-scroller'); - // var footer = $('.footer'); - var sidebar = $('.sidebar'); - - //Add active class to nav-link based on url dynamically - //Active class can be hard coded directly in html file also as required - - function addActiveClass(element) { - if (current === "") { - //for root url - if (element.attr('href').indexOf("index.html") !== -1) { - element.parents('.nav-item').last().addClass('active'); - if (element.parents('.sub-menu').length) { - element.closest('.collapse').addClass('show'); - element.addClass('active'); - } - } - } else { - //for other url - if (element.attr('href').indexOf(current) !== -1) { - element.parents('.nav-item').last().addClass('active'); - if (element.parents('.sub-menu').length) { - element.closest('.collapse').addClass('show'); - element.addClass('active'); - } - if (element.parents('.submenu-item').length) { - element.addClass('active'); - } - } - } - } - - var current = location.pathname.split("/").slice(-1)[0].replace(/^\/|\/$/g, ''); - $('.nav li a', sidebar).each(function() { - var $this = $(this); - addActiveClass($this); - }) - - //Close other submenu in sidebar on opening any - - // sidebar.on('show.bs.collapse', '.collapse', function() { - // sidebar.find('.collapse.show').collapse('hide'); - // }); - - - //Change sidebar - - // $('[data-toggle="minimize"]').on("click", function() { - // body.toggleClass('sidebar-icon-only'); - // }); - - //checkbox and radios - // $(".form-check label,.form-radio label").append(''); -}); diff --git a/backoffice/tmpl/block/javascript.tt b/backoffice/tmpl/block/javascript.tt index 909dbab..3ea575a 100644 --- a/backoffice/tmpl/block/javascript.tt +++ b/backoffice/tmpl/block/javascript.tt @@ -1,6 +1,4 @@ - - \ No newline at end of file diff --git a/backoffice/tmpl/block/sidebar.tt b/backoffice/tmpl/block/sidebar.tt index 677040c..4b87182 100644 --- a/backoffice/tmpl/block/sidebar.tt +++ b/backoffice/tmpl/block/sidebar.tt @@ -32,7 +32,7 @@ [% END %] -[% admcnt = dksdb.prepare("select count(*) as cnt from useringroups where id_user=?;") %] +[% admcnt = dksdb.prepare("select count(*) as cnt from useringroups uig join usergroups ug on (uig.id_group=ug.id) where uig.id_user=? and ug.usergroup='admin'") %] [% isadmin = admcnt.execute(session.id) %] [% IF isadmin > 0 %] diff --git a/backoffice/tmpl/module/js/modules_global.js b/backoffice/tmpl/module/js/modules_global.js index 86fb627..0aeab71 100644 --- a/backoffice/tmpl/module/js/modules_global.js +++ b/backoffice/tmpl/module/js/modules_global.js @@ -1,9 +1,9 @@ var apiurl = "[% baseurl %]/api/"; function process_data(data,callback){ - // console.log("process data"); - // console.log(JSON.stringify(data)); - + console.log("process data"); + console.log(JSON.stringify(data)); + console.log(apiurl); strdata = ""; for (var i in data){ if (typeof(data[i]) == "object"){ @@ -14,14 +14,16 @@ } } + console.log(strdata); + console.log(callback); $.ajax({ encoding:"UTF-8", url: apiurl + 'process.cgi' , method: "POST", data: strdata, success: function (data){ - // console.log("returned data"); - // console.log(data); + console.log("returned data"); + console.log(data); if (data && data.result){ callback(data.result); } else { diff --git a/backoffice/tmpl/module/users/form_users.js b/backoffice/tmpl/module/users/form_users.js index 12e871f..0b2612b 100644 --- a/backoffice/tmpl/module/users/form_users.js +++ b/backoffice/tmpl/module/users/form_users.js @@ -1,3 +1,7 @@ function initpage(){ -} \ No newline at end of file +} +$("input.fieldsave").on('blur',function(event){ + console.log(event); + savefield(event.currentTarget.id); +}); \ No newline at end of file diff --git a/backoffice/tmpl/module/users/form_users.tt b/backoffice/tmpl/module/users/form_users.tt index d2a7a5d..6abf712 100644 --- a/backoffice/tmpl/module/users/form_users.tt +++ b/backoffice/tmpl/module/users/form_users.tt @@ -31,10 +31,14 @@ left join usergroups uign on (uig.id_group=uign.id) where us.id=? group by us.id [% END %] +
+ + +
[% END %]

Applications

-[% appdata = dksdb.prepare("select ap.name,ac.id_user,ac.id_app,ac.publicenabled,ac.expiration from appaccess ac join apps ap on (ac.id_app=ap.id) where ac.id_user=?;") %] +[% appdata = dksdb.prepare("select ac.id,ap.name,ac.id_user,ac.id_app,ac.publicenabled,ac.expiration from appaccess ac join apps ap on (ac.id_app=ap.id) where ac.id_user=?;") %] @@ -48,8 +52,8 @@ left join usergroups uign on (uig.id_group=uign.id) where us.id=? group by us.id [% FOREACH uap = appdata.execute(params.id) %] - - + + [% END %] diff --git a/backoffice/tmpl/module/users/index.tt b/backoffice/tmpl/module/users/index.tt index 70b211c..a8a1f6c 100644 --- a/backoffice/tmpl/module/users/index.tt +++ b/backoffice/tmpl/module/users/index.tt @@ -1,8 +1,5 @@ - -

Utilisateurs

- -
[% uap.name %][% uap.publicenabled %][% uap.expiration %]
+
@@ -31,7 +28,7 @@ group by us.id,ug.id") %] - + diff --git a/backoffice/tmpl/module/vouchers/form_voucher.js b/backoffice/tmpl/module/vouchers/form_voucher.js new file mode 100644 index 0000000..4290706 --- /dev/null +++ b/backoffice/tmpl/module/vouchers/form_voucher.js @@ -0,0 +1,48 @@ +function initpage(){ + +} + +[% prices = dksdb.prepare("select id,duration,price,package from prices where id_app=? and evaluation = false;") %] + + var appdata = { + [% FOREACH modules = dksdb.query("select id,\"name\" from apps where activated=true;") %] + [% modules.id %]:{"name":"[% modules.name %]","packages":{ + [% FOREACH price = prices.execute(modules.id) %] + [% price.id %]:{"id":[% price.id %],"package":"[% price.package %]","price":[% price.price %],"duration":[% price.duration %]}, + [% END %] + }}, + [% END %] +}; + +function setpackages(){ + var idapp= document.getElementById("id_app").value; + console.log(appdata); + var pkg = document.getElementById("id_package"); + pkg.innerHTML= ""; + var pkgdata =""; + for (var i in appdata[idapp]['packages']){ + pkgdata += '' ; + } + pkg.innerHTML = pkgdata; +} + +function generate_vouchers(){ + + var discpercent = document.getElementById("discount").value/100; + process_data( + {fn:"generatevouchers", + "id_price":document.getElementById("id_package").value, + "expiration":document.getElementById("expiration").value, + "discount":discpercent, + "num":document.getElementById("numvouchers").value, + + },reload_vouchers); + +} + +function reload_vouchers(data){ + console.log("Voucher Return"); + console.log(data); + parent.backoffice.loadpage('module/vouchers/index.html','Vouchers'); + return false; +} diff --git a/backoffice/tmpl/module/vouchers/form_voucher.tt b/backoffice/tmpl/module/vouchers/form_voucher.tt new file mode 100644 index 0000000..a9ca892 --- /dev/null +++ b/backoffice/tmpl/module/vouchers/form_voucher.tt @@ -0,0 +1,32 @@ + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ diff --git a/backoffice/tmpl/module/vouchers/index.js b/backoffice/tmpl/module/vouchers/index.js index e69de29..12e871f 100644 --- a/backoffice/tmpl/module/vouchers/index.js +++ b/backoffice/tmpl/module/vouchers/index.js @@ -0,0 +1,3 @@ +function initpage(){ + +} \ No newline at end of file diff --git a/backoffice/tmpl/module/vouchers/index.tt b/backoffice/tmpl/module/vouchers/index.tt index e69de29..85e66ea 100644 --- a/backoffice/tmpl/module/vouchers/index.tt +++ b/backoffice/tmpl/module/vouchers/index.tt @@ -0,0 +1,37 @@ + +
Username[% aus.username %] [% aus.prename %] [% aus.surname %][% aus.blocked %][% IF aus.blocked %] [% END %] [% aus.defaultgroup %] [% aus.apps %] [% aus.othergroups %]
+ + + + + + + + + + + + + + + + [% FOREACH vou = dksdb.query("SELECT vo.id,vo.expiration ,vo.voucher, vo.used, vo.percentdiscount * 100 as discount, vo.expiration,pr.duration,pr.package,pr.price,ap.name as appname,pr.duration +FROM vouchers vo +join prices pr on (pr.id=vo.id_price) +join apps ap on (pr.id_app=ap.id)") %] + + + + + + + + + + + + [% END %] + +
VoucherExpirationUsedApplicationPackageDiscountPackage Priceduration (month)
[% vou.voucher %][% vou.expiration %][% IF vou.used == "1" %] [% END %][% vou.appname %][% vou.package %][% vou.discount %]%[% vou.price %]€[% vou.duration %] + +
diff --git a/backoffice/tmpl/module/vouchers/javascript.tt b/backoffice/tmpl/module/vouchers/javascript.tt index e69de29..7e6959c 100644 --- a/backoffice/tmpl/module/vouchers/javascript.tt +++ b/backoffice/tmpl/module/vouchers/javascript.tt @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/backoffice/tmpl/skeleton/login.tt b/backoffice/tmpl/skeleton/login.tt index 3079ac6..da3403d 100644 --- a/backoffice/tmpl/skeleton/login.tt +++ b/backoffice/tmpl/skeleton/login.tt @@ -69,7 +69,7 @@
- vous avez déjà une compte? se Connecter + vous avez déjà un compte? se Connecter
[% ELSIF pagename == 'forgotpassword' %] -- 2.39.5