<?
session_start();
$client_name=$_SESSION['client_name'];
if ($client_name !== 'admin')
{
include "client_header.php";
$client_id=$_SESSION['client_id'];
$first_name=$_SESSION['first_name'];
$last_name=$_SESSION['last_name'];
$remoteaddr=$_SESSION['remoteaddr'];
$date_in=$_SESSION['date_in'];
$time_in=$_SESSION['time_in'];
$cisloggedin=$_SESSION['cisloggedin'];
$url_access=$_SERVER['REQUEST_URI'] ;
$isql = "INSERT INTO patient (first_name,last_name, email, country , address , phone , gender , height , weight , bloodpressure , bloodtype)
VALUES ('$first_name','$last_name','$email','$country','$address','$phone','$gender','$height','$weight','$bloodpressure','$bloodtype')";
$result = mysql_query($isql);
?>
<h2><br>Welcome <b>
<?=$client_name?>
Here are your bills:
</b></h2>
<?
$result = mysql_query("SELECT * FROM invoices WHERE clientid = '$client_id' ORDER BY id",$db);
echo "<p><table border=1 cellspacing=0 cellpadding=2 bordercolor=#000000 width=90%>";
echo "<tr align=top>
<td class=topHeadrow5><b>Inv. #</b></td>
<td class=topHeadrow5><b>Receipt Date</b></td>
<td class=topHeadrow5><b>Due Date</b></td>
<td class=topHeadrow5><b>Total</b></td>
<td class=topHeadrow5><b>Status</b></td>
<td class=topHeadrow5> </td></tr>";
while ($row = mysql_fetch_array($result))
{
$id = $row["id"];
$date = $row["date"];
$bill_date = $row["bill_date"];
$due_date = $row["due_date"];
$paid_date = $row["paid_date"];
$dateshow = fixDate($date);
$dateshow1 = fixDate($bill_date);
$dateshow2 = fixDate($due_date);
$dateshow3 = fixDate($paid_date);
$total = $row["total"];
$status = $row["status"];
if ($alternate == "1") {
$color = "#ffffff";
$alternate = "2";
}
else {
$color = "#c0c0c0";
$alternate = "1";
}
echo "<tr valign=top bgcolor=$color><td>$id</td><td>$dateshow</td><td>$dateshow2</td><td align=right>$currency$total</td>";
if($status == "paid"){
echo "<td bgcolor=#33cc33>$status</td>";
}else{
echo "<td>$status</td>";
}
echo "<td>[ <a href='invoice.php?id=$id'>view</a> ] [ <a target=_blank href='invoice_print.php?id=$id'>Print</a> ]</td></tr>";
}
echo "</table>";
//-------------------------------------------------Begin Admin-------------------------------------------------
}
elseif ($client_name == 'admin')
{
include "header.php";
$url_access=$_SERVER['REQUEST_URI'] ;
?>
<h2><br>Hello <b>
<?=$client_name?>
Patients List:
</b></h2>
<?
if ($menusort1 = $menusort1) {
$result = mysql_query("SELECT invoices.*, clients.*
FROM invoices,clients
WHERE invoices.clientid = clients.clientid && invoices.date >'$ytd'
ORDER BY $menusort1 ASC",$db);
}
if ($menusort = $menusort) {
$result = mysql_query("SELECT invoices.*, clients.*
FROM invoices,clients
WHERE invoices.clientid = clients.clientid && invoices.date >'$ytd'
ORDER BY $menusort DESC",$db);
}
if (!$menusort and !$menusort1) {
$result = mysql_query("SELECT invoices.*, patient.*
FROM invoices,patient
WHERE invoices.clientid = clients.clientid && invoices.date >'$ytd'
ORDER BY id",$db);
}
echo "<p><table border=1 cellspacing=0 cellpadding=2 bordercolor=#000000 width=95%>";
echo "<tr align=top>
<td class=topHeadrow5><b>ID number: <a href='menu.php?menusort=id'><img class=arrows src=images/dn_arrow.gif></a><a href='menu.php?menusort1=id'><img class=arrows src=images/up_arrow.gif></a></b></td>
<td class=topHeadrow5><b>Name <a href='menu.php?menusort=name'><img class=arrows src=images/dn_arrow.gif></a><a href='menu.php?menusort1=name'><img class=arrows src=images/up_arrow.gif></a></b></td>
<td class=topHeadrow5><b>Out Patient<a href='menu.php?menusort=date'><img class=arrows src=images/dn_arrow.gif></a><a href='menu.php?menusort1=date'><img class=arrows src=images/up_arrow.gif></a></b></td>
<td class=topHeadrow5><b>Due Date <a href='menu.php?menusort=due_date'><img class=arrows src=images/dn_arrow.gif></a><a href='menu.php?menusort1=due_date'><img class=arrows src=images/up_arrow.gif></a></b></td>
<td class=topHeadrow5> </td>
<td class=topHeadrow5> </td>
<td class=topHeadrow5> </td>
<td class=topHeadrow5> </td></tr>";
while ($row = mysql_fetch_array($result))
{
$id = $row["id"];
$clientid = $row["clientid"];
$name = $row["first_name"];
$date = $row["date"];
$bill_date = $row["bill_date"];
$due_date = $row["due_date"];
$paid_date = $row["paid_date"];
$dateshow = fixDate($date);
$dateshow1 = fixDate($bill_date);
$dateshow2 = fixDate($due_date);
$dateshow3 = fixDate($paid_date);
if ($alternate == "1") {
$color = "#ffffff";
$alternate = "2";
}
else {
$color = "#e5e5e5";
$alternate = "1";
}
echo "<tr valign=top bgcolor=$color>
<td width=10>$id</td><td>$name</td>
<td>$dateshow</td><td>$dateshow2</td>
<td align=right>$currency$total</td>";
if ($status == 'pending') {
echo "<td bgcolor=$color>$status</td>";
} else {
echo "<td class=rowviewinv >$status</td>";
}
if ($status == 'pending') {
echo "<td>[ <a href='admin_invoice.php?id=$id'>view / change status</a> ]</td>";
}
else {
echo "<td class=rowviewinv>[ <a class=inv_links href='admin_invoice.php?id=$id'>view</a> ]</td>";
}
if ($status == 'pending') {
echo "<td>[ <a href='notifyclient.php?id=$id&clientid=$clientid'>notify client</a> ]</td>";
} else {
echo "<td class=rowviewinv>[ Paid $dateshow3 ]</td>";
}
echo "<td>[ <a href='edit_invoice.php?id=$id'>edit</a> ]</td><td>[ <a href='delete_invoice.php?id=$id' onClick=\"return confirm('Are you sure?')\">delete</a> ]</td></tr>";
}
$result = mysql_query("SELECT sum(total) AS sum FROM invoices WHERE date >'.$ytd.'");
$sum = mysql_result($result,0,"sum");
if ($sum == 1){
echo "";
}else{
echo "";
}
echo "</table>";
?>
<p align="center"><font class="medBold">You can review previous dates by selecting from the calendar icons.
</font></p>
<form method="post" name=form1 action="invoice_history.php">
<input type="text" name="invdate" id="invdate">
<img src="img.gif" id="f_trigger_c"
style="cursor: pointer; border: 1px solid red;"
title="Date selector"
onmouseover="this.style.background='red';"
onmouseout="this.style.background=''" />
<script type="text/javascript">
Calendar.setup({
inputField : "invdate",
ifFormat : "%Y-%m-%d",
button : "f_trigger_c",
align : "Tl",
singleClick : true
});
</script>
<input type="Submit" name="submit" value="Submit Invoice Date"></form>
<?
}
?>
它以前工作得很好。我没有做任何事情,因为我不是编写代码的人。我所做的只是将文件复制到一个新文件夹,但两个文件都不起作用。在数据库中,我确实修改了一些,但不是在该程序正在使用的数据库中。