//溯ӵfunction.phpļ·? >ǰ
function alipay_shop()
{
$custom_fields = get_post_custom_keys($post_id);
if (in_array ('binghe', $custom_fields)) 
{ 
$custom = get_post_custom($post_id);
$custom_value = $custom['binghe']; 
global $wpdb; $table_name = $wpdb->prefix; 
$results = mysql_query("select * from ".$table_name."merchandise_config where id=". $custom_value[0]);
if(mysql_num_rows($results))
{
 	$row = mysql_fetch_array($results);
	ini_set("date.timezone","Asia/Shanghai");
  $shijian=mktime("0","0","0",date('m'),date("d"),date("Y"));
  $xjdate=mktime("0","0","0",substr($row[xjdate],5,2),substr($row[xjdate],8,2),substr($row[xjdate],0,4));
  $days=round(($xjdate-$shijian)/3600/24) ;
	if($row[quantity]>"0"&&$days>=0)
	{
    	?>
       		<div style="width:100%; height:200px; background:url(<?php echo 'http://'.$_SERVER['HTTP_HOST']?>/wp-content/plugins/wordpress-glacier-alipay/bg.gif);border:1px solid #d0dfe9; text-align:right;">
        <?php if ( has_post_thumbnail() ) { ?>
        <div style="margin-left:10px; margin-top:10px; float:left;">
<?php the_post_thumbnail(array(250,180));  ?>
</div>
<?php } else {?>
<div style="margin-left:10px; margin-top:10px; float:left;">
<img src="<?php echo 'http://'.$_SERVER['HTTP_HOST']?>/wp-content/plugins/wordpress-glacier-alipay/tese.gif"/>
</div>
<?php } 
global $user_identity;
?>
<div style="height:180px; float:left; width:300px; margin-left:10px; margin-top:10px; text-align:left">
  <form id="form2" name="form2" method="post" target="_blank" action="<?php echo 'http://'.$_SERVER['HTTP_HOST'];?>/alipayjs/alipayto.php?id=<?php echo $row[id];?>&username=<?php echo $user_identity;?>">
    [Ʒ]<?php echo $row[shopname];?><br>
  ۸񣺣 <font color="#FF0000" size="+2"><?php echo $row[shopjg];?> Ԫ </font> 
     ,ʱ<?php
 echo $days+1;
   ?>  <br>
  <input name="spsl" type="text" id="spsl" value="1" size="3" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/>,ʹ:
  <select name="fangshi" id="fangshi">
              <option value="bankPay"></option>
              <option value="directPay"></option>
              <option value="cartoon">ͨ</option>
              <option value="CASH">֧</option>
      </select> <br>
  <input name="user_name" type="text" id="user_name" size="8" />
  QQ<input name="user_qq" type="text" id="user_qq" size="12" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/><br>
  䣺<input name="user_mail" type="text" id="user_mail" size="30" /><br>
  <input type="image" src="<?php echo 'http://'.$_SERVER['HTTP_HOST']?>/wp-content/plugins/wordpress-glacier-alipay/24.gif" value="submit" />
  </form>
</div>
<div style="width:20px; height:180px; margin-left:10px; margin-top:10px; float:right"><?php echo get_option('glacier_Copyright');?></div>
</div>
		<?php
		
	}
	else
	{
		echo "<font color=#ff0000>ƷջѾ</font>";
	}
}
else
{
	echo "<font color=#FF0000>ԶĿֵд,дƷID</font>";
}
}
}