Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.23 KB | None | 0 0
  1. <?php
  2.     $username="root";
  3.     $password="";
  4.     $database="wctif";
  5.  
  6.     mysql_connect("localhost",$username,$password);
  7.     @mysql_select_db($database) or die( "Unable to select database");
  8.  
  9. ?>
  10. <html>
  11.     <head>
  12.         <title>Print</title>
  13.         <style type="text/css">
  14.             *
  15.             {
  16.                 font-family:Arial, Helvetica, sans-serif;
  17.                 font-size:10pt;
  18.             }
  19.  
  20.             .heading
  21.             {
  22.                 font-weight:bold;
  23.             }
  24.         </style>
  25.     </head>
  26.     <body>
  27.         <h2>Printing</h2>
  28.         <?php
  29.             // Run through the post data and retrieve the IDs we're pulling out of the database
  30.             foreach($_POST['print'] as $id)
  31.             {
  32.                 $query = "SELECT * FROM `data` WHERE `ID` = ".$id;
  33.                 $res = mysql_query($query);
  34.                 $row = mysql_fetch_assoc($res);
  35.         ?>
  36.             <h3>Print Date: <?php echo date("m-d-Y");?></h3>
  37.             <table>
  38.                 <tr>
  39.                     <td class="heading">Student Name</td>
  40.                     <td><?php echo $row['field_1'];?></td>
  41.                     <td class="heading">Date</td>
  42.                     <td><?php $row['field_2'];?></td>
  43.                 </tr>
  44.                 <tr>
  45.                     <td class="heading">Course</td>
  46.                     <td><?php echo $row['field_3'];?></td>
  47.                     <td class="heading">Assignment Name</td>
  48.                     <td><?php echo $row['field_4'];?></td>
  49.                 </tr>
  50.                 <tr>
  51.                     <td class="heading">Course Instructor</td>
  52.                     <td><?php echo $row['field_8'];?></td>
  53.                     <td class="heading">Tutor Name</td>
  54.                     <td><?php echo $row['field_7'];?></td>
  55.                 </tr>
  56.                 <tr>
  57.                     <td class="heading">Start Time</td>
  58.                     <td><?php echo $row['field_5'];?></td>
  59.                     <td class="heading">End Time</td>
  60.                     <td><?php echo $row['field_6'];?></td>
  61.             </table>
  62.             <h3>Student request help with</h3>
  63.             <p><i><?php echo $row['field_10'];?></i></p>
  64.             <p><?php echo $row['field_12'];?></p>
  65.             <h3>Other</h3>
  66.             <p><?php echo $row['field_11'];?></p>
  67.             <p><i>Please review and sign acknowledging that the student visited the writing center with work pertaining to your course listed above. Return signed form to writing center director.</i></p>
  68.             <br>
  69.             <p><b>Signature:</b>______________________________</p>
  70.             <br>
  71.             <br>
  72.             <br>
  73.             <br>
  74.             <br>
  75.             <br>
  76.             <br>
  77.             <br>
  78.             <br>
  79.             <br>
  80.             <br>
  81.             <br>
  82.             <br>
  83.             <br>
  84.             <br>
  85.             <br>
  86.             <br>
  87.             <br>
  88.             <br>
  89.             <br>
  90.             <br>
  91.             <br style="page-break-after: always">
  92.         <?
  93.             }
  94.         ?>
  95.     </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement