aeroswat Posted December 23, 2009 Share Posted December 23, 2009 This should be printing out like 30 pages with 3 of the same slip on each page. In my print preview for internet explorer i get my first page with the right stuff on it and my 29th page with a bunch of jumbled up crap on it. The 27 pages in between have absolutely nothing on them. And on my browser page it's only showing the first 3 results then i can't scroll anymore. Here's my css code .containerorder{ position: relative; font: 12px Verdana, Arial, Helvetica, sans-serif; color: #000000; overflow: hidden; margin: 0px auto; height: 11in; width: 8.5in; } .outorder{ position: relative; overflow: visible; margin: 0px auto; height: 34%; width: 100%; } .toporder{ position: relative; overflow: hidden; margin: 0px auto; height: 7%; width: 100%; } .midorder{ position: relative; overflow: hidden; margin: 0px auto; height: 40%; width: 100%; } .mainorder{ position: relative; overflow: hidden; margin: 0px auto; height: 30%; width: 100%; } .bottomorder{ position: relative; overflow: hidden; margin: 0px auto; height: 20%; width: 100%; font-weight: bold; font-style: italic; } .div1order{ position: relative; overflow: hidden; float: left; width: 50%; font-weight: bold; } .div2order{ position: relative; overflow: hidden; font-size: 14px; float: right; width: 50%; font-weight: bolder; } .div3order{ position: relative; overflow: hidden; float: left; width: 50%; } .div4order{ position: relative; overflow: hidden; float: right; width: 50%; font-weight: normal; } and here is the php/html that is outputting the stuff <?php require_once('auth.php'); require_once('config.php'); function addspace($str, $len){ if (strlen($str) >= $len){return $str;} return $str . str_repeat(' ', $len-strlen($str)); } $link = mysql_connect(DB_HOST, DBA_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DBA_DATABASE); if(!$db) { echo DBA_DATABASE; die("Unable to select database"); } $qry = "SELECT * FROM tblOrders WHERE filled=0"; $result = mysql_query($qry); if($result) { if(mysql_num_rows($result)!=0) { echo "<link href=\"loginmodule.css\" rel=\"stylesheet\" type=\"text/css\" />"; echo "<div class='containerorder'>"; while($res=mysql_fetch_array($result)) { $qryCode = "SELECT * FROM tblCodes WHERE Code='" . $res['Code'] . "'"; $resultCode = mysql_query($qryCode); $resCode = mysql_fetch_array($resultCode); $qry2 = "SELECT StudentName FROM tblStudents WHERE StudentNumber=" . $res['StudentNumber']; $result2 = mysql_query($qry2); $res2 = mysql_fetch_array($result2); echo "<div class='containerorder'>"; for($i=0;$i<3;$i++){ echo "<div class='outorder'>" . "<div class='toporder'>" . "<div class='div1order'>" . "Alabama Instructional Resource Center for the Blind" . "</div>" . "<div class='div2order'>" . addspace('ORDER ACKNOWLEDGMENT',40) . ($i+1) . "</div>" . "</div>" . "<div class='midorder'>" . "<div class='div3order'>" . "<b>Alabama Institute for the Deaf and Blind<br>" . "P.O. Box 698, Talladega, AL 35161<br>" . "1-256-761-3262 or 1-256-761-3337</b><br><br>" . $resCode['Definition'] . "<br><br><br><br><br>" . addspace($res['SchoolSystem'],50) . "Code: " . $res['Code'] . "</div>" . "<div class='div4order'>" . "Process Date: " . addspace($res['DateOrdered'],30) . "Ship Date: " . $res['ShipDate'] . "<br>" . "Order Number: " . addspace($res['OrderNumber'],36) . "Line Number: " . $res['Line'] . "<br><br>" . "Title: " . $res['BookTitle'] . "<br><br><br><br><br>" . "ISBN#: " . $res['ISBNten'] . "<br>" . "Publisher: " . addspace($res['Publisher'],37) . "Copyright: " . $res['Copyright'] . "<br>" . "</div>" . "</div>" . "<div class='mainorder'>" . "<div class='div3order'>" . addspace('',4) . "Student: " . $res2['StudentName'] . "<br>" . addspace('',9) . $res['ShipAttention'] . "<br>" . addspace('',9) . $res['ShipName'] . "<br>" . addspace('',9) . $res['ShipAddress'] . "<br>" . addspace('',9) . $res['ShipCity'] . ", " . $res['ShipState'] . " " . $res['ShipZip'] . "<br>" . "</div>" . "<div class='div4order'>" . "AIRCB#: " . $res['AIRCBNum'] . "<br>" . "Item#: " . addspace($res['ItemNum'],40) . "Value:<br>" . "Format: " . addspace($res['FormatNeeded'],14) . "Grade: " . addspace($res['StudentGrade'],14) . "Record Number: " . $res['OrderYearNum'] . "<br>" . "Upon receipt of item, please sign and return.<br><br>" . "Signature _______________________ Date __________<br>" . "</div>" . "</div>" . "<div class='bottomorder'>" . "<center>All items MUST be returned to AIRCB ASAP at the completion of each course.</center>" . "</div>" . "</div>"; } echo "</div>"; } }else { echo "There are no results to be displayed"; } }else { die("Query failed"); } ?> <?php include("footer-main.php"); ?> Anyone know what I'm doing wrong? Quote Link to comment Share on other sites More sharing options...
aeroswat Posted December 23, 2009 Author Share Posted December 23, 2009 Ok I fixed the issue of the print preview not displaying everything. I can get all the pages to print now but I still have two other problems. One problem is the fact that only the first 3 order slips show up on the page... after that nothing else shows up. I find this very strange considering I am able to print all the slips... On top of that it seems like the bottom page margin is larger than the top one. It looks like I have a good 3/4 inch from the top of the page to the first writing while at the bottom of the page I have an entire inch... if I try to reduce it by even a fraction of an inch it cuts off... Sometimes it goes onto the next page sometimes it doesn't even show up at all... Quote Link to comment Share on other sites More sharing options...
haku Posted December 24, 2009 Share Posted December 24, 2009 Please do not show PHP in the CSS forums. Show the HTML output. PHP scripts are irrelevant here. If the php script is relevant to your question, you are posting in the wrong section, and should be posting in the php section. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.