Viewing file: allrecords.php (7.53 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<style type="text/css"> body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000; font-weight: bold; } </style>
<div id="print2"> <div id="talltweets"> <script type="text/javascript">
function print1(strid) { if(confirm("Do you want to print?")) { var values = document.getElementById(strid); var printing = window.open('','','left=0,top=0,width=550,height=400,toolbar=0,scrollbars=0,sta?tus=0'); printing.document.write(values.innerHTML); printing.document.close(); printing.focus(); printing.print(); printing.close(); } } </script> <?php
// Get the search variable from URL
$var = @$_GET['q'] ; $trimmed = trim($var); //trim whitespace from the stored variable // rows to return $limit=400;
// 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
// Build SQL Query $query = "select * from student_admission where branch like \"$trimmed\" order by ID"; // 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)) { $branch=$row[branch ]; $id=$row[roll_no]; $name=$row[stduentname]; $father=$row[studentfathername]; $addres=$row[address]; $Subject=$row[programname]; $year=$row[cyear]; $DOB=$row[dob]; $phtoo="<img border='0' width='80' height='80' src=http://www.mitmgroup.com/data/files/".$row['photo_upload'] .">";
echo "<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"2\"><IMG SRC=\"images/School-Id-Card[1]_1.jpg\" WIDTH=\"2\" BORDER=\"0\" HEIGHT=\"81\"></TD>\n"; echo " <TD COLSPAN=\"6\"><IMG SRC=\"images/School-Id-Card[1]_2.jpg\" WIDTH=\"399\" BORDER=\"0\" HEIGHT=\"81\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"81\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"4\"><IMG SRC=\"images/School-Id-Card[1]_3.jpg\" WIDTH=\"297\" BORDER=\"0\" HEIGHT=\"2\"></TD>\n"; echo " <TD COLSPAN=\"4\"><IMG SRC=\"images/School-Id-Card[1]_4.jpg\" WIDTH=\"104\" BORDER=\"0\" HEIGHT=\"2\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"2\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"3\" bgcolor=\"#E4E5B9\"> </TD>\n"; echo " <TD COLSPAN=\"4\" bgcolor=\"#E3E6B9\"> $branch </TD>\n"; echo " <TD><IMG SRC=\"images/School-Id-Card[1]_7.jpg\" WIDTH=\"2\" BORDER=\"0\" HEIGHT=\"15\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"15\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"4\" ROWSPAN=\"5\" align=\"left\" valign=\"top\" bgcolor=\"#E3E6B9\"><table width='290' border='0'>\n"; echo " <tr valign='top'>\n"; echo " <td width=\"82\" >NAME:-</td>\n"; echo " <td width=\"198\"> $name </td>\n"; echo " </tr>\n"; echo " <tr valign='top'>\n"; echo " <td>FATHER'S:-</td>\n"; echo " <td> $father </td>\n"; echo " </tr>\n"; echo " \n"; echo " <tr valign='top'>\n"; echo " <td>ROLL NO:-</td>\n"; echo " <td>$id </td>\n"; echo " </tr>\n"; echo " <tr valign='top'>\n"; echo " <td>COURSE:-</td>\n"; echo " <td rowspan=\"2\">$Subject </td>\n"; echo " </tr>\n"; echo " <tr valign='top'>\n"; echo " <td> </td>\n"; echo " </tr>\n"; echo " <tr valign='top'>\n"; echo " <td>SESSION:-</td>\n"; echo " <td>$year </td>\n"; echo " </tr>\n"; echo " </table></TD>\n"; echo " <TD bgcolor=\"#DEE6B7\"> $phtoo </TD>\n"; echo " <TD COLSPAN=\"3\"><IMG SRC=\"images/School-Id-Card[1]_10.jpg\" WIDTH=\"18\" BORDER=\"0\" HEIGHT=\"101\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"101\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"4\"><IMG SRC=\"images/School-Id-Card[1]_11.jpg\" WIDTH=\"104\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"2\" bgcolor=\"#DEE6B7\"> </TD>\n"; echo " <TD COLSPAN=\"2\"><IMG SRC=\"images/School-Id-Card[1]_13.jpg\" WIDTH=\"3\" BORDER=\"0\" HEIGHT=\"27\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"27\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"4\"><IMG SRC=\"images/School-Id-Card[1]_14.jpg\" WIDTH=\"104\" BORDER=\"0\" HEIGHT=\"2\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"2\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"4\" ROWSPAN=\"2\"><IMG SRC=\"images/School-Id-Card[1]_15.jpg\" WIDTH=\"104\" BORDER=\"0\" HEIGHT=\"12\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"11\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD COLSPAN=\"4\"><IMG SRC=\"images/School-Id-Card[1]_16.jpg\" WIDTH=\"297\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD><IMG SRC=\"images/School-Id-Card[1]_17.jpg\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"27\"></TD>\n"; echo " <TD COLSPAN=\"7\" align=\"center\" bgcolor=\"#DB3529\"><img src=\"images/School-Id-Card[1]_18.jpg\" width=\"400\" height=\"27\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"27\"></TD>\n"; echo " </TR>\n"; echo " <TR>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"294\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"86\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"15\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"2\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo " <TD><IMG SRC=\"images/space.gif\" WIDTH=\"1\" BORDER=\"0\" HEIGHT=\"1\"></TD>\n"; echo "</TR>\n"; echo "</TABLE>\n"; echo "<br>\n";
$count++ ; }
$currPage = (($s/$limit) + 1);
//break before paging
// 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>
|