Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Multiple Receipt Templates

sparkweb Sep 22nd, 2011 204 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2. //Place This code right after the <body> tag
  3. //Make sure that .noprint { display: none; } is in your @media print css
  4. //Now you can go through your template and do if-then statements for the $receiptstyle variable
  5.  
  6. $current_url = "";
  7. foreach($_GET as $key => $val) {
  8.         if ($key == "receiptstyle") continue;
  9.         if ($current_url) $current_url .= "&amp;";
  10.         $current_url .= $key."=".urlencode($val);
  11. }
  12. $current_url = "edit.php?".$current_url;
  13.  
  14. $receiptstyle = isset($_GET['receiptstyle']) ? (int)$_GET['receiptstyle'] : 1;
  15. ?>
  16. <ul class="noprint">
  17.         <li><a href="<?php echo $current_url . "&amp;receiptstyle=1"; ?>">Standard Recipt</a></li>
  18.         <li><a href="<?php echo $current_url . "&amp;receiptstyle=2"; ?>">Gift Recipt</a></li>
  19.         <li><a href="<?php echo $current_url . "&amp;receiptstyle=3"; ?>">Pick List</a></li>
  20. </ul>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top