<html>
<head>
<title>Persona Homes Project Management System</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="60">
<link type="text/css" rel="stylesheet" href="style.css">
<script language="JavaScript" type="text/javascript" src="../js/print.js"></script>
</head>
<body>
<!-- #include file="includes/top.asp" -->
<table width="800" align="center" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="800" height="400" bgcolor="#FFFFFF" valign="top"><table width="800" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="10"></td>
				<td width="780"><div id="areaToPrint"><table width="780" border="0" cellpadding="0" cellspacing="0">
<%
On Error Resume Next
Response.Expires = 0
Dim objConn, objRS, strQuery
Dim strConnection

if Session("Admin") <> -1 then
	Response.Write "<tr><td width=""780"" height=""80""></td></tr>"
  	Response.Write "<tr><td width=""780"" height=""25"" align=""center"" class=""h2"">You are not authorized to view this page.</td></tr>"
    Response.Write "<tr><td width=""780"" height=""20""></td></tr>"
    Response.Write "<tr><td width=""780"" height=""25"" align=""center""><input TYPE=""button"" NAME=""Login"" value=""Login"" class=""submit"" ONCLICK=""JavaScript:window.open('index.asp', target='_self');""></td></tr>"
else

  	Set objConn = Server.CreateObject("ADODB.Connection")
  	strConnection = "DSN=personahomes;Database=WebDB.mdb;"

  	objConn.Open strConnection

    strQuery = "SELECT * FROM KPI ORDER BY Rank"
    Set objRS = objConn.Execute(strQuery)
%>
    				<tr>
      					<td width="780" height="25" align="center" class="head">Hi <%= Session("Login") %>!</td>
					</tr>
    				<tr>
                    	<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
                        	<tr height="25">
                            	<td class="h2"><%= Day(Date) & "/" & Month(Date) & "/" & Year(Date) & " " & Time%></td>
                                <td align="right"><table border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td height="25"><a href="javascript:printPage('areaToPrint');" class="h2">Print</a></td>
                                        <td width="20" height="25"></td>
                                        <td height="25"><a href="home.asp" class="h2">Back to Home</a></td>
                                        <td width="20" height="25"></td>
                                        <td height="25"><a href="logout.asp" class="h2">Logout</a></td>
                                    </tr>
                                </table></td>
                            </tr>
                        </table></td>
					</tr>
    				<tr>
      					<td width="780" height="10"></td>
					</tr>
    				<tr>
      					<td width="780" height="25" align="center" class="h1">KPI</td>
					</tr>
    				<tr>
      					<td width="780" height="10"></td>
					</tr>
					<form name="fmEditKPI" method="post" action="settingKPIUpdate.asp">
    				<tr>
      					<td width="780" height="20" align="center"><table border="0" cellpadding="0" cellspacing="0">
<%
	Do While not objRS.EOF
	
		if objRS("Target") = 0 then
			tTarget = ""
		else
			tTarget = objRS("Target")
		end if
%>	
                            <tr height="25">
                                <td align="right" class="p"><%= objRS("Name") %>:</td>
                                <td width="10"></td>
                                <td><input type="text" name="<%= objRS("ID") %>" class="registertext" value="<%= tTarget %>"></td>
                            </tr>
<%
		objRS.MoveNext
	Loop
%>
                        </table></td>
					</tr>
					<tr>
      					<td width="780" height="10"></td>
    				</tr>
    				<tr>
      					<td width="780" height="25" align="center"><table height="25" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td width="150" height="25"></td>
								<td height="25"><input type="reset" value="Reset" name="reset" class="submit"></td>
								<td width="30" height="25"></td>
								<td height="25"><input name="B1" type="submit" class="submit" value="Update"></td>
				    		</tr>
						</table></td>
					</tr>
					</form>
<%
  objRS.close
  objConn.close
  Set objRS = Nothing
  Set objConn = Nothing
end if
%>
				</table></div></td>
				<td width="10"></td>
			</tr>
		</table></td>
	</tr>
<!-- #include file="includes/bottom.asp" -->
</table>
</body>
</html>