Viewing file: FrmDentiscode.php (21.3 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user"))
{
$Username = $valid_user;
include("../../include/FunctionDB.php");
include("../../include/Function.php");
include("./header.php");
ConnectDB();
//$strSQL = "SELECT * FROM account Order by HN_code ";
$sql2 = "Select * From account Where Teacher_code='$Teacher_code' Order By Teach_id ASC ";
$result2 = mysql_query($sql2) or die(" Error").mysql_error();
$num = mysql_num_rows($result2);
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 25;
$result = mysql_query($strSQL);
$Page_start = ($Per_Page*$Page) - $Per_Page;
$Num_Rows = mysql_num_rows($result2);
if( $Num_Rows <= $Per_Page)
$Num_Pages = 1;
else if (($Num_Rows % $Per_Page) == 0)
$Num_Pages = ($Num_Rows / $Per_Page);
else
$Num_Pages = ($Num_Rows / $Per_Page) + 1;
$Num_Pages = (int)$Num_Pages;
if (( $Page > $Num_Pages) || ($Page < 0))
echo"Page $Page More than $Num_Pages";
$strSQL .=" LIMIT $Page_start,$Per_Page" ;
$result = mysql_query($strSQL);
$num = mysql_num_rows($result2);
?>
<html>
<head>
<title>Display Personal List</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="../../css/style1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style3 {color: #003333}
.style9 {color: #0000FF}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" style="border:1px solid #CCCCFF">
<form name="form1" method="get" action="./SearchDentiscode.php">
<tr>
<td height="24" bgcolor="#DFDFFF"><div align="center"><font size="2" face="Tahoma"> </font><font size="2" face="Tahoma"><strong>ชื่อที่ต้องการค้นหา</strong></font> <font size="2" face="Tahoma"> <img src="../../Image/b_select.png" width="16" height="16" align="absmiddle" border="0">
<input name="keyword" type="text" style="background-color:#F0FFD2;" value="<? echo"$keyword"; ?>" size="30" >
<strong>จาก</strong></font> <font size="2" face="Tahoma">
<select name="fields" style="background-color:#F0FFD2;" >
<option value="<? echo "$fields"; ?>">เลือกรายการ</option>
<option value="Dentis_code">รหัสทันตแพทย์</option>
<option value="Citizen_id">บัตรประชาชน</option>
<option value="No_code">เลขที่ใบเสร็จ</option>
<option value="Date">วันที่มาใช้บริการ</option>
</select>
<input type="submit" name="Submit" value="ค้นหา">
</font></div></td>
</tr>
</form>
</table> </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#EEEEEE" style="border:1px solid gray">
<tr bgcolor="#AFCFEF" >
<td colspan="10"><div align="left"><font color="#003366" size="4" face="Tahoma"><strong> </strong></font></div></td>
</tr>
<tr bgcolor="#EEEEEE">
<td width="33" align="center" style="border:1px solid gray"><font color="#003366" size="1" face="Tahoma"><strong> No.</strong></font></td>
<td width="55" align="center" style="border:1px solid gray"><font color="#000000" size="2" face="Tahoma"><strong>เลขที่</strong></font></td>
<td width="78" align="center" style="border:1px solid gray"><font color="#000000" size="2" face="Tahoma"><strong>วันที่</strong></font></td>
<td width="155" align="center" style="border:1px solid gray"><strong><font color="#000000" size="2" face="Tahoma">ชื่อคนไข้</font></strong></td>
<td width="77" align="center" style="border:1px solid gray"><font color="#003366" size="2" face="Tahoma">ซี่ฟัน</font></td>
<td align="center" style="border:1px solid gray"><font color="#000000" size="2" face="Tahoma"><b>รายการรักษา</b></font></td>
<td width="40" align="center" style="border:1px solid gray"><font color="#003366" size="2" face="Tahoma">จำนวน</font> </td>
<td width="79" align="center" style="border:1px solid gray"><font color="#003366" size="2" face="Tahoma">ค่ารักษา</font></td>
<td width="58" align="center" style="border:1px solid gray"><font color="#003366" size="2" face="Tahoma">ส่วนลด</font></td>
<td width="86" align="center" style="border:1px solid gray"><font color="#003366" size="2" face="Tahoma">จำนวนเงิน</font></td>
</tr>
<?
$i = 1;
while($row = mysql_fetch_array($result2))
{
if($count==0)
{
?>
<tr bordercolor="#EEEEEE" bgcolor="#FDFAEE" onMouseOver="this.style.backgroundColor='#D8F8FA'" onMouseOut="this.style.backgroundColor='#FDFAEE'" >
<td align="center" ><font color="#003366" size="2" face="Tahoma"> </font><font color="#000000" size="2" face="Tahoma">
<?
$no = ($Per_Page * ( $Page -1))+$i ;
echo $no;
?>
</font><font color="#003366" size="2" face="Tahoma"> </font></td>
<td align="center" ><div align="center"> <font color="#003333" size="2" face="Tahoma"></font><font color="#003366" size="2" face="Tahoma"><span class="style9"><font color="#003366" size="2" face="Tahoma"><font size="2" face="Tahoma"><a href="Planteachdetail.php?No_code=<?=$row["No_code"]?>"title="คลิกดูเพื่อพิมพ์ใบรายการค่าใช้จ่าย " class="d" ><? echo $row["No_code"]?></a></font></font><font size="2" face="Tahoma"></font></span></font><font color="#003333" size="2" face="Tahoma"> </font> </div></td>
<td align="center" ><div align="center"><font color="#003333" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"><span class="style9"><font color="#003366" size="2" face="Tahoma"><font size="2" face="Tahoma"><a href="Planteachdetail.php?No_code=<?=$row["No_code"]?>"title="คลิกดูเพื่อพิมพ์ใบรายการค่าใช้จ่าย " class="d" >
<?php
$sday = $row[Date];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>
<font color="#003333" size="2" face="Tahoma"> </font></a></font></font></span></font></div></td>
<td align="center" ><div align="left"><font size="2" face="Tahoma"><strong></strong></font></div>
<div align="left"><font color="#003333" size="2" face="Tahoma"> </font><font size="2" face="Tahoma"><strong><a href="AddTearch.php?Person_code=<? echo $row[Person_code]?>" class="c" > </a></strong></font><font size="2" face="Tahoma"><span class="d style3"><font size="2" face="Tahoma"> <font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><strong><strong><strong><strong><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font size="2" face="Tahoma"><font size="2" face="Tahoma">
<font size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><strong><strong><strong><strong><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font size="2" face="Tahoma"><font size="2" face="Tahoma">
<?php
$Person_code = $row["Person_code"];
$sql = "Select * From personal_den_tb Where Person_code='$Person_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "$rss[First_name] $rss[Name] $rss[Lastname]";
?>
</font></font></strong></font></strong></font></strong></font></strong></font></strong></strong></strong></strong></strong></font></font></font></font></font></font> </font></font></strong></font></strong></font></strong></font></strong></font></strong></strong></strong></strong></strong></font></font></font></font></font> </font></span></font><font color="#003333" size="2" face="Tahoma"> </font></div></td>
<td align="center" ><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma"> </font><font size="2" face="Tahoma"><font size="2" face="Tahoma">
<?php
$Tooth_code = $row["Tooth_code"];
$sql= "Select * From tooth_tb Where Tooth_code='$Tooth_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss= mysql_fetch_array($result1);
echo "$rss[Description_1] ";
?>
</font></font><font color="#003333" size="2" face="Tahoma"> </font></span></font></td>
<td width="299" align="center" bgcolor="#FDFAEE" ><div align="left"><font color="#990099" size="2" face="Tahoma"> <a href="Historydetail.php?Person_code=<?=$row["Person_code"]?>" title="Click to see Detail"> </a></font><font color="#990099" size="2" face="Tahoma"><a href="Historydetail.php?Person_code=<?=$row["Person_code"]?>" title="Click to see Detail" class="d"> </a></font><font size="2" face="Tahoma"><span class="d style3"><font size="2" face="Tahoma"> <font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"> <font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"> <font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma">
<?php
$Teach_code = $row["Teach_code"];
$sql = "Select * From treatment_tb Where Teach_code ='$Teach_code' ";
$result = mysql_query($sql) or die("Error".mysql_error());
$rss= mysql_fetch_array($result);
echo "$rss[Description_1] ";
?>
<font size="2" face="Tahoma"> </font> </font></font></font></font></font></font></font></font> </font></font></font></font> </font></font> </font> </font></span></font><font color="#003366" size="2" face="Tahoma"> </font></div></td>
<td align="center" bgcolor="#FDFAEE" ><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma">
<?=$row["Mount"]?>
</font></span></font></td>
<td align="center" bgcolor="#FDFAEE" ><div align="right"><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma">
<?=$row["Price"]?>
</font></span></font></div></td>
<td align="center" bgcolor="#FDFAEE" ><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma">
<?=$row["Percen"]?>
</font></span></font></td>
<td align="center" bgcolor="#FDFAEE" ><div align="right"><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma"> </font><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Cost_total'],2,'.',','); ?></font><font color="#003333" size="2" face="Tahoma"> </font><font size="2" face="Tahoma"> </font></span></font> </div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bordercolor="#EEEEEE" bgcolor="#FFFEF4" onMouseOver="this.style.backgroundColor='#D8F8FA'" onMouseOut="this.style.backgroundColor='#FFFEF4'">
<td align="center" bgcolor="#FDFAEE" ><font color="#003366" size="2" face="Tahoma"> </font><font color="#000000" size="2" face="Tahoma">
<?
$no = ($Per_Page * ( $Page -1))+$i ;
echo $no;
?>
</font><font color="#003366" size="2" face="Tahoma"> </font></td>
<td align="center" bgcolor="#FDFAEE" ><div align="center"><font color="#003333" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"><span class="style9"><font color="#003366" size="2" face="Tahoma"><font size="2" face="Tahoma"><a href="Planteachdetail.php?No_code=<?=$row["No_code"]?>"title="คลิกดูเพื่อพิมพ์ใบรายการค่าใช้จ่าย" class="d" ><? echo $row["No_code"]?></a></font></font><font size="2" face="Tahoma"></font></span></font><font color="#003333" size="2" face="Tahoma"> </font></div></td>
<td align="center" bgcolor="#FDFAEE" ><div align="center"><font color="#003333" size="2" face="Tahoma"></font><font color="#003366" size="2" face="Tahoma"><span class="style9"><font color="#003366" size="2" face="Tahoma"><font size="2" face="Tahoma"> <a href="Planteachdetail.php?No_code=<?=$row["No_code"]?>"title="คลิกดูเพื่อพิมพ์ใบรายการค่าใช้จ่าย " class="d" >
<?php
$sday = $row[Date];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>
<font color="#003333" size="2" face="Tahoma"> </font></a></font></font></span></font></div></td>
<td align="center" bgcolor="#FDFAEE" ><div align="left"><font size="2" face="Tahoma"><strong></strong></font></div>
<div align="left"><font size="2" face="Tahoma"><strong></strong></font><font color="#003333" size="2" face="Tahoma"><span class="style3"><font size="2" face="Tahoma"><font size="2" face="Tahoma"> <span class="d style3"><font size="2" face="Tahoma"> <font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma"><strong><strong><strong><strong><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font color="#000000" size="2" face="Tahoma"><strong><font size="2" face="Tahoma"><font size="2" face="Tahoma">
<?php
$Person_code = $row["Person_code"];
$sql = "Select * From personal_den_tb Where Person_code='$Person_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "$rss[First_name] $rss[Name] $rss[Lastname]";
?>
</font></font></strong></font></strong></font></strong></font></strong></font></strong></strong></strong></strong></strong></font></font></font></font></font> </font></span> </font></font></span> </font></div></td>
<td align="center" bgcolor="#FDFAEE" ><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma"> </font><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma">
<?php
$Tooth_code = $row["Tooth_code"];
$sql= "Select * From tooth_tb Where Tooth_code='$Tooth_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss= mysql_fetch_array($result1);
echo "$rss[Description_1] ";
?>
</font></font></font><font color="#003333" size="2" face="Tahoma"> </font></span></font></td>
<td align="center" bgcolor="#FDFAEE" ><div align="left"><font color="#990099" size="2" face="Tahoma"><a href="Historydetail.php?Person_code=<?=$row["Person_code"]?>" title="Click to see Detail" class="d"> </a></font><font size="2" face="Tahoma"><span class="d style3"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"> <font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><font size="2" face="Tahoma">
<?php
$Teach_code = $row["Teach_code"];
$sql = "Select * From treatment_tb Where Teach_code ='$Teach_code' ";
$result = mysql_query($sql) or die("Error".mysql_error());
$rss= mysql_fetch_array($result);
echo "$rss[Description_1] ";
?>
<font size="2" face="Tahoma"> </font> </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font> </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font> </font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font> </font></font></span></font></div></td>
<td align="center" bgcolor="#FDFAEE" ><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma">
<?=$row["Mount"]?>
</font></span></font></td>
<td align="center" bgcolor="#FDFAEE" ><div align="right"><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma">
<?=$row["Price"]?>
</font></span></font></div></td>
<td align="center" bgcolor="#FDFAEE" ><font size="2" face="Tahoma"><span class="d style3"><font color="#003333" size="2" face="Tahoma">
<?=$row["Percen"]?>
</font></span></font></td>
<td align="center" bgcolor="#FDFAEE" ><div align="left" class="style3">
<div align="right"><font size="2" face="Tahoma"><font size="2" face="Tahoma"><span class="d style3"><font color="#993333" size="2" face="Tahoma"><?echo number_format($row['Cost_total'],2,'.',','); ?></font></span> </font></font> </div>
</div></td>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#AFCFEF">
<td colspan="10" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="57%" bgcolor="#E8FAFD"><div align="right"><font color="#0033CC" size="2" face="Tahoma"><strong> <font color="#993333"> ราคารวมทั้งหมด</font></strong></font></div></td>
<td width="12%" bgcolor="#E8FAFD"><div align="center"><font color="#993333" size="2" face="Tahoma"> </font></div></td>
<td width="16%" bgcolor="#E8FAFD"><div align="center"><font color="#993333" size="2" face="Tahoma"> </font></div></td>
<td width="10%" bgcolor="#E8FAFD"><div align="right"><font color="#993333" size="2" face="Tahoma"><strong><font color="#993333" size="2" face="Tahoma">
<?php
$sql3 = "Select Sum(Cost_total) as Sum From account Where Teacher_code='$Teacher_code' ";
$result3 = mysql_query($sql3) or die("Error".mysql_error());
$rss3 = mysql_fetch_array($result3);
echo number_format($rss3['Sum'],2,'.',',');
CloseDB();
?>
</font></strong> </font></div></td>
</tr>
</table></td>
<tr bgcolor="#AFCFEF">
<td height="18" colspan="10" align="center"><div align="center"><font color="#003366" size="2" face="Tahoma">ทั้งหมด</font><font color="#FFFFFF" size="2" face="Tahoma"> <? echo $num ?> <font color="#003366">รายการ</font> </font> </div></td>
</table>
<table width="74%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#99CCFF">
<tr>
<td align="right" bordercolor="#CCCCCC" class="Tahoma11"><div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="3" face="MS Sans Serif"><strong> <font color="#000000" size="2" face="Tahoma"><?php echo $Num_Pages;?></font></strong></font><font color="#000000" size="2" face="Tahoma"><strong> </strong>หน้า</font> <font color="#000000" size="2" face="Tahoma"> <strong>
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b><< Previus</b> </font></a>";
for($i=1;$i<=$Num_Pages;$i++)
{
if($i != $Page)
echo" [<a href=\"$PHP_SELF?Page=$i\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b>$i</b></font></a>] ";
else
echo"<b>$i</b>";
}
if($Page != $Num_Pages)
echo"<a href=\"$PHP_SELF?Page=$Next_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</strong></font> </font> </div></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
</html>
<?php
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"3;URL=FrmLogin.php\">\n";
echo"Please Login ";
}
?>
|