[ PHPXref.com ] [ Generated: Sun Jul 20 17:52:21 2008 ] [ Focus/SIS 1.0 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> labels_test.php (source)

   1  <?
   2  /**
   3  * @file labels_test.php 2006-04-17 andrew $
   4  * @package Focus/SIS
   5  * @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved.
   6  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
   7  * Focus/SIS is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.txt for copyright notices and details.
  12  */
  13  
  14  /**
  15  * /----------------------------------------------------------------------\
  16  * | Digital Express, Inc.
  17  * | Copyright (c) 2002 Richard Clark All rights reserved.
  18  * | http://www.dvexinc.com
  19  * | <richievc@hotmail.com>
  20  * | 
  21  * | AVERY 5160 Print Lables Moduel v 1.1.2 revised
  22  * /----------------------------------------------------------------------\
  23  */
  24  /************************************************** ************** */
  25  /************************************************** ************** */
  26  /************************************************** ************** */
  27  include ('Warehouse.php');
  28  ?>
  29  <html xmlns:o="urn:schemas-microsoft-com:office:office"
  30  xmlns:w="urn:schemas-microsoft-com:office:word"
  31  xmlns="http://www.w3.org/TR/REC-html40">
  32  
  33  <head>
  34  <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  35  <title>Avery 5160</title>
  36  <!--[if gte mso 9]><xml>
  37  <o:DocumentProperties>
  38  <o:Author>Techmaster</o:Author>
  39  <o:Template>Normal</o:Template>
  40  <o:LastAuthor>Techmaster</o:LastAuthor>
  41  <o:Revision>2</o:Revision>
  42  <o:TotalTime>3</o:TotalTime>
  43  <o:Created>2004-02-09T19:49:00Z</o:Created>
  44  <o:LastSaved>2004-02-09T19:49:00Z</o:LastSaved>
  45  <o:Pages>1</o:Pages>
  46  <o:Words>36</o:Words>
  47  <o:Characters>206</o:Characters>
  48  <o:Company>Digital Express</o:Company>
  49  <o:Lines>1</o:Lines>
  50  <o:Paragraphs>1</o:Paragraphs>
  51  <o:CharactersWithSpaces>241</o:CharactersWithSpaces>
  52  <o:Version>10.3501</o:Version>
  53  </o:DocumentProperties>
  54  </xml><![endif]--><!--[if gte mso 9]><xml>
  55  <w:WordDocument>
  56  <w:SpellingState>Clean</w:SpellingState>
  57  <w:GrammarState>Clean</w:GrammarState>
  58  <w:Compatibility>
  59  <w:BreakWrappedTables/>
  60  <w:SnapToGridInCell/>
  61  <w:WrapTextWithPunct/>
  62  <w:UseAsianBreakRules/>
  63  </w:Compatibility>
  64  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  65  </w:WordDocument>
  66  </xml><![endif]-->
  67  <style>
  68  <!--
  69  /* Style Definitions */
  70  p.MsoNormal, li.MsoNormal, div.MsoNormal
  71  {mso-style-parent:"";
  72  margin-bottom:.0001pt;
  73  mso-pagination:widow-orphan;
  74  font-size:12.0pt;
  75  font-family:"Times New Roman";
  76  mso-fareast-font-family:"Times New Roman"; margin-left:0in; margin-right:0in; margin-top:0in}
  77  span.SpellE
  78  {mso-style-name:"";
  79  mso-spl-e:yes}
  80  @page Section1
  81  {size:8.5in 11.0in;
  82  margin:.5in 13.6pt 0in 13.6pt;
  83  mso-header-margin:.5in;
  84  mso-footer-margin:.5in;
  85  mso-paper-source:4;}
  86  div.Section1
  87  {page:Section1;}
  88  -->
  89  </style>
  90  <!--[if gte mso 10]>
  91  <style>
  92  /* Style Definitions */
  93  table.MsoNormalTable
  94  {mso-style-name:"Table Normal";
  95  mso-tstyle-rowband-size:0;
  96  mso-tstyle-colband-size:0;
  97  mso-style-noshow:yes;
  98  mso-style-parent:"";
  99  mso-padding-alt:0in 5.4pt 0in 5.4pt;
 100  mso-para-margin:0in;
 101  mso-para-margin-bottom:.0001pt;
 102  mso-pagination:widow-orphan;
 103  font-size:10.0pt;
 104  font-family:"Times New Roman"}
 105  </style>
 106  <![endif]-->
 107  
 108  </head>
 109  <body lang=EN-US style='tab-interval:.5in'>
 110  <?
 111  // CONN TO DB 
 112  
 113  $res = DBGet(DBQuery("SELECT * FROM address limit 20")); 
 114  
 115  if (count($res) < 1){ 
 116  echo "<CENTER><B>No Results</B></CENTER>";
 117  } elseif (count($res) > 0) { 
 118  $cols = 0; 
 119  $rows = 0; 
 120  $max_cols=3; 
 121  $max_rows=10;
 122  // Set the num of rows and cols 
 123  
 124  foreach ($res as $data){ 
 125  
 126  # if ($rows == 0){ // echo out table info 
 127  #
 128  # } 
 129  if ($cols < 1){ // output the tr 
 130  echo "<div class=Section1>
 131  <table class=MsoNormalTable border=0 cellspacing=2 cellpadding=2 
 132  style='border-collapse:collapse;padding-top-alt:0in;padding-bottom-alt: 0in'>";
 133  echo "<tr style='yfti-irow:0;page-break-inside:avoid;height:1.0in'>"; 
 134  } 
 135  echo "<td width=189 style='width:189.0pt;padding:0in .75pt 0in .75pt;height:1.0in'> 
 136  <p class=MsoNormal align=center style='margin-top:0in; margin-right:5.3pt; 
 137  margin-bottom:0in; margin-left:5.3pt; margin-bottom:.0001pt;text-align:center'> 
 138  <span class=SpellE>"; 
 139  echo "<FONT SIZE=1 FACE=\"Arial\">";
 140  echo "$data[f_name] $data[l_name]<BR>
 141  $data[ADDRESS]<BR>
 142  $data[CITY] $data[STATE]. $data[ZIPCODE]</FONT>"; 
 143  echo "</span></p></td>"; 
 144  // before, you were outputting the end of the td before the beginning 
 145  
 146  $cols++; 
 147  
 148  if ($cols == $max_cols){ // reset cols, make new row, output trs 
 149  echo '</tr>'; 
 150  $rows++; 
 151  $cols=0; 
 152  } 
 153  
 154  if ($rows == $max_rows){ // reset rows, end table,put in line break--I substituted <hr> 
 155  echo "</table></div><BR><BR>"; 
 156  $rows=0; 
 157  } 
 158  }//end while loop 
 159  //now the tricky part, completing the last table 
 160  
 161  if ($cols == 0 && $rows == 0){ //done 
 162  
 163  } else { //end cols, then end table 
 164  while ($cols !=0 && $cols < $max_cols){//don't do if the cols have been reset 
 165  echo "<td width=252 style='width:189.0pt;padding:0in .75pt 0in .75pt;height:1.0in'> 
 166  <p class=Normal align=center style='margin-top:0in; margin-right:5.3pt; 
 167  margin-bottom:0in; margin-left:5.3pt; margin-bottom:.0001pt;text-align:center'> 
 168  <span class=SpellE> </td>"; 
 169  $cols++; 
 170  } 
 171  if ($cols == $max_cols) echo '</tr>';//to end the row if needed 
 172  echo '</table></div>'; //to end the table 
 173  }//end else 
 174  }//end if there are more than 0 rows 
 175  
 176  
 177  ?>
 178  </body></html>
 179  <?
 180  
 181  /************************************************** ************** */
 182  /************************************************** ************** */
 183  /************************************************** ************** */
 184  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]