File manager - Edit - /home/autoph/public_html/portal/index.php
Back
<?php include 'core/init.php'; logged_in_redirect(); ?> <html> <!DOCTYPE html> <!--https://www.w3schools.com/bootstrap/bootstrap_forms_inputs.asp --> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/screen_white.css"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" href="ajs/vendors/jQueryUI/jquery-ui.css"> <script src="ajs/vendors/jQueryUI/jquery-1.12.4.js"></script> <script src="ajs/vendors/jQueryUI/jquery-ui.js"></script> <style> body { position: relative; } #section1 {padding-top:50px;height:500px;color: #fff; background-color: #1E88E5;} #section2 {padding-top:50px;height:500px;color: #fff; background-color: #673ab7;} #section3 {padding-top:50px;height:500px;color: #fff; background-color: #ff9800;} #section41 {padding-top:50px;height:500px;color: #fff; background-color: #00bcd4;} #section42 {padding-top:50px;height:500px;color: #fff; background-color: #009688;} </style> <style> * { box-sizing: border-box; } body{ margin:0px; } .menu { float:left; width:20%; } .menuitem { padding:8px; margin-top:7px; border-bottom:1px solid #f1f1f1; } .main { float:left; width:60%; padding:0 20px; } .right { background-color:lightblue; float:left; width:20%; padding:10px 15px; margin-top:7px; } @media only screen and (max-width:800px) { /* For tablets: */ .main { width:80%; } .right { width:100%; } } @media only screen and (max-width:500px) { /* For mobile phones: */ .menu, .main, .right { width:100%; } } </style> <script type="text/javascript" charset="utf-8"> $( function() { var userName = <?php $d = mysql_query( "SELECT * FROM `company` WHERE `status`='1' ORDER BY `name` ASC" ); $compName = array(); while( $r = mysql_fetch_assoc($d) ) { $compName[] = $r['name']."---".$r['code']; } echo json_encode( $compName ); ?>; $( "#complist" ).autocomplete({ source: userName }); } ); </script> <script type="text/javascript" charset="utf-8"> $( function() { var userName = <?php $d = mysql_query( "SELECT * FROM `dealers` ORDER BY `name` ASC" ); $usernames = array(); while( $r = mysql_fetch_assoc($d) ) { $usernames[] = $r['name'].'---'.$r['dcode']; } echo json_encode( $usernames ); ?>; $( "#dealList" ).autocomplete({ source: userName }); } ); </script> <script type="text/javascript" charset="utf-8"> $( function() { var userName = <?php $d = mysql_query( "SELECT * FROM `departments` ORDER BY `name` ASC" ); $usernames = array(); while( $r = mysql_fetch_assoc($d) ) { $usernames[] = $r['name'].'---'.$r['code']; } echo json_encode( $usernames ); ?>; $( "#deptList" ).autocomplete({ source: userName }); } ); </script> </head> <?php if(isset($_POST['RecoverPassword'])){ $userEmail = $_POST['userEmail']; $getPw = mysql_result(mysql_query("SELECT `pw` FROM `c_users` WHERE `email`='$userEmail'"),0); $rToken = md5($toDate)."" . md5($currentTime); //echo "PW".$userEmail; if(empty($getPw)){ $msg = 'Sorry, no such e-mail found in our records. Please check your entry and try again!'; }else{ mysql_query("UPDATE `c_users` SET `recovery_token`='$rToken', `recovery_date`='$toDate' WHERE `email`='$userEmail'"); $msg = 'A recovery link has been sent to your registered e-mail address. Thank you'; $message = "You received this e-mail because you request to recovery your password. Please click the link below to reset your password http://www.autohub.ph/portal/password_recovery.php?token=".$rToken."&recovery=".$userEmail." Thank you. Autohub Support Group"; mail($userEmail, 'PASSWORD RECOVERY', $message, 'From: support@autohubgroup.com'); } } ?> <!-- <body style="font-family:Verdana;"> --> <body data-spy="scroll" data-target=".navbar" data-offset="50"> <center> <table style='height:100%;width:100%;border-collapse:collator_compare'> <!--<tr class='titleBlue'> <td colspan='2' class='titleBlue' style='height:50px;border:1px solid lightgray'> <p style='font-family:Calibri Light;font-size:20px;font-weight:normal;color:#000;text-shadow:0px 0px 5px white'>AUTOHUB GROUP</p> </td> </tr> --> <tr class='titleBlue'> <td align='left' valign='top' class='titleBlack' style=' padding:10px;width:20%;min-width:280px;border:0px solid black'> <center><form action='' method='POST'> <table style='width:100%;border-collapse:collapse;height:100%'> <tr class='titleBlue'> <td colspan='2' align='center' class='titleBlack' style='padding:10px;height:250px;border:1px solid gray;color:white'> <?php if(isset($_POST['LOGINMEIN'])){ mysql_query('SET NAMES utf8'); mysql_query("SET NAMES 'utf8'"); mysql_query("SET CHARACTER SET utf8"); if(empty($_POST) === false) { $username = $_POST['MYusername']; $username = mysql_real_escape_string($username); $password = $_POST['MYpassword']; if (empty($username) === true || empty($password) ===true){ $errors = 'You need to enter a valid username and password.'; } else if (user_exists($username) === false) { $errors = 'We can\'t find that username.'; } else if (user_active($username) === false) { $errors = 'You haven\'t activated your account!'; } else { $login = login($username, $password); if ($login === false) { $errors = 'Invalid username or password. '; $errorCount = mysql_result(mysql_query("SELECT `u_locked_count` FROM `c_users` WHERE `u_name` = '$username'"),0); $errorCount=$errorCount+1; mysql_query("UPDATE `c_users` SET `u_locked_count` = '$errorCount' WHERE `u_name`='$username'"); } else { $_SESSION['u_id'] = $login; //log user mysql_query("UPDATE `c_users` SET `u_locked_count` = '0' WHERE `u_name`='$username'"); $logged="INSERT INTO `login_history` (`log_id`,`u_name`,`remarks`,`date`,`time`,`branch_code`) VALUES('','$username','IN','$toDate','$currentTime','$compCode')"; if(!mysql_query($logged)) { die('Error: ' . mysql_error()); } //==================================================================== //==================================================================== echo "<center> <div class='titleBlack' style='position:relative;width:100%;height:300px;top:10px;border:0px solid blue;border-radius:5px;z-index:9999999;'>"; echo "<center><br><br><p style='font-family:Calibri Light;font-size:12px;color:white;padding:5px;'> <b style='font-family:Calibri;font-size:15px;'>Welcome! <br><br> ".STRTOUPPER($username)." </b><br><br><br> Your access has been verified.. Please click the button to continue...</p>"; $chkIfUserOnly = mysql_result(mysql_query("SELECT `user_only` FROM `c_users` WHERE `u_name`='$username'"),0); echo "<br><br>"; if($chkIfUserOnly==='false'){ //echo "Type: ".$chkIfUserOnly; echo "<a href='main_new.php?menu&view=100&sid=M1&sview=100&tab=1#id-0' style='padding:8px;border:0px solid lightgray;font-family:Calibri;font-size:14px;color:white;font-weight:bold'>"; echo "Continue...</a>"; }else{ //echo "Type: ".$chkIfUserOnly; echo "<a href='myportal.php?window=1' style='padding:8px;border:0px solid lightgray;font-family:Calibri;font-size:14px;color:blue;font-weight:bold;border:1px solid green;background:lightgray;border-radius:5px;padding:10px;padding-left:15px;padding-right:15px;'>"; echo "CLICK TO CONTINUE</a>"; } echo "<br><br><br><br><a href='logout.php' style='padding:8px;border:0px solid lightgray;font-family:Calibri;font-size:14px;color:white;font-weight:bold'> EXIT</a> </center>"; echo "</div><br><br> </center>"; //==================================================================== //==================================================================== //header('Location:main_new.php?view=&sview=&sid=db&tab=0#id-0'); //exit(); } } }else { $errors = 'Please login to continue...'; } //==================================================================== //==================================================================== if(!empty($errors)){ echo "<center> <div class='titleBlack' style='position:relative;width:100%;height:300px;top:10px;border:0px solid blue;border-radius:5px;z-index:9999999;'>"; echo "<center><br><p style='font-family:Calibri Light;font-size:12px;color:white;padding:5px;'> <b style='font-family:Calibri;font-size:18px;'>LOGIN FAILED! <br> <br> ".STRTOUPPER($username)."! </b><br><br> <p style='font-family:Calibri Light;font-size:14px;color:red;text-shadow:0px 0px 5px black'>".$errors."</p><br><br> Thank you!</p>"; echo "<a href='index.php' style='padding:8px;border:0px solid lightgray;font-family:Calibri;font-size:14px;color:white;font-weight:bold'>Try Again</a></button> </center>"; echo "<br><br></div> </center>"; } //==================================================================== //==================================================================== } else{ ?> <table style='width:100%;border-collapse:collapse;height:100%'> <tr style='border:0px solid lightgray;background:transparent'> <td colspan='2' style='border:0px solid lightgray'> <div class='titleBlack' style='width:100%;top:0px;left:0px;position:relative;z-index:2'> <a href='#' style='padding:3px;display:block;width:100%;height:30px;border:0px solid lightgray;border-radius:2px;font-size:14px;color:white;padding-left:10px;'> USER AUTHENTICATION </a> </div><br> <p style='font-family:Calibri Light;font-size:12px;font-weight:normal;color:#fff;line-height:120%'>Login using your assigned username and password only. Accessing someone else Account is strictly PROHIBITED and punishable according to Autohub COC</p><br> <input type='text' name='MYusername' required class="form-control" id="usr" placeholder='Username' style='width:100%;height:35px;padding:5px;padding-left:10px;border:1px solid black'> <br><br> </td> </tr> <tr style='border:0px solid lightgray;background:transparent'> <td colspan='2' style='border:0px solid lightgray'> <input type='password' name='MYpassword' required class="form-control" id="usr" placeholder='Password' style='width:100%;height:35px;padding:5px;padding-left:10px;border:1px solid black'> </td> </tr> <tr style='border:0px solid lightgray;background:transparent'> <td colspan='2' style='border:0px solid lightgray'><br> <?php if(!empty($errors)){ echo "<p style='font-family:Verdana;font-size:11px;font-weight:normal;color:red'>".$errors."</p>"; } echo "</p>";?> <input type="reset" name='RESET' value='Reset' class="btn btn-default" style='width:45%;border:1px solid black'> <button type="submit" name='LOGINMEIN' class="btn btn-default" style='width:45%;margin-left:19px;border:1px solid black'>Login</button> <br><br> </td> <tr style='border:0px solid lightgray;background:transparent'> <td colspan='1' style='border:0px solid lightgray'> <div style='float:left;font-family:Calibri <div> </td> <td colspan='1' style='border:0px solid lightgray'> <div style='float:right;font-family:Calibri Light;font-size:12px;padding-right:5px'><a href='index.php?recover' style='font-size:12px;font-weight:normal;color:white'>Password Recovery</a><div> </td> </tr> </tr> </table> <?php }?> </td> </tr> </table> </form> </center> <p style='padding:5px;margin-top:10px;font-family:Calibri Light;color:white;font-size:13px;font-weight:normal;padding-left:2px'>Don't have an account? <a href='index.php?register=true' style='font-size:13px;font-family:Calibri Light;font-weight:normal;color:yellow'>Register Here</a></p> <hr> <p style='line-height:130%;padding:5px;margin-top:10px;font-family:Calibri Light;color:#fff;font-size:12px;font-weight:normal;padding-left:2px'> CONTACT US: <br><br> <b style='font-size:14px;font-family:Calibri;font-weight:normal;color:#fff;'>AUTOHUB GROUP <br></b> <b style='font-size:10px;font-family:Calibri;font-weight:normal;color:#fff;'>IT SUPPORT TEAM<br>mis@autohubgroup.com <br>8608849 / 8608848 / 8549/8549</b> </p> </td> <td align='center' valign='top' class='titleBlack' style='padding:0px;background:#000;width:100%;height:100%;border:0px solid blue'> <div style='width:100%;height:100%;border:1px solid #000;border-radius:0px;background:white;padding:10px;' class='titleBlack' > <?php if(isset($_GET['recover'])){ echo "<div align='center' style='top:100px;position:relative;padding:0px;border:0px solid'> <form action='' method='POST'> <p align='left' style='width:40%;font-family:Calibri Light;font-size:26px;color:red;margin-bottom:50px'>Password Recovery</p> <p align='left' style='width:40%;font-family:Calibri;font-size:16px;color:red;'>Type your E-mail Address...</p> <input required type='text' name='userEmail' placeholder='Type your e-mail here..' style='margin-left:20px;width:40%;height:30px;padding:10px;font-family:Calibri Light;font-size:14px;color:red;font-weight:normal;border:1px solid gray;border-radius:3px;'> <p align='left' style='width:40%;font-family:Calibri;font-size:16px;color:red;'> <input type='submit' name='RecoverPassword' value='Recover my Password' style='width:180px;border:1px solid lightgray;height:30px;margin-top:20px;border-radius:10px;color:blue;' class='lightGradient'> </p> </form> <br><p style='font-size:14px;color:red;font-family:Calibri Light'>".$msg ."</p> </div>"; } if(isset($_GET['register'])){ echo "<div align='left' style='position:relative;padding:0px;border:0px solid lightgray;width:100%;height:80%;background:white;'>"; echo "<h3 style='font-family:Calibri Light;font-size:25px;color:black;height:40px;padding:5px;margin-top:0px;' class='lightGradient'>Registration Form</h3>"; include 'includes/pms_user_registration.php'; echo "</div>"; } if(isset($_GET['activate'])){ $token = $_GET['token']; $empID = $_GET['id']; $getToken = mysql_result(mysql_query("SELECT `email` FROM `c_users` WHERE `emp_id`='$empID'"),0); $chkStat = mysql_result(mysql_query("SELECT `status` FROM `c_users` WHERE `emp_id`='$empID'"),0); //echo "STATUS: ".$chkStat; if($chkStat === '1'){ echo "<div title='SECURITY TOKEN EXPIRED' style='width:400px;height:230px;border:1px solid lightgray;top:200px;left:400px;position:absolute;background:#FAFAFA;z-index:20000 '> <h3 style='font-size:16px;padding:3px;background:#FA5858'>SECURITY TOKEN HAS BEEN EXPIRED</h3> <p style='line-height:130%;font-family:Calibri Light;font-size:12px;padding:15px;'>Your security token has been expired. Please contact your system administrator if your account still not activated <br><br>Thank you! </p><br> <center><a href='http://www.autohub.ph/portal'><input type='button' class='submit' name='Exit' value='Login'></a></center> </div>"; }else{ $encToken = $getToken; $myToken = md5($encToken); if($myToken == $token){ mysql_query("UPDATE `c_users` SET `status`='1' WHERE `emp_id`='$empID' AND `email`='$getToken'"); echo "<div title='ACCOUNT ACTIVATION COMPLETE' style='width:400px;height:230px;border:1px solid lightgray;top:200px;left:400px;position:absolute;background:#FAFAFA;z-index:20000 '> <h3 style='font-size:16px;padding:3px;'>ACCOUNT ACTIVATION COMPLETE</h3><br> <p>Your Account has been activated. You can now login to our Autohub Portal using credentials sent to your registered e-mail address. <br><br>Thank you! </p><br><br> <center><a href='http://www.autohub.ph/portal'><input type='button' class='submit' name='Exit' value='Login'></a></center> </div>"; } } } ?> </div> </td> </tr> </table> </body> </html>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings