diff --git a/app/pub/css/an.css b/app/pub/css/an.css index 4519104..c924961 100644 --- a/app/pub/css/an.css +++ b/app/pub/css/an.css @@ -25,6 +25,10 @@ h1 { color: red; } +#the-canvas{ + width:100%; +} + #redi{ color: red; text-transform: lowercase; diff --git a/app/pub/scripts/anviewer.js b/app/pub/scripts/anviewer.js index c561c27..ffca8ee 100644 --- a/app/pub/scripts/anviewer.js +++ b/app/pub/scripts/anviewer.js @@ -108,7 +108,8 @@ function newpdfzoom(czoom){ var status = czoom+"%"; document.getElementById(pdfcanvas).style.width = status; - document.getElementById('zoomstatus').innerHTML = status; + document.getElementById('zoomstatus_up').innerHTML = status; + //document.getElementById('zoomstatus_down').innerHTML = status; setzoom('pdfscale', czoom); @@ -143,24 +144,20 @@ function setzoom( cname, cvalue, exdays = 30 ) { -function startpdfviewer(newpdf){ +function startpdfviewer(newcurr){ - var div = document.getElementById(pdfcanvas); - - - currpdf = getzoom('currpdf'); + pdcurr = getzoom('pdcurr'); - if (currpdf !== null & currpdf !== newpdf){ - + if (pdcurr == newcurr){ czoom = getzoom('pdfscale'); - - if (czoom != null & czoom > 10) { + if (czoom > 10) { + cnt = czoom; newpdfzoom(czoom); } - } else { - setzoom('currpdf', newpdf); + setzoom('pdcurr', newcurr); + setzoom('pdfscale', 100); } 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 198c652..fa5fa8c 100644 --- a/app/views/anpdf2.phtml +++ b/app/views/anpdf2.phtml @@ -6,6 +6,7 @@ pageRendering = false, pageNumPending = null, nexturl = '=$nexturl?>', + newcurr ='=$newcurr?>', prevurl = '=$prevurl?>'; @@ -23,7 +24,7 @@ -