<!--#include file="../../inc/cms_class.asp"-->
<!--#include file="../../inc/cms_Language.asp"-->
document.write("<script src='<%=sitepath%>plugins/layer/layer.min.js'></script>");
document.write("<link rel='stylesheet' type='text/css' href='<%=sitepath%>wap/gbook/gbook.css'/>");
document.write(" <form id='drive_form' class='gbookform' method='post' name='drive_form' action='<%=sitepath%>wap/?act=gbooking'>");
document.write(" <input name='userid' type='hidden' value='<%=getsession("userid")%>'>");
document.write(" <input name='backurl' type='hidden' value='"+window.location.href +"'>");
document.write(" <ul class='form-box'>");
 <%if ongbookname=1 then%>
document.write(" <li class='form-item'><h4><%=gbookname%>：</h4><div class='input-box'><input class='inp' type='text' autocomplete='off' name='gname' value='<%=getsession("username")%>' id='txt_user_name'<%=isred(isgbookname)%></span></div></li>");
  <%end if
  if ongbooktitle=1 then%>
document.write(" <li class='form-item'><h4><%=gbooktitle%>：</h4><div class='input-box'><input class='inp' type='text' autocomplete='off' name='gtitle' id='txt_user_name' <%=isred(isgbooktitle)%></span></div></li>");
  <%end if
  if ongbooktel=1 then%>
document.write(" <li class='form-item'><h4><%=gbooktel%>：</h4><div class='input-box'><input class='inp' type='text' autocomplete='off' name='gtel' value='<%=getcookie("usertel")%>' id='txt_user_tel' <%=isred(isgbooktel)%></span></div></li>");
  <%end if
  if ongbookmail=1 then%>
document.write(" <li class='form-item'><h4><%=gbookmail%>：</h4><div class='input-box'><input class='inp' type='text' autocomplete='off' name='gemail'  value='<%=getcookie("useremail")%>' id='txt_user_email'  <%=isred(isgbookmail)%></span></div></li>");
 <%end if%>
document.write("<% echo (getCustom()) %>")
<%if ongbookcontent=1 then%>
document.write(" <li class='form-item'><h4><%=gbookcontent%>：</h4><div class='textarea-box'><textarea class='inp' placeholder='请输入<%=gbookcontent%>' name='gContent' id='txt_content' <%if not isnul(isgbookcontent) then echo "datatype='"&isgbookcontent&"' ></textarea> <span class='note'>*</span>" else echo "></textarea>"%> </span></div></li>");
 <%end if%><%if gbookCode=1 then%>
document.write(" <li class='form-item'><h4><%=str_code%>：</h4><div class='input-box'><input type='text' autocomplete='off' required name='code' id='imgcode' class='codeinp' placeholder='<%=str_code%>'  datatype='n4-4'> <div class='form-inline imgcode' style='display:none'><img src='<%=sitepath%>inc/imgcode.asp' id='SeedImg' align='absmiddle' class='codeimg' style='cursor:pointer;' border='0' onClick=\"this.src+='?'+Math.random();\" /></div></span></div></li>");
 <%end if%>
document.write("  </ul><div class='form-btn'><input class='btn' type='submit' value='<%=str_gbook%>' id='btnSubmit' /></div>");
document.write("</form>");
document.write(" <script>$('#imgcode').focus(function (){$('#SeedImg').click();$('.imgcode').show()});$('textarea').each(function () { this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;'); }).on('input', function () { this.style.height = 'auto'; this.style.height = (this.scrollHeight) + 'px'; })</script> ");
<%
function getCustom()	
		Dim rs,CustomFields,rs1,i,CustomNames,splitValue,checkstr,selectstr,valstr,topstr,endstr,filetype
		CustomFields=""		
		Set rs=dbsqlr1("select CustomName,Custom,customValues,customOptions,customClass,customplace from [dbpre]Content_custom where Customtype ='gbook' order by CustomOrder asc,CustomID desc")		
		Do While not rs.Eof 
				valstr=rs(2)
				select case rs(4)
				case 0,1	
				getCustom= getCustom&"<li class='form-item'><h4>"&rs(0)&"：</h4><div class='input-box'><input name='"&rs(1)&"' id='"&rs(1)&"' type='text' autocomplete='off' class='inp' value='"&valstr&"' "&isred(rs(5))&"</span></div></li>"
				case 2
				getCustom= getCustom&"<li class='form-item'><h4>"&rs(0)&"：</th<td> <textarea class='textarea tbox_h_100'   name='"&rs(1)&"' id='"&rs(1)&"'>"&valstr&"</textarea "&isred(rs(5))&"</span></div></li>"
				case 3
				getCustom= getCustom&"<li class='form-item'><h4>"&rs(0)&"：</h4><div class='input-box'> <textarea class='textarea tbox_h_100'   name='"&rs(1)&"' id='"&rs(1)&"'>"&decode(valstr)&"</textarea "&isred(rs(5))&"</span></div></li>"
				case 4,5,6
					if ifstrin(rs(3),",") then
					getCustom= getCustom&"<li class='form-item'><h4>"&rs(0)&"：</th>"	
					if rs(4)=6 then getCustom= getCustom&"<td><select name='"&rs(1)&"' id='"&rs(1)&"' class='inp'>" else getCustom= getCustom&"<td>"
					splitValue=split(rs(3),",")
						for i=0 to ubound(splitValue)
						if valstr=splitValue(i) then
						  checkstr="checked"
						  selectstr="selected"
						  else 
						  checkstr=""
						  selectstr=""
						end if
						if rs(4)=4	then getCustom= getCustom& "<input type='radio' id='"&rs(1)&i&"' name='"&rs(1)&"' "&checkstr&" value='"&splitValue(i)&"'/><label for='"&rs(1)&i&"'>"&splitValue(i)&"</label> "
						if rs(4)=5	then getCustom= getCustom& "<input type='checkbox' id='"&rs(1)&i&"' name='"&rs(1)&"' "&checkstr&" value='"&splitValue(i)&"'/><label for='"&rs(1)&i&"'>"&splitValue(i)&"</label> "
						if rs(4)=6	then getCustom= getCustom& "<option value='"&splitValue(i)&"' "&selectstr&">"&splitValue(i)&"</option>"
						next
					if rs(4)=6 then getCustom= getCustom&" </select>"
					if not isnul(rs(5)) then getCustom= getCustom&"<span class='red_zi'>*</span>"
					getCustom=  getCustom&"</span></div></li>"
					end if
				
				end select
			rs.MoveNext
		Loop
		getCustom=topstr&getCustom&endstr
End function

function isred(str)
	if not isnul(str) then
		isred= "required datatype='"&str&"'><span class='note'>*</span>"
	else
		isred= ">"
	end if
end function
%>