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 一张白纸 阅读(1512) | 评论 (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 一张白纸 阅读(226) | 评论 (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="http://detail.china.alibaba.com/buyer/offerdetail/34574566.html"
        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="http://detail.china.alibaba.com/buyer/offerdetail/34574566.html"
        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="http://trust.alibaba.com.cn/credit/hkaq.shtml?tracelog=list_c01_dupai"
         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 一张白纸 阅读(316) | 评论 (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 一张白纸 阅读(943) | 评论 (0)编辑 收藏

仅列出标题