Web Proj - III (Search & Search Result Pages)
Web Proj - III (Search & Search Result Pages)
php
Code :
<?php
session_start();
if(isset($_SESSION['RName'])){
<tr>
</tr>
<tr>
</tr>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SeaBreeze.com</title>
<style type="text/css">
<!--
body,td,th {
font-family: Calibri;
font-size: 16px;
color: #000066;
body {
background-color: #D2FBFB;
.style3 {
color: #CCCCCC;
font-size: 20px;
font-weight: bold;
font-style: italic;
.style4 {
font-size: 18px;
color: #000000;
.style5 {
font-size: 24px;
color: #000099;
font-weight: bold;
.style7 {
font-size: 12px;
color: #FF0000;
font-style: italic;
-->
</style></head>
<body>
<?php
echo '<tr>
<td width="25%">
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<tr>
</tr>
<tr>
</tr>
</table>
</td>
<td width="75%">
<tr>
</tr>
<tr>
</tr>
<tr>
<td width="61%"><label>
</label></td>
</tr>
<tr>
<td colspan="2"><span class="style7">*** To Search all Customers, Keep the above Text Box
Empty</span></td>
</tr>
<tr>
<td><label>
<div align="center">
</div>
</label></td>
<td>
<div align="center">
</div></td>
</tr>
<tr>
</tr>
</table>
</form>
</td>
</tr>
</table>';
?>
</body>
</html>
SearchRes.php
Code :
<?php
session_start();
if(isset($_SESSION['RName'])){
<tr>
</tr>
<tr>
</tr>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SeaBreeze.com</title>
<style type="text/css">
<!--
body,td,th {
color: #000066;
font-family: Calibri;
font-size: 14px;
body {
background-color: #D2FBFB;
td{
vertical-align:top;
.style3 {
color: #CCCCCC;
font-size: 20px;
font-weight: bold;
font-style: italic;
-->
</style></head>
<body>
<?php
echo '<tr>
<td width="25%">
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
</td>
<td width="75%">';
$cid=$_POST['txtCusID'];
$conn=mysqli_connect('localhost','root','','hnd_28_final');
if($conn){
if(!empty($cid)){
if(mysqli_query($conn,$res)){
$dRes=mysqli_query($conn,$res);
if(mysqli_num_rows($dRes)>0){
<tr>
</tr>
<tr>
<th>Customer Name</th>
<th>NIC</th>
<th>Contact No.</th>
<th>Address</th>
<th>Date of Birth</th>
<th>Gender</th>
<th>Civil Status</th>
<th> </th>
<th> </th>
</tr>';
while($rowVal=mysqli_fetch_assoc($dRes)){
echo '<tr>
<td>'.$rowVal['Title'].$rowVal['CusName'].'</td>
<td>'.$rowVal['NIC'].'</td>
<td>'.$rowVal['ConNo'].'</td>
<td>'.$rowVal['CAdd'].'</td>
<td>'.$rowVal['DOB'].'</td>
<td>'.$rowVal['Gender'].'</td>
<td>'.$rowVal['CStat'].'</td>
<td><a
href="Edit.php?id='.$cid.'"><img src="Imgs/EditImg.png" width="30" height="30"></a></td>
<td><a
href="Delete.php?id='.$cid.'"><img src="Imgs/DelImg.png" width="30" height="30"></a></td>
</tr>';
echo '</table>';
else{
if(mysqli_query($conn,$res)){
$dRes=mysqli_query($conn,$res);
if(mysqli_num_rows($dRes)>0){
<tr>
<th>Customer ID</th>
<th>Customer Name</th>
<th>NIC</th>
<th>Contact No.</th>
<th>Address</th>
<th>Date of Birth</th>
<th>Gender</th>
<th>Civil Status</th>
<th> </th>
<th> </th>
</tr>';
while($rowVal=mysqli_fetch_assoc($dRes)){
echo '<tr>
<td>'.$rowVal['CusID'].'</td>
<td>'.$rowVal['Title'].$rowVal['CusName'].'</td>
<td>'.$rowVal['NIC'].'</td>
<td>'.$rowVal['ConNo'].'</td>
<td>'.$rowVal['CAdd'].'</td>
<td>'.$rowVal['DOB'].'</td>
<td>'.$rowVal['Gender'].'</td>
<td>'.$rowVal['CStat'].'</td>
<td><a
href="Edit.php?id='.$rowVal['CusID'].'"><img src="Imgs/EditImg.png" width="30"
height="30"></a></td>
<td><a
href="Delete.php?id='.$rowVal['CusID'].'"><img src="Imgs/DelImg.png" width="30"
height="30"></a></td>
</tr>';
echo '</table>';
}
}
else{
echo '</td>
</tr>
</table>';
?>
</body>
</html>