Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

UDHNA CITIZEN COMMERCE COLLEGE &

SPB COLLEGE OF BUSINESS ADMINISTRATION &


SMT. DIWALIBEN HARJIBHAI GONDALIA COLLEGE OF BCA AND I.T
(Self Financed College Affiliated To VNSGU, Surat)
(Managed By Udhna Academy Education Trust, Udhna)
214, Ranchhodnagar, Opp. Swaminarayan Temple, Surat-Navsari Road, Udhna, Surat – 394 210
(B.COM./B.B.A./B.C.A.)

:: B.C.A. PROGRAMME ::

CERTIFICATE

This is to certify that Mr./ Miss.

of Class. Semester. Roll No.

Exam/Seat No. has satisfactorily completed his / her software

laboratory work in the subject

paper no. during the academic year. .

He / She has completed programs out of .

Date:

Faculty Name: Head Of the Dept.

Sign:

Examiner:

Date:
Practical (Web Framework and Services)-
504 Academic Year: 2023-24

INDEX

Sr. Particulars Signature


Page
No. No.
1 Write a PHP script to sort the given user defined array in either
ascending or descending order according to user choice.

2 Create a registration form for patient with minimum 12 fields


including file upload facility for reports of the patients. Do
necessary validations on all the fields. (Design Only)
3 Perform CRUD Operation for the patient. Also provide search
patient facility.
4 Create a Sign in form for patient. Upon Successful sign in
patient can give feedback about hospital using feedback
form. Create feedback form.
Manage session and cookies between the logs in and log
out process.
5 Write a shell script that counts the number of vowels,
consonants,numbers and special characters in the given
string.
6 Write a python program to perform Count Visitors of Page
and call it using php.
7 Write a PHP script to create Photo Album Application and call
it using python
1. Create Album
2. Upload Photos in Album

3. Display Album in Gallery


QUESTION:1
Write a PHP script to sort the user defined array in either
ascending or descending order according to the user choice.

 Code:-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="que1.php" method="post">
<table>
<tr>
<td>
Enter your array :</td>
<td>
<textarea name="myarray" id="arr" cols="30"
rows="10"></textarea></td>
</tr>
<tr>
<td>
<input type="submit" name="btnsubmit" value="submit">
</td>
</tr>
<tr>
<td>
Ascending
</td> else
<td>
Desending </td>
</tr>
<tr>
<td>
<?php
if (isset($_POST['myarray'])){
$arr=$_POST['myarray'];
$carr=explode(" ",

$arr); sort($carr);

foreach($carr as $val)
{ echo $val;
}
}
?>
</td>
<td>
<?php
if (isset($_POST['myarray'])){
$arr=$_POST['myarray'];
$carr=explode(" ",$arr);

1 | P a g
e
rsort($carr);
foreach($carr as $val){
echo $val;}

2 | P a g
e
}
?> </td>
</tr>
</table>
</form>
</body>
</html>
 Output:

QUESTION: 2
Create a registration form for the patient with minimum 12 fields including
file upload facility for reports of the patients. Do necessary validationson all
the fields. (Design Only)
 Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hospital Management</title>
</head>
<body>
<form action="file:///D|/index.php" method="post">
<h2 align="center">Patient Registration Details</h2>
<table align="center" border="line">
<tr>
<td>
Patient Name </td>
<td>
<input type="text" name="pname" id="pname"> </td>
</tr>
<tr>
<td>Patient Gender</td>
<td>
<label for="Male"><input type="radio" name="pgender" id="pmale">
Male</label>
<label for="Female"><input type="radio" name="pgender" id="pfemale">
Female</label> </td>
</tr>
<tr>
<td>Patient Age</td>
<td>
<input type="text" name="pAge" id="pAge"> </td>
3 | P a g
e
</tr>
<tr>
<td>Gaurdian Name</td>
<td>
<input type="text" name="Gname" id="Gname"> </td>
</tr>
<td>Mobile no.</td>
<td>
<input type="number" name="pmobile" id="pmobile"> </td>
<tr>
<td></td>
<td><input type="number" name="pmobile" id="pmobile"></td>
</tr>
<tr>
<td>Patient Address</td>
<td>
<textarea name="pAddress" id="pAddress" cols="20"
rows="5"></textarea> </td>
</tr>
<tr>
<td>Patient Symptoms</td>
<td>
<textarea name="pSymps" id="pSymps" cols="20" rows="5"></textarea>
</td>
</tr>
<tr>
<td>Blood Group</td>
<td>
<input type="text" name="bgrp" id="bgrp"> </td>
</tr>
<tr>
<td>Doctor name</td>
<td>
<input type="text" name="dname" id="dname"> </td>
</tr>
<tr>
<td>
Doctor Contact no. </td>
<td>
<input type="number" name="Dcont" id="Dcont"> </td>
</tr>
<tr>
<td>Appointment Date</td>
<td>
<input type="date" name="Adate" id="Adate"> </td>
</tr>
<tr>
<td>
Patient report
</td>
<td>
<input type="file" </td>
</tr>
<tr>
<td></td>
<td align="right">
<input type="button" value="Submit" name="Sbtn" id="Sbtn">
<input type="button" value="Reset" name="Rbtn" id="Rbtn">
</td>

4 | P a g
e
</tr>
</table>
</form>
</body>
</html>
 Output:

QUESTION:3
Perform CRUD Operation for the patient. Also provide search patient
facility.
 PHP + HTML Code:
 index.php:
<!DOCTYPE html>
<html lang="en">
<?php
$pname = "";
$bgroup = "";
$pgender = "";
$dob = "";
$paddress = "";
$pcon = "";
$pemail = "";
$pdis = "";
$drname = "";
$drcon = "";
$apdate = "";
$report = "";
$uid = "";
if (isset($_POST['submit'])) { $pname = $_POST['pname'];

5 | P a g
e
$bgroup = $_POST['bgroup'];
$pgender = "";
if (!empty($_POST['pgender'])) {
$pgender = $_POST['pgender'];
}
$dob = $_POST['dob'];
$paddress = $_POST['paddress'];
$pcon = $_POST['pcon'];
$pemail = $_POST['pemail'];
$pdis = $_POST['pdis'];
$drname = $_POST['drname'];
$drcon = $_POST['drcon'];
$apdate = $_POST['apdate'];
$report = $_POST['report'];
}
if (isset($_GET['uid'])) {
$server = "localhost";
$user = "root";
$pass = "";
$str = "SELECT * FROM
`ishita`.`patient` WHERE id=" .
$_GET['uid'];
$con = mysqli_connect($server, $user,
$pass);
$r = $con->query($str);
$row = $r->fetch_assoc();
$pname = $row["pname"];
$pgender = $row["pgender"];
$bgroup = $row["bgroup"];
$dob = $row["dob"];
$paddress = $row["paddress"];
$pcon = $row["pcon"];
$pemail = $row["pemail"];
$pdis = $row["pdis"];
$drname = $row["drname"];
$drcon = $row["drcon"];
$apdate = $row["apdate"];
$report = $row["report"] == "" ?
$row['report'] : $row['report'];
}
if (isset($_POST['reset'])) {
$pname = "";
$bgroup = "";
$pgender = "";
$dob = "";
$paddress = "";
$pcon = "";
$pemail = "";
$pdis = "";
$drname = "";
$drcon = "";
$apdate = "";
$report = "";
}
if (isset($_POST['update'])) {
$uid = $_POST['uid'];
$pname = $_POST["pname"];
$pgender = $_POST["pgender"];
$bgroup = $_POST["bgroup"];
$dob = $_POST["dob"];

6 | P a g
e
$paddress = $_POST["paddress"];
$pcon = $_POST["pcon"];
$pemail = $_POST["pemail"];
$pdis = $_POST["pdis"];
$drname = $_POST["drname"];
$drcon = $_POST["drcon"];
$apdate = $_POST["apdate"];
$con = mysqli_connect("localhost", "root",
"");
$str = "SELECT * FROM `ishita`.`patient`
WHERE id=" . $uid;
$r = $con->query($str);
$row = $r->fetch_assoc();
$report = isset($_POST['report']) ?
$_POST['report'] : $row['report'];
$str = "UPDATE `ishita`.`patient` SET
`pname`='$pname',`pgender`='$pgender',`bgroup`=
'$bgroup',`dob`='$dob',`paddress`='$paddress',`
pcon`='$p
con',`pemail`='$pemail',`pdis`='$pdis',`drname`
='$drname',`drcon`='$drcon',`apdate`='$apdate',
`report`=
'$report' WHERE id=" .
$uid; echo $str;
if (
$pname != "" and
$bgroup != "" and
$pgender != "" and
$dob != "" and
$paddress != "" and
$pcon != "" and
$pemail != "" and
$pdis != "" and
$drname != "" and
$drcon != "" and
$apdate != "" and
$report != ""
) {
$res = $con-
>query($str); if ($res)
{
header("Location:q3.php");
}
}
}
?>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible"
content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-
scale=1.0">
<title>Hospitel Manage</title>

</head>

<body>
<form action="q3.php" method="POST">
<h1 align="center">Patient Details

7 | P a g
e
Form</h1>
<input type="hidden" name="uid"
value="<?php if (isset($_GET['uid']) and
$_GET['uid'] != "") {

echo $_GET['uid'];
} ?>">
<table align="center">
<tr>
<td class="hd">
Patient Name
:
</td>
<td>
<input class="idata"
type="text" name="pname" value="<?php echo
$pname ?>" id="pName">
<p name="p" class="vld">
<?php if
(isset($_POST['pname']) and $_POST['pname']
== "") {
echo "<br>plesae
enter patient name";
} ?
</p> >
</td>
<td class="hd">
Patient Gender :</td>
<td>
<label for="male">
<input class="idata"
type="radio" name="pgender" <?php if (
$pgender ==
"male"
) {
echo "checked";
} ?> value="male" id="male"> Male</label>
<label for="female">
<input
class="idata" type="radio" name="pgender"
<?php if
$pgender ==
"female"
) {
echo "checked";
} ?> value="female" id="female"> Female</label>
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['pgender'])) {
echo "<br>plesae
Select Patient Gender";
} ?
</p> >
</td>
</tr>
<tr>
<td class="hd">
Blood Group : </td>
<td>
<input class="idata"
8 | P a g
e
type="text" name="bgroup" value="<?php echo
$bgroup ?>" id="bg">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['bgroup'])) {
echo "<br>plesae
Enter Blood Group";
} ?
</p> >
</td>
<td class="hd">
Date of Birth
:
</td>
<td>
<input class="idata"
type="date" name="dob" value="<?php echo
$dob
?>" id="dob">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['dob'])) {
echo "<br>plesae
Select Patient Blood Group";
} ?>
</p>
</td>
</tr>
<tr>
<td class="hd">
Patient Address
:
</td>
<td>
<textarea
class="idata" name="paddress"
id="paddress" cols="25" rows="5"><?php

echo $paddress ?></textarea>


<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['paddress'])) {
echo "<br>plesae
Select Patient
Address"; } ?
>
</p>
</td>
<td class="hd">
Patient Contect :</td>
<td>
<input class="idata"
type="number" name="pcon" value="<?php echo
$pcon ?>" id="pCon">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['pcon'])) {

9 | P a g
e
echo "<br>plesae
Enter Patient Contect";

10 | P a
g e
} ?>
</p>
</td>
</tr>
<tr>
<td class="hd">
Patient Email :</td>
<td>
<input value="<?php echo
$pemail ?>" class="idata"
type="email" name="pemail" id="pEm">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['pemail'])) {
echo "<br>plesae
Enter Patient Email";
} ?
</p> >
</td>
<td class="hd">
Patient Disease
:
</td>
<td>
<input class="idata"
type="text" value="<?php echo $pdis ?>"
name="pdis" id="pDis">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['pdis'])) {
echo "<br>plesae
Enter Patient Disease";
} ?
</p> >
</td>
</tr>
<tr>
<td class="hd">
Doctor Name :
</td>
<td>
<input class="idata"
type="text" value="<?php echo $drname ?
>" name="drname" id="dName">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['drname'])) {
echo "<br>plesae
Enter Doctor name";
} ?
</p> >
</td>
<td class="hd">
Docter Contect
:
</td>
<td>
<input class="idata"
11 | P a
g e
type="number" value="<?php echo $drcon ?
>" name="drcon" id="dCon">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['drcon'])) {
echo "<br>plesae
Enter Doctor Contect";
} ?
</p> >
</td>
</tr>
<tr>
</tr>
<tr>
<td class="hd">
Appoiment Date :
</td>
<td>
<input class="idata"
type="date" value="<?php echo $apdate ?
>" name="apdate" id="aDate">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['apdate'])) {
echo "<br>plesae
Enter Appoiment Date";
} ?
</p> >
</td>
<td
class="hd">
Report :
</td>
<td>
<input class="idata"
type="file" value="<?php echo $report ?
>" name="report" id="file">
<p name="p" class="vld">
<?php if
(isset($_POST['submit']) and
empty($_POST['report'])) {
echo "<br>plesae
Select
File"; } ?
</p> >
</td>
</tr>
</table>
<div style="text-align:
center;margin- top: 20px;">
<input class="btn"
type="submit" name="submit" value="SUBMIT">
<input class="btn"
type="submit" name="reset" value="RESET">
<?php
if (isset($_GET['uid'])) {
?>
<input class="btn"

12 | P a g
e
type="submit" name="update" value="UPDATE">
<?php
}
?>
</div>
</form>
<?php
$server = "localhost";
$user = "root";
$pass = "";
$con = mysqli_connect($server, $user,
$pass);
if (isset($_POST['submit'])) {
$pname = $_POST['pname'];
$bgroup = $_POST['bgroup'];
$pgender = "";
if (!empty($_POST['pgender'])) {
$pgender = $_POST['pgender'];
}
$dob = $_POST['dob'];
$paddress = $_POST['paddress'];
$pcon = $_POST['pcon'];
$pemail = $_POST['pemail'];
$pdis = $_POST['pdis'];
$drname = $_POST['drname'];
$drcon = $_POST['drcon'];
$apdate = $_POST['apdate'];
$report =
$_POST['report']; if (
$pname != "" and
$bgroup != "" and
$pgender != "" and
$dob != "" and
$paddress != "" and
$pcon != "" and
$pemail != "" and
$pdis != "" and
$drname != "" and
$drcon != "" and
$apdate != "" and
$report != ""
) {
$q = "INSERT INTO
`ishita`.`patient` ( `pname`, `pgender`,
`bgroup`, `dob`, `paddress`,
`pcon`, `pemail`, `pdis`, `drname`, `drcon`,
`apdate`, `report`) VALUES (
'$pname', '$pgender',
'$bgroup', '$dob', '$paddress', '$pcon',
'$pemail', '$pdis', '$drname',
'$drcon', '$apdate',
'$report')";
$con->query($q);
$pname = "";
$bgroup = "";
$pgender = "";
$dob = "";
$paddress = "";
$pcon = "";

13 | P a g
e
$pemail = "";
$pdis = "";
$drname = "";
$drcon = "";
$apdate = "";
$report = "";
}
}
?>
<form action="q3.php" method="post">
<div class="srh">
<input
type="text"
name="searchText">
<input type="submit" value="Search"
name="search">
</div>
</form>
<div>
<table class="dtbl">
<tr>
<th>ID</th>
<th>pName</th>
<th>pGender</th>
<th>B-Group</th>
<th>DOB</th>
<th>pAddress</th>
<th>pContect</th>
<th>pEmail</th>
<th>pDisease</th>
<th>dr.Name</th>
<th>dr.Contect</th>
<th>Date</th>
<th>report</th>
<th>Delete</th>
<th>Edit</th>
</tr>
<?php
if (isset($_POST['search'])) {
$query = "SELECT * FROM
`ishita`.`patient` WHERE id=" .
$_POST["searchText"];
$r = $con-
>query($query); if ($r-
>num_rows > 0) {
while ($row = $r-
>fetch_assoc()) {
?>
<tr>
<td><?php echo
$row["id"]; ?></td>
<td><?php echo
$row["pname"]; ?></td>
<td><?php echo
$row["pgender"]; ?></td>jo
<td><?php echo
$row["bgroup"]; ?></td>
<td><?php echo
$row["dob"]; ?></td>
<td><?php echo
$row["paddress"]; ?></td>
14 | P a g
e
<td><?php echo
$row["pcon"]; ?></td>
<td><?php echo
$row["pemail"]; ?></td>
<td><?php echo
$row["pdis"]; ?></td>
<td><?php echo
$row["drname"]; ?></td>
<td><?php echo
$row["drcon"]; ?></td>
<td><?php echo
$row["apdate"]; ?></td>
<td><?php echo
$row["report"]; ?></td>
<td><button
class="btn red" onclick="location.href
= 'delete.php?id=<?php echo $row['id'];
?>'">Delete</button></td>
<td><button
class="btn blue" onclick="location.href
= 'q3.php?uid=<?php echo $row['id'];
?>'">Edit</button></td>
</tr>
<?php
}
}
} else {
$query = "SELECT * FROM
`ishita`.`patient`";
$r = $con-
>query($query); if ($r-
>num_rows > 0) {
while ($row = $r-
>fetch_assoc()) {
?>
<tr>
<td><?php echo
$row["id"]; ?></td>
<td><?php echo
$row["pname"]; ?></td>
<td><?php echo
$row["pgender"]; ?></td>
<td><?php echo
$row["bgroup"]; ?></td>
<td><?php echo
$row["dob"]; ?></td>
<td><?php echo
$row["paddress"]; ?></td>
<td><?php echo
$row["pcon"]; ?></td>
<td><?php echo
$row["pemail"]; ?></td>
<td><?php echo
$row["pdis"]; ?></td>
<td><?php echo
$row["drname"]; ?></td>
<td><?php echo
$row["drcon"]; ?></td>
<td><?php echo
$row["apdate"]; ?></td>

15 | P a g
e
<td><?php echo
$row["report"]; ?></td>
<td><button
class="btn red" onclick="location.href
= 'delete.php?id=<?php echo $row['id'];
?>'">Delete</button></td>
<td><button
class="btn blue" onclick="location.href
= 'q3.php?uid=<?php echo $row['id'];
?>'">Edit</button></td>
</tr>
<?php
}
}
}
?>
</table>
</div>
</body>
</html>
 delete code:
<?php
if(isset($_GET['id'])){
$server = "localhost";
$user = "root";
$pass = "";
$con = mysqli_connect($server, $user, $pass);
$str = "DELETE FROM `ishita`.`patient` WHERE id=".$_GET['id'];
$res = $con->query($str);
if ($res) {
header("Location:javascript:history.go(-1)");
}
else{
echo "Failed to Insertion..";
}
}
?>
 index.php:

16 | P a g
e
 After insert data:

QUESTION:4
Create a sign in form for patient. Upon Successful sign in patient cangive
feedback about hospital using feedback form. Create feedback Form.
Manage session and cookies between the logs in and log out process.
 Signin.php
<!DOCTYPE html>
<html lang="en">
<?php
$con = mysqli_connect("localhost", "root",
"", "ishita");
$check = false;
$email = "";
$number = "";
$rembr = "";
if (isset($_POST['submit'])) {
$email = $_POST['email'];
$number = $_POST['number'];
if (isset($_POST['cb'])) {
$rembr = $_POST['cb'];
}
if ($email != "" and $number != "" and
$rembr != "") {
$str = "SELECT * FROM `patient`
WHERE pemail='$email' and pcon='$number'";
$res = mysqli_query($con, $str);
$row = mysqli_fetch_row($res);
if (isset($row[2])) {
$check = true;

session_start();
$_SESSION['user'] = $row[0];
header("Location:fBForm.php");
}
}
}
?><head>

17 | P a g
e
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible"
content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-
scale=1.0">
<title>SignIn</title>
<link rel="stylesheet" href="signin.css">
</head>
<body>
<h1 style="color: rgb(19
210 147);">Welcome to Login</h1>
<p style="font-size: 15px;">Please
fill your field and submit</p>
<div class="divider"></div>
<form action="signin.php" method="post">
<h5>E-Mail</h5>
<input type="email"
class="inp" name="email" id="email"
value="<?php echo
$email; ?>">
<p class="vld"><?php if
(isset($_POST['email']) and $_POST['email']
== "") {
echo "Please
enter your
Email"; } ?></p>
<h5>Phone number</h5>
<input type="number" class="inp"
name="number" id="number" value="<?php echo
$number; ?>"><br>
<p class="vld"><?php if
(isset($_POST['number']) and $_POST['number']
== "") {
echo "Please
enter your
number"; } ?></p>
<label for="cb">
<input type="checkbox"
name="cb" id="cb"> Remember me ?
<p class="vld"><?php
if (isset($_POST['submit']) and
!isset($_POST['cb'])) {
echo "Please
check";
} ?></p>
</label>
<input type="submit"
align="end" class="btn" name="submit"
value="SUBMIT">
<p class="vld"><?php if
(isset($_POST['submit']) and !$check) {
echo "invalid
Data";
} ?></p>
</form>
</body>
</html>

18 | P a g
e
 Output:

 fbForm.php
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
$fname = "";
$lname = "";
$date = "";
$first = "";
$sec = "";
$thi = "";
$four = "";
$fifth = "";
$six = "";
$con = mysqli_connect("localhost", "root", "", "yagnesh");
$str = "select * from `feedback` where fid=" . $_SESSION['user'];
$res = $con->query($str);
if (mysqli_num_rows($res) > 0) {
header("Location:home.php");
}
if (!isset($_SESSION["user"])) {
header("location:signin.php");
}
if (isset($_POST['submit'])) {
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$date = $_POST['date'];
if ($fname != "" and $lname != "" and $date != "" and isset($_POST['first']) and
isset($_POST['first']) and isset($_POST['third']) and isset($_POST['fourth']) and
isset($_POST['fifth']) and isset($_POST['sixth'])) {
$first = $_POST['first'];
$sec = $_POST['second'];

19 | P a g
e
$thi = $_POST['third'];
$four = $_POST['fourth'];
$fifth = $_POST['fifth'];
$six = $_POST['sixth'];
$str = "INSERT INTO `feedback` VALUES
({$_SESSION['user']},'$fname','$lname','$date','$first','$sec','$thi','$four','$fifth','$
six')";
$res = $con-
>query($str); if ($res)
{
setcookie("user", $_SESSION['user'], time() + (86400 * 30), "/");
header("Location:home.php");
}
}
}
?>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FeedBack from hospitel</title>
<link rel="stylesheet" href="fbfrom.css">
</head>
<body>
<h2 style="color:rgb(0 201 135)">Patient Feedback Form</h2>
<p>Please take a moments to complete this form</p>
<div class="divider"></div>
<form action="fBForm.php" method="post">
<table class="tbl">
<tr>
<td>
<h4>First name : </h4>
</td>
<td>
<h4>Last name : </h4>
</td>
<td>
<h4>Birth Date : </h4>
</td>
</tr>
<tr>
<td>
<input class="idata" type="text" name="fname" id="fname"
value="<?php echo $fname ?>">
<p class="vld"><?php
if (isset($_POST['fname']) and $_POST['fname'] ==
"") {
echo "please Enter";
}
?> </p>
</td>
<td>
<input type="text" class="idata" name="lname" id="lname"
value="<?php echo $lname ?>">
<p class="vld"><?php
if (isset($_POST['lname']) and $_POST['lname'] ==
"") {
echo "please Enter";
}
?> </p>

20 | P a g
e
</td>
<td>
<input type="date" class="idata" name="date" id="date"
value="<?php echo $date ?>">
<p class="vld"><?php
if (isset($_POST['date']) and $_POST['date'] ==
"")
{ echo "please Enter";
}
?> </p>

</td> </tr>
</table>
<h4>Overall Satisfaction</h4>
<table>
<tr>
<th></th>
<th>Very Satisfied</th>
<th>Satisfied</th>
<th>Neutral</th>
<th>UnSatisfied</th>
<th>Very UnSatisfied</th>
</tr>
<tr>
<th>Doctor Knowledge</th>
<td><input class="rd" type="radio" name="first" value="1"></td>
<td><input class="rd" type="radio" name="first" value="2"></td>
<td><input class="rd" type="radio" name="first" value="3"></td>
<td><input class="rd" type="radio" name="first" value="4"></td>
<td><input class="rd" type="radio" name="first" value="5"></td>
</tr>
<tr>
<th>Doctor Kindness</th>
<td><input class="rd" type="radio" name="second" value="1"></td>
<td><input class="rd" type="radio" name="second" value="2"></td>
<td><input class="rd" type="radio" name="second" value="3"></td>
<td><input class="rd" type="radio" name="second" value="4"></td>
<td><input class="rd" type="radio" name="second" value="5"></td>
</tr>
<tr>
<th>Nurse Patience</th>
<td><input class="rd" type="radio" name="third" value="1"></td>
<td><input class="rd" type="radio" name="third" value="2"></td>
<td><input class="rd" type="radio" name="third" value="3"></td>
<td><input class="rd" type="radio" name="third" value="4"></td>
<td><input class="rd" type="radio" name="third" value="5"></td>
</tr>
<tr>
<th>Nurse Knowledge</th>
<td><input type="radio" class="rd" name="fourth" value="1"></td>
<td><input type="radio" class="rd" name="fourth" value="2"></td>
<td><input type="radio" class="rd" name="fourth" value="3"></td>
<td><input type="radio" class="rd" name="fourth" value="4"></td>
<td><input type="radio" class="rd" name="fourth" value="5"></td>
</tr>
<tr>
<th>Waiting Time</th>
<td><input type="radio" name="fifth" class="rd" value="1"></td>
<td><input type="radio" name="fifth" class="rd" value="2"></td>

21 | P a g
e
<td><input type="radio" name="fifth" class="rd" value="3"></td>
<td><input type="radio" name="fifth" class="rd" value="4"></td>
<td><input type="radio" name="fifth" class="rd" value="5"></td>
</tr>
<tr>
<th>Hygiene</th>
<td><input type="radio" name="sixth" value="1" class="rd"></td>
<td><input type="radio" name="sixth" value="2" class="rd"></td>
<td><input type="radio" name="sixth" value="3" class="rd"></td>
<td><input type="radio" name="sixth" value="4" class="rd"></td>
<td><input type="radio" name="sixth" value="5" class="rd"></td>
</tr>
</table>
<input type="submit" class="btn" name="submit" value="SUBMIT">
</form>
</body>
</html>
 Design:

 Home.php:
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
if (isset($_POST['logout'])) {
unset($_COOKIE['user']);
session_destroy();
unset($_SESSION['user']);
setcookie('user', null, -1, '/');
}
if (!isset($_COOKIE["user"])) {
header("location:signin.php");
}
$uid = isset($_SESSION['user']) ? $_SESSION['user'] : $_COOKIE["user"];
$con = mysqli_connect("localhost", "root", "", "yagnesh");
$str = "SELECT * FROM `patient` WHERE id=" . $uid;
// echo $str;
$res = mysqli_query($con, $str);
$row = mysqli_fetch_row($res);
?>

22 | P a g
e
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home page</title>
<link rel="stylesheet" href="home.css">
</head>
<body>
<form action="home.php" method="post">

<div class="header">

<h1 class="head">Welcome to My Hospitel</h1>

<div class="head2">
<input type="submit" class="btn" name="logout" value="Logout">
</div>
</div>
</form>
<div class="tbl">
<table class="table">
<tr>
<td>
<h3 class="ke">Patient Name</h3>
</td>
<td>
<h3 class="ke">Patient Gender</h3>
</td>
</tr>
<tr>
<td>
<p class="val"><?php echo $row[1]; ?></p>
</td>
<td>
<p class="val"><?php echo $row[2]; ?></p>

</td>
</tr>
<tr>
<td>
<h3 class="ke">Blood Group</h3>
</td>
<td>
<h3 class="ke">Date of Birth</h3>
</td>
</tr>
<tr>
<td>
<p class="val"><?php echo $row[3]; ?></p>
</td>
<td>
<p class="val"><?php echo $row[4]; ?></p>

</td>
</tr>
<tr>
<td>
<h3 class="ke">Patient Address</h3>
</td>

23 | P a g
e
<td>
<h3 class="ke">Patinet Contect</h3>
</td>
</tr>
<tr>
<td>
<p class="val"><?php echo $row[5]; ?></p>
</td>
<td>
<p class="val"><?php echo $row[6]; ?></p>

</td>
</tr>
<tr>
<td>
<h3 class="ke">Patient Email</h3>
</td>
<td>
<h3 class="ke">Patinet Disease</h3>
</td>
</tr>
<tr>
<td>
<p class="val"><?php echo $row[7]; ?></p>
</td>
<td>
<p class="val"><?php echo $row[8]; ?></p>
</td>
</tr>
<tr>
<td>
<h3 class="ke">Doctor name</h3>
</td>
<td>
<h3 class="ke">Docter contect</h3>
</td>
</tr>
<tr>
<td>
<p class="val"><?php echo $row[9]; ?></p>
</td>
<td>
<p class="val"><?php echo $row[10]; ?></p>
</td>
</tr>
<tr>
<td>
<h3 class="ke">Appoiment date</h3>
</td>
<td>
<h3 class="ke">Report</h3>
</td>
</tr>
<tr>
<td>
<p class="val"><?php echo $row[11]; ?></p>
</td>
<td>
<p class="val"><?php echo $row[12]; ?></p>

24 | P a g
e
</td>
</tr>
</table>
</div>
</body>
</html>
 Design:

QUESTION:6
Write a python program to perform Count Visitors of Page and call itusing
PHP.
 Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php
session_start();

if(isset ($_SESSION['views']))
$_SESSION[ 'views' ] = $_SESSION[ 'views' ] +1;
else
$_SESSION[ 'views' ] =1;

echo"views = ".$_SESSION[ 'views' ];


?>
<body>
</body>
</html>
Python file:
ishita.py

25 | P a g
e
 Design:

QUESTION:7
Write a PHP script to create Photo Album Application and call it using
python.
• Create Album
• Upload Photos in Album
• Display Album in Gallery
 Code:
// Compress Image compressImage($_FILES['imagefiles']['type'],$location,
$thumbnail_location,60);
echo "Successfully Uploaded";
}
}
}
// Compress image
function compressImage($type,$source, $destination, $quality) {
$info = getimagesize($source);
if ($type == 'image/jpeg')
$image = imagecreatefromjpeg($source);

elseif ($type == 'image/gif')


$image = imagecreatefromgif($source);

elseif ($type == 'image/png')


$image = imagecreatefrompng($source);

imagejpeg($image, $destination, $quality);


}
?>
<!-- Upload form -->
<form method='post' action='' enctype='multipart/form-data'>
<input type='file' name='imagefiles' >
<input type='submit' value='Upload' name='upload'>
</form>

26 | P a g
e
</body>
</html>

 Design:

27 | P a g
e

You might also like