connect_error); return $conn; } $conn = Connect(); $msg = ""; if(isset($_POST['Submit'])){ $first_name = empty($_POST["first_name"]) ? 'NULL' : "'" . $_POST["first_name"] . "'"; $last_name = empty($_POST["last_name"]) ? 'NULL' : "'" . $_POST["last_name"] . "'"; $mobilenumber = empty($_POST["mobilenumber"]) ? 'NULL' : "'" . $_POST["mobilenumber"] . "'"; $gender = empty($_POST["gender"]) ? 'NULL' : "'" . $_POST["gender"] . "'"; $year_birth = empty($_POST["year_birth"]) ? 'NULL' : "'" . $_POST["year_birth"] . "'"; $appointment_type = empty($_POST["appointment_type"]) ? 'NULL' : "'" . $_POST["appointment_type"] . "'"; $speciality = empty($_POST["speciality"]) ? 'NULL' : "'" . $_POST["speciality"] . "'"; $payment_details = empty($_POST["payment_details"]) ? 'NULL' : "'" . $_POST["payment_details"] . "'"; $mpesa_reference = empty($_POST["mpesa_reference"]) ? 'NULL' : "'" . $_POST["mpesa_reference"] . "'"; $agree = empty($_POST["agree"]) ? 'NULL' : "'" . $_POST["agree"] . "'"; $query = "INSERT into appointment(first_name,last_name,mobilenumber,gender,year_birth,appointment_type,speciality,payment_details,mpesa_reference,agree,date_added) VALUES($first_name,$last_name,$mobilenumber,$gender,$year_birth,$appointment_type,$speciality,$payment_details,$mpesa_reference,$agree,now())"; if ($conn->query($query) === TRUE) { echo "New record created successfully"; echo ""; } else { echo "Error: " . $query . "
" . $conn->error; return; } } ?> Online Appointment
ONLINE APPOINTMENT BOOKING
Patient Details
First Name
*
Last Name
*
Cellphone Number
*
Gender
* Female
Year of Birth
*
Location
*
Appointment Details
Appointment Type
*
Payment Details
*

Consultation Cost : [General 1000/= and Speciality is 1500/=]

Paybill Number : 400222

Enter Accout Number : 400200

Enter Amount : Ksh

Enter Your Pin : Don't share your pin

Please pay this amount via M-PESA and tye the transaction code below

M-Pesa Payment Reference Number*

The information I have provided on this form is true to the best of my knowledge.

I Agree