Fatal error: Call to undefined function set_my() in C:\AppServ\www\t\Report.php on line 51
Code
<?
session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
exit();
}
if($_SESSION['Status'] != "USER")
{
echo "This page for User only!";
exit();
}
include ("connect.php");
$strSQL = "SELECT * FROM member WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<style type="text/css">
<!--
body {
background-image: url();
background-color: #E2DEDD;
}
.style7 {
font-size: 24px;
color: #00CCFF;
}
.style8 {
color: #FFFFFF;
font-size: 24px;
}
.style17 {color: #333333; font-weight: bold; font-size: 18px; }
-->
</style></head>
<body>
<?php
if ($year !=0 && $month!=0){
$sql_my = set_my($year,$month);
}else{
$year = date('Y');
$month = date('m');
$sql_my = set_my($year,$month); <------------------------------ตรงนี้คับ
}
?>
<table width="1020" height="39" align="center" cellspacing="0">
<tr>
<td background="Images/BG/expenses2_01.jpg" align="center"><span class="style8">| <a href="home.php" style="color: #FFFFFF">Add Expenses</a> | <a href="Report.php" style="color: #FFFFFF">Reports</a> |<a href="form.php" style="color: #FFFFFF">Dowload Forms</a> | <a href="upload.php" style="color: #FFFFFF">Upload Document ||<a href="logout.php" style="color: #FFFFFF">Log out</a> |</span></td>
</tr>
<tr>
<td background="Images/BG/expenses2_02.jpg" height="96"> </td>
</tr>
<tr>
<td background="Images/BG/expenses2_03.jpg" height="230"> </td>
</tr>
<tr>
<td background="Images/BG/expenses2_04.jpg" height="249" align="center"><table width="918" align="center">
<tr>
<td width="495" align="left">
<?php $prevmy = set_prevmy($year,$month);?>
<a href="Report.php?<?=$prevmy;?>"><img src="Images/back.jpg" width="102" height="102" border="0" /></a></td>
<td width="407" align="right">
<?php $nextmy = set_nextmy($year,$month);?>
<a href="Report.php?<?=$nextmy;?>"><img src="Images/goF.jpg" width="102" height="102" border="0" /></a></td>
</tr>
</table>
<p> </p>
<form id="Rp" name="Rp" method="post" action="Print_Report.php">
<table width="665" >
<tr>
<td colspan="4" align="center" valign="top"><span class="style7">Expenses Report </span></td>
</tr>
<tr>
<td align="right" valign="top">User Name : </td>
<td height="0" colspan="3" align="left" valign="top"> <? echo "$user2" ?></td>
</tr>
<tr>
<td align="right">Date : </td>
<td colspan="3" align="left" valign="top">
<?php
//------------------>Print date time<------------------------//
$timezone = "Asia/Bangkok";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
echo date('l jS \of F Y h:i:s A');
?></td>
</tr>
<tr>
<td align="right">Report Of :</td>
<td colspan="3" align="left" valign="top"> <?php print_my($year,$month); ?></td>
</tr>
<input type="hidden" name="year" id="year" value="<? echo $year;?>"/>
<input type="hidden" name="month" id="month" value="<? echo $month;?>"/>
<tr>
<td align="right"> </td>
<td width="306" align="left" valign="top"><? echo ("my_set") ;?></td>
<td colspan="2"> </td>
</tr>
<tr>
<td width="112" align="center" bgcolor="#D4D0C8"><span class="style17">Date</span></td>
<td align="center" bgcolor="#D4D0C8"><span class="style17">Lists</span></td>
<td width="158" align="center" bgcolor="#D4D0C8"><span class="style17">Price</span></td>
<td width="69" align="center" bgcolor="#D4D0C8"><span class="style17">Manage</span></td>
</tr>
<tr>
<?
$total =0;
$sql = "SELECT `ex`.`Ex_ID`, `ex`.`Ex_Date`, `ex`.`Ex_List`, `ex`.`Ex_List2`, `ex`.`Ex_Price`
FROM ex
WHERE `ex`.`UserID` ='$UserID' AND ex.Ex_Date LIKE '$sql_my%'
ORDER BY `ex`.`Ex_ID` ASC";
$qr = mysql_query($sql);
while($rs = mysql_fetch_array($qr))
{
$Ex_ID = $rs["`ex`.`Ex_ID`"];
$Date = $rs['Ex_Date'];
$list= $rs['Ex_List'];
$list2= $rs['Ex_List2'];
$price= $rs['Ex_Price'];
$total += $price;
?>
<td align="center" bgcolor="#33FFFF"><? echo $Date; ?></td>
<td align="left" bgcolor="#33FFFF"><? echo $list; ?> <? echo $list2; ?></td>
<td align="right" bgcolor="#33FFFF"><? echo $price; ?> Baht</td>
<td align="center" bgcolor="#33FFFF"><?
echo "<a href=delete.php?Ex_ID=$rs[Ex_ID]>Delete</a>";?></td>
</tr>
<?
}
?>
<tr>
<td colspan="2"> </td>
<td align="right"><? echo $total; ?> Baht</td>
<td> </td>
</tr>
</table>
<p>
<input type="submit" name="button" id="button" value="Print" />
</p>
</form>
<p>
</p></td>
</tr>
<tr>
<td background="Images/BG/expenses2_06.jpg" height="125"> </td>
</tr>
</table>
</body>
</html>
ช้วยดูให้หน่อยคับTag : PHP, MySQL, Ms SQL Server 2005, Ms SQL Server 2008, Ms SQL Server 2012, HTML/CSS
Date :
2012-07-08 20:18:23
By :
NatE
View :
995
Reply :
4
ไม่มีฟังก์ชั่น set_my ครับ
Date :
2012-07-09 00:51:46
By :
กะล่อน
น่าจะลืม include ไฟล์เข้ามาบางตัวครับ
Date :
2012-07-09 06:08:55
By :
mr.win
ขอบคุณคับ ด้ายแล้วคับ ลืม include function ขอบคุณมากคับ
Date :
2012-07-09 12:35:46
By :
NatE
เวอร์ชั่นไรคับ
Date :
2012-07-12 08:01:40
By :
Bo
Load balance : Server 02