<?php 
	if (empty($_REQUEST['OrderID']))  $FinOrderID=$LastOrderID;
	else $FinOrderID=$_REQUEST['OrderID'];
	if (!empty($FinOrderID)) {
	?> 
 <a href="#" onclick="confirmdelete();"  class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-delete ui-btn-icon-left ui-btn-a" data-transition="none">清空</a><a href="#" onclick="formfinorder.submit();;"  class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-check ui-btn-icon-left ui-btn-a" data-transition="none">下单</a><br />
<?php 
if (isset($_POST['CompanyName'])) {
$updateSQL = sprintf("UPDATE Customers SET CompanyName=%s,Address=%s,City=%s,PostalCode=%s,Phone=%s,wechat=%s WHERE CustomerID=%s",
  					   GetSQLValueStringGBK($_POST['CompanyName'], "text"),
  					   GetSQLValueStringGBK($_POST['Address'], "text"),
  					   GetSQLValueStringGBK($_POST['City'], "text"),
  					   GetSQLValueStringGBK($_POST['PostalCode'], "text"),
  					   GetSQLValueStringGBK($_POST['Phone'], "text"),
  					   GetSQLValueStringGBK($_POST['wechat'], "text"),
                      GetSQLValueStringGBK($GUID, "text")
					   );

		$orders->exec($updateSQL);
}
		
	$SQlStr="SELECT top 1 CompanyName,Address,City,PostalCode,Phone,wechat,ShipType,PaymentType  FROM Customers  where CustomerID='".$GUID."'  ";
	//echo $SQlStr;
 			 $values = $orders->query($SQlStr);
if (is_iterable($values)){
  foreach ($values as $pSQlStr1)
			{
			$pSQlStr1['CompanyName']=loadFromMssql($pSQlStr1['CompanyName']);
			$pSQlStr1['Address']=loadFromMssql($pSQlStr1['Address']);

				$ShipTypeFin=$pSQlStr1['ShipType'];$PaymentTypeFin=$pSQlStr1['PaymentType'];
			}
			//return $theValue;
		} 
?> 


	  
	  
<fieldset data-role="controlgroup" data-type="horizontal"  data-mini="true" <?php if ($CFG_statedisabled==1) echo 'class="ui-state-disabled"';?> >
      <legend>
      
      类型：</legend>
        <label for="takeaway">外卖</label>
      <input name="ShipType" type="radio" id="takeaway" value="takeaway" <?php if ($ShipTypeFin=='takeaway' || $ShipTypeFin=='') echo 'checked="checked"';?> />
         <label for="inside">店内</label>
      <input name="ShipType" type="radio" id="inside" value="inside" <?php if ($ShipTypeFin=='inside') echo 'checked="checked"';?>/>
         <label for="takemyself">自提</label>
       <input name="ShipType" type="radio" id="takemyself" value="takemyself" <?php if ($ShipTypeFin=='takemyself') echo 'checked="checked"';?>/>
      </fieldset>



  <fieldset data-role="controlgroup" data-type="horizontal"  data-mini="true" <?php if ($CFG_statedisabled==1) echo 'class="ui-state-disabled"';?>>
        <legend>支付方式：</legend>
	<label for="cash">现金</label>
	<input name="PaymentType" type="radio" id="cash" value="cash" <?php if ($PaymentTypeFin=='cash'  || $PaymentTypeFin=='') echo 'checked="checked"';?> />
	<label for="vor">饭票</label>
	<input name="PaymentType" type="radio" id="vor" value="vor"  <?php if ($PaymentTypeFin=='vor') echo 'checked="checked"';?>/>
	<label for="other">其他</label>
	<input name="PaymentType" type="radio" id="other" value="other" <?php if ($PaymentTypeFin=='other') echo 'checked="checked"';?>/>

      </fieldset>
        <div class="ui-corner-all custom-corners" <?php if ($forcein==1) echo 'hidden="true"';?> >
    <input name="CompanyName" type="text" id="CompanyName" value="<?php echo $pSQlStr1['CompanyName'];?>" placeholder="姓名"/>
    <input name="Address" type="text" id="Address" value="<?php echo $pSQlStr1['Address'];?>" placeholder="地址"/>
    <input name="City" type="text" id="City" value="<?php echo $pSQlStr1['City'];?>" placeholder="城市"/>
    <input name="PostalCode" type="text" id="PostalCode" value="<?php echo $pSQlStr1['PostalCode'];?>" placeholder="邮编"/>
    <input name="Phone" type="tel" id="Phone" value="<?php echo $pSQlStr1['Phone'];?>" placeholder="电话"/>
    <input name="wechat" type="text" id="wechat" value="<?php echo $pSQlStr1['wechat'];?>"size="25" placeholder="微信"/>
    <textarea name="Remark" id="Remark" cols="30" rows="3" placeholder="留言"><?php echo $RemarkFin; ?></textarea>
  <?php //if (!empty($_REQUEST[wechat])) echo '  <input type="hidden" name="wechat" id="wechat" value="'.$_REQUEST[wechat].'"/>'; ?>
  <?php 	if (!empty($LastOrderID))	echo '  <input type="hidden" name="OrderID" id="OrderID" value="'.$LastOrderID.'"/>
  		<input type="hidden" name="prnOrderID" id="prnOrderID" value="'.$LastOrderID.'"/>';
  ?>
	<input type="submit" data-inline="false" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-check ui-btn-icon-left ui-btn-a"  value="确认下单"></div>
   <?php } ?>