| [ PHPXref.com ] | [ Generated: Sun Jul 20 19:57:02 2008 ] | [ PHP Timeclock 1.02 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 session_start(); 3 4 include 'config.inc.php'; 5 include 'header.php'; 6 include 'topmain.php'; 7 echo "<title>$title - Reports Login</title>\n"; 8 9 $self = $_SERVER['PHP_SELF']; 10 11 if (isset($_POST['login_userid']) && (isset($_POST['login_password']))) { 12 $login_userid = $_POST['login_userid']; 13 $login_password = crypt($_POST['login_password'], 'xy'); 14 15 $query = "select empfullname, employee_passwd, reports from ".$db_prefix."employees 16 where empfullname = '".$login_userid."'"; 17 $result = mysql_query($query); 18 19 while ($row=mysql_fetch_array($result)) { 20 21 $reports_username = "".$row['empfullname'].""; 22 $reports_password = "".$row['employee_passwd'].""; 23 $reports_auth = "".$row['reports'].""; 24 } 25 26 if (($login_userid == @$reports_username) && ($login_password == @$reports_password) && ($reports_auth == "1")) { 27 $_SESSION['valid_reports_user'] = $login_userid; 28 } 29 30 } 31 32 if (isset($_SESSION['valid_reports_user'])) { 33 echo "<script type='text/javascript' language='javascript'> window.location.href = 'reports/index.php';</script>"; 34 exit; 35 36 } else { 37 38 // build form 39 40 echo "<form name='auth' method='post' action='$self'>\n"; 41 echo "<table align=center width=210 border=0 cellpadding=7 cellspacing=1>\n"; 42 echo " <tr class=right_main_text><td colspan=2 height=35 align=center valign=top class=title_underline>PHP Timeclock Reports Login</td></tr>\n"; 43 echo " <tr class=right_main_text><td align=left>Username:</td><td align=right><input type='text' name='login_userid'></td></tr>\n"; 44 echo " <tr class=right_main_text><td align=left>Password:</td><td align=right><input type='password' name='login_password'></td></tr>\n"; 45 echo " <tr class=right_main_text><td align=center colspan=2><input type='submit' onClick='admin.php' value='Log In'></td></tr>\n"; 46 47 if (isset($login_userid)) { 48 echo " <tr class=right_main_text><td align=center colspan=2>Could not log you in. Either your username or password is incorrect.</td></tr>\n"; 49 } 50 echo "</table>\n"; 51 echo "</form>\n"; 52 echo "<script language=\"javascript\">document.forms['auth'].login_userid.focus();</script>\n"; 53 } 54 55 echo "</body>\n"; 56 echo "</html>\n"; 57 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |