Guest User

?MS

a guest
May 3rd, 2020
37
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  echo '<h3 class="block-head">Platební metody</h3>            
  2.  
  3.            
  4.             <table border="0" style="width:100%; margin:10px auto;" cellpadding="4">';
  5.  
  6.       $getData = db::query("SELECT * FROM `platebni_metody` WHERE active='0' ORDER BY `id` ASC");
  7.       while ($data = db::row($getData)) {        
  8.  
  9.          echo '<tr style="padding-bottom:2px;margin-bottom:2px">
  10.                   <td style="vertical-align:top" class="r">';
  11.                   if($data['id'] == 13){echo'
  12.                   <input type="radio" name="platba" disabled id="hotove" value="13">
  13.                   ';}else{echo '
  14.                   <input type="radio" name="platba" id="jinak-'.$data['id'].'" value="' . $data['id'] . '"> ';}
  15.                   echo '
  16.                     </td>
  17.                   <td style="vertical-align:top; padding-top: 0px;padding-bottom:5px;padding-left:10px;text-align:left;width:100%">';
  18.          echo '      <strong>' . $data['nazev'] . '</strong>';
  19.          
  20.          
  21.          echo '   </td>
  22.                   <td style="vertical-align:top" class="c">'. $data['cena'] . ',-</td>
  23.                </tr>';
  24.          
  25.       }
  26.  
  27.       echo '</table>';
  28.  
  29.  
  30.  
  31.  
  32. echo '<h3 class="block-head">Celkem k platbě</h3>';
  33.  
  34.  
  35.  
  36.       echo '
  37.              <table class="params" id="invoice" cellspacing="0" style="width: 100%;
  38.     border: 1px solid #e2e2e2;
  39.     border-spacing: 0;
  40.     border-collapse: collapse;
  41.     margin-bottom: 20px;">
  42.    
  43.     <tbody style="display: table-row-group;
  44.     vertical-align: middle;
  45.     border-color: inherit;
  46. ">';
  47.  
  48.  
  49.       // $total dal znamena slevnenou cenu, tj. kolik se bude celkem platit
  50.       $totalTisk = $total;
  51.  
  52.       // dohledat kuponovou slevu na objednavku
  53.       if ($kupon && $kupon['type'] == 'kupon-vse') {
  54.          echo '
  55. <tr class="order-total" style="white-space: nowrap;border-bottom:none">
  56.       <th style="padding: 10px;
  57.     vertical-align: middle;text-transform: uppercase;
  58.     border-right: 1px solid #e2e2e2;
  59.     background: #f5f5f5;
  60.     border-bottom: 1px solid #e2e2e2;color:#777
  61. ">Aktivní ' . ($kupon['percent'] > 0 ? 'sleva <strong>' . $kupon['percent'] . '%</strong>' : 'sleva ' . self::formatPrice($kupon['fixed'])) . '</th>
  62.       <td style="text-align: right;
  63.     font-size: 15px;padding: 10px;
  64.     vertical-align: middle;border-right: 1px solid #e2e2e2;
  65.     border-bottom: 1px solid #e2e2e2;color:#777"><span style="text-align: right;
  66.     font-size: 15px;white-space: nowrap;">' . ($kupon['percent'] > 0 ? '-' . self::formatPrice(($kupon['percent'] / 100) * $total) : '-' . self::formatPrice($kupon['fixed']) ) . '</span> </td>
  67.     </tr>
  68. ';
  69.          if ($kupon['percent'] > 0)
  70.             $total -= $total * ($kupon['percent'] / 100);
  71.          else
  72.             $total -= $kupon['fixed'];
  73.  
  74.          if ($total < 0) {
  75.             //echo '<tr><td style="text-align: left; color: red">SLEVOVÝ KUPON je dobré využít v plné výši. Z hodnoty kuponu nevracíme peníze.<br /> Prosím, vyberte si ještě nějaké fotografie, využijte vaši SLEVU celou !</td></tr>';
  76.             $total = 0;
  77.          }
  78.  
  79.       }
  80.  
  81.       echo '
  82.  
  83.  
  84.       <tr class="order-total" style="white-space: nowrap;border-bottom:none">
  85.       <td class="l" style="padding: 10px;
  86.     vertical-align: middle;text-transform: uppercase;
  87.     border-right: 1px solid #e2e2e2;
  88.     background: #f5f5f5;
  89.     border-bottom: 1px solid #e2e2e2;color:#777;text-align:left;font-size:15px;font-weight:bold;padding-left:10px
  90. ">Cena za tisk fotografií</th>
  91.       <td style="text-align: left;
  92.     font-size: 15px;padding: 5px;
  93.     vertical-align: middle;border-right: 1px solid #e2e2e2;
  94.     border-bottom: 1px solid #e2e2e2;color:#777"><span style="margin-left:5px;
  95.     font-size: 14px;white-space: nowrap;float:right;padding:5px">' . self::formatPrice($total) . '</span> </td>
  96.     </tr>';
  97.  
  98.  
  99.       // dohledat slevu na objednavku
  100.       $sleva = db::row(db::query("SELECT * FROM `photo_slevy` WHERE `type`='objednavka' AND `from`<=%f ORDER BY `from` DESC LIMIT 1", $total));
  101.       if ($sleva) {
  102.          echo '<tr class="order-total" style="white-space: nowrap;border-bottom:none">
  103.       <td class="l" style="padding: 10px;
  104.     vertical-align: middle;text-transform: uppercase;
  105.     border-right: 1px solid #e2e2e2;
  106.     background: #f5f5f5;
  107.     border-bottom: 1px solid #e2e2e2;color:#777;text-align:left;font-size:16px;font-weight:bold;padding-left:10px
  108. ">' . ($sleva['percent'] > 0 ? 'Sleva <strong>' . $sleva['percent'] . '%</strong>' : 'Sleva ' . self::formatPrice($sleva['fixed'])) . '</th>
  109.       <td style="text-align: right;
  110.     font-size: 15px;padding: 5px;
  111.     vertical-align: middle;border-right: 1px solid #e2e2e2;
  112.     border-bottom: 1px solid #e2e2e2;color:#777"><span style="text-align: right;margin-left:5px;
  113.     font-size: 14px;white-space: nowrap;">' . ($sleva['percent'] > 0 ? '-' . self::formatPrice(($sleva['percent'] / 100) * $total) : '-' . self::formatPrice($sleva['fixed']) ) . '</span> </td>
  114.     </tr>
  115.     <tr>
  116.            ';
  117.  
  118.          if ($sleva['percent'] > 0)
  119.             $total -= $total * ($sleva['percent'] / 100);
  120.          else
  121.             $total -= $sleva['fixed'];
  122.            
  123.       }
  124.  
  125.       $giveMePrice = $total + $odber['price']['fixed'] + $platba['cena'];
  126.       echo '  <tr id="postovneInfo" style="display:none"></tr>
  127.               <tr id="postovneSleva" style="display:none"></tr>
  128.               <tr id="postovneDan" style="display:none"></tr>
  129.               <tr id="postovneCelkem" style="display:none; font-size:14px;"></tr>
  130.             </table>';
  131.  
  132.       echo '<script type="text/javascript">
  133.             var sleva = null;
  134.             var dobirka = null;
  135.             var totalTisk = ' . $totalTisk . '; // celkova cena objednavky pred slevami
  136.             var total = ' . $total . '; // celkova cena objednavky po pripadne sleve, bez postovneho' . "\n";
  137.  
  138.       // postovne/balne
  139.       $sleva = db::row(db::query("SELECT * FROM `photo_slevy` WHERE `type`='postovne' AND `from`<=%f ORDER BY `from` DESC LIMIT 1", $totalTisk));
  140.       if ($sleva) {
  141.          echo 'sleva = { from:' . $sleva['from'] . ', percent:' . $sleva['percent'] . ', fixed:' . $sleva['fixed'] . ' };';
  142.       }
  143.  
  144.       echo ' window.addEvent("domready", function() {
  145.               // predpokladame jediny radek s postou - toto je jeho FX
  146.               var fx = null;
  147.  
  148.  
  149.  
  150.                // hooknout radiobuttony pro postovne
  151.                $("theform").getElements("input[type=radio]").each(function(item){
  152.  
  153.                  // event
  154.                  item.addEvent("click", function(){                  
  155.                    // sestavit radek s cenou postovneho ----------------------
  156.                    if (document.getElementById("jinak-1").checked){
  157.                    $("postovneInfo").set("html", "<td style=\"padding: 10px;vertical-align: middle;text-transform: uppercase;border-right: 1px solid #e2e2e2;background: #f5f5f5;border-bottom: 1px solid #e2e2e2;color:#777;text-align:left;font-size:16px;font-weight:bold;padding-left:10px\"><strong><span style=\"text-align: left;font-size: 25px;white-space: nowrap;font-size:14px\">Poštovné</span></strong></td><th style=\"text-align:left;font-size: 15px;padding: 10px;vertical-align: middle;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;color:#777;font-weight:400;text-align:right\">" + formatPrice(document.getElementById("jinak-1").value + document.getElementById("odber").value) + "</td>");}else
  158.                    $("postovneInfo").set("html", "<td style=\"padding: 10px;vertical-align: middle;text-transform: uppercase;border-right: 1px solid #e2e2e2;background: #f5f5f5;border-bottom: 1px solid #e2e2e2;color:#777;text-align:left;font-size:16px;font-weight:bold;padding-left:10px\"><strong><span style=\"text-align: left;font-size: 25px;white-space: nowrap;font-size:14px\">Poštovné</span></strong></td><th style=\"text-align:left;font-size: 15px;padding: 10px;vertical-align: middle;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;color:#777;font-weight:400;text-align:right\">" + formatPrice($(this).get("data-price")) + "</td>");
  159.                    $("postovneInfo").setStyle("display", "table-row");
  160.  
  161.                    
  162.                    // sestavit radek se slevou -------------------------------
  163.                    if (sleva != null) {
  164.                      var titleText = "Sleva <strong>";
  165.                      if (sleva.percent > 0) titleText += sleva.percent + "%";
  166.                      else titleText+= formatPrice(sleva.fixed);
  167.                      titleText += "</strong> z poštovného";
  168.                      
  169.                      var title = new Element("td", {html: titleText, "class":"l"});
  170.                          
  171.                      var price = 0;
  172.                      if (sleva.percent > 0) price = -1 * (sleva.percent/100) * $(this).get("data-price");
  173.                      else price = -sleva.fixed;
  174.                      
  175.                      if (-price > $(this).get("data-price"))
  176.                        price = -1 * $(this).get("data-price");
  177.                      
  178.                      var prc = new Element("td", {html: formatPrice(price), "style":"text-align:right;font-size: 15px;padding: 10px;vertical-align: middle;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;color:#777"});                    
  179.                      
  180.                      $("postovneSleva").empty();      
  181.                      $("postovneSleva").adopt(title, prc);
  182.                      $("postovneSleva").setStyle("display", "table-row");
  183.                    } else price = 0;
  184.                      
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                    // sestavit radek s celkovou cenou ------------------------
  193.                    if (document.getElementById("jinak-1").checked){
  194.                    var totalPrice = total + price + parseInt("79") + parseFloat($(this).get("data-price"));
  195.                    }else
  196.                    var totalPrice = total + price + parseFloat($(this).get("data-price"));
  197.  
  198.                    $("postovneCelkem").set("html", "<th style=\"width:75%;max-width:75%;min-width:75%;padding: 10px;vertical-align: middle;text-transform: uppercase;border-right: 1px solid #e2e2e2;background: #f5f5f5;border-bottom: 1px solid #e2e2e2;color:#777\"><strong><span style=\"text-align: left;font-size: 25px;white-space: nowrap;font-size:14px\">CELKEM ZA OBJEDNÁVKU</span></strong></th><th style=\"width:25%;max-width:25%;min-width:25%;text-align:right;font-size: 25px;padding: 10px;vertical-align: middle;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;color:#777;background:#f5f5f5;letter-spacing:1.8px\">" + formatPrice(totalPrice) + "</th></tr>");
  199.                    $("postovneCelkem").setStyle("display", "table-row");
  200.  
  201.  
  202.  
  203.                    var untaxPrice = totalPrice / 1.2;
  204.  
  205.                    if (document.getElementById("jinak-1").checked){
  206.                    $("postovneDan").set("html", "<td style=\"padding: 10px;vertical-align: middle;text-transform: uppercase;border-right: 1px solid #e2e2e2;background: #f5f5f5;border-bottom: 1px solid #e2e2e2;color:#777;text-align:left;font-size:16px;font-weight:bold;padding-left:10px\"><strong><span style=\"text-align: left;font-size: 25px;white-space: nowrap;font-size:14px\">Cena celkem bez DPH</span></strong></td><th style=\"text-align:left;font-size: 15px;padding: 10px;vertical-align: middle;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;color:#777;font-weight:400;text-align:right\">" + formatPrice(untaxPrice) + "</td>");}else
  207.                    $("postovneDan").set("html", "<td style=\"padding: 10px;vertical-align: middle;text-transform: uppercase;border-right: 1px solid #e2e2e2;background: #f5f5f5;border-bottom: 1px solid #e2e2e2;color:#777;text-align:left;font-size:16px;font-weight:bold;padding-left:10px\"><strong><span style=\"text-align: left;font-size: 25px;white-space: nowrap;font-size:14px\">Cena celkem bez DPH</span></strong></td><th style=\"text-align:left;font-size: 15px;padding: 10px;vertical-align: middle;border-right: 1px solid #e2e2e2;border-bottom: 1px solid #e2e2e2;color:#777;font-weight:400;text-align:right\">" + formatPrice(untaxPrice) + "</td>");
  208.                    $("postovneDan").setStyle("display", "table-row");
  209.                    
  210.                    // sestavit radek s cenou bez dane ------------------------
  211.                    var untaxed = totalPrice / 1.2;
  212.                    $("celkemBezDane").set("html", "<th class=\"l\" colspan=\"2\">Celková cena objednávky bez DPH</th><th>"+ formatPrice(untaxed) +"</th>");
  213.                    $("celkemBezDane").setStyle("display", "table-row");
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×