<%@ page language="C#" autoeventwireup="true" inherits="wap_user_company, kfenlei" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-control" content="no-cache" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title><%=sWebName %> - 商家资料</title>
<link href="/js/css/layui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css.css" />
</head>
<body>
<%=qTemplate.Ac("wapUserTop.html") %>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script type="text/javascript" language="javascript" src="/js/layui.js"></script>
<script type="text/javascript">
layui.use(['form','laydate'], function(){
var form = layui.form();
    form.render();
	form.on('select(address)', function(data){
acLoadAddress($("#address").val(),"");
});
	form.on('select(sort)', function(data){
acLoadBizSort($("#sort").val(),"");
});
});
</script>
<div align="left">
<div class="wapPageTitle"><a href="/wap/user/index1.aspx" class="infoback">返回</a><%=sZhuangtai %>商家资料</div>
<div class="clear10"></div>
<div class="infowrap" align="left">
<form action="/inc/kfUpload.aspx?s=nowatermark" style="display:none;" id="upFileForm" name="upFileForm" method="post" enctype="multipart/form-data">
<input type="file" id="upFile" name="upFile" />
<input type="submit" value="上传">
</form>
<form action="action.aspx?s=usermess" onSubmit="return valiForm()" class="layui-form" method="post" name="userMessEdit">
<input class="inputText" value="<%=pic%>" name="pic"  id="pic" type="hidden" size="20" />
<table width="100%" class="userMessTable" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="head" width="90">企业图标：</td>
<td><img src="" width="100" height="100" id="imgpic" class="fl5" onClick="$('#upFile').click();" style="border:1px solid #e5e5e5; border-radius:3px; cursor:pointer;" onclick="$('#upfileDiv').fadeIn(800)" />
<a href="#nogo" id="wapUploadBtn" class="btn_upfile fl5">上传</a>
</td>
</tr>
<tr>
<td class="head">企业分类：</td>
<td><div class="selectDivLine"><%=tools.showBizSortSelectAdmin("sort","sort_1") %></div></td>
</tr>
<tr>
<td class="head">所在地：</td>
<td><div class="selectDivLine"><%=tools.showAddressSelect("address","city") %></div></td>
</tr>
<tr>
<td class="head">企业名称：</td>
<td><input name="name" value="<%=name%>" type="text" class="inputText" size="25" /></td>
</tr>
<tr>
<td class="head">电话：</td>
<td><input name="phone" value="<%=phone%>" type="text" class="inputText" size="25" /></td>
</tr>
<tr>
<td class="head">手机：</td>
<td><input name="tel" value="<%=tel%>" type="text" class="inputText" size="25" /></td>
</tr>
<tr>
<td class="head">ＱＱ：</td>
<td><input name="qq" value="<%=qq%>" type="text" class="inputText" size="25" /></td>
</tr>
<tr>
<td class="head">Email：</td>
<td><input name="email" value="<%=email%>" type="text" class="inputText" size="25" /></td>
</tr>
<tr>
<td class="head">营业时间：</td>
<td><input name="businesshours" value="<%=businesshours%>" type="text" class="inputText" size="25" /></td>
</tr>
<tr>
<td class="head">企业地址：</td>
<td><input name="address_1" value="<%=address_1%>" type="text" class="inputText" size="25" /></td>
</tr>
<tr>
<td class="head">企业简介：</td>
<td><textarea class="inputTextarea" name="about" rows="6" cols="25"><%=about%></textarea></td>
</tr>
</table>
<div class="clear10"></div>
<input type="submit" class="postSubmit" value="<%=sZhuangtai %>商家资料" />
</form>
<script language="javascript" type="text/javascript">
$("#wapUploadBtn").click(function(){
	$("#upFile").click();
});
$('#upFile').change(function(){
$("#imgpic").attr('src',"/images/wait.gif");
$("#upFileForm").ajaxSubmit(
{
	url:"/inc/kfUpload.aspx",type:"POST",
	success:function(response)
	{
		var data=eval("("+response+")");
		if(data.status=="1")
		{ 
			valiUpPic('pic','imgpic',data.pic);
		}
		else
		{
			valiUpPic('pic','imgpic',data.pic);
  			alert(data.ps);
		}
  	},
 	error:function(msg)
	{
	}
});
$('#upFile').val('');
});

function valiUpPic(picInputId,picId,picValue)
{
	if(picValue!="")
	{
		if($("#"+picInputId)!=null)
		{
  			$("#"+picInputId).val(picValue);
		}
	}
	if($("#"+picId)!=null)
	{
		if($("#"+picInputId).val()!="")
		{
		    if(picValue.toLowerCase().indexOf("http://")==-1)
		    {
			   	$("#"+picId).attr('src',"/"+$("#"+picInputId).val());
		    }
		    else
		    {
				$("#"+picId).attr('src',$("#"+picInputId).val());
			}
		}
		else
		{
			$("#"+picId).attr('src','/user/images/nophoto.png');
		}
	}
  }
  valiUpPic('pic','imgpic','<%=pic%>');
  $("#address").val("<%=address %>");
$("#sort").val("<%=sort%>");
acLoadAddress("<%=address %>","<%=city %>")
acLoadBizSort("<%=sort%>","<%=sort_1%>");
  function valiForm()
  {
    return true
  }
  
   function valiForm()
  {
    if(document.userMessEdit.name.value.length>50)
    {
        alert("填写企业名称请保持在50字以内！")
        return false
    }
    if(document.userMessEdit.address_1.value.length>100)
    {
        alert("填写企业地址请保持在100字以内！")
        return false
    }
    if(document.userMessEdit.phone.value.length>15)
    {
        alert("填写电话号请保持在15字以内！")
        return false
    }
    if(document.userMessEdit.tel.value.length>11)
    {
        alert("填写手机号请保持在11字以内！")
        return false
    }
    if(document.userMessEdit.qq.value.length>11)
    {
        alert("填写QQ号请保持在11字以内！")
        return false
    }
    return true
  }
</script>
</div></div>
<div class="clear80"></div>
</body>
</html>
