<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    java+jsp

    2006年8月17日 #

    javascrip驗證---validate.js

    //???? 2005-6-17? ????????
    ///////////////////////////////////////////////////////////////////////
    //The follow jscript is used to validte the form fields?????? //
    //?????????????????????????????????????????????????????????????????? //
    //Create By Geng Zhan??????????????????????????????????????????????? //
    ///////////////////////////////////////////////////////////////////////

    //changed by yb 20050706 加入郵箱驗證


    //--------------------------------------------------------------------
    //作用:校驗Form中所有必填項是否為空,為空提示并返回焦點到相應域
    //用法:結合CSS中定義的must樣式,must樣式將必填項的邊框突出顯示,在Form
    //????? 提交時(onsubmit)調用此函數
    //參數:無
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------
    function checkEmpty(srcObj)
    {
    ?var result=true;
    ?
    ?if (srcObj.value.length==0 || srcObj.value.length==srcObj.value.split(" ").length-1)
    ?{
    ??result=false;
    ??alert("輸入項目["+srcObj.title+"]不能為空,請輸入!");
    ??srcObj.focus();
    ?}
    ?return result;?
    }
    //--------------------------------------------------------------------
    //作用:校驗輸入項中輸入的是否為數字,不是數字彈出提示;
    //用法:結合CSS中定義的num樣式,num樣式定義數字輸入項的樣式,在Form
    //????? 提交時(onsubmit)調用此函數
    //參數:無
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------
    function checkNaN(srcObj)
    {
    ?var result=true;
    ?
    ?if (isNaN(srcObj.value))
    ?{
    ??result=false;
    ??alert("輸入項目["+srcObj.title+"]必須輸入數字,請更改!");
    ??srcObj.focus();
    ?}
    ?return result;?
    }

    function checkRepeat(valueArray)
    {
    ?var loop=valueArray.length;
    //?alert(loop);
    ?var refValue=valueArray[0];
    ?for (var i=1;i<loop;i++){
    //???alert(valueArray.toString()+"+++"+refValue+":::"+valueArray[i]);
    ??if (valueArray[i]==refValue) {
    ???return false;
    ??}
    ??else
    ??{
    ???var newArray=valueArray.slice(i);
    ???if (checkRepeat(newArray)==false) return false;
    ??}
    ?}
    ?return true;
    }

    //--------------------------------------------------------------------
    //作用:校驗輸入項中輸入的是否為數字,不是數字彈出提示;
    //用法:結合CSS中定義的num樣式,num樣式定義數字輸入項的樣式,在Form
    //????? 提交時(onsubmit)調用此函數
    //參數:無
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------
    function checkPhone(srcObj)
    {
    ?var result=true;
    ?var tempStr;
    ?
    ?tempStr=srcObj.value;
    ?while (tempStr.search("-")>=0)
    ?{
    ??tempStr=tempStr.replace("-","0");
    ?}
    //??alert(tempStr);
    ?if (isNaN(tempStr) || (tempStr.length<6))
    ?{
    ??result=false;
    ??alert("輸入項目["+srcObj.title+"]必須輸入正確的電話號碼,請更改!");
    ??srcObj.focus();
    ?}
    ?return result;?
    }

    //--------------------------------------------------------------------
    //作用:校驗日期輸入項是否正確,不正確彈出提示;
    //用法:結合CSS中定義的num樣式,num樣式定義數字輸入項的樣式,在Form
    //????? 提交時(onsubmit)調用此函數
    //參數:無
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------
    function? checkDate(srcObj)
    {
    ?var mini_year = 1900;
    ?var i_countSeparater = 0;
    ?var charset = "1234567890";
    ???
    ?var the_date = srcObj.value;
    ?var the_dateLength=the_date.length;
    ?var i_firstSepLoc = the_date.indexOf('-',0);
    ?var i_lastSepLoc = the_date.lastIndexOf('-');
    ?if (i_firstSepLoc < 0 || i_firstSepLoc == i_lastSepLoc)
    ?{
    ??alert('請輸入“年-月-日”格式的正確時間!');
    ??return false;
    ?
    ?}?

    ?var the_year = the_date.substring(0,i_firstSepLoc);
    ?var the_month = the_date.substring(i_firstSepLoc+1,i_lastSepLoc);
    ?var the_day = the_date.substring(i_lastSepLoc+1,the_dateLength);
    ?if (! CheckChar(charset, the_year, true)){
    ???? alert('年份應為數字!');
    ???? return false;
    ?}

    ?if (! CheckChar(charset, the_month, true)){
    ???? alert('月份應為數字!');
    ???? return false;
    ?}
    ?if (! CheckChar(charset, the_day, true)){
    ???? alert('日期應為數字!');
    ???? return false;
    ?}

    ?if (the_year.length >4){
    ???? alert('年份不能大于4位!');
    ???? return false;
    ?}else if (the_year.length == 1){
    ???? the_year = '200'+the_year;
    ?}else if (the_year.length == 2){
    ???? the_year = '20'+the_year;
    ?}else if (the_year.length == 3){
    ???? the_year = '2'+the_year;
    ?}else if (the_year.length == 0){
    ???? alert('請輸入“年-月-日”格式的正確時間!');
    ???? return false;
    ?}???
    ???
    ?if (the_month.length > 2){
    ???? alert('月份不能大于2位!');
    ???? return false;
    ?}else if (the_month.length == 1){
    ???? the_month = '0'+the_month;
    ?}else if (the_month.length ==0){
    ???? alert('請輸入由“-”分隔的正確的時間!');
    ???? return false;
    ?}?

    ?if (the_day.length > 2){
    ???? alert('日期不能大于2位!');
    ???? return false;
    ?}else if (the_day.length == 1){
    ???? the_day = '0'+the_day;
    ?}else if (the_day.length == 0){
    ???? alert('請輸入由“-”分隔的正確的時間!');
    ???? return false;
    ?}?

    ??? if ( the_year < mini_year){
    ??????? alert("年份不得小于 " + mini_year +"!");
    ??????? return false;
    ??? }
    ??? if (the_month < 01 || the_month > 12){
    ??????? alert("請輸入正確的月份!")
    ??????? return false;
    ??? }
    ??? if (the_day >31 || the_day < 01){
    ??????? alert("請輸入正確的日期!")
    ??????? return false;
    ???????
    ??? }else{
    ??????? switch(eval(the_month)) {
    ??????????? case 4:
    ??????????? case 6:
    ??????????? case 9:
    ??????????? case 11:
    ??????????????? if (the_day < 31){
    ??????????????????? the_date=the_year+'-'+the_month+'-'+the_day;
    ??????????????????? return the_date;
    ??????????????? }???
    ??????????????? break;
    ??????????? case 2:
    ??????????????? var num = Math.floor(the_year/4) * 4;
    ??????????????? if(the_year == num) {
    ??????????????????? if (the_day < 30){
    ??????????????????????? the_date=the_year+'-'+the_month+'-'+the_day;
    ??????????????????????? return the_date;
    ???????????????????? }??
    ??????????????? } else {
    ??????????????????? if (the_day < 29){
    ??????????????????????? the_date=the_year+'-'+the_month+'-'+the_day;
    ??????????????????????? return the_date;
    ??????????????????? }???
    ??????????????? }
    ??????????????? break;
    ??????????? default:
    ??????????????? if (the_day < 32){
    ??????????????????? the_date=the_year+'-'+the_month+'-'+the_day;
    ??????????????????? return the_date;
    ??????????????? }???
    ??????????????? break;
    ??????? }
    ??? }
    ??? alert("請輸入正確的日期!");
    ??? return false;
    ?
    }


    //--------------------------------------------------------------------
    //作用:校驗輸入項是否有指定的字符;
    //參數:charset:字符串;val:查找的字符;should_in:是否應該在串中
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------
    function CheckChar(charset, val, should_in)
    {
    ??? var num = val.length;
    ??? for (var i=0; i < num; i++) {
    ?????? var strchar = val.charAt(i);
    ?????? strchar = strchar.toUpperCase();
    ?????? if ((charset.indexOf(strchar) > -1) && (!should_in))
    ????????? return false;
    ?????? else if ((charset.indexOf(strchar) == -1) && (should_in))
    ????????? return false;
    ??? }
    ??? return true;
    }
    /***驗證是否為電子郵箱***/
    function validEmail(ele)
    {
    ??????? if(!isEmail(ele.value))
    ??????? {
    ??????????????? alert("用戶編號請輸入有效郵箱");
    ??????????????? ele.focus();
    ??????????????? return false;
    ??????? }
    ??????? return true;
    }
    /***判斷是否為郵箱***/
    function isEmail(str)
    {
    ??????? if(str.match(/[\w-.]+@{1}[\w-]+\.{1}\w{2,4}(\.{0,1}\w{2}){0,1}/ig)!=str)
    ??????????????? return false;
    ??????? else
    ??????????????? return true;
    }
    ?
    //--------------------------------------------------------------------
    //作用:校驗日期輸入項是否正確,不正確彈出提示;
    //用法:結合CSS中定義的num樣式,num樣式定義數字輸入項的樣式,在Form
    //????? 提交時(onsubmit)調用此函數
    //參數:無
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------

    function formValidation()
    {
    ?var formObj=window.event.srcElement;
    ?var len=formObj.elements.length;
    ?var i;
    ?var srcObj;
    ?
    ?for (i=0;i<len;i++)
    ?{
    ??srcObj=formObj.elements[i];?
    ??if (srcObj.tagName=="INPUT" && (srcObj.type=="text"||srcObj.type=="password") || srcObj.tagName=="SELECT")
    ??{
    ???switch (srcObj.className)
    ???{
    ????case 'must':
    ?????if (checkEmpty(srcObj)==false) return false;
    ?????break;
    ????case 'usermust':
    ????? if (checkEmpty(srcObj)==false) return false;
    ?????if (validEmail(srcObj)==false) return false;
    ?????break;
    ????case 'number-must':
    ?????if (checkEmpty(srcObj)==false) return false;
    ?????if (checkNaN(srcObj)==false) return false;
    ?????break;
    ????case 'date-must':
    ?????if (checkEmpty(srcObj)==false) return false;
    ?????if (checkDate(srcObj)==false) return false;
    ?????break;
    ????case 'number':
    ?????if (srcObj.value.length>0)
    ?????{
    ??????if (checkNaN(srcObj)==false) return false;
    ?????}
    ?????break;
    ????case 'date':
    ?????if (srcObj.value.length>0)
    ?????{
    ??????if (checkDate(srcObj)==false) return false;
    ?????}
    ?????break;
    ????case 'phone-must':
    ?????if (checkPhone(srcObj)==false) return false;
    ?????break;
    ????case 'phone':
    ?????if (srcObj.value.length>0)
    ?????{
    ??????if (checkPhone(srcObj)==false) return false;
    ?????}
    ?????break;
    ???}
    ??}
    ?}
    ?return true;
    }

    //--------------------------------------------------------------------
    //作用:校驗日期輸入項是否正確,不正確彈出提示;
    //用法:結合CSS中定義的num樣式,num樣式定義數字輸入項的樣式,在Form
    //????? 提交時(onsubmit)調用此函數
    //參數:無
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------

    function formValidationById(formId)
    {
    ?var formObj=document.getElementById(formId);
    //?alert("111:"+formObj);
    ?if (!formObj){
    ??formObj=document.forms[formId];
    //??alert(formObj.tagName)
    ?}
    //?alert("112:"+formObj);
    ?if (!formObj)?formObj=eval("document.all."+formId);
    //?alert("113:"+formObj);
    ?if (!formObj)?formObj=document.all.item(formId);
    //?alert("114:"+formObj);
    ?var len=formObj.elements.length;
    ?var i;
    ?var srcObj;
    ?
    ?for (i=0;i<len;i++)
    ?{
    ??srcObj=formObj.elements[i];?
    ??if (srcObj.tagName=="INPUT" && srcObj.type=="text" || srcObj.tagName=="SELECT")
    ??{
    ???switch (srcObj.className)
    ???{
    ????case 'must':
    ?????if (checkEmpty(srcObj)==false) return false;
    ?????break;
    ????case 'number-must':
    ?????if (checkEmpty(srcObj)==false) return false;
    ?????if (checkNaN(srcObj)==false) return false;
    ?????break;
    ????case 'date-must':
    ?????if (checkEmpty(srcObj)==false) return false;
    ?????if (checkDate(srcObj)==false) return false;
    ?????break;
    ????case 'number':
    ?????if (srcObj.value.length>0)
    ?????{
    ??????if (checkNaN(srcObj)==false) return false;
    ?????}
    ?????break;
    ????case 'date':
    ?????if (srcObj.value.length>0)
    ?????{
    ??????if (checkDate(srcObj)==false) return false;
    ?????}
    ?????break;
    ????case 'phone-must':
    ?????if (checkPhone(srcObj)==false) return false;
    ?????break;
    ????case 'phone':
    ?????if (srcObj.value.length>0)
    ?????{
    ??????if (checkPhone(srcObj)==false) return false;
    ?????}
    ?????break;
    ???}
    ??}
    ?}
    ?return true;
    }

    function readOnlyAll()
    {
    ?var loop=document.forms.length
    ?var Ele;
    ?for (var i=0;i<loop;i++)
    ?{
    ??for( var j=0;j<document.forms[i].elements.length;j++)
    ??{
    ???Ele=document.forms[i].elements[j];
    ???switch(Ele.tagName)
    ???{
    ????case 'INPUT':
    ?????if ((Ele.type=="button" || Ele.type=="submit" ||Ele.type=="reset") && Ele.className!='SHOWALWAYS' ){
    ??????Ele.className="off";
    ??????Ele.disabled=true;
    ?????}
    ?????else
    ?????{
    ??????if(Ele.type=="radio" || Ele.type=="checkbox")?Ele.disabled=true;
    ??????else?Ele.readOnly=true;
    ?????}
    ?????break;
    ?????
    ????case 'SELECT':
    ?????Ele.className="off";
    ?????Ele.insertAdjacentText('beforeBegin',Ele.value);
    ?????break;
    ?????
    ????case 'TEXTAREA':
    ?????Ele.readOnly=true;
    ?????break;
    ???}
    ??}
    ?}
    }

    ?

    var refString="must,number,date,phone,number-must,date-must,phone-must";
    function hideCheck(padObj)
    {
    ?if (padObj){
    ??if (padObj.tagName=='DIV'){
    ???var len=padObj.all.length;
    ???for(var i=0;i<len;i++){
    ????var item=padObj.all.item(i);
    ????if (refString.search(item.className.toLowerCase())>-1){
    ?????item.className="hidden-"+item.className;
    ????}
    ???}
    ??}
    ?}
    }

    function showCheck(padObj)
    {
    ?if (padObj){
    ??if (padObj.tagName=='DIV'){
    ???var len=padObj.all.length;
    ???for(var i=0;i<len;i++){
    ????var item=padObj.all.item(i);
    //????alert(item.className.search("hidden-")+":::"+item.className.slice(7));
    ????if (item.className.search("hidden-")> -1) item.className=item.className.slice(7);
    ???}
    ??}
    ?}
    }
    //--------------------------------------------------------------------
    //作用:以下4個函數是數值型變量的小數位處理函數,分別為:
    //?fixNumber:?四舍五入;
    //?greaterNumber:?取大值;
    //?lessNumber:?取小值;
    //?halfFixNumber:?先四舍五入,結果最后一位不足5按5計算,最后一位大于五進位;
    //用法:fixNumber(0.626,2)=0.63?fixNumber(0.23,1)=0.2
    //?greaterNumber(0.626,2)=0.63?greaterNumber(0.23,1)=0.3
    //?lessNumber(0.626,2)=0.62?lessNumber(0.23,1)=0.2
    //?halfFixNumber(0.626,2)=0.65?halfFixNumber(0.23,1)=0.5
    //參數:orgNumber:原始數值,可以為字符或數字型;
    //?fractions:返回的小數位數;
    //返回值:字符串
    //作者:耿戰
    //日起:2002-04-16
    //--------------------------------------------------------------------
    function fixNumber(orgNumber,fractions)
    {
    ?if (isNaN(orgNumber)) return 'NaN';
    ?
    ?var?tempValue=parseFloat(orgNumber);
    ?var rtValue=tempValue.toFixed(parseInt(fractions));?
    ?return rtValue;
    }
    function greaterNumber(orgNumber,fractions)
    {
    ?if (isNaN(orgNumber)) return 'NaN';
    ?
    ?var?tempValue=parseFloat(orgNumber);
    ?var rtValue=tempValue.toFixed(parseInt(fractions));
    ?if (parseFloat(rtValue)<tempValue){
    ??rtValue=((parseFloat(rtValue)*Math.pow(10,parseInt(fractions))+1)/Math.pow(10,parseInt(fractions))).toFixed(parseInt(fractions));
    ?}?
    ?return rtValue;
    }
    function lessNumber(orgNumber,fractions)
    {
    ?if (isNaN(orgNumber)) return 'NaN';
    ?
    ?var?tempValue=parseFloat(orgNumber);
    ?var rtValue=tempValue.toFixed(parseInt(fractions));
    ?if (parseFloat(rtValue)>tempValue){
    ??rtValue=((parseFloat(rtValue)*Math.pow(10,parseInt(fractions))-1)/Math.pow(10,parseInt(fractions))).toFixed(parseInt(fractions));
    ?}?
    ?return rtValue;
    }
    function halfFixNumber(orgNumber,fractions)
    {
    ?if (isNaN(orgNumber)) return 'NaN';
    ?
    ?var?tempValue=parseFloat(orgNumber);
    ?var rtValue=tempValue.toFixed(parseInt(fractions));
    ?if (parseInt(rtValue.substr(rtValue.length-1,1))<5 && parseInt(rtValue.substr(rtValue.length-1,1))>0){
    ??rtValue=rtValue.substr(0,rtValue.length-1)+'5';?
    ?}
    ?if (parseInt(rtValue.substr(rtValue.length-1,1))>5 && parseInt(rtValue.substr(rtValue.length-1,1))<=9){
    ??rtValue=greaterNumber(rtValue,parseInt(fractions)-1)+'0';?
    ?}
    ?return rtValue;
    }

    function find()
    {?var objTableLeft=document.getElementById('item_list');
    ?var Rows=objTableLeft.rows.length;
    ?var intSelectNum = 0;
    ??
    ?for( var i=2;i<Rows;i++)
    ?{
    ??if(objTableLeft.rows[i].cells[0].children[0].checked)
    ??{
    ???intSelectNum++;
    ???strProject_ID = objTableLeft.rows[i].cells[0].children[0].value;
    ???break;
    ??}?
    ?}
    ?return intSelectNum;?
    //?if(intSelectNum!=1){
    //??return false;
    //?}else return true;
    }

    function checkAll(){
    ?var nn=document.forms[0].elements.length;
    ?
    ?for(var i=0;i<nn;i++){
    ??var v=document.forms[0].elements[i].name;
    ??if(v=="del_uid"){
    ???document.forms[0].elements[i].checked=true;
    ??}
    ?}
    }

    function unCheckAll(){
    ?var nn=document.forms[0].elements.length;
    ?for(var i=0;i<nn;i++){
    ??var v=document.forms[0].elements[i].name;
    ??if(v=="del_uid"){
    ???document.forms[0].elements[i].checked=false;
    ??}
    ?}
    }

    //--------------------------------------------------------------------
    //????????????
    //changed by an 2005-06-17
    //--------------------------------------------------------------------
    function PopupCalendar(InstanceName)
    {
    ?///Global Tag
    ?this.instanceName=InstanceName;
    ?///Properties
    ?this.separator="-"
    ?this.oBtnTodayTitle="Today"
    ?this.oBtnCancelTitle="Cancel"
    ?this.weekDaySting=new Array("S","M","T","W","T","F","S");
    ?this.monthSting=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
    ?this.Width=200;
    ?this.currDate=new Date();
    ?this.today=new Date();
    ?this.startYear=1970;
    ?this.endYear=2020;
    ?///Css
    ?this.divBorderCss="1px solid #BCD0DE";
    ?this.tableBorderColor="#CCCCCC"
    ?///Method
    ?this.Init=CalendarInit;
    ?this.Fill=CalendarFill;
    ?this.Refresh=CalendarRefresh;
    ?this.Restore=CalendarRestore;
    ?///HTMLObject
    ?this.oTaget=null;
    ?this.oPreviousCell=null;
    ?this.sDIVID=InstanceName+"oDiv";
    ?this.sTABLEID=InstanceName+"oTable";
    ?this.sMONTHID=InstanceName+"oMonth";
    ?this.sYEARID=InstanceName+"oYear";
    ?
    }
    function CalendarInit()????///Create panel
    {
    ?var sMonth,sYear
    ?sMonth=this.currDate.getMonth();
    ?sYear=this.currDate.getYear();
    ?htmlAll="<div id='"+this.sDIVID+"' style='display:none;position:absolute;width:130;border:"+this.divBorderCss+";padding:1px;background-color:#FFFFFF;z-index:100';>";
    ?//htmlAll+="<div align='center'>";
    ?/// Month
    ?htmloMonth="<select id='"+this.sMONTHID+"' onchange=CalendarMonthChange("+this.instanceName+") style='width:50%;background-color:#D0F5FF;'>";
    ?for(i=0;i<12;i++)
    ?{???
    ??htmloMonth+="<option value='"+i+"'>"+this.monthSting[i]+"</option>";
    ?}
    ?htmloMonth+="</select>";
    ?/// Year
    ?htmloYear="<select id='"+this.sYEARID+"' onchange=CalendarYearChange("+this.instanceName+") style='width:50%;background-color:#D0F5FF;'>";
    ?for(i=this.startYear;i<=this.endYear;i++)
    ?{
    ??htmloYear+="<option value='"+i+"'>"+i+"</option>";
    ?}
    ?htmloYear+="</select>";
    ?/// Day
    ?htmloDayTable="<table id='"+this.sTABLEID+"' width='130' border=0 cellpadding=0 cellspacing=1 bgcolor='"+this.tableBorderColor+"'>";
    ?htmloDayTable+="<tbody bgcolor='#ffffff'style='font-size:10px;'>";
    ?for(i=0;i<=6;i++)
    ?{
    ??if(i==0)
    ???htmloDayTable+="<tr bgcolor='#98B8CD'>";
    ??else
    ???htmloDayTable+="<tr>";
    ??for(j=0;j<7;j++)
    ??{

    ???if(i==0)
    ???{
    ????htmloDayTable+="<td height='14' align='center' valign='middle' style='cursor:hand;font-size:12px;'>";
    ????htmloDayTable+=this.weekDaySting[j]+"</td>"
    ???}
    ???else
    ???{
    ????htmloDayTable+="<td height='14' align='center' valign='middle' style='cursor:hand;font-size:12px;'";
    ????htmloDayTable+=" onmouseover=CalendarCellsMsOver("+this.instanceName+")";
    ????htmloDayTable+=" onmouseout=CalendarCellsMsOut("+this.instanceName+")";
    ????htmloDayTable+=" onclick=CalendarCellsClick(this,"+this.instanceName+")>";
    ????htmloDayTable+="&nbsp;</td>"
    ???}
    ??}
    ??htmloDayTable+="</tr>";?
    ?}
    ?htmloDayTable+="</tbody></table>";
    ?/// Today Button
    ?htmloButton="<div align='center' style='padding:1px'>"
    ?htmloButton+="<button style='width:40px;height:16px;border:1px solid #BCD0DE;background-color:#eeeeee;cursor:hand;font-size:12px;'"
    ?htmloButton+=" onclick=CalendarTodayClick("+this.instanceName+")>"+this.oBtnTodayTitle+"</button>&nbsp;"
    ?htmloButton+="<button style='width:40px;height:16px;border:1px solid #BCD0DE;background-color:#eeeeee;cursor:hand;font-size:12px;'"
    ?htmloButton+=" onclick=CalendarCancel("+this.instanceName+")>"+this.oBtnCancelTitle+"</button> "
    ?htmloButton+="</div>"
    ?/// All
    ?htmlAll=htmlAll+htmloYear+htmloMonth+htmloDayTable+htmloButton+"</div>";
    ?document.write(htmlAll);
    ?this.Fill();?
    }
    function CalendarFill()???///
    {
    ?var sMonth,sYear,sWeekDay,sToday,oTable,currRow,MaxDay,sDaySn,sIndex,rowIndex,cellIndex,oSelectMonth,oSelectYear
    ?sMonth=this.currDate.getMonth();
    ?sYear=this.currDate.getYear();
    ?sWeekDay=(new Date(sYear,sMonth,1)).getDay();
    ?sToday=this.currDate.getDate();
    ?oTable=document.all[this.sTABLEID];
    ?currRow=oTable.rows[1];
    ?MaxDay=CalendarGetMaxDay(sYear,sMonth);
    ?
    ?oSelectMonth=document.all[this.sMONTHID]
    ?oSelectMonth.selectedIndex=sMonth;
    ?oSelectYear=document.all[this.sYEARID]
    ?for(i=0;i<oSelectYear.length;i++)
    ?{
    ??if(parseInt(oSelectYear.options[i].value)==sYear)oSelectYear.selectedIndex=i;
    ?}
    ?////
    ?for(sDaySn=1,sIndex=sWeekDay;sIndex<=6;sDaySn++,sIndex++)
    ?{

    ??if(sDaySn==sToday)
    ??{
    ???currRow.cells[sIndex].innerHTML="<font color=red><i><b>"+sDaySn+"</b></i></font>";
    ???this.oPreviousCell=currRow.cells[sIndex];
    ??}
    ??else
    ??{
    ???currRow.cells[sIndex].innerHTML=sDaySn;
    ???currRow.cells[sIndex].style.color="#666666";?
    ??}
    ??CalendarCellSetCss(0,currRow.cells[sIndex]);
    ?}
    ?for(rowIndex=2;rowIndex<=6;rowIndex++)
    ?{
    ??if(sDaySn>MaxDay)break;
    ??currRow=oTable.rows[rowIndex];
    ??for(cellIndex=0;cellIndex<currRow.cells.length;cellIndex++)
    ??{
    ???if(sDaySn==sToday)
    ???{
    ????currRow.cells[cellIndex].innerHTML="<font color=red><i><b>"+sDaySn+"</b></i></font>";
    ????this.oPreviousCell=currRow.cells[cellIndex];
    ???}
    ???else
    ???{
    ????currRow.cells[cellIndex].innerHTML=sDaySn;?
    ????currRow.cells[cellIndex].style.color="#666666";?
    ???}
    ???CalendarCellSetCss(0,currRow.cells[cellIndex]);
    ???sDaySn++;
    ???if(sDaySn>MaxDay)break;?
    ??}
    ?}
    }
    function CalendarRestore()?????/// Clear Data
    {?
    ?var oTable
    ?oTable=document.all[this.sTABLEID]
    ?for(i=1;i<oTable.rows.length;i++)
    ?{
    ??for(j=0;j<oTable.rows[i].cells.length;j++)
    ??{
    ???CalendarCellSetCss(0,oTable.rows[i].cells[j]);
    ???oTable.rows[i].cells[j].innerHTML="&nbsp;";
    ??}
    ?}?
    }
    function CalendarRefresh(newDate)?????///
    {
    ?this.currDate=newDate;
    ?this.Restore();?
    ?this.Fill();?
    }
    function CalendarCellsMsOver(oInstance)????/// Cell MouseOver
    {
    ?var myCell
    ?myCell=event.srcElement;
    ?CalendarCellSetCss(0,oInstance.oPreviousCell);
    ?if(myCell)
    ?{
    ??CalendarCellSetCss(1,myCell);
    ??oInstance.oPreviousCell=myCell;
    ?}
    }
    function CalendarCellsMsOut(oInstance)????////// Cell MouseOut
    {
    ?var myCell
    ?myCell=event.srcElement;
    ?CalendarCellSetCss(0,myCell);?
    }
    function CalendarCellsClick(oCell,oInstance)
    {
    ?var sDay,sMonth,sYear,newDate
    ?sYear=oInstance.currDate.getFullYear();
    ?sMonth=oInstance.currDate.getMonth();
    ?sDay=oInstance.currDate.getDate();
    ?if(oCell.innerText!=" ")
    ?{
    ??sDay=parseInt(oCell.innerText);
    ??if(sDay!=oInstance.currDate.getDate())
    ??{
    ???newDate=new Date(sYear,sMonth,sDay);
    ???oInstance.Refresh(newDate);
    ??}
    ?}
    ?sDateString=sYear+oInstance.separator+CalendarDblNum(sMonth+1)+oInstance.separator+CalendarDblNum(sDay);??///return sDateString
    ?if(oInstance.oTaget.tagName=="INPUT")
    ?{
    ??oInstance.oTaget.value=sDateString;
    ?}
    ?document.all[oInstance.sDIVID].style.display="none";??
    }
    function CalendarYearChange(oInstance)????/// Year Change
    {
    ?var sDay,sMonth,sYear,newDate
    ?sDay=oInstance.currDate.getDate();
    ?sMonth=oInstance.currDate.getMonth();
    ?sYear=document.all[oInstance.sYEARID].value
    ?newDate=new Date(sYear,sMonth,sDay);
    ?oInstance.Refresh(newDate);
    }
    function CalendarMonthChange(oInstance)????/// Month Change
    {
    ?var sDay,sMonth,sYear,newDate
    ?sDay=oInstance.currDate.getDate();
    ?sMonth=document.all[oInstance.sMONTHID].value
    ?sYear=oInstance.currDate.getYear();
    ?newDate=new Date(sYear,sMonth,sDay);
    ?oInstance.Refresh(newDate);?
    }
    function CalendarTodayClick(oInstance)????/// "Today" button Change
    {?
    ?oInstance.Refresh(new Date());??
    }
    function getDateString(oInputSrc,oInstance)
    {
    ?if(oInputSrc&&oInstance)
    ?{
    ??CalendarDiv=document.all[oInstance.sDIVID];
    ??oInstance.oTaget=oInputSrc;
    ??CalendarDiv.style.pixelLeft=CalendargetPos(oInputSrc,"Left")-134+oInputSrc.offsetWidth;
    ??CalendarDiv.style.pixelTop=CalendargetPos(oInputSrc,"Top")+oInputSrc.offsetHeight;
    ??CalendarDiv.style.display=(CalendarDiv.style.display=="none")?"":"none";
    ?}?
    }
    function CalendarCellSetCss(sMode,oCell)???/// Set Cell Css
    {
    ?// sMode
    ?// 0: OnMouserOut 1: OnMouseOver
    ?if(sMode)
    ?{
    ??oCell.style.border="1px solid #5589AA";
    ??oCell.style.backgroundColor="#BCD0DE";
    ?}
    ?else
    ?{
    ??oCell.style.border="1px solid #FFFFFF";
    ??oCell.style.backgroundColor="#FFFFFF";
    ?}?
    }
    function CalendarGetMaxDay(nowYear,nowMonth)???/// Get MaxDay of current month
    {
    ?var nextMonth,nextYear,currDate,nextDate,theMaxDay
    ?nextMonth=nowMonth+1;
    ?if(nextMonth>11)
    ?{
    ??nextYear=nowYear+1;
    ??nextMonth=0;
    ?}
    ?else?
    ?{
    ??nextYear=nowYear;?
    ?}
    ?currDate=new Date(nowYear,nowMonth,1);
    ?nextDate=new Date(nextYear,nextMonth,1);
    ?theMaxDay=(nextDate-currDate)/(24*60*60*1000);
    ?return theMaxDay;
    }
    function CalendargetPos(el,ePro)????/// Get Absolute Position
    {
    ?var ePos=0;
    ?while(el!=null)
    ?{??
    ??ePos+=el["offset"+ePro];
    ??el=el.offsetParent;
    ?}
    ?return ePos;
    }
    function CalendarDblNum(num)
    {
    ?if(num<10)
    ??return "0"+num;
    ?else
    ??return num;
    }
    function CalendarCancel(oInstance)???///Cancel
    {
    ?CalendarDiv=document.all[oInstance.sDIVID];
    ?CalendarDiv.style.display="none";??
    }
    //?????
    ? function tyse()
    ? {?
    ? var A_checked = window.document.queryFrm.typeselectA.checked;
    ? var B_checked = window.document.queryFrm.typeselectB.checked;
    ? var C_checked = window.document.queryFrm.typeselectC.checked;
    ? var D_checked = window.document.queryFrm.typeselectD.checked;?
    ? var E_checked = window.document.queryFrm.typeselectE.checked;
    ? var F_checked = window.document.queryFrm.typeselectF.checked;
    ? var G_checked = window.document.queryFrm.typeselectG.checked;
    ? var H_checked = window.document.queryFrm.typeselectH.checked;
    ? var I_checked = window.document.queryFrm.typeselectI.checked;
    ? var J_checked = window.document.queryFrm.typeselectJ.checked;
    ? var K_checked = window.document.queryFrm.typeselectK.checked;
    ? var N_checked = window.document.queryFrm.typeselectN.checked;?
    ? var P_checked = window.document.queryFrm.typeselectP.checked;
    ? var Q_checked = window.document.queryFrm.typeselectQ.checked;
    ? var R_checked = window.document.queryFrm.typeselectR.checked;
    ? var S_checked = window.document.queryFrm.typeselectS.checked;?
    ? var U_checked = window.document.queryFrm.typeselectU.checked;
    ? var V_checked = window.document.queryFrm.typeselectV.checked;
    ? var X_checked = window.document.queryFrm.typeselectX.checked;
    ? var Z_checked = window.document.queryFrm.typeselectZ.checked;???
    ? var num1_checked = window.document.queryFrm.typeselect01.checked;
    ? var num2_checked = window.document.queryFrm.typeselect02.checked;
    ? var num3_checked = window.document.queryFrm.typeselect03.checked;
    ? var num4_checked = window.document.queryFrm.typeselect04.checked;?
    ? var num5_checked = window.document.queryFrm.typeselect05.checked;
    ? var num6_checked = window.document.queryFrm.typeselect06.checked;
    ? var num7_checked = window.document.queryFrm.typeselect07.checked;
    ? var TB_checked = window.document.queryFrm.typeselectTB.checked;
    ? var TE_checked = window.document.queryFrm.typeselectTE.checked;
    ? var TD_checked = window.document.queryFrm.typeselectTD.checked;
    ? var TF_checked = window.document.queryFrm.typeselectTF.checked;
    ? var TH_checked = window.document.queryFrm.typeselectTH.checked;?
    ? var TJ_checked = window.document.queryFrm.typeselectTJ.checked;
    ? var TK_checked = window.document.queryFrm.typeselectTK.checked;
    ? var TL_checked = window.document.queryFrm.typeselectTL.checked;
    ? var TM_checked = window.document.queryFrm.typeselectTM.checked;?
    ? var TX_checked = window.document.queryFrm.typeselectTX.checked;
    ? var TP_checked = window.document.queryFrm.typeselectTP.checked;
    ? var TQ_checked = window.document.queryFrm.typeselectTQ.checked;
    ? var TS_checked = window.document.queryFrm.typeselectTS.checked;
    ? var TU_checked = window.document.queryFrm.typeselectTU.checked;???
    ? var TV_checked = window.document.queryFrm.typeselectTV.checked;???????????????????????
    ? if(A_checked==true)
    ? { A=",'A'";}
    ? else
    ? {A="";}
    ? if(B_checked==true)
    ? {B=",'B'"; }
    ? else
    ? {B="";}
    ? if(C_checked==true)
    ? {C=",'C'"; }
    ? else
    ? {C="";}
    ? if(D_checked==true)
    ? { D=",'D'";}
    ? else
    ? {D="";}
    ? if(E_checked==true)
    ? { E=",'E'";}
    ? else
    ? {E="";}
    ? if(F_checked==true)
    ? {F=",'F'"; }
    ? else
    ? {F="";}
    ? if(G_checked==true)
    ? {G=",'G'"; }
    ? else
    ? {G="";}
    ? if(H_checked==true)
    ? { H=",'H'";}
    ? else
    ? {H="";}
    ? if(I_checked==true)
    ? { I=",'I'";}
    ? else
    ? {I="";}
    ? if(J_checked==true)
    ? {J=",'J'"; }
    ? else
    ? {J="";}
    ? if(K_checked==true)
    ? {K=",'K'"; }
    ? else
    ? {K="";}
    ? if(N_checked==true)
    ? { N=",'N'";}
    ? else
    ? {N="";}
    ? if(P_checked==true)
    ? { P=",'P'";}
    ? else
    ? {P="";}
    ? if(Q_checked==true)
    ? {Q=",'Q'"; }
    ? else
    ? {Q="";}
    ? if(R_checked==true)
    ? {R=",'R'"; }
    ? else
    ? {R="";}
    ? if(S_checked==true)
    ? { S=",'S'";}
    ? else
    ? {S="";}?
    ?if(U_checked==true)
    ? { U=",'U'";}
    ? else
    ? {U="";}
    ? if(V_checked==true)
    ? {V=",'V'"; }
    ? else
    ? {V="";}
    ? if(X_checked==true)
    ? {X=",'X'"; }
    ? else
    ? {X="";}
    ? if(Z_checked==true)
    ? { Z=",'Z'";}
    ? else
    ? {Z="";}
    ?
    ?
    ? if(num1_checked==true)
    ? { num1=",'01'";}
    ? else


    ? {num1="";}
    ? if(num2_checked==true)
    ? {num2=",'02'"; }
    ? else
    ? {num2="";}
    ? if(num3_checked==true)
    ? {num3=",'03'"; }
    ? else
    ? {num3="";}
    ? if(num4_checked==true)
    ? { num4=",'04'";}
    ? else
    ? {num4="";}
    ? if(num5_checked==true)
    ? { num5=",'05'";}
    ? else
    ? {num5="";}
    ? if(num6_checked==true)
    ? {num6=",'06'"; }
    ? else
    ? {num6="";}
    ? if(num7_checked==true)
    ? {num7=",'07'"; }
    ? else
    ? {num7="";}
    ? if(TB_checked==true)
    ? { TB=",'TB'";}
    ? else
    ? {TB="";}
    ? if(TE_checked==true)
    ? { TE=",'TE'";}
    ? else
    ? {TE="";}
    ? if(TD_checked==true)
    ? {TD=",'TD'"; }
    ? else
    ? {TD="";}
    ? if(TF_checked==true)
    ? {TF=",'TF'"; }
    ? else
    ? {TF="";}
    ? if(TH_checked==true)
    ? { TH=",'TH'";}
    ? else
    ? {TH="";}
    ? if(TJ_checked==true)
    ? { TJ=",'TJ'";}
    ? else
    ? {TJ="";}
    ? if(TK_checked==true)
    ? {TK=",'TK'"; }
    ? else
    ? {TK="";}
    ? if(TL_checked==true)
    ? {TL=",'TL'"; }
    ? else
    ? {TL="";}
    ? if(TM_checked==true)
    ? { TM=",'TM'";}
    ? else
    ? {TM="";}?
    ?if(TX_checked==true)
    ? { TX=",'TX'";}
    ? else
    ? {TX="";}
    ? if(TP_checked==true)
    ? {TP=",'TP'"; }
    ? else
    ? {TP="";}
    ? if(TQ_checked==true)
    ? {TQ=",'TQ'"; }
    ? else
    ? {TQ="";}
    ? if(TS_checked==true)
    ? { TS=",'TS'";}
    ? else
    ? {TS="";}
    ? if(TU_checked==true)
    ? { TU=",'TU'";}
    ? else
    ? {TU="";}
    ? if(TV_checked==true)
    ? { TV=",'TV'";}
    ? else
    ? {TV="";}??????????????????????
    ? document.queryFrm.typetxt.value="''"+A+B+C+D+E+F+G+H+I+J+K+N+P+Q+R+S+U+V+X+Z+num1+num2+num3+num4+num5+num6+num7+TB+TE+TD+TF+TH+TJ+TK+TL+TM+TX+TP+TQ+TS+TU+TV;
    ? queryFrm.submit();
    ? }

    //-->

    posted @ 2006-08-17 14:44 一張白紙 閱讀(1520) | 評論 (0)編輯 收藏

    2006年8月16日 #

    transaction_cat_list_page_display_3.jsp

    <%@ page contentType="text/html; charset=GB2312" %>
    <%@ page import="com.silence.market.*"%>
    <%@include file="../common/public.jsp"%>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script type="text/javascript" src="../../../p_emarket/WebModule1/js/validation.js"></script>
    <link href="../../../p_emarket/WebModule1/css/book.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .style4 {color: #666666}
    -->
    </style>
    </head>
    <body leftmargin="0" topmargin="0">
    <%
    try {
    ?request.setCharacterEncoding("GBK");
    ?String sFileName = "transaction_cat_list_page_display_2.jsp";
    ? int intPerPageNum = request.getParameter("sPerPage")==null?25:Integer.parseInt(request.getParameter("sPerPage"));
    ? int intPageNo = request.getParameter("sPageNo")==null?1:Integer.parseInt(request.getParameter("sPageNo"));
    ? int nRows = 0;
    ? int nPages = 0;
    ? String sPageNo = String.valueOf(intPageNo);
    ? String sPerPage = String.valueOf(intPerPageNum);
    ? String strCondition = " (s_cat_grade='3' or s_cat_grade='2' )";?
    ?
    ? //查詢條件con_cat_id
    ? String conType = request.getParameter("con_type")==null?"":request.getParameter("con_type");
    ? String conCatID = request.getParameter("con_cat_id")==null?"":request.getParameter("con_cat_id");
    ? int grade = request.getParameter("con_cat_grade")==null?2:Integer.parseInt(request.getParameter("con_cat_grade"));

    ?
    ? TransactionCatManager tempManager = new TransactionCatManager();
    ??? TransactionCat[] temps = tempManager.getAllTransactionCat("",strCondition,"", intPageNo, intPerPageNum);
    ?nRows = tempManager.getRows();
    ?nPages = (nRows - 1 + Integer.parseInt(sPerPage))/Integer.parseInt(sPerPage);
    ?int pageCount = nPages;
    ??? TransactionCat temp = new TransactionCat();
    %>
    <form method="post" name="queryFrm" action=<%=sFileName%>>
    ? <div align="center">
    ??? <table border=0 cellpadding=0 cellspacing=1 align="left" width="95%">
    ????? <tr>
    ??????? <td colspan="7" align="center" valign="top">
    ??<table width="95%" height="32"? border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FBF9F5">
    ??????????? <tr>
    ????????????? <td width="11%"><img src="../../../p_emarket/WebModule1/images/01-1.gif" width="75" height="32"></td>
    ????????????? <td width="79%" height="32" align="left" valign="middle" background="../../../p_emarket/WebModule1/images?牨晥∽∣???C?g??8?8??????栠敲??????慴杲瑥弽汢湡????????牨晥∽∣9????8?8/01-3.gif" class="clsHLine"><span class="clsNav style4">您當前的位置&gt;&gt;商品管理&gt;&gt;商品列表</span>
    ????????????? <td width="10%" align="right" valign="bottom"><img src="../../../p_emarket/WebModule1/images/01-32.gif" width="43" height="32">
    ????????? </table>
    ????????? <table width="100%"? border="0" cellspacing="0" cellpadding="0">
    ??????????? <tr>
    ????????????? <td height="10"></td>
    ??????????? </tr>
    ????????? </table>
    ?? </td>
    ????? </tr>
    ????? <tr> <td>
    ??<table border=0 cellpadding=0 cellspacing=3 class="clsBgColor2" align="center" width="95%">
    ??????????? <%
    ??? String catid="";
    ??? for(int index=0;index<temps.length;index++){
    ????? temp=temps[index];
    ????? if(temp.getCatGrade().equals(String.valueOf(grade))&&temp.getCatID().equals(conCatID))
    ?? {????
    ????? catid=conCatID;
    ?? /////////////二級產品目錄?
    ??? %>
    ??????? <tr class="clsTblDtl1">
    ????? <td><A href="transaction_list_page_display.jsp?con_type=<%=conType%>&con_cat_id=<%=temp.getCatID()%>"><%=temp.getCatName()%></A></td>
    ??</tr>
    ??<tr><td>------</td></tr>
    ??<tr>
    ?? <%
    ?? int count=0;
    ??/////////////三級產品目錄???
    ??for(int i=0;i<temps.length;i++)
    ??{
    ??? temp=temps[i];
    ??? if(temp.getCatGrade().equals(String.valueOf(grade+1))&&temp.getCatParentID().equals(catid))
    ??? {
    ???
    ?? %>
    ????? <td><A href="transaction_list_page_display.jsp?con_type=<%=conType%>&con_cat_id=<%=temp.getCatID()%>"><%=temp.getCatName()%></A></td> <td><%if(temp.getCatDiscribetion()!=null){%>(<%=temp.getCatDiscribetion()%>)<%}%></td>
    ????? <td>||</td>
    ????? <% count++;
    ????? if(count<5)
    ????? continue;
    ?????else{
    ??????? count=0;
    ??????? %>
    ??????? </tr><tr>
    ??????? <%}??
    ??? }??
    ??? }?
    ??????
    ??}%>
    ????</tr>
    ??
    ??
    ??? <%}%>
    ?
    ????????????? <td colspan=20 valign="top" class="clsBgColor1">
    ?????? <input type="hidden" name="con_cat_id" value="<%=conCatID%>"></input>
    ????<input type="hidden" name="con_type" value="<%=conType%>"></input>
    ??????????????? <%@include file="../common/page_deal.jsp"%>
    ????????????? </td>
    ??????????? </tr>
    ????????? </table>
    ??? </td>
    ??? </tr>
    ??? </table>
    ?
    ?
    ?<br><br><br><br><br>
    ? </div>
    </form>
    </body>
    </html>
    <%
    } catch(Exception e){
    ?String strErr = e.getMessage();
    ?onError(request,response,strErr,"","window.close();");
    ?e.printStackTrace();
    }
    %>

    posted @ 2006-08-16 16:29 一張白紙 閱讀(232) | 評論 (0)編輯 收藏

    transaction_list_page_display.jsp

    <%@ page contentType="text/html; charset=GB2312" %>
    <%@ page import="com.silence.market.*"%>
    <%@include file="../common/public.jsp"%>
    <html>
    <head>
    <title>商品信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script type="text/javascript" src="../js/validation.js"></script>
    <link href="../css/book.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {? //reloads the window if Nav4 resized
    ? if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    ??? document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    ? else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    </head>
    <script language="javascript">
    function del_project()
    {
    ?if(find()>=1)
    ?{
    ??if(confirm("確實要刪除選中項嗎?"))
    ??{
    ???document.queryFrm.action="transaction_control.jsp?actiontype=del&id=ok";
    ???document.queryFrm.submit();
    ??}else{
    ???return;
    ??}
    ?} else {
    ??alert("只有選擇至少一項,才能進行操作");
    ??return;
    ?}
    }

    ? //檢查是否為任意數(實數)?
    ?? function? isNumeric(strNumber)? {?
    ????? var? newPar=/^(-? |\+)?\d+(\.\d+)?$/?
    ????? return? newPar.test(strNumber);?
    ???? }?
    ?? //檢查是否為正數?
    ?? function? isUnsignedNumeric(strNumber)? {?
    ????? var? newPar=/^\d+(\.\d+)?$/?
    ????? return? newPar.test(strNumber);?
    ???? }?
    ?? //檢查是否為整數?
    ?? function? isInteger(strInteger)? {?
    ????? var? newPar=/^(-? |\+)?\d+$/?
    ????? return? newPar.test(strInteger);?
    ???? }?
    ?? //檢查是否為正整數?
    ?? function? isUnsignedInteger(strInteger)? {?
    ?????????????????????? var? newPar=/^\d+$/?
    ?????????????????????? return? newPar.test(strInteger);?
    ?????????????????????? }?


    </script>
    <body leftmargin="0" topmargin="0">

    <table width="100%"? border="0" cellspacing="0" cellpadding="0">
    ? <tr>
    ??? <td><img src="../images/bid_title.jpg.jpg" width="1024" height="100"></td>
    ? </tr>
    </table>
    <%
    try {
    ?request.setCharacterEncoding("GBK");
    ?String sFileName = "transaction_list_page_display.jsp";
    ?int intPerPageNum = request.getParameter("sPerPage")==null?10:Integer.parseInt(request.getParameter("sPerPage"));
    ?int intPageNo = request.getParameter("sPageNo")==null?1:Integer.parseInt(request.getParameter("sPageNo"));
    ?int nRows = 0;
    ?int nPages = 0;
    ?String sPageNo = String.valueOf(intPageNo);
    ?String sPerPage = String.valueOf(intPerPageNum);
    ?String strCondition = " 1 = 1 and s_status = '0' ";
    //按查詢條件查詢
    ??? //類別
    ?String conType = request.getParameter("con_type")==null?"":request.getParameter("con_type");
    ?if(!conType.equals("")){
    ??strCondition = strCondition + " and s_transaction_type = '" + conType + "' ";
    ?}
    ?//標題
    ?String conTitle = request.getParameter("con_title")==null?"":request.getParameter("con_title");
    ?if(!conTitle.equals("")){
    ??strCondition = strCondition + " and s_transaction_title like '%" + conTitle + "%' ";
    ?}
    ?//發布人
    ?String conArtID = request.getParameter("con_art_id")==null?"":request.getParameter("con_art_id");
    ?if(!conArtID.equals("")){
    ??strCondition = strCondition + " and s_art_id = '" + conArtID + "' ";
    ?}
    ?//產品目錄
    ?String conCatID = request.getParameter("con_cat_id")==null?"":request.getParameter("con_cat_id");
    ?if(!conCatID.equals("")){
    ??strCondition = strCondition + " and s_cat_id like '%" + conCatID + "%' ";
    ?}
    ?//日期
    ?String conTimeIssue = request.getParameter("con_time_issue")==null?"":request.getParameter("con_time_issue");
    ?if(!conTimeIssue.equals("")){
    ??strCondition = strCondition + " and d_time_issue = '" + conTimeIssue + "' ";
    ?}
    ?//最低價格
    ?int conPriceMin = request.getParameter("con_price_min")==null?0:Integer.parseInt(request.getParameter("con_price_min"));
    ?if(conPriceMin!=0){
    ??strCondition = strCondition + " and n_price_min >= " + conPriceMin + " ";
    ?}
    ?//最高價格
    ?int conPriceMax = request.getParameter("con_price_max")==null?0:Integer.parseInt(request.getParameter("con_price_max"));
    ?if(conPriceMax!=0){
    ??strCondition = strCondition + " and n_price_max <= " + conPriceMax + " ";
    ?}
    ?
    //查詢結果放在類對象里面
    ?TransactionManager tempManager = new TransactionManager();
    ??? Transaction[] temps = tempManager.getAllTransaction("",strCondition," order by n_uid desc ", intPageNo, intPerPageNum);
    ?nRows = tempManager.getRows();
    ?nPages = (nRows - 1 + Integer.parseInt(sPerPage))/Integer.parseInt(sPerPage);
    ?int pageCount = nPages;
    ??? Transaction temp = new Transaction();
    %>
    ?
    <form method="post" name="queryFrm" action=<%=sFileName%>>
    ? <div id="Layer1" style="position:absolute; left:30px; top:100px; width:800px; height:94px; z-index:1">

    <table border=0 cellpadding=0 cellspacing=1 align="left" width="800">
    ??? <tr>
    ????? <td colspan="7" height="32"><span class="clsNav"><img src="../images/messages2.gif" width="16" height="15">您當前的位置&gt;&gt;供求信息&gt;&gt;供求信息列表</span>
    ??????? <hr noshade class="clsHLine"></td>
    ??? </tr>
    ??? <%
    ???? String strCondition1 = " 1=1 ";
    ??
    ??TransactionCatManager tempManager1 = new TransactionCatManager();
    ??TransactionCat[] temps1 = tempManager1.getAllTransactionCat("",strCondition1," order by s_cat_grade", 1, 500);
    ??TransactionCat temp1 = new TransactionCat();
    ?//查詢條件
    ?%>?
    ? <tr><td><table><tr>
    ?????????? <td>產品目錄:
    ??????????????? <select class="Comm" name="con_cat_id">
    ????????????????? <option value="" >--</option>
    ????? <!--這里是一級產品目錄-->
    ?????? <%
    ?????String catid1="";
    ?????for(int i1=0;i1<temps1.length;i1++)
    ?????{
    ?????? temp1=temps1[i1];
    ?????? if(temp1.getCatGrade().equals("1"))
    ?????? {????
    ?????? catid1=temp1.getCatID();
    ?????%>
    ????? <option value="<%=temp1.getCatID()%>" <%if(conCatID.equals(temp1.getCatID())){%>selected<%}%> >
    ????? <%=temp1.getCatName()%>
    ????? </option>
    ?????? <!--這里是二級產品目錄-->
    ?????? <%String catid2="";
    ??????for(int i2=0;i2<temps1.length;i2++)
    ??????{
    ???????? temp1=temps1[i2];
    ???????? if(temp1.getCatGrade().equals("2")&&temp1.getCatParentID().equals(catid1))
    ???????? {????
    ???????? catid2=temp1.getCatID();
    ?????? %>
    ?????? <option value="<%=temp1.getCatID()%>" <%if(conCatID.equals(temp1.getCatID())){%>selected<%}%> >
    ?????? <%=temp1.getCatName()%>
    ?????? </option>????????????????
    ???????? <!--這里是三級產品目錄-->
    ???????? <%
    ????????String catDiscribetion3="";
    ????????for(int i3=0;i3<temps1.length;i3++)
    ????????{
    ?????????? temp1=temps1[i3];
    ?????????? if(temp1.getCatGrade().equals("3")&&temp1.getCatParentID().equals(catid2))
    ?????????? {???
    ?????????? String s3CatID=temp1.getCatID();
    ???????? %>
    ???????? <option value="<%=s3CatID%>" <%if(conCatID.equals(s3CatID)){%>selected<%}%> >
    ???????? <%=temp1.getCatName()%>
    ???????? <%if(temp1.getCatDiscribetion()!=null){%>
    ???????? (<%=temp1.getCatDiscribetion()%>)<%}%>
    ???????? </option>
    ????????? <%}
    ???????? }
    ??????????????? }
    ??????? }
    ????????????? }
    ????????? }%>?
    ??????????????? </select>
    ????????????? </td>
    ????
    ???? <td>標題
    ??????????????? <input name="con_title" type="text" class="Comm" value="<%=conTitle%>" size="15" maxlength="50"></td>
    ?????????? <td>發布人
    ??????????????? <input name="con_art_id" type="text" class="Comm" size="15" value="<%=conArtID%>" maxlength="50">
    ??????????????? </input>
    ????????????? </td>
    ????????????? <td>日期:
    ??????????????? <input name="con_time_issue" type="text" class="Comm" value="<%=conTimeIssue%>" size="15" maxlength="50">
    ??????????????? </input>
    ????????????? </td>
    ????????????? <td>最低價:
    ??????????????? <input name="con_price_min" type="text" class="Comm" size="15"? value="<%=conPriceMin%>" maxlength="50">
    ??????????????? </input>
    ????????????? </td>
    ???? <td>最高價:
    ??????????????? <input name="con_price_max"? onFocus="isNumeric(con_price_max.value)" type="text" class="Comm" size="15" value="<%=conPriceMax%>" maxlength="50">
    ??????????????? </input>
    ????<input name="con_type" type="hidden" value="<%=conType%>"></input>
    ????????????? </td>
    ????????????? <td>
    ??????????????? <input type="submit" onClick="isNumeric(con_price_max.value)" name="Submit" value="查詢" class="button1">
    ????????????? </td>
    ???????? </tr>
    ??? </table>
    ??? </td>
    ? </tr>
    ?<tr></tr>
    ? <tr>
    ? <td><table width="800">
    ??????????? <tr align="center" class="clsMenu1">
    ????????????? <td width="30"><font size="3">編號</font></td>
    ????????????? <td width="97"><font size="3">相關圖片</font></td>
    ????????????? <td width="454"><font size="3">供應商品信息/聯系人</font></td>
    ????????????? <td width="40"><font size="3">價格(元)</font></td>
    ????????????? <td width="25"><font size="3">數量</font></td>
    ????????????? <td width="40"><font size="3">日期</font></td>
    ????????????? <td width="65"><font size="3">操作</font></td>
    ??????????? </tr>
    ????????? </table></td>
    ?????<td></td>
    ? </tr>
    ?
    ?
    ?
    ?
    ?? <%//////////////////////////////
    ??for(int index=0;index<temps.length;index++){
    ??? temp=temps[index];
    ?? %>
    ?
    ?? <tr>
    ???? <td width="600">
    ???? <!--內部表111111111111111111111-->????????
    ????????? <table align="left"? width="800" border="0">
    ????? <tr>
    ?????<DIV class=offer13j> ????
    ????????????
    ????????????? <DIV class=offerbackground33j id=compareColor3>
    ??????<td width="30"><%=temp.getUid()%>
    ??????</td>
    ??????<td width="104">&nbsp; <DIV class=comparecheck3j>????????????????
    ???????<a href="#"
    ????????target=_blank> <img src="../<%=sessionFilesPic%><%=temp.getPicSmall()%>" alt="" width="100" height="100"
    ????????style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px">
    ???????</a> </DIV></td>
    ??????<td width="12">&nbsp; <DIV class=picture3j> <A class=m
    ????????onmousedown="aliclick(this,'?tracelog=po_listsell_1_3_j_3');addParam(this,'keywords','')"
    ????????href="????????target=_blank> </A> </DIV></td>
    ??????<td width="416">&nbsp; <DIV class=content3j>
    ???????
    ????????????????????? <DIV class=info3j> <SPAN class=m> <A href="transaction_single.jsp?id=<%=temp.getUid()%>" target=_blank><%=temp.getTransactionTitle()%></A>
    ??????????????????????? </SPAN>&nbsp;&nbsp; <NOBR><SPAN class=gray><%=FormatManager.getDateFormat10(temp.getTimeIssue())%></SPAN></NOBR><BR>
    ??????????????????????? <SPAN class="gray s">
    ??????????????????????? <%=temp.getTransactionText()%></SPAN><BR>
    ??????????????????????? <A href="#" target=_blank>&nbsp;&nbsp;
    ??????<%if(temp.getManConnect()!=null){%>
    ???????????????????????? 聯系人:<%=temp.getManConnect()%>
    ?????? <%}%>
    ??????<%if(temp.getPhoneConnect()!=null){%>
    ???????????????????????? 手機:<%=temp.getPhoneConnect()%>
    ?????? <%}%>
    ?????? <%if(temp.getMobileConnect()!=null){%>
    ???????????????????????? 電話:<%=temp.getMobileConnect()%>
    ?????? <%}%>??????
    ??????? </A>
    ??????????????????????? <DIV class=gray align=right>
    ?????? <%if(temp.getAddressConnect()!=null){%>
    ???????????????????????? [
    ????????????????????????? <%=temp.getAddressConnect()%>
    ????????????????????????? ]
    ?????? <%}%>
    ?????? </DIV>
    ???????</DIV>
    ??????? </DIV>
    ??????? </td>
    ??????<td width="40"> <DIV class=myt3j style="LINE-HEIGHT: 150%">
    ????????????????????? <%=temp.getPriceMin()%>~<%=temp.getPriceMax()%> /公斤<BR>
    ??????????????????????? </DIV></td>
    ??????<td width="25"> <DIV class=athena3j>
    ???????? <SPAN><A onmousedown="return aliclick(this,'?tracelog=list_cxpd_tpbz')" title=點擊查看該公司信用資料
    ????????href="#" target=_blank><IMG height=14 src="%CD%F8%D5%BE/scon_buyer_1_1.files/trust.gif" width=22 align=middle
    ????????border=0><BR>
    ????????????????????? <%=temp.getQtyIssue()%></A></SPAN></DIV>
    ??????
    ??????<td width="30"><DIV class=hackbox><%=FormatManager.getDateFormat10(temp.getTimeIssue())%></DIV></td>
    ??????
    ????????????????? <td width="65"><a
    ???????href="javascript:f572628('34574566','jxnb440483','isOnline','','pm')"><img
    ???????src="%CD%F8%D5%BE/scon_buyer_1_1.files/list_mytlogo_online.gif" border=0></a><a
    ???????href="javascript:f572628('34574566','jxnb440483','isOnline','','pm')"><span
    ???????class=lh15><br>
    ??????????????????? 跟我協商</span></a>
    ?????<br>
    ?????<a href="#" title="查看詳細信息" onClick="window.open('transaction_single.jsp?id=<%=temp.getUid()%>','', 'toolbar=no, menubar=no,scrollbars=yes, resizable=yes')">[查看]</a>
    ?????</td>
    ?????? </DIV>
    ?????</DIV>
    ????? </tr>
    ????</table>
    ????
    ????
    ?????????? </td>
    ?????????? </tr>
    ???? <%
    ????}%>
    ????
    ????
    ????
    ???? <tr>
    ???? <td width="600">
    ???? <!--內部表2222222222222222222222-->????????
    ????????? <table align="left"? width="800" border="0">
    ????? <tr>
    ?????<DIV class=offer13j> ????
    ????????????
    ????????????? <DIV class=offerbackground33j id=compareColor3>
    ??????<td><INPUT id=compareBox3
    ????????onclick=javascript:clickcompareBox(34574566,this); type=checkbox value=on
    ????????name=34574566></td>
    ??????<td>&nbsp; <DIV class=comparecheck3j>????????????????
    ???????<a href="#"
    ????????target=_blank> <img src="../<%=sessionFilesPic%><%=temp.getPicSmall()%>" alt="" width="100" height="100"
    ????????style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px">
    ???????</a> </DIV></td>
    ??????<td>&nbsp; <DIV class=picture3j> <A class=m
    ????????onmousedown="aliclick(this,'?tracelog=po_listsell_1_3_j_3');addParam(this,'keywords','')"
    ????????href="
    ????????target=_blank> </A> </DIV></td>
    ??????<td>&nbsp; <DIV class=content3j>
    ???????<DIV class=info3j>
    ???????? <SPAN class=m> <A href="#" target=_blank><%=temp.getTransactionTitle()%></A> </SPAN>&nbsp;&nbsp;
    ???????? <NOBR><SPAN class=gray><%=FormatManager.getDateFormat10(temp.getTimeIssue())%>2006-06-03 09:38:36</SPAN></NOBR><BR>
    ???????? <SPAN class="gray s"><%=temp.getTransactionTitle()%>KD-1280型注塑機系參考了歐洲名牌后模板聯體結構注塑機的設計理念,具有選材優良,結構先進、造型美觀,操?...</SPAN><BR>
    ???????? <A href="#" target=_blank><%=temp.getTransactionTitle()%>寧波市金星塑料機械有限公司</A>
    ???????? <DIV class=gray align=right>[<%=temp.getTransactionTitle()%>浙江寧波市]</DIV>
    ???????</DIV>
    ??????? </DIV></td>
    ??????<td> <DIV class=myt3j style="LINE-HEIGHT: 150%"> <A
    ???????href="javascript:f572628('34574566','jxnb440483','isOnline','','pm')"><IMG
    ???????src="%CD%F8%D5%BE/scon_buyer_1_1.files/list_mytlogo_online.gif" border=0><BR>
    ???????<SPAN
    ???????class=lh15>跟我洽談</SPAN></A> </DIV></td>
    ??????<td> <DIV class=athena3j>
    ???????? <SPAN><A onmousedown="return aliclick(this,'?tracelog=list_cxpd_tpbz')" title=點擊查看該公司信用資料
    ????????href="#" target=_blank><IMG height=14 src="%CD%F8%D5%BE/scon_buyer_1_1.files/trust.gif" width=22 align=middle
    ????????border=0><BR>54</A></SPAN>
    ??????? </DIV>
    ??????</td>
    ??????<td> <DIV class=address3j> <A
    ?????????href="
    ?????????target=_blank><IMG alt=使用支付寶付款,交易更安全 src="%CD%F8%D5%BE/scon_buyer_1_1.files/logo_alipay.gif"
    ?????????border=0></A> <BR>
    ???????<BR>
    ??????? </DIV></td>
    ??????<td><DIV class=hackbox></DIV></td>
    ?????? </DIV>
    ?????</DIV>
    ????? </tr>
    ????</table>
    ????
    ????
    ?????????? </td>
    ?????????? </tr>
    ????
    ???? <tr>
    ??????????? <td colspan=20 valign="top" class="clsBgColor1">
    ????????????? <
    %@include file="../common/page_deal.jsp"%>
    ?????????? </tr>
    ???
    </table>
    ?
    ???
    ? </div>
    ?
    </form>
    </body>
    </html>
    <%
    } catch(Exception e){
    ?String strErr = e.getMessage();
    ?onError(request,response,strErr,"","window.close();");
    ?e.printStackTrace();
    }
    %>

    posted @ 2006-08-16 16:26 一張白紙 閱讀(326) | 評論 (2)編輯 收藏

    transaction_cat_list_page_display.jsp

    <FORM name=queryFrm action="<%=sFileName%" method=post>&gt;
    <DIV align=center>
    <TABLE cellSpacing=1 cellPadding=0 width="95%" align=left border=0>
    <TBODY>
    <TR>
    <TD vAlign=top align=middle colSpan=7>
    <TABLE height=32 cellSpacing=0 cellPadding=0 width="95%" align=center bgColor=#fbf9f5 border=0>
    <TBODY>
    <TR>
    <TD width="11%"><IMG height=32 src="/p_emarket/WebModule1/images/01-1.gif" width=75></TD>
    <TD class=clsHLine vAlign=center align=left width="79%" background=../../../p_emarket/WebModule1/images?牨晥∽∣???C?g??8?8??????栠敲??????慴杲瑥弽汢湡????????牨晥∽∣9????8?8/01-3.gif height=32><SPAN class="clsNav style4">您當前的位置&gt;&gt;商品管理&gt;&gt;商品列表</SPAN></TD>
    <TD vAlign=bottom align=right width="10%"><IMG height=32 src="/p_emarket/WebModule1/images/01-32.gif" width=43></TD></TR></TBODY></TABLE>
    <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
    <TBODY>
    <TR>
    <TD height=10></TD></TR></TBODY></TABLE></TD></TR>
    <TR>
    <TD>
    <TABLE class=clsBgColor2 cellSpacing=3 cellPadding=0 width="95%" align=center border=0><![CDATA[<%
    ??? String catid="";
    ??? for(int index=0;index<temps.length;index++){
    ????? temp=temps[index];
    ????? if(temp.getCatGrade().equals("2")&&temp.getCatID().equals(strCatID))
    ?? {????
    ????? catid=strCatID;
    ??? %>]]&gt;
    <TBODY>
    <TR class=clsTblDtl1>
    <TD><A href="#?catID=<%=temp.getCatID()%>"><![CDATA[<%=temp.getCatName()%>]]&gt;</A></TD></TR>
    <TR>
    <TD>------</TD></TR>
    <TR><![CDATA[<%
    ?? int count=0;
    ? /////////////三級產品目錄???
    ? for(int i=0;i<temps.length;i++)
    ? {
    ??? temp=temps[i];
    ??? if(temp.getCatParentID().equals(catid))
    ??? {
    ???
    ?? %>]]&gt;
    <TD><A href="#?con_type=<%=conType%>&amp;catID=<%=temp.getCatID()%>"><![CDATA[<%=temp.getCatName()%>]]&gt;</A></TD>
    <TD><![CDATA[<%if(temp.getCatDiscribetion()!=null){%>]]&gt;(&lt;%=temp.getCatDiscribetion()%&gt;)&lt;%}%&gt;</TD>
    <TD>||</TD><![CDATA[<% count++;
    ????? if(count<5)
    ????? continue;
    ???? else{
    ??????? count=0;
    ??????? %>]]&gt;</TR>
    <TR><![CDATA[<%}??
    ??? }??
    ??? }?
    ??????
    ? }%>]]&gt;</TR><![CDATA[<%}%>]]&gt;
    <TR>
    <TD class=clsBgColor1 vAlign=top colSpan=20><![CDATA[<%@include file="../common/page_deal.jsp"%>]]&gt;</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR><BR><BR><BR></DIV></FORM><![CDATA[<%
    } catch(Exception e){
    ?String strErr = e.getMessage();
    ?onError(request,response,strErr,"","window.close();");
    ?e.printStackTrace();
    }
    %>]]&gt;

    posted @ 2006-08-16 09:19 一張白紙 閱讀(953) | 評論 (0)編輯 收藏

    僅列出標題  
    主站蜘蛛池模板: 亚洲AV无码专区电影在线观看| 两个人的视频高清在线观看免费| a高清免费毛片久久| 国产在线观看免费av站| 久久九九全国免费| 91精品国产免费入口| 在线观看视频免费国语| 亚洲日韩国产精品乱| 亚洲av色福利天堂| 亚洲AV无码一区二区三区久久精品 | 免费无码一区二区三区| 午夜寂寞在线一级观看免费| 日韩精品极品视频在线观看免费 | 99久久国产精品免费一区二区| 13一14周岁毛片免费| 国产中文字幕免费观看| 亚洲国产一区国产亚洲| 国产精品亚洲综合| 1000部拍拍拍18勿入免费视频下载 | 美女黄网站人色视频免费| 足恋玩丝袜脚视频免费网站| 中文字幕亚洲综合精品一区| 美女免费视频一区二区| JLZZJLZZ亚洲乱熟无码| 久久国产乱子精品免费女| 亚洲精品欧洲精品| 99re6在线视频精品免费| 免费人成年激情视频在线观看| 亚洲午夜国产精品| 久久一区二区三区免费播放| 2048亚洲精品国产| 无码一区二区三区免费| 97久久国产亚洲精品超碰热| 久久国产免费观看精品| 亚洲日韩国产精品无码av| 久久综合给合久久国产免费| 亚洲精品第一国产综合野| 国产亚洲日韩一区二区三区| 亚洲乱码无人区卡1卡2卡3| 久久久精品2019免费观看| 亚洲精品国产高清在线观看|