<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>{#$txt_title#} - Powered by HuCart.COM</title>
<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/info.css" rel="stylesheet">
<script language="javascript" src="{#$base_weburl#}/js/pinyin.js"></script>
<script language="javascript" src="{#$base_weburl#}/js/admin_common.js"></script>
<script src="{#$base_weburl#}/js/jquery.min.js"></script>
<!--[if lt IE 9]>
  <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script language="javascript">
	var webroot_url = '{#$base_weburl#}';
	function submitFun()
	{
			var idadd_name 		= document.getElementById('add_name');
			var iduse_id 		= document.getElementById('use_id');
			var idadd_mobile 	= document.getElementById('add_mobile');
			var idadd_province 	= document.getElementById('add_province');
			var idadd_city 		= document.getElementById('add_city');
			var idadd_district 	= document.getElementById('add_district');
			//var idsuggestionInfo 	= document.getElementById('suggestionInfo');
	
			if(idadd_name.value=='')
			{
				alert('{#$lang.add_name_err#}');
				idadd_name.focus();
				return false;
			}else if(iduse_id.value=='')
			{
				alert('{#$lang.use_id_err#}');
				iduse_id.focus();
				return false;
			}else if(idadd_mobile.value=='')
			{
				alert('{#$lang.add_mobile_err#}');
				idadd_mobile.focus();
				return false;
			}else if(idadd_province.value=='')
			{
				alert('{#$lang.add_province_err#}');
				idadd_province.focus();
				return false;
			}
			
			document.formSub.target="_self"
			document.formSub.submit();
	}
	
	function select_user( type_val,id_val)
	{
	   var someValue=window.showModalDialog("./index.php?load=user_list&act=select_user&type="+type_val+"&get_id="+id_val,"","dialogWidth=500px;dialogHeight=500px;status=no;help=no;scrollbars=no");
	   document.getElementById(id_val).value=some_value;
	}

</script>
</head>
<body>
    <div class="info-tit"><span class="glyphicon glyphicon-paperclip"> </span> <a href="index.php?load={#$master_act#}&act=info_list" >{#$lang.title#}</a> > {#$txt_title#} ({#$lang.need_edit#}&nbsp;&nbsp; {#$lang.need_add#} {#$lang.need_del#})</div>
    <!-- custom con start -->
    <div class="info-add">
      <form class="form-horizontal" name="add-form" id="add-form" method="post" action="{#$act_url#}">
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> {#$lang.field_list.add_name#}</label>
          <div class="col-sm-4">
            <input class="form-control" name="add_name" id="add_name" value="{#$info.add_name#}" type="text"  >
          </div>
        </div>

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> {#$lang.field_list.use_name#}</label>
          <div class="col-sm-3">
            <input class="form-control" name="use_id" id="use_id" value="{#$info.use_id#}" type="text"  >
          </div><div class="col-sm-3" style="margin-left:12px;"><button type="button" class="btn btn-default"  onclick="select_user('select_user','use_id')" >{#$lang.add_use_name#}</button></div>
        </div>   
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> {#$lang.field_list.add_phone#}</label>
          <div class="col-sm-3">
              <input class="form-control" name="add_phone" id="add_phone" value="{#$info.add_phone#}" type="text"  >
          </div>
        </div> 

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> {#$lang.field_list.add_mobile#}</label>
          <div class="col-sm-3">
              <input class="form-control" name="add_mobile" id="add_mobile" value="{#$info.add_mobile#}" type="text"  >
          </div>
        </div> 
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> {#$lang.field_list.add_pcdall#}</label>
          <div class="col-sm-1">
		  <div id="top_addr"><span id="province_span"><select class="form-control" name="province" id="province">
          <option value="">{#$lang.txt_select#}</option>
          </select></span> </div>
          </div>
          <div class="col-sm-1"> 
          <span id="city_span"><select class="form-control" name="city" id="city">
          <option value="" >{#$lang.txt_select#}</option>
          </select></span>
          </div>
          <div class="col-sm-1">
          <span id="district_span"><select class="form-control" name="district" id="district">
          <option value="" >{#$lang.txt_select#}</option>
          </select></span>
          </div>
        <input name="inv_pcd_all" id="inv_pcd_all" value="{#$info.inv_pcd_all#}" type="hidden"  >
        </div>
<script language="javascript">
	function get_area( obj_val,  area_type , sel_val )
	{
		if(obj_val!='')
		{
			$.get(webroot_url+"/adminsys/index.php?load=ajax_area&act="+area_type+"&obj_val="+obj_val+"&sel_val="+sel_val, function(data)
			{
				$('#'+area_type+'_span' ).html(data);
			})
		}else{
			$.get(webroot_url+"/adminsys/index.php?load=ajax&act=area&type="+area_type, function(data)
			{
				$('#'+area_type+'_span' ).html(data);
			})
		}
	}
	function get_pcd_all(obj,type)
	{
		var all_val = '';
		var p_obj = document.getElementById('province');
		var c_obj = document.getElementById('city');
		var d_obj = document.getElementById('district');
		
		if(type=='province' && obj.value!='' ){
			all_val = obj.options[obj.selectedIndex].text;
		}
		
		if(type=='city' && obj.value!='' ){
			all_val = p_obj.options[p_obj.selectedIndex].text + obj.options[obj.selectedIndex].text;
		}
		if(type=='district' && obj.value!='' ){
			all_val = p_obj.options[p_obj.selectedIndex].text + c_obj.options[c_obj.selectedIndex].text + obj.options[obj.selectedIndex].text;
		}
		$('#inv_pcd_all').val( all_val );
	}

	get_area( '0',  'province' ,  '{#$info.use_province#}');
	get_area( '{#$info.use_province#}', 'city' ,  '{#$info.use_city#}');
	get_area( '{#$info.use_city#}', 'district' ,  '{#$info.use_district#}');
	
</script>



        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <font color="red">*</font> {#$lang.field_list.add_address#}</label>
          <div class="col-sm-4">
            <input class="form-control" name="add_address" id="add_address" value="{#$info.add_address#}" type="text"  style="width:300px;"    >
          </div>
        </div>
        

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> {#$lang.field_list.add_sex#}</label>
          <div class="col-sm-4">
           {#foreach key=ek item=ei from=$lang.sex_arr#}&nbsp;&nbsp;
    {#$ei#}<input type="radio"   name="add_sex" id="add_sex[{#$ek#}]"  value="{#$ek#}" {#if $ek eq $info.add_sex#} checked="checked" {#/if#}>
    {#/foreach#}
          </div>
        </div>




        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> {#$lang.field_list.add_zip_code#}</label>
          <div class="col-sm-4">
            <input class="form-control" name="add_zip_code" id="add_zip_code" value="{#$info.add_zip_code#}" type="text"  style="width:300px;"    >
          </div>
        </div>
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> {#$lang.field_list.add_send_type#}</label>
          <div class="col-sm-4">
            <input class="form-control" name="add_send_type" id="add_send_type" value="{#$info.add_send_type#}" type="text"  style="width:300px;"    >
          </div>
        </div>
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> {#$lang.field_list.add_sign#}</label>
          <div class="col-sm-4">
            <input class="form-control" name="add_sign" id="add_sign" value="{#$info.add_sign#}" type="text"  style="width:300px;"    >
          </div>
        </div>


        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> {#$lang.field_list.add_enabled#}</label>
          <div class="col-sm-4">
{#foreach key=ek item=ei from=$lang.enabled_arr#}&nbsp;&nbsp;
{#$ei#}<input type="radio"   name="add_enabled" id="add_enabled[{#$ek#}]"  value="{#$ek#}" {#if $ek eq $info.add_enabled#} checked="checked" {#/if#}>
{#/foreach#}
          </div>
        </div> 

        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary  btn-sm" onclick="return submitFun(this)" >{#$edit_submit#}</button>&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="reset" class="btn btn-default btn-sm">{#$lang.reset#}</button>
          </div>
        </div>
        <input type="hidden" name="act_type" value="{#$act_type#}">
        <input type="hidden" name="add_id" id="add_id"  value="{#$info.add_id#}">
      </form>
    </div>
    <!-- custom con end -->
    
    <footer class="footer">
      <div class="container">
        <p class="text-muted">Powered by <a href="http://Www.HuCart.COM" target="_blank">HuCart.COM</a></p>
      </div>
    </footer>
<script src="{#$base_weburl#}/js/jquery.min.js"></script>
<script src="{#$base_weburl#}/js/base.js"></script>
</body>
</html>