Viewing file: index.php (5.63 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","mitm_user","mitmpass838"); //(host, username, password)
//specify database ** EDIT REQUIRED HERE ** mysql_select_db("mitm_ailwssor_database") 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.mitmgroup.com/data/files/".$row['photo_upload'] .">";
$id=$row[roll_no]; $name=$row[stduentname]; $father=$row[studentfathername]; $addres=$row[address]; $Subject=$row[subject1]; $year=$row[cyear]; $DOB=$row[dob]; $phtoo="<img border='5' width='70' height='100' src=http://www.mitmgroup.com/data/files/".$row['photo_upload'] .">";
$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">FATHER NAME</td> <td align="left" valign="top"><?PHP echo $father ?></td> </tr> <tr> <td align="left" valign="top">DOB</td> <td align="left" valign="top"><?PHP echo $DOB ?></td> </tr> <tr> <td align="left" valign="top">PROGRAMME</td> <td align="left" valign="top"><?PHP echo $Subject ?></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> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Page</title> <meta name="generator" content="WYSIWYG Web Builder 10 - http://www.wysiwygwebbuilder.com"> <link href="Untitled1.css" rel="stylesheet"> <link href="index.css" rel="stylesheet"> </head> <body> <div id="Layer1" style="position:absolute;text-align:left;left:3px;top:6px;width:374px;height:243px;z-index:3;"> <div id="wb_Image1" style="position:absolute;left:4px;top:3px;width:370px;height:48px;z-index:0;"> <img src="images/id2.jpg" width="350" height="47" /></div> <div id="wb_Image2" style="position:absolute;left:275px;top:60px;width:99px;height:132px;z-index:1;"> <img src="images/wwb_london.jpg" id="Image2" alt=""></div> <table style="position:absolute;left:10px;top:57px;width:253px;height:164px;z-index:2;" id="Table1"> <tr> <td class="cell0"><span style="color:#000000;font-family:Arial;font-size:13px;line-height:16px;"> </span></td> <td class="cell1"><span style="color:#000000;font-family:Arial;font-size:13px;line-height:16px;"> </span></td> </tr> <tr> <td class="cell2"><span style="color:#000000;font-family:Arial;font-size:13px;line-height:16px;"> </span></td> <td class="cell3"><span style="color:#000000;font-family:Arial;font-size:13px;line-height:16px;"> </span></td> </tr> </table> </div> </body> </html>
|