diff --git a/app/pub/scripts/anviewer.js b/app/pub/scripts/anviewer.js index aaf76c8..5aec792 100644 --- a/app/pub/scripts/anviewer.js +++ b/app/pub/scripts/anviewer.js @@ -97,10 +97,10 @@ function newpdfzoom(czoom){ var status = czoom+"%"; - document.getElementById("pdfcanvas").style.width = status; - document.getElementById("zoomstatus").innerHTML = status; + document.getElementById(pdfcanvas).style.width = status; + document.getElementById('zoomstatus').innerHTML = status; - setzoom("pdfscale", czoom); + setzoom('pdfscale', czoom); } @@ -135,20 +135,18 @@ function setzoom( cname, cvalue, exdays = 30 ) { -function startpdfviewer(newpdf){ +function startpdfviewer(newcurr){ - currpdf = getzoom("currpdf"); + pdcurr = getzoom('pdcurr'); - if (currpdf == newpdf){ - - czoom = getzoom("pdfscale"); + if (pdcurr == newcurr){ + czoom = getzoom('pdfscale'); if (czoom > 10) { newpdfzoom(czoom); } - } else { - setzoom("currpdf", newpdf); + setzoom('pdcurr', newcurr); } diff --git a/app/routes/anpdf.php b/app/routes/anpdf.php index 4e34dd9..a6fdea4 100644 --- a/app/routes/anpdf.php +++ b/app/routes/anpdf.php @@ -10,6 +10,7 @@ function anpromo_kuri($page = 1, $scale = 1){ $pdfile = '/pub/files/pdf/promo.pdf'; $title = 'Номер 12(706)'; $baseurl = '/'; + $newcurr = strtotime('2006-05-12'); $nextpage = $page + 1; if (file_exists(SITEPATH.$pdfile)){ @@ -36,7 +37,7 @@ function anpromo_kuri($page = 1, $scale = 1){ function read_kuri($hash, $page = 1, $scale = 1, $promo = false){ - $price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1"); + $price = db_get("SELECT `price_id`, `pricename`, `BeginDate` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1"); if (!isset($price['price_id'])){ header("HTTP/1.0 404 Not Found"); @@ -48,6 +49,10 @@ function read_kuri($hash, $page = 1, $scale = 1, $promo = false){ $basepg = PGDIR.$hash.'/'.$hash.'-'; $pgfile = $basepg.$page.'.pdf'; $cachefile = PDFDIR.$namefile; + $newcurr = strtotime($price['BeginDate']); + + + if (file_exists($cachefile)){ $fullpdf = '/pdf/'.$namefile; diff --git a/app/views/anpdf2.phtml b/app/views/anpdf2.phtml index af06371..889b0ac 100644 --- a/app/views/anpdf2.phtml +++ b/app/views/anpdf2.phtml @@ -6,7 +6,7 @@ pageRendering = false, pageNumPending = null, nexturl = '=$nexturl?>', - hash = '=$hash?>', + newcurr ='=$newcurr?>', prevurl = '=$prevurl?>'; @@ -42,10 +42,10 @@