Popravek izpisa predracuna - preko ajax-a namesto preko api-ja

This commit is contained in:
pero1203 2020-12-05 11:51:24 +01:00
parent 8713f0214c
commit 4595f7abdf
5 changed files with 33 additions and 5 deletions

View File

@ -178,7 +178,8 @@ function preparePlacilaTableAdmin(){
// Pridobimo predracun preko api-ja in redirectamo
function getNarociloPredracun(narocilo_id){
$.post(siteUrl+'frontend/payments/api.php?action=get_predracun', {narocilo_id : narocilo_id}, function(response){
//$.post(siteUrl+'frontend/payments/api.php?action=get_predracun', {narocilo_id : narocilo_id}, function(response){
$.post('ajax.php?t=userNarocila&a=getPredracun', {narocilo_id : narocilo_id}, function(response){
var pdf_url = response.replace(/\\\//g, "/");
pdf_url = pdf_url.replace(/['"]+/g, '');
@ -190,7 +191,8 @@ function getNarociloPredracun(narocilo_id){
// Pridobimo racun preko api-ja in redirectamo
function getNarociloRacun(narocilo_id){
$.post(siteUrl+'frontend/payments/api.php?action=get_racun', {narocilo_id : narocilo_id}, function(response){
//$.post(siteUrl+'frontend/payments/api.php?action=get_racun', {narocilo_id : narocilo_id}, function(response){
$.post('ajax.php?t=userNarocila&a=getRacun', {narocilo_id : narocilo_id}, function(response){
var pdf_url = response.replace(/\\\//g, "/");
pdf_url = pdf_url.replace(/['"]+/g, '');

View File

@ -1400,5 +1400,31 @@ class UserNarocila{
// Na novo izrisemo tabelo z narocili
$this->displayNarocilaTableAdmin();
}
// Vrnemo predracun
if($_GET['a'] == 'getPredracun') {
$narocilo_id = (isset($_POST['narocilo_id'])) ? $_POST['narocilo_id'] : '';
if($narocilo_id != ''){
$cebelica = new UserNarocilaCebelica($narocilo_id);
$predracun = $cebelica->getNarociloPredracun();
echo $predracun;
}
}
// Vrnemo racun
if($_GET['a'] == 'getRacun') {
$narocilo_id = (isset($_POST['narocilo_id'])) ? $_POST['narocilo_id'] : '';
if($narocilo_id != ''){
$cebelica = new UserNarocilaCebelica($narocilo_id);
$this->response = $cebelica->getNarociloRacun();
echo $predracun;
}
}
}
}

View File

@ -183,7 +183,7 @@ class UserPlacila{
echo '<td>'.$data_row['narocilo']['podjetje_drzava'].'</td>';
// Paket
echo '<td>'.$data_row['narocilo']['package'].'KA</td>';
echo '<td>'.$data_row['narocilo']['package_id'].'KA</td>';
// Trajanje
echo '<td>'.$data_row['narocilo']['trajanje'].'</td>';

View File

@ -7476,7 +7476,7 @@ $lang = array (
'srv_placilo_stornirano' => "Stornirano",
'srv_placilo_drzava' => "Država",
'srv_placilo_paket' => "Paket",
'srv_placilo_trajanje' => "Veljavnost",
'srv_placilo_trajanje' => "Trajanje",
// DOSTOP GLEDE NA PAKET

View File

@ -7359,7 +7359,7 @@ $lang = array (
'srv_placilo_stornirano' => "Canceled",
'srv_placilo_drzava' => "Country",
'srv_placilo_paket' => "Package",
'srv_placilo_trajanje' => "Expire",
'srv_placilo_trajanje' => "Expire after",
// DOSTOP GLEDE NA PAKET