<?php
/*
	[Phpup.Net!] (C)2009-2011 Phpup.net.
	This is NOT a freeware, use is subject to license terms

	$Id: admin.class.php 2010-08-24 10:42 $
*/

if(!defined('IN_PHPUP')) {
	exit('Access Denied');
}
?>
<?php include ROOT_PATH.'/views/admin/header.php';?>
<body>
<SCRIPT LANGUAGE="JavaScript">

	function checkform(theform)
	{
		if(theform.title.value=='')
		{
			alert('团购项目不能为空');
			return false;
		}
		if(theform.start_time.value=='')
		{
			alert('开始日期不能为空');
			return false;
		}
		if(theform.close_time.value=='')
		{
			alert('结束日期不能为空');
			return false;
		}
	
		if(theform.city.value=='')
		{
			alert('所属城市不能为空');
			return false;
		}
	}
</SCRIPT>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <A HREF="index.php?pluginid=coupon&con=admin&act=coupon" class="on"><em>优惠券管理</em></A>
	</div>
</div>
<div id="man_zone">
  <form action="index.php?pluginid=coupon&con=admin&act=couponmodify"  onsubmit="return checkform(this);"  enctype="multipart/form-data"  method="post">
  <INPUT TYPE="hidden" NAME="commit" value="1">
  <INPUT TYPE="hidden" NAME="updateid" value="<?php echo $coupon_info['id'];?>">
<table width="100%" class="table_form">
		<tbody>
		<tr>
			<td width="80">标题：</td> 
			<td><input type="text" size="30"  id="title" value="<?php echo $coupon_info['title'];?>" class="input-text" name="title"></td>
		</tr>
		<tr>
			<td>商家：</td> 
			<td><input type="text" size="30"  value="<?php echo $coupon_info['merchant_name'];?>" id="merchant_name" class="input-text" name="merchant_name"></td>
		</tr>
		<tr>
			<td>开始日期：</td> 
			<td><input type="text" size="30"  value="<?php  if($coupon_info['start_time'] > 0 ){ echo date("Y-m-d H:i:s",$coupon_info['start_time']); } ?>" onfocus="HS_setDate(this);"  id="starttime" class="input-text" name="starttime"></td>
		</tr>
		<tr>
			<td>结束日期：</td> 
			<td><input type="text" size="30"  value="<?php  if($coupon_info['close_time'] >0){ echo date("Y-m-d H:i:s",$coupon_info['close_time']); }?>" onfocus="HS_setDate(this);"  id="lasttime" class="input-text" name="lasttime"></td>
		</tr>
		

		<tr>
			<td>所属城市：</td>
			<td>
				<select name="city" id="city" >
					<option value="0">请选择</option>
					<?php  foreach($GLOBALS['city'] AS $key => $val){  ?>	
					<option value="<?php  echo  $key; ?>"  <?php  if($key == $coupon_info['cityid']){ echo "selected";}   ?>   ><?php  echo  $key; ?>-<?php  echo  $val['cityname']; ?></option>
					<?php  }  ?>
				</select>		
			</td>
		</tr>

		<tr>
			<td>分类：</td>
			<td>
				<select name="big_catelist"  id="big_catelist"> 
					<option value="0">请选择</option>
					<?php  foreach($tempcate AS $key => $val){  ?>	
					<option value="<?php  echo  $key; ?>"  <?php  if( $key ==  $coupon_info['class']){ echo "selected";}   ?>  ><?php  echo  $val; ?></option>
					<?php  }  ?>
				</select>
			</td>
		</tr>
	

		<tr>
			<td>缩略图：</td>
			<td>
            <input type="file" name="thumb">
			<?php
			
				if($coupon_info['img_url'])
				{
                     echo "<img src='".$coupon_info['img_url']."' height='100px'>";
				}
			?>
			</td>
		</tr>

		<tr>
			<td>访问地址：</td>
			<td><input type="text" size="30" id="goods_url" class="input-text" value="<?php echo $coupon_info['goods_url'];?>" name="goods_url" ></td>
		</tr>
		

		<tr>
			<td>价格：</td>
			<td><input type="text" size="30" id="sale_price" class="input-text" value="<?php echo $coupon_info['sale_price'];?>" name="sale_price"></td>
		</tr>

		<tr>
			<td>当前领取人数：</td>
			<td><input type="text" size="30" id="sales_num" class="input-text" value="<?php echo $coupon_info['sales_num'];?>" name="sales_num"></td>
		</tr>


		<tr>
			<td>排序：</td>
			<td><input type="text" size="30" id="sortorder" class="input-text" value="<?php echo $coupon_info['sortorder'];?>" name="sortorder"></td>
		</tr>

		<tr>
			<td></td>
			<td>
			<INPUT TYPE="submit" class="button" value="提交">
			</td>
		</tr>
	</tbody></table>
  </FORM>
</div>

</body>
</html>
