@ 2013-11-23T09:56:00Z <?php
require_once('config.php');
/*
id fullname user_name dp gender dob mood history past_history treatments address fu_plans
*/
$active='profile';
// page title
$pagetitle="View Patient - ".$sitename;
$styles.='
.leftcl {
padding-right:10px;
float: left;
width: 200px;
border-right: 1px solid #ccc;
margin-bottom:10px;
}
.leftcl a {
padding-bottom:5px;
padding-top:5px;
border-bottom:1px solid #ccc;
display:block;
}
.leftcl a:hover {
color:rgb(226,4,4);
background:#eee;
}
.dp {
width: 200px;
height: 200px;
border:1px solid #ccc;
}
.ptheader {
width:509px;
padding-left:10px;
float:left;
margin-bottom:10px;
}
.h_line {
border-bottom:1px solid #ddd;display:block;margin-bottom:10px;overflow:hidden;
}
.cltitle {
//color: rgb(153, 153, 153);
color:#666;font-weight: bold;line-height: 15px;text-align: left;word-wrap: break-word;float:left;
}
.clarea {
float:right;
display:block;
font-family: Verdana, sans-serif;
}
#posts_container, #photos, #pt_wrapper {
clear:both;
border-bottom:1px solid #ccc;
min-height:300px;
margin-top:50px;
border-top:1px dashed #ccc;
display:block;
padding-bottom:20px;
}
.post {
padding-top:20px;
padding-bottom:20px;
border-bottom:dashed 1px #dedede;
overflow:auto;
}
.post:hover {
background:#eee;
}
.status {
word-wrap:break-word;
padding:5px;
border-bottom:1px solid #ccc;
}
.status b {
color:#006699;
}
.st_time {
font-size:11px;
color:#999;
font-family:Arial, Helvetica, sans-serif;
margin-top:3px;
text-align:right;
}
';
require_once('header.php');
function age($dob) {
list($d,$m,$y) = explode('-', $dob);
if (($m = (date('m') - $m)) < 0) {
$y++;
} elseif ($m == 0 && date('d') - $d < 0) {
$y++;
}
return date('Y') - $y;
}
function time_stamp($session_time)
{
$time_difference = time() - $session_time ;
$seconds = $time_difference ;
$minutes = round($time_difference / 60 );
$hours = round($time_difference / 3600 );
$days = round($time_difference / 86400 );
$weeks = round($time_difference / 604800 );
$months = round($time_difference / 2419200 );
$years = round($time_difference / 29030400 );
if($seconds <= 60)
{
return "$seconds seconds ago";
}
else if($minutes <=60)
{
if($minutes==1)
{
return "one minute ago";
}
else
{
return "$minutes minutes ago";
}
}
else if($hours <=24)
{
if($hours==1)
{
return "one hour ago";
}
else
{
return "$hours hours ago";
}
}
else if($days <=7)
{
if($days==1)
{
return "one day ago";
}
else
{
return "$days days ago";
}
}
else if($weeks <=4)
{
if($weeks==1)
{
return "one week ago";
}
else
{
return "$weeks weeks ago";
}
}
else if($months <=12)
{
if($months==1)
{
return "one month ago";
}
else
{
return "$months months ago";
}
}
else
{
if($years==1)
{
return "one year ago";
}
else
{
return "$years years ago";
}
}
}
if($_GET['id']){
$id=mysql_real_escape_string($_GET['id']);
$uq=mysql_query("SELECT * FROM $tbl2 WHERE id='$id'") or print_r("ERROR");
$u=mysql_fetch_array($uq);
if(mysql_num_rows($uq)=='0'){
echo '<h1>Not found</h1>';
echo '<p style="margin-left:20px;">Sorry, you entered an invalid input. <a href="/patients">Click here</a> to go back.</p>';
} else {
$age=$u['dob'];
$age=age($age);
$name=$u['fullname'];
$mood=$u['mood'];
$user=$u['user_name'];
$gender=$u['gender'];
$addr=$u['address'];
$past_history=$u['past_history'];
$history=$u['history'];
$treatments=$u['treatments'];
$fu_plans=$u['fu_plans'];
$dp=$u['dp'];
?>
<h1>Profile of <?=$name?></h1>
<div class="leftcl">
<img src="<?=$dp?>" class="dp" />
<div style="padding-bottom:30px;margin-top:20px;">
<a href="/patients/<?=$id?>">Profile</a>
<a href="/patients/<?=$id?>/photos">View Photos</a>
<a href="/patients/<?=$id?>/photos">Guestbook (Comments)</a>
</div>
</div>
<div class="ptheader">
<div class="h_line">
<span class="cltitle">Name: </span> <span class="clarea"><?=$name?></span></div>
<div class="h_line">
<span class="cltitle">Age: </span> <span class="clarea"> <?=$age?></span></div>
<div class="h_line">
<span class="cltitle">Gender: </span> <span class="clarea"> <?=$gender?></span></div>
<div class="h_line">
<span class="cltitle">Mood: </span> <span class="clarea"> <?=$mood?></span></div>
<div class="h_line">
<span class="cltitle">Address: </span> <span class="clarea"><?=$addr?></span></div>
<div class="h_line">
<span class="cltitle">History: </span> <span class="clarea"><?=$history?></span></div>
<div class="h_line">
<span class="cltitle">Past History: </span> <span class="clarea"><?=$past_history?></span></div>
<div class="h_line">
<span class="cltitle">Future Plans: </span> <span class="clarea"><?=$fu_plans?></span></div>
<div class="h_line">
<span class="cltitle">Treatments: </span> <span class="clarea"><?=$treatments?></span></div>
</div>
<?php if($_GET['view']=='photos'){ ?>
<div id="photos">
<h2 class="h2">Photos</h2>
<div class="gallery">
<?php
foreach(glob("uploads/folks/images/$user*.*") as $filename){
$filename=' <a class="image-link" href="/thumber.php?img='.$filename.'&h=800" data-lightbox="example-set" title="Image of '.$name.'"><img class="image" src="/thumber.php?img='.$filename.'&h=200" alt="'.$name.'\'s image" width="150" height="150"/></a>';
echo $filename;
}
?>
</div>
</div>
<?php } elseif($_GET['view']=='guestbook') { ?>
<h2 class="h2">Guestbook</h2>
<div id="pt_wrapper">
<?php if($_GET['action']=='add'){ ?>
<?php if($_POST['email'] && $_POST['name'] $$ $_POST['comment']){
$time=time();
$sql=mysql_query("INSERT INTO $tbl_name(user, name, email, comment, datetime)VALUES('$user', '$name', '$email', '$comment', '$time')") or die(mysql_error());
echo 'Your comment has been posted! <br/>Click <a href="/patients/'.$id.'/guestbook">here</a> to view the Guestbook.';
} else {
?>
<b>Post Your Comment</b>
<form id="form1" name="form1" method="post" action="">
Name:<br/>
<input name="name" type="text" id="name" size="40" /><br/><br/>
Email:<br/>
<input name="email" type="text" id="email" size="40" /><br/><br/>
Comment:<br/>
<textarea name="comment" cols="40" rows="3" id="comment"></textarea><br/><br/>
<input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" />
<?php
}
} else { ?>
<div style="float:right;"><a href="/patients/<?=$user?>/guestbook/add">Add a Comment</a></div>
<?php
$qcomments=mysql_query("SELECT * FROM guestbook WHERE user='$user' ORDER BY id DESC") or print_r("error fetching comments");
while($post=mysql_fetch_array($qposts)){
echo "<div class=\"post\">";
echo "<div class=\"status\">".$post['comment']."</div>";
echo "<div class=\"st_time\">By ".$post['name']." about ".time_stamp($post['time'])."</div>";
echo "</div>";
}
?>
<div align="center"><a href="/patients/<?=$user?>/guestbook/add">Add a Comment</a></div>
<?php } ?>
</div>
<?php } else { ?>
<div id="posts_container">
<h2 class="h2">Status Updates</h2>
<?php
$qposts=mysql_query("SELECT * FROM pt_updates WHERE user='$user' ORDER BY id DESC") or print_r("error fetching status updates");
while($post=mysql_fetch_array($qposts)){
echo "<div class=\"post\">";
echo "<div class=\"status\">".$post['status']."</div>";
echo "<div class=\"st_time\">".time_stamp($post['time'])."</div>";
echo "</div>";
}
?>
</div>
<?php } ?>
<?php
}
} else {
?>
<h1>Patient Profile</h1>
<form style="margin-left:20px;" method="GET" action="" >
Please enter the id of the person to view his/her profile!<br/>
<input class="input" style="margin:20px;" size="50" type="text" name="id" id="id" placeholder="E.g 4535..." />
<input class="btn-submit" type="submit" name="submit" value="Get Profile" />
</form>
<?php
}
require_once('sidebar.php');
require_once('footer.php');
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.22 0.019 0.042 12.47 5.4.21 0.015 0.043 12.46 5.4.20 0.012 0.045 12.46 5.4.19 0.012 0.045 12.46 5.4.18 0.014 0.045 12.46 5.4.17 0.019 0.036 12.47 5.4.16 0.009 0.046 12.47 5.4.15 0.011 0.043 12.46 5.4.14 0.013 0.040 12.15 5.4.13 0.012 0.042 12.13 5.4.12 0.014 0.042 12.10 5.4.11 0.012 0.041 12.10 5.4.10 0.013 0.043 12.10 5.4.9 0.015 0.045 12.10 5.4.8 0.012 0.040 12.10 5.4.7 0.013 0.044 12.09 5.4.6 0.012 0.042 12.09 5.4.5 0.013 0.047 12.09 5.4.4 0.014 0.050 12.08 5.4.3 0.010 0.045 12.07 5.4.2 0.013 0.046 12.07 5.4.1 0.011 0.048 12.08 5.4.0 0.011 0.046 11.56 5.3.27 0.011 0.051 12.73 5.3.26 0.013 0.049 12.72 5.3.25 0.011 0.051 12.72 5.3.24 0.011 0.054 12.72 5.3.23 0.015 0.061 12.71 5.3.22 0.015 0.045 12.68 5.3.21 0.015 0.044 12.69 5.3.20 0.015 0.050 12.69 5.3.19 0.020 0.041 12.68 5.3.18 0.015 0.052 12.68 5.3.17 0.016 0.049 12.68 5.3.16 0.020 0.059 12.68 5.3.15 0.011 0.046 12.68 5.3.14 0.013 0.046 12.67 5.3.13 0.014 0.047 12.66 5.3.12 0.015 0.050 12.66 5.3.11 0.013 0.049 12.67 5.3.10 0.019 0.065 12.15 5.3.9 0.011 0.045 12.13 5.3.8 0.013 0.043 12.12 5.3.7 0.015 0.045 12.12 5.3.6 0.014 0.042 12.10 5.3.5 0.013 0.045 12.05 5.3.4 0.014 0.043 12.05 5.3.3 0.013 0.051 12.02 5.3.2 0.014 0.051 11.79 5.3.1 0.015 0.044 11.76 5.3.0 0.015 0.043 11.74
preferences:dark mode live preview
141.59 ms | 1394 KiB | 7 Q