Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Other

ict2613 Task 5 Assignment 3 Answer

Document preview thumbnail
Preview 2 out of 5 pages

ict2613 Task 5 Assignment 3 Answer

Content preview

<html>
<body>
<?php
$pageTitle = "Task 5";
include './menu.inc';
include "connection.php";
?>

<?php
//////////////////////////////Task
5//////////////////////////

//Declaration of the the valiables to be used
$practiceNumber=empty($_POST["practiceNumber"]) ? 0 :
$_POST["practiceNumber"];
$Name=empty($_POST["Name"]) ? 'Null' : $_POST["Name"];
$specialty=empty($_POST["specialty"]) ? 'Null' : $_POST["specialty"];
$fees=empty($_POST["fees"]) ? 0 : $_POST["fees"];
$selectMe=empty($_POST['hospital'])? 0 : $_POST["hospital"];
$ErrorMsg ="";
//////////////////////////insert
Records//////////////////////////////////

, if(isset($_POST['btnSuc'])) {

if($selectMe =='0'){
$ErrorMsg="Please select one of the options on the
drop down list ";
$AlertStyle="alert alert-warning";

}
else
if($selectMe =='Add'){
if($practiceNumber =='0'){

$ErrorMsg="Please insert value to
add record";
$AlertStyle="alert alert-warning";

}else{
$sqlss="INSERT INTO
doctors(practiceNumber,specialty,fee,Name)
VALUES
('$practiceNumber','$specialty','$fees','$Name')";

$result=mysqli_query($con,$sqlss);
if($result){

echo "<script>location.href =
'task5.php';</script>";
echo "row has been inserted";
}
}
}

///////////////////////////delete
Records/////////////////////////////////

if($selectMe=='Delete'){
if($practiceNumber =='0'){

$ErrorMsg="Please value to delete ";

$AlertStyle="alert alert-warning";

}
else{
$qer="DELETE from doctors WHERE
practicenumber='$practiceNumber'";
$results=mysqli_query($con,$qer);
if($results){
echo $selectMe;
echo "<script>location.href =
'task5.php';</script>";
}

}
}

///////////////////////////Update
Records/////////////////////////////////

Document information

Uploaded on
July 18, 2021
Number of pages
5
Written in
2020/2021
Type
Other
Person
Unknown
$5.74

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
hlogzaogza
3.9
(8)
Sold
33
Followers
30
Items
0
Last sold
1 year ago


Reviews from verified buyers




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions