<!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=windows-874" />
<meta http-equiv="refresh" content="90;URL=" />
<title>ราคาทองคำ | ห้างขายทองทองใบเยาวราช</title>
<SCRIPT src="swfobject.js"  type=text/javascript></SCRIPT>

<style type="text/css">
<!--
.style1 {color: #FF0000}
.style3 {color: #FF0000; font-size: 12px; }
.style5 {
	font-weight: bold;
	font-size: 14px;
}
.style14 {font-size: 14px}
.style19 {font-weight: bold}
.style26 {
	color: #FF9900;
	font-size: 12px;
}
a:link {
	color: #FF9900;
}
a:visited {
	color: #CC3300;
}
a:hover {
	color: #FF6633;
}
a:active {
	color: #CC6633;
}
.style30 {color: #FF0000; font-size: 56px; font-weight: bold; }
.style31 {
	font-size: 56px;
	color: #FF0000;
}
.style32 {
	font-size: 36px;
	color: #FFCC00;
}
body,td,th {
	color: #FFCC99;
}
body {
	background-color: #032D5A;
}
-->
</style>
</head>

<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%" height="100%" align="center" valign="middle">
<div align="center">
  <table width="930" height="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td height="100%" align="center" valign="middle">
      <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
          <td height="68" align="center" valign="top">


		  <form id="form1" name="form1" method="get" action="price11.php">
            <label>ชื่อร้าน
              <input name="name1" type="text" id="name1" />
            </label>
            <label>
            <input type="submit" name="Submit" value="Submit" />
            </label>
          </form>	   


</td>
        </tr>
        <tr>
          <td align="center" valign="top">            <?php

$d=date("Y-m-d",strtotime("-1 week"));  		
$sd=date(" D, d/M/Y     H:i:s");


$user="cp037684_tbadm";
$password="siamnovaTho1220!";
$database="cp037684_tbadm";



mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");


														
$query="SELECT * FROM goldprice   ORDER BY date  DESC, time DESC LIMIT 2"; //
$result=mysql_query($query);

//$num=mysql_numrows($result);
$num=1;

mysql_close();

$i=0;

$date2 =$date;

$id=mysql_result($result,$i,"id");
$date=mysql_result($result,$i,"date");
$time=mysql_result($result,$i,"time");
$b96sb=mysql_result($result,$i,"b96sb");
$b96bb =mysql_result($result,$i,"b96bb");
$o96bg =mysql_result($result,$i,"o96bg");
$o96sb=mysql_result($result,$i,"o96sb");
$o96bb=mysql_result($result,$i,"o96bb");
$g90bg=$o96bg*.9;
$g90sb=$g90bg*15.16;
$g40bg=round($o96bg*.35);
$g40sb=$g40bg*15.16;

$dateshow=date("d/m/Y",strtotime($date));
$dd=date("w",strtotime($date));

                  $p_old =mysql_result($result,($i+1),"b96bb");
				  $diff=$b96bb-$p_old ;
			      $err=0;

$nd=date("w ") ;
switch ($nd)
{
case 0 :
$bgc="images/bg_red";
$nday="อาทิตย์";
$fc="c00000";
break;  
case 1:
$bgc="images/bg_yel";
$nday="จันทร์";
$fc="#FF9900";
break;
case 2:
$bgc="images/bg_pink";
$nday="อังคาร";
$fc="f20be4";
break;
case 3:
$bgc="images/bg_gre";
$nday="พุธ";
$fc="008800";
break;
case 4:
$bgc="images/bg_ora";
$nday="พฤหัสบดี";
$fc="FF6600";
break;
case 5:
$bgc="images/bg_blue";
$nday="วันศุกร์";
$fc="000088";
break;
case 6:
$bgc="images/bg_vio";
$nday="เสาร์";
$fc="008888";
break;
default:
$bgc="images/bg_whi";
$fc="000000";

}

switch ($dd)
{
case 0;
$nday="อาทิตย์";
break;  
case 1:
$nday="จันทร์";
break;
case 2:
$nday="อังคาร";
break;
case 3:
$nday="พุธ";
break;
case 4:
$nday="พฤหัสบดี";
break;
case 5:
$nday="วันศุกร์";
break;
case 6:
$nday="เสาร์";
break;
default:
$bgc="images/bg_whi";
$fc="000000";

}


     $dbuf=date("d");
	 $d1=sprintf("%02d", $dbuf);
	 $d0=date("D");
	 $yb=date("y")+43;
	 $y1=sprintf("%02d", $yb);
	 $mb = date("m");
	 $m=sprintf("m%d", $mb);
	 
	 $d11=$d1[0]*10;
	 $d10=$d1[1];
	 
	  	 
	 $sBuf=round($b96bb ); 
	 $sB=sprintf("%05d", $sBuf);

	 $sBuf=round( $b96sb);
	 $bB=sprintf("%05d", $sBuf);
	 
	  if($y1[1] ==1) $y11="01";
	 

		  if($diff==0)
		         {
				       $arr="price_eq.swf";
				       $cp="#0000ff";
				 }
		  if($diff>0)
		         {
  		  				$arr="price_up.swf";
				       $cp="#00ff00";						
		          }
		  if($diff<0)
		         {
  		  				$arr="price_dw.swf";
				       $cp="#ff0000";
						
				}		
?>
            <span class="style19"><strong>
            <?php 
					                                                                        echo "<font color=$fc  size=16>&nbsp; $nday $dateshow  </br> &nbsp; &nbsp;  เวลา $time</font >" ; 
																												 ?>
          </strong></span> </td>
        </tr><tr>
          <td align="center" valign="top">&nbsp;</td>
         
        </tr>
      </table>
       </span>
       
      <table width="100%" border="0" cellpadding="10" cellspacing="10" bgcolor="#8C5C04">
        <tr>
          <td align="center" bgcolor="#331B00"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="62%" align="right"><div align="right" id="flashContent2"></div>
                  <script type="text/javascript">
			var so = new SWFObject("<?php echo $arr  ?>", "flash", "260", "50", "8", "#ffffff");
			so.addParam("allowscriptaccess", "always");
			so.addParam("wmode", "transparent");
			so.write("flashContent2");
			</script></td>
              <td width="38%" align="left"><?php echo "<font color=$cp  size=20><strong> $diff</strong></font>"  ?></td>
            </tr>
          </table>               
            <p><span class="style32">ทองคำแท่ง 96.5%</span><br />
            </p>
            <table width="100%" border="0" cellspacing="2" cellpadding="0">
              <tr>
                <td width="5%">&nbsp;</td>
                <td width="39%" class="style1 style14"><strong><span class="style31"><strong>ซื้อบาทละ</strong></span></strong></td>
                <td width="36%" align="right" class="style31"><strong><?php echo $b96bb ?></strong></td>
                <td width="20%" class="style31"><strong>&nbsp;บาท</strong></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td class="style31"><strong>ขายบาทละ</strong></td>
                <td align="right"><strong><span class="style30"><?php echo $b96sb ?></span></strong></td>
                <td class="style31"><strong>&nbsp;บาท</strong></td>
              </tr>
            </table>
             
            <span class="style5">&nbsp;&nbsp;&nbsp;</span><span class="style32">ทองรูปพรรณ 96.5%</span><span class="style3"><br />
            </span>
            <table width="100%" border="0" cellspacing="2" cellpadding="0">
              <tr>
                <td width="5%">&nbsp;</td>
                <td width="39%" class="style30">ซื้อบาทละ</td>
                <td width="36%" align="right" class="style31"><strong><?php echo $o96bb ?></strong></td>
                <td width="20%" class="style30">&nbsp;บาท</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td class="style30">ซื้อกรัมละ</td>
                <td align="right" class="style31"><strong><?php echo $o96bg ?></strong></td>
                <td class="style30">&nbsp;บาท</td>
              </tr>
            </table></td>
          </tr>
      </table></td>
  </tr>
  <tr>
    <td><div align="center">
      <p><span class="style26"><a href="http://thongbai.com" target="_blank" class="style32">ห้างขายทองทองใบเยาวราช</a> </span><br />
      </p>
      </div></td>
  </tr>
</table>
</div>	
	</td>
  </tr>
</table>


</body>
</html>
