Location: PHPKode > projects > TherapyDoc > therapydoc_1.3.1_3/view/referrals/insert_referral.php
<?php
session_start();
ob_start();
require_once "connect.inc";
include('globals.inc');
$date = isset($_REQUEST["date"]) ? $_REQUEST["date"] : "";
$birthdate = isset($_REQUEST["birthdate"]) ? $_REQUEST["birthdate"] : "";
$stmt = $dbh->prepare("INSERT INTO tbl_referral_info (physician_id,fname,lname,date,add1,add2,city,state,zip,phone,existing,birthdate,pt,ot,st,location_id,email,payor1,payor2) VALUES (:physician_id,:fname,:lname,:date,:add1,:add2,:city,:state,:zip,:phone,:existing,:birthdate,:pt,:ot,:st,:location_id,:email,:payor1,:payor2)");
$stmt->bindParam(':physician_id', $_POST['physician_id']);
$stmt->bindParam(':fname', $_POST['fname']);
$stmt->bindParam(':lname', $_POST['lname']);
$stmt->bindParam(':date', $date);
$stmt->bindParam(':add1', $_POST['add1']);
$stmt->bindParam(':add2', $_POST['add2']);
$stmt->bindParam(':city', $_POST['city']);
$stmt->bindParam(':state', $_POST['state']);
$stmt->bindParam(':zip', $_POST['zip']);
$stmt->bindParam(':phone', $_POST['phone']);
$stmt->bindParam(':existing', $_POST['existing']);
$stmt->bindParam(':birthdate', $birthdate);
$stmt->bindParam(':pt', $_POST['pt']);
$stmt->bindParam(':ot', $_POST['ot']);
$stmt->bindParam(':st', $_POST['st']);
$stmt->bindParam(':location_id', $_POST['location_id']);
$stmt->bindParam(':email', $_POST['email']);
$stmt->bindParam(':payor1', $_POST['payor1']);
$stmt->bindParam(':payor2', $_POST['payor2']);
$stmt->execute();
$dbh = null;

if(!isset($_POST['add_phys'])){
	$_POST['add_phys']="NO";
}
if($_POST['add_phys']=="Add Physician"){
	ob_start();
	header("location: http://$sname/therapydoc/view/physician/input_form.php?l={$_POST['lname']}&&f={$_POST['fname']}&&d=$date");
	ob_flush();
}

?>
<META
	HTTP-EQUIV="refresh"
	content="0;URL=http://<? echo $sname; ?>/therapydoc/menu.php">
Return current item: TherapyDoc