Viewing file: teacheridcard.php (4.34 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include('session.php'); ?>
<div id="print2"> <div id="talltweets"> <?php
// Get the search variable from URL
$var = @$_GET['ID'] ; $trimmed = trim($var); //trim whitespace from the stored variable // rows to return $limit=10;
// check for an empty string and display a message. if ($trimmed == "") { exit; }
// check for a search parameter if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; }
mysql_connect("localhost","pccl_user","rb!pcl838"); //(host, username, password)
//specify database ** EDIT REQUIRED HERE ** mysql_select_db("pccl_data") or die("Unable to select database"); //select which database we're using
$field = 'identity_no'; // Build SQL Query $query = "select * from teacher_registration where $field like \"$trimmed\" order by $field"; // EDIT HERE and specify your table and field names for the SQL query
$numresults=mysql_query($query); $numrows=mysql_num_rows($numresults);
// If we have no results, offer a google search as an alternative
if ($numrows == 0) { echo " Sorry, $trimmed this Number is not found";
}
// next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; }
// get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query");
// begin to show results set $count = 1 + $s ;
// now you can display the results returned while ($row= mysql_fetch_array($result)) {
$photo="<img border='5' width='70' height='100' src=http://www.pcclasses.in/data/files/".$row['photo_upload'] .">";
$id=$row[identity_no]; $name=$row[name]; $father=$row[fathers]; $addres=$row[post]; $qualificaiton=$row[qualificaiton]; $year=$row[cyear]; $DOB=$row[dob]; $phtoo="<img border='5' width='70' height='100' src=http://www.pcclasses.in/data/files/".$row['photo'] .">";
$count++ ; }
$currPage = (($s/$limit) + 1);
//break before paging echo "";
// next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print "<a href=\"$PHP_SELF?s=$prevs&q=$var\"><< Prev 10</a> "; }
// calculate number of pages needing links $pages=intval($numrows/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
?> </form>
<div><table width="350" border="1" > <tr> <td align="center" valign="middle"><table width="350" border="0"> <tr><img src="images/id2.jpg" width="350" height="47" /> </td> </tr> <tr> <td width="" align="left" valign="top">NAME</td> <td width="36%" align="left" valign="top"><?PHP echo $name ?></td> <td width="28%" rowspan="5" align="left" valign="top"><?PHP echo $phtoo ?></td> </tr> <tr> <td align="left" valign="top">ID NO</td> <td align="left" valign="top"><?PHP echo $id ?></td> </tr> <tr> <td align="left" valign="top">QUALIFICATION</td> <td align="left" valign="top"><?PHP echo $DOB ?></td> </tr> <tr> <td align="left" valign="top">QUALIFICATION</td> <td align="left" valign="top"><?PHP echo $qualificaiton ?></td> </tr> <tr> <td align="left" valign="top">ROLL NO</td> <td align="left" valign="top"><?PHP echo $id ?></td> </tr> <tr> <td align="left" valign="top">ADDRESS</td> <td align="left" valign="top"><?PHP echo $addres ?></td> <td align="left" valign="top"> </td> </tr> <tr> <td align="left" valign="top">BRANCH</td> <td align="left" valign="top"><?PHP echo $user ?></td> <td align="left" valign="top">SIGNATURE</td> </tr> </table></td> </tr> </table> <h5> </h5> </div> </div> </form> </div>
<input type="button" name="printbutton" value="Print ID" onclick="return print1('print2')"/> </body></center> </html> <!-- The PNG image will be added here --> <div> <img id="textScreenshot" src=""> </div> <!-- Include the HTMl2Canvas library --> <script src="//cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script> <script> html2canvas(document.getElementById("talltweets"), { onrendered: function(canvas) { var screenshot = canvas.toDataURL("image/png"); document.getElementById("textScreenshot").setAttribute("src", screenshot); } }); </script>
|