$UserClass = "Patient"; //PatientDAO DB fields $Height = $_POST["height"]; $Weight = $_POST["weight"]; $DOB = $_POST["DOB"]; $Gender = $_POST["gender"]; $SSN = $_POST["SSN"]; $MedicalConditions = $_POST["MedicalConditions"]; if ($Username == "" || $Password == "" || $FirstName == "" || $MiddleName == "" || $LastName == "" || $Address == "" || $PhoneNumber == "" || $Height == "" || $Weight == "" || $DOB == "" || $Gender == "" || $SSN == "" || $MedicalConditions == "") { header("Location: add_patient.php?error=102"); } $u = new UserDAO(); $u->Username = $_SESSION["username"]; $u->Find(); $ClinicianId = $u->idNumber; $p = new PatientDAO(); $p->Username = $Username; if ($p->Find()) { header("Location: add_patient.php?error=103"); } $p->Password = $Password; $p->FirstName = $FirstName; $p->MiddleName = $MiddleName; $p->LastName = $LastName; $p->Address = $Address; $p->PhoneNumber = $PhoneNumber; $p->UserClass = $UserClass; $p->Height = $Height; $p->Weight = $Weight; $p->DOB = $DOB; $p->Gender = $Gender;
<a href="stats.php">Stats Tables</a><br /> <a href="logout.php">Logout</a> </div> </div> <div id="columnwrapper"> <div id="breadcrumbs"> </div> <div id="content_container"> <h2 class="welcome">Edit Task</h2> <div id="content1"> <?php $p = new PatientDAO(); $p->Username = $_GET["patient"]; $p->Find(); if ($_POST["dailyTaskClass"] == "WalkingTask") { ?> <h3 class="welcome">Walking Task</h3> <form name="add_task" action="add_task_script.php?patient=<?php echo $_GET["patient"]; ?> " method="post"> Patient: <?php echo $p->FirstName . " " . $p->MiddleName . " " . $p->LastName; ?> <br /> Task: <input type="text" readonly name="class" value="<?php echo $_POST["dailyTaskClass"];
?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="healthClinic.css"/> <script type="text/javascript" src="js/jquery-2.1.4.js"></script> <title>Health Clinic - Home</title> </head> <body> <?php $id = $_SESSION["patient_id"]; include_once 'patientDAO.php'; $patientDAO = new PatientDAO("localhost", "healthclinicuser", "hcuser", "healthclinic"); $patient = $patientDAO->getPatientByID($id); ?> <h3 id="patient"> Olá, <?php echo $patient->name; ?> ! </h3> <div class="menu"> <!-- <a href="delete.php"> Excluir conta </a> --> <a href="#" onclick="desactivateLogin()"> Excluir conta </a> <a href="searchPatientPage.php"> Pesquisar paciente </a> <!-- <a href="#" onclick="searchPatient()"> Pesquisar paciente </a>-->
print_r($w); print "<br/>\n"; //Insert a patient $d = new PatientDAO; $d->Username = "******"; $d->Height = 105; $d->ClinicianId = 1; $d->Gender = "male"; $d->UserClass = "Patient"; print "Patient Insert: " . $d->Insert() . "<br/>\n"; //Update a patient $f = new PatientDAO; $f->Username = "******"; $f->Gender = "female"; print "Patient Update: " . $f->Update() . "<br/>\n";; */ //THIS SECTION IS TO TEST THE STATISTICS DAOS! ///////////////////////////////////////// $pat = new PatientDAO(); $pat->Username = "******"; $dt_list = $pat->ListDailyTasks(); print "Patient List Obtained\n"; $st = $dt_list[0]->GetStatistics("2009-10-31 22:00"); print_r($st); $st_list = $dt_list[1]->ListStatistics("2008-11-01 12:00", "2010-11-01 12:00", "2008-11-01 12:00", "2010-11-01 12:00"); print_r($st_list);
Stats </h2> <br /> <?php if ($_GET["error"] == 101) { ?> <table class="error" bgcolor="red"> <tr> <td size=>User was not updated.</td> </tr> </table> <?php } ?> <?php $p = new PatientDAO(); $p->Username = $_GET["patient"]; //$p->Find(); $dailytaskArray = $p->ListDailyTasks(); ?> <p> <?php echo "Click a Column Heading to sort by that Field."; ?> </p> <table class="sortable" border="1"> <tr> <th>Date</th> <th>Steps</th> </tr>
<a href="logout.php">Logout</a> </div> </div> <div id="columnwrapper"> <div id="breadcrumbs"> </div> <div id="content_container"> <h2 class="welcome">Patient Profile</h2> <div id="content1"> <?php $p = new PatientDAO(); $p->Username = $_GET["patient"]; $p->Find(); ?> Name: <?php echo $p->FirstName . " " . $p->MiddleName . " " . $p->LastName . "<br />"; ?> Username: <?php echo $p->Username . "<br />"; ?> Address: <?php echo $p->Address . "<br />"; ?> Phone Number: <?php echo $p->PhoneNumber . "<br />"; ?>
<?php include_once "session.php"; include_once 'patientVO.php'; include_once 'patientDAO.php'; $patientDAO = new PatientDAO("localhost", "healthclinicuser", "hcuser", "healthclinic"); $patient = new Patient(); $patient->idpatient = $_SESSION["patient_id"]; $patient->name = $_POST['name']; $patient->cpf = $_POST['cpf']; $patient->complement = $_POST['complement']; $patient->number = $_POST['number']; $patient->cep = $_POST['cep']; echo $patientDAO->alterPatient($patient);
$LastName = $_POST["lastname"]; $Address = $_POST["address"]; $PhoneNumber = $_POST["phone"]; $UserClass = "Patient"; //PatientDAO DB fields $Height = $_POST["height"]; $Weight = $_POST["weight"]; $DOB = $_POST["DOB"]; $Gender = $_POST["gender"]; $SSN = $_POST["SSN"]; $MedicalConditions = $_POST["MedicalConditions"]; $u = new UserDAO(); $u->Username = $_SESSION["username"]; $u->Find(); $ClinicianId = $u->idNumber; $p = new PatientDAO(); $p->Username = $Username; $p->Password = $Password; $p->FirstName = $FirstName; $p->MiddleName = $MiddleName; $p->LastName = $LastName; $p->Address = $Address; $p->PhoneNumber = $PhoneNumber; $p->UserClass = $UserClass; $p->Height = $Height; $p->Weight = $Weight; $p->DOB = $DOB; $p->Gender = $Gender; $p->SSN = $SSN; $p->MedicalConditions = $MedicalConditions; $p->ClinicianId = $ClinicianId;