Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > การค้นหารายรับปีแบบใช้ list menu เมื่อค้นหาแล้วมันไม่โชว์ตามที่ค้นหา



 

การค้นหารายรับปีแบบใช้ list menu เมื่อค้นหาแล้วมันไม่โชว์ตามที่ค้นหา

 



Topic : 079004

Guest




ดูโค๊ดให้หน่อยนะคะ


Code (PHP)
<? 
session_start();
if($_SESSION['LOGIN_NAME']==""){ echo "<meta http-equiv=\"refresh\" content=\"0;URL=../login.php\" />"; }

include "../include/connect.php"; 
?>

<!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=utf-8" />
<title>Untitled Document</title>
<link href="../design1.css" rel="stylesheet" type="text/css" />
<link  href="../timepicker/css/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" />
	
		<script type="text/javascript" src="../timepicker/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="../timepicker/js/jquery-ui-1.8.19.custom.min.js"></script>
		
		<script type="text/javascript" >
        <!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
		  $(function () {
		    var d = new Date();
		    var toDay = d.getDate() + '/' + (d.getMonth() + 1) + '/' + (d.getFullYear() + 543);


		    // กรณีต้องการใส่ปฏิทินลงไปมากกว่า 1 อันต่อหน้า ก็ให้มาเพิ่ม Code ที่บรรทัดด้านล่างด้วยครับ (1 ชุด = 1 ปฏิทิน)

		    $("#datepicker-th").datepicker({ dateFormat: 'dd/mm/yy', isBuddhist: true, defaultDate: toDay, dayNames: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'],
              dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
              monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
              monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.','ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.']});

		    $("#datepicker-th2").datepicker({ dateFormat: 'dd/mm/yy', isBuddhist: true, defaultDate: toDay, dayNames: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'],
              dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
              monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
              monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.','ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.']});
     		    $("#datepicker-en").datepicker({ dateFormat: 'dd/mm/yy'});

		    $("#inline").datepicker({ dateFormat: 'dd/mm/yy', inline: true });


			});
		</script>
        <script language="javascript">
 function PrintWindow() {
          var address
          address = "../report/report_InY.php?year=<? echo $year;?>"
                 window.open(address,"","HEIGHT=600, WIDTH=800, toolbar=0,  location=0,  status=0,  menubar=0,  scrollbars=1,  resizeable=0,  left=0,  top=380 ");

     }	
</script>
<style type="text/css">
			/*demo page css*/
			body{ font: 75% "Trebuchet MS", sans-serif; }
			.demoHeaders { margin-top: 2em; }
			#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
			#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
			ul#icons {margin: 0; padding: 0;}
			ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
			ul#icons span.ui-icon {float: left; margin: 0 4px;}
		</style>

<style type="text/css">
<!--
#header {
	margin: auto;
	height: 130px;
	width: auto;
}
#MainMenu {
	background-image: url(image/test_04.jpg);
	background-repeat: repeat-x;
	margin: auto;
	height: 25px;
	width: auto;
	padding-top: 10px;
	padding-left: 50px;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
	font-size: 14px;
}
.style4 {font-family: CordiaUPC; font-size: 24px; font-weight: bold; }
body {
	background-image: url(image/test_05.jpg);
	background-repeat: repeat;
}
.b {
	color: #00F;
}
#AllContents #LeftContent #form1 table tr td table tr td p .b em {
	font-size: 16px;
}
.x {
	font-size: 14px;
}
.b1 {color: #F00;
}
#AllContents #LeftContent #form1 .table2 table tbody tr th p {
	font-size: 18px;
	color: #00F;
}
.x1 {	color: #F00;
}
.x1 {	color: #F00;
}
-->
</style>
<?
/*-------ฟังก์ชัน วัน/เดือน/ปี่(eng)---------*/
function date_eng_convert_show_thai($b_time)
{
$yyyy = substr($b_time,0,4);
$mm = substr($b_time,5,2);
$dd = substr($b_time,8,2);

$d = substr($dd,0,1);

if ($d == "0") {
$dd = substr($dd,1,1);
} else {
$dd = $dd;
}
$hh = substr($b_time,11,2);
$ii = substr($b_time,14,2);
$ss = substr($b_time,17,2);
$th_month = array(
"01" => "มกราคม",
"02" => "กุมภาพันธ์",
"03" => "มีนาคม",
"04" => "เมษายน",
"05" => "พฤษภาคม",
"06" => "มิถุนายน",
"07" => "กรกฎาคม",
"08" => "สิงหาคม",
"09" => "กันยายน",
"10" => "ตุลาคม",
"11" => "พฤศจิกายน",
"12" => "ธันวาคม"

);
$th_year = array(
"01" => "2551",
"02" => "2552",
"03" => "2553",
"04" => "2554",
"05" => "2554",
"06" => "2555",
"07" => "2556",
"08" => "2557",
"09" => "2558",
"10" => "2559",
"11" => "2560",
"12" => "2561"

);
return  $yyyy + 543;
}
?>
</head>

<body>
<div id="header"><img src="../image/bn.jpg" width="100%" height="130" alt="MyWallet" /></div>
<div id="MainMenu">
  <ul>
    <li><a href="index.php">รายรับรายจ่าย</a></li>
| <a href="Account.php">บัญชี </a>| <a href="Report_In_Ex.php">รายงาน</a> |<a href="../logout.php">ออกจากระบบ</a>
<li></li></ul>
</div>
<div id="AllContents">
  <div id="LeftContent">
    <p align="left"><strong>ยินดีต้อนรับคุณ</strong> : <? echo $_SESSION['LOGIN_NAME']; ?>
      
    </p>
     <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1" onSubmit=" return chkData(this);">
       <table width="254" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td width="124" height="42"><a href="Income_Add.php"><img src="../image/th_gem_bussum_button_hover1.jpg" width="106" height="31" border="0" /></a></td>
            <td width="114"><a href="Expense_Add.php"><img src="../image/th_templatemo_button_hover1.jpg" width="106" height="30" border="0" /></a></td>
         </tr>
       </table>
       <table width="144" height="45" border="0" align="right" cellpadding="0" cellspacing="0">
         <tr>
           <td width="316" valign="top">คงเหลือ <?php 
	$total_in=0;
	$sql="select * from income where user_id  = '$_SESSION[LOGIN_ID]'";
	$data=mysql_query($sql); //สั่ง Run SQL
	  //ดึงข้อมูล
	while($rowdata=mysql_fetch_array($data)){
		$in=$rowdata["price"];
		$total_in=$total_in+$in;
	}
	  $total_ex=0;
$sql="select * from expense where user_id  = '$_SESSION[LOGIN_ID]' ";
$data=mysql_query($sql); //สั่ง Run SQL
	  //ดึงข้อมูล
while($rowdata=mysql_fetch_array($data)){
$ex=$rowdata["price"];
$total_ex=$total_ex-$ex;
}

	
?>
             <?=number_format($total_in+$total_ex);?>  </td>
         </tr>
       </table>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
       <div class="table2">
         <table width="69%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border:ridge; font-size: 14px; color: #000;">
           <!--DWLayoutTable-->
           <tr>
             <td width="678" height="34" align="right"><span class="style151"><a href="In_Mon.php"><img src="../image/a5.gif" alt="" width="150" height="30" border="0" /></a><a href="In_Y.php"><img src="../image/a6.gif" alt="" width="150" height="30" border="0" /></a></span></td>
           </tr>
           <tr>
             <td height="101" align="center" valign="top"><p>&nbsp;</p>
               <p><span class="style3">ข้อมูลรายรับ(ประจำปี)</span></p>
               <p>&nbsp;</p>
               <p><span class="style156"><span class="style152">เลือกปี::</span></span>
                 <label for="select6"></label>
                 <select name="year">
                   <option value="01" selected="selected"<? if ($year=="01"){echo "selected";}?>>2551</option>
                   <option value="02"<? if ($year=="02"){echo "selected";}?>>2552</option>
                   <option value="03"<? if ($year=="03"){echo "selected";}?>>2553</option>
                   <option value="04"<? if ($year=="04"){echo "selected";}?>>2554</option>
                   <option value="05"<? if ($year=="05"){echo "selected";}?>>2555</option>
                   <option value="06"<? if ($year=="06"){echo "selected";}?>>2556</option>
                   <option value="07"<? if ($year=="07"){echo "selected";}?>>2557</option>
                   <option value="08"<? if ($year=="08"){echo "selected";}?>>2558</option>
                   <option value="09"<? if ($year=="09"){echo "selected";}?>>2559</option>
                   <option value="10"<? if ($year=="10"){echo "selected";}?>>2560</option>
                   <option value="11"<? if ($year=="11"){echo "selected";}?>>2561</option>
                   <option value="12"<? if ($year=="12"){echo "selected";}?>>2562</option>
                 </select>
                 <label>
                   <input name="submit" type="hidden" id="submit" value="1" />
                 </label>
                 <label for="Submit"></label>
                 <input type="submit" name="Submit" id="Submit" value=" ตกลง " />
             </p></td>
           </tr>
           <tr>
             <td height="131" valign="top"><? if($Submit){?>
               <table width="100%" border="0" cellpadding="0" cellspacing="0">
                 <!--DWLayoutTable-->
                 <tr>
                   <td width="800" height="131"><table width="86%" height="140" border="0" align="center">
                     <!--DWLayoutTable-->
                     <tr>
                       <td width="237" height="34" bgcolor="#A4CDFF"><div align="center" class="style159">วันที่่</div></td>
                       <td width="266" bgcolor="#A4CDFF"><div align="center" class="style159">รายรับ/บาท</div></td>
                     </tr>
                     <? 

if($Submit){
	$check_y=date("Y");
	$check_m=$mount;//เดือน
	$day="$check_y-$check_m-%";//ปี-เดือน-วันอะไรก็ได้
	$sql="SELECT * FROM income WHERE user_id = '$_SESSION[LOGIN_ID]' AND date LIKE '%$_POST[year]%' ORDER BY date ASC  ";
	$data=mysql_query($sql);//สั่ง Run SQL 
	}
	  //ดึงข้อมูล
	 
	while($rowdata=mysql_fetch_array($data)){
		
	if($bg == "CCE3FF"){
						         $bg="ECF4FF";
							}else{
									$bg="CCE3FF";
							}
	
?>
                     <? echo  "<tr bgcolor=\"$bg\" align='center'> "?>
                     <tr>
                       <td bgcolor="<? echo $bg;?>"><div align="center"><span class="style155"><? echo date_eng_convert_show_thai($rowdata['date']);?></span></div></td>
                       <td bgcolor="<? echo $bg;?>"><div align="center"><span class="style156"> </span><span class="style155">
                         <?=number_format( $rowdata['price']);?>
                       </span></div></td>
                     </tr>
                     <? $sum=$sum+$rowdata['price'];?>
                     <? }?>
                     <tr>
                       <td height="44" colspan="2"><div align="right" class="style161">
                         <div align="right"><span class="x1"></span>รวมรายรับประจำเดือนทั้งหมด  : <strong><font color="#FF6600">
                           <?=number_format($sum);?>
                         </font></strong><font color="#FF6600"> บาท</font></div></td>
                     </tr>
                     <tr></tr>
                     <tr>
                       <td height="32" colspan="2"><div align="right"><span class="style12 style42">
                         <input name="print3" type="image" class="style29" onclick="PrintWindow();" src="../image/fileprint.png" alt="พิมพ์ใบยืนยัน" align="middle" width="35" height="30" />
                       </span></div></td>
                     </tr>
                   </table></td>
                 </tr>
               </table>
               <? }?></td>
           </tr>
           <tr>
             <td height="220">&nbsp;</td>
           </tr>
           <tr>
             <td height="33" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
               <!--DWLayoutTable-->
               <tr>
                 <td width="800" height="33" valign="top" bgcolor="#E3F3F7"><!--DWLayoutEmptyCell-->&nbsp;</td>
               </tr>
             </table></td>
           </tr>
         </table>
         <p>&nbsp;</p>
       </div>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
      <p align="center">&nbsp;</p>
    </form>
<p>&nbsp;</p>
  </div>
  
</div>
</body>
</html>




Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-05-27 15:09:12 By : ning View : 1048 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook



Go to : PHP + MySQL อยากทำ search แบบ Dropdown list เลือกจาก Field และสามารถใส keyword ได้ด้วย พอจะมีโค๊ด ไหมคะ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-05-27 15:44:27 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : การค้นหารายรับปีแบบใช้ list menu เมื่อค้นหาแล้วมันไม่โชว์ตามที่ค้นหา
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่