Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.25 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.     print_r($_POST);
  9.  
  10. ?>
  11. <html>
  12.     <head>
  13.         <title>Print</title>
  14.         <style type="text/css">
  15.             *
  16.             {
  17.                 font-family:Arial, Helvetica, sans-serif;
  18.                 font-size:10pt;
  19.             }
  20.  
  21.             .heading
  22.             {
  23.                 font-weight:bold;
  24.             }
  25.         </style>
  26.     </head>
  27.     <body>
  28.         <h2>Printing</h2>
  29.         <?
  30.             // Run through the post data and retrieve the IDs we're pulling out of the database
  31.             foreach($_POST['print'] as $id)
  32.             {
  33.                 $query = "SELECT * FROM `data` WHERE `ID` = ".$id;
  34.                 $res = mysql_query($query);
  35.                 $row = mysql_fetch_assoc($res);
  36.                                 echo "ERror: ".mysql_error();
  37.         ?>
  38.             <h3>Print Date: <?=date("m-d-Y")?></h3>
  39.             <table>
  40.                 <tr>
  41.                     <td class="heading">Student Name</td>
  42.                     <td><?php echo $row['field_1'];?></td>
  43.                     <td class="heading">Date</td>
  44.                     <td><?php $row['field_2'];?></td>
  45.                 </tr>
  46.                 <tr>
  47.                     <td class="heading">Course</td>
  48.                     <td><?php $row['field_3'];?></td>
  49.                     <td class="heading">Assignment Name</td>
  50.                     <td><?php $row['field_4'];?></td>
  51.                 </tr>
  52.                 <tr>
  53.                     <td class="heading">Course Instructor</td>
  54.                     <td><?php $row['field_8'];?></td>
  55.                     <td class="heading">Tutor Name</td>
  56.                     <td><?php $row['field_7'];?></td>
  57.                 </tr>
  58.                 <tr>
  59.                     <td class="heading">Start Time</td>
  60.                     <td><?php $row['field_5'];?></td>
  61.                     <td class="heading">End Time</td>
  62.                     <td><?php $row['field_6'];?></td>
  63.             </table>
  64.             <h3>Student request help with</h3>
  65.             <p><i><?php $row['field_10'];?></i></p>
  66.             <p><?php $row['field_12'];?></p>
  67.             <h3>Other</h3>
  68.             <p><?php $row['field_11'];?></p>
  69.             <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>
  70.             <br>
  71.             <p><b>Signature:</b>______________________________</p>
  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>
  92.             <br>
  93.             <br style="page-break-after: always">
  94.         <?
  95.             }
  96.         ?>
  97.     </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement