Web Project - Part I
Web Project - Part I
Web Project - Part I
php
<?php
session_start();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
font-family: Calibri;
font-size: 16px;
color: #000066;
body {
background-color: #D2FBFB;
-->
</style></head>
<body>
<?php
$conn=mysqli_connect('localhost','root','','hnd_28_final');
if($conn){
if(mysqli_query($conn,$queNum)){
$dRes=mysqli_query($conn,$queNum);
$sno=0;
if(mysqli_num_rows($dRes)>0){
$dataR=mysqli_query($conn,$queMax);
$dVal=mysqli_fetch_assoc($dataR);
$sno=$dVal['MAX(SerialNo)'];
$sno+=1;
else{
$sno=1;
$cid='SEA-'.$sno;
$_SESSION['cid']=$cid;
header("Location:CusReg.php");
else{
?>
</body>
</html>
CusReg.php
Code :
<?php
session_start();
if(isset($_SESSION['RName'])){
<tr>
</tr>
<tr>
</tr>';
?>
<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;
}
.style1 {color: #000033}
.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;
td{
vertical-align:top;
-->
</style></head>
<?php
echo '<tr>
<td width="25%">
<tr>
</tr>
<tr>
<td align="right"><a href="cusNumGen.php"><img
src="Imgs/CusReg.png"></a></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
</td>
<td width="75%"><br>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
</tr>
<tr>
<td colspan="2"><label>
</label></td>
</tr>
<tr>
<td colspan="2">NIC</td>
</tr>
<tr>
<tr>
<td colspan="2">Address</td>
</tr>
<tr>
</label></td>
<td><label>
Male
Female
</label></td>
</tr>
<tr>
<td> </td>
<td>Civil Status</td>
</tr>
<tr>
<td> </td>
Married
Unmarried</td>
</tr>
<tr>
<td colspan="2"><label>
<div align="center">
</div>
</label></td>
</div></td>
</tr>
<tr>
</tr>
</table>
</form>
</td>
</tr>
</table>';
?>
<body>
</body>
</html>
regProc.php
<?php
session_start();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
font-family: Calibri;
font-size: 16px;
color: #000066;
body {
background-color: #D2FBFB;
-->
</style></head>
<body>
<?php
$cid=$_SESSION['cid'];
$cname=$_POST['txtFName'].' '.$_POST['txtLName'];
$nic=$_POST['txtNIC'];
$conNo=$_POST['txtConNo'];
$add=$_POST['txtAdd'];
$dob=$_POST['txtDOB'];
$gen=$_POST['rbGen'];
$cs=$_POST['rbCs'];
if($gen=='Male'){$tit='Mr.';}
else if($cs=='Unmarried'){$tit='Miss.';}
else{$tit='Mrs.';}
$conn=mysqli_connect('localhost','root','','hnd_28_final');
if($conn){
$queSave="INSERT INTO
Customer(CusID,CusName,NIC,ConNo,CAdd,DOB,Gender,CStat,Title)
VALUES('$cid','$cname','$nic','$conNo','$add','$dob','$gen','$cs','$tit')";
if(mysqli_query($conn,$queSave)){
else{
else{
?>
</body>
</html>
Customer Table: