{include file="page_header.htm"}
{insert_scripts files="../js/utils.js,../js/region.js"}
<script type="text/javascript">
{literal}
region.isAdmin = true;
{/literal}
</script>
<form enctype="multipart/form-data" name="theForm" action="customer_address.php" method="post" onsubmit="return validate()">
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="table_form1" >	
	<tr>
	<td class="label">姓名:</td>
	<td>
	<input type="text" name="name" value="{$customer_address.name|escape:html}" class="FormSmall" style="width:200px;" /> <span class="required">&nbsp;</span>
	</td>
	</tr>
	
	<tr>
	<td class="label">电话:</td>
	<td>
	<input type="text" name="telephone" value="{$customer_address.telephone|escape:html}" class="FormSmall" style="width:200px;" /> 
	</td>
	</tr>	
	
	<tr>
	<td class="label">手机:</td>
	<td>
	<input type="text" name="mobile" value="{$customer_address.mobile|escape:html}" class="FormSmall" style="width:200px;" /> 
	</td>
	</tr>		
	
	<tr>
	<td class="label">公司名:</td>
	<td>
	<input type="text" name="company" value="{$customer_address.company|escape:html}" class="FormSmall" style="width:200px;" /> 
	</td>
	</tr>		
	
	<tr>
	<td class="label">省市区:</td>
	<td>
	<input type="hidden" name="country_id" value="1" />
	<select name="province_id" id="provinces" onchange="region.changed(this, 2, 'city')" class="select_input">>
	<option value="0">请选择省</option>
	{foreach from=$province_list item=province}
	<option value="{$province.region_id}"{if $customer_address.province_id == $province.region_id} selected="selected"{/if}>{$province.region_name}</option>
	{/foreach}
	</select>
	<select name="city_id" id="city" onchange="region.changed(this, 3, 'district')" class="select_input">>
	<option value="0">请选择城市</option>
	{foreach from=$city_list item=city}
	<option value="{$city.region_id}" {if $customer_address.city_id == $city.region_id} selected="selected"{/if}>{$city.region_name}</option>
	{/foreach}
	</select>
	<select name="district_id" id="district" {if !$district_list}style="display:none"{/if} class="select_input">>
	<option value="0">请选择区</option>
	{foreach from=$district_list item=district}
	<option value="{$district.region_id}" {if $customer_address.district_id == $district.region_id} selected="selected"{/if}>{$district.region_name}</option>
	{/foreach}
	</select>	
	</td>
	</tr>	
	
	<tr>
	<td class="label">地址:</td>
	<td>
	<input type="text" name="address" value="{$customer_address.address|escape:html}" class="FormSmall" style="width:350px;" /> 
	</td>
	</tr>	

	<tr>
	<td class="label">邮编:</td>
	<td>
	<input type="text" name="postcode" value="{$customer_address.postcode|escape:html}" class="FormSmall" style="width:100px;" /> 
	</td>
	</tr>

	<tr>
	<td class="label">排序:</td>
	<td><input name="sort_order" type="text" value="{$customer_address.sort_order}" class="FormSmall" style="width:100px;" /></td>
	</tr>
		
	<tr>
	<td class="label">是否默认:</td>
	<td>
	
	<label><input name="is_default" type="radio" value="0" {if $customer_address.is_default == 0}checked="checked"{/if} /> 否</label>
	<label><input name="is_default" type="radio" value="1" {if $customer_address.is_default == 1}checked="checked"{/if} /> 是</label>
	
	</td>
	</tr>		
		

	<tr>
	<td style="border:none;"></td>
	<td style="border:none;">
		<input type="hidden" name="act" value="{$form_act}" />
		<input type="hidden" name="id" value="{$customer_address.address_id}" />
		<input type="hidden" name="customer_id" value="{$customer_id}" />		
	<input type="submit" value="提交" class="bginput" />
	<input type="reset" value="重置" class="bginput" />
	</td>
	</tr> 
</table>
</form>
<script language="JavaScript">
{literal}
function validate(){
    validator = new Validator("theForm");
    validator.required("name",   "请输入分组名称");
    return validator.passed();
}
{/literal}
</script>
{insert_scripts files="validator.js"}
{include file="page_footer.htm"}