⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 projectlist.asp

📁 BugTrack is a basic, yet fully functional web based Bug Tracking system that you may use as a framew
💻 ASP
字号:
<!-- #INCLUDE FILE="Common.asp" -->

<%
'
'   Filename: ProjectList.asp
'   Generated with CodeCharge 1.2.0
'   ASPTemplates.ccp build 5/9/2001
'


sFileName = "ProjectList.asp"
sTemplateFileName = "ProjectList.html"


' ProjectList Open Event start
' ProjectList Open Event end


' ProjectList PageSecurity begin

CheckSecurity(3)

' ProjectList PageSecurity end

' ProjectList OpenAnyPage Event start
' ProjectList OpenAnyPage Event end


LoadTemplate sAppPath & sTemplateFileName, "main"

LoadTemplate sHeaderFileName, "Header"


SetVar "FileName", sFileName


Menu_Show
ProjectList_Show
Parse "Header", False
Parse "main", False
Response.write PrintVar("main")

' ProjectList Close Event start
' ProjectList Close Event end


'--------------------------------------------------



Sub ProjectList_Show()
  
  Dim sWhere, sOrder, sSQL, HasParam
  sWhere = ""
  sOrder = ""
  sSQL = ""
  HasParam = false

  SetVar "TransitParams", ""
  SetVar "FormParams", ""

' Build WHERE statement

  ' Build ORDER statement
  sOrder = " order by p.project_name Asc"
  iSort = GetParam("FormProjectList_Sorting")
  iSorted = GetParam("FormProjectList_Sorted")
  sDirection = ""
  if IsEmpty(iSort) then
    SetVar "Form_Sorting", ""
  else
    if iSort = iSorted then 
      SetVar "Form_Sorting", ""
      sDirection = " DESC"
      sSortParams = "FormProjectList_Sorting=" & iSort & "&FormProjectList_Sorted=" & iSort & "&"
    else
      SetVar "Form_Sorting", iSort
      sDirection = " ASC"
      sSortParams = "FormProjectList_Sorting=" & iSort & "&FormProjectList_Sorted=" & "&"
    end if
    
    if iSort = 1 then sOrder = " order by p.[project_name]" & sDirection
    if iSort = 2 then sOrder = " order by e.[employee_name]" & sDirection
  end if
  

  ' Build full SQL statement
  
  sSQL = "select [p].[employee_id] as p_employee_id, " & _
    "[p].[project_id] as p_project_id, " & _
    "[p].[project_name] as p_project_name, " & _
    "[e].[employee_id] as e_employee_id, " & _
    "[e].[employee_name] as e_employee_name " & _
    " from [projects] p, [employees] e" & _
    " where [e].[employee_id]=p.[employee_id]  "

' ProjectList Open Event start
' ProjectList Open Event end

  sSQL = sSQL & sWhere & sOrder

  
  SetVar "FormAction", "ProjectMaint.asp"
  SetVar "SortParams", sSortParams
  

  ' Open recordset

  openrs rs, sSQL
	
  
  if rs.eof then
    ' Recordset is empty
    set rs = nothing
    SetVar "DListProjectList", ""
    Parse "ProjectListNoRecords", False
    SetVar "ProjectListNavigator", ""
    Parse "FormProjectList", False
    exit sub
  end if


  iRecordsPerPage = 20
  iCounter = 0
  ' Select current page
  iPage = GetParam("FormProjectList_Page")
  
  if IsEmpty(iPage) then iPage = 1 else iPage = CLng(iPage)

  while not rs.eof and iCounter < (iPage-1)*iRecordsPerPage
    rs.movenext
		iCounter = iCounter + 1
  wend
  iCounter = 0
  

  ' Show main table based on recordset
  while not rs.EOF  and iCounter < iRecordsPerPage
    fldproject_id_URLLink = "ProjectMaint.asp"
    fldproject_id_project_id = GetValue(rs, "p_project_id")
    fldemployee_id = GetValue(rs, "e_employee_name")
    fldproject_name = GetValue(rs, "p_project_name")
    fldproject_id= "Edit"
    ' ProjectList Show begin
    
' ProjectList Show Event start
' ProjectList Show Event end


      SetVar "project_id", ToHTML(fldproject_id)
      SetVar "project_id_URLLink", "ProjectMaint.asp"
      SetVar "Prmproject_id_project_id", ToURL(fldproject_id_project_id)
      SetVar "project_name", ToHTML(fldproject_name)
      SetVar "employee_id", ToHTML(fldemployee_id)
    Parse "DListProjectList", True
    ' ProjectList Show end
    
    rs.MoveNext

    iCounter = iCounter + 1
  wend

  ' ProjectList Navigation begin
  isEndOfRS = rs.EOF
  ' Parse Navigator
  if isEndOfRS and iPage = 1 then
    SetVar "ProjectListNavigator", ""
  else
    if isEndOfRS then
      SetVar "ProjectListNavigatorLastPage", "_"
    else
      SetVar "NextPage", (iPage + 1)
    end if
    if iPage = 1 then
      SetVar "ProjectListNavigatorFirstPage", "_"
    else
      SetVar "PrevPage", (iPage - 1)
    end if

    SetVar "ProjectListCurrentPage", iPage
    Parse "ProjectListNavigator", False
  end if
  ' ProjectList Navigation end
  set rs = nothing
  SetVar "ProjectListNoRecords", ""
  Parse "FormProjectList", False
  
' ProjectList Close Event start
' ProjectList Close Event end

End Sub

%>

<!-- #INCLUDE FILE="Header.asp" -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -