<%@Language="JScript"%> <% var desc, name, path, thumbPath, dateStart, dateEnd, sortValue, sql, rs; var projects = new Array(); var images = new Array(); var id = Request.QueryString("id").item; var con = Server.CreateObject("ADODB.Connection"); con.open( Application("ConnectionString") ); if( !id ) { sql = "SELECT ID, Name, Description, StartDate, EndDate, SortValue " + "FROM tony_projects p " + "WHERE Flags = 2 " + "ORDER BY ID DESC LIMIT 1"; } else if(parseInt(id, 10)) { sql = "SELECT ID, Name, Description, StartDate, EndDate, SortValue " + "FROM tony_projects p " + "WHERE Flags = 2 AND ID = " + id; } else if(Session("Authenticated") && id == "new") { name = "New category name"; desc = "New category description"; sortValue = 0; } if( sql ) { rs = con.Execute( sql ); if( !rs.eof ) { id = rs("ID").value; name = rs("Name").value; desc = rs("Description").value; dateStart = new Date(rs("StartDate").value); dateEnd = new Date(rs("EndDate").value); sortValue = rs("SortValue").value; } rs.close(); } sql = "SELECT ID, Name FROM tony_projects WHERE Flags = 2 ORDER BY ID DESC"; rs = con.Execute( sql ); if( !rs.eof ) projects = rs.getRows().toArray(); rs.close(); if( parseInt(id, 10) ) { sql = "SELECT Name, Path, ThumbPath, ID, Description FROM tony_images WHERE ProjectId = " + id + " ORDER BY ID DESC"; rs = con.Execute( sql ); if( !rs.eof ) images = rs.getRows().toArray(); rs.close(); } con.close(); rs = null; con = null; putHeader(true, name, images, "projects_name_" + id); %>
  • Home
  • Projects
  • Categories
  • Writings
  • About
  • Contact
  • <% if( !Session("Authenticated") ) { %> loading images ...
    <% renderText( "projects_description_" + id, desc ) %>
    <% } else { %>
    <% renderText( "projects_description_" + id, desc ) %>
    <% } %>
    <% for( var i = 0; i < images.length; i+=5 ) { %><%=images[i + 4]?images[i + 4]:name + " <%=Session("Authenticated")?"onclick=\"editImage(" + images[i + 3] + ", " + id + ", '" + images[i + 1] + "', '" + images[i + 2] + "', '" + images[i + 4] + "', " + (i/5) + ")\" ":""%>/><% } if( Session("Authenticated") && i / 5 < 12 ) { %>Add new image<% } %>
    <% putFooter( "projects_" + id, desc.length > 0 ); %>