Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <? require_once('common.php'); checkUser(); ?>
- <!DOCTYPE html>
- <html><head>
- <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
- <meta http-equiv='Content-Language' content='EN'>
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
- <title>DMS</title>
- <style>
- body {
- font-size: 1.3em;
- font-size-adjust: from-font;
- font-variant: small-caps;
- color: orange;
- background: rgba(0, 0, 0, 1);
- }
- button {
- margin: 1px;
- padding: 3px 5px;
- font-size: 12px;
- border-radius: 3px;
- }
- </style></head><body>
- <center><br><br><div id='dateTime'></div>
- <script src='dtscript.js'></script>
- <?
- if(isset($_GET['hgen'])) { hgenesis(); }
- if(isset($_GET['update'])) { update(); }
- if(isset($_GET['logout'])) { logoutUser(); }
- date_default_timezone_set('America/New_York');
- $CurrenTime = time();
- $FinalTime = '+25 days 25 minutes';
- $FinalFile = 'dmsr.txt';
- $datestr = "l\, F j\<\s\u\p\>\<\s\m\a\l\l\>S\<\/\s\m\a\l\l\>\<\/\s\u\p\> Y g\:i A";
- if(!file_exists($FinalFile)) { file_put_contents($FinalFile, $CurrenTime); }
- $FinalCon = file_get_contents($FinalFile); $FinalConStr = date($datestr, $FinalCon);
- echo "<br>Switch closed $FinalConStr<br><br>Update by " . date ($datestr, strtotime($FinalTime, $FinalCon));
- if(strtotime($FinalTime, $FinalCon) < $CurrenTime){
- echo "<br><br><strong>Deadline!</strong><br>";
- //unlink($FinalFile);
- // mailer();
- }
- if ((isset($_SESSION['validUser'])) && ($_SESSION['validUser'] == true)){
- echo "<br><br><button onclick=window.location.replace('?logout')>Log out</button>  <button onclick=window.location.replace('?update')>Update</button>"; } else {echo "<br><br><button onclick=window.location.replace('login.php')>Logged out</button>  ";
- if(strtotime($FinalTime, $FinalCon) < $CurrenTime){echo "  <button onclick=window.location.replace('?hgen')>HGenesis</button>";}
- }
- function update(){
- if ((isset($_SESSION['validUser'])) && ($_SESSION['validUser'] == true)){
- date_default_timezone_set('America/New_York');
- $CurrenTime = time();
- $FinalFile = 'dmsr.txt'; $NotifyFile = 'dmsr_notify.txt';
- file_put_contents($FinalFile, $CurrenTime); echo "<script>location.href = 'dmsr.php'</script>";
- }}
- function hgenesis(){
- if ((isset($_SESSION['validUser'])) && ($_SESSION['validUser'] == true)){
- $FinalFile = 'dmsr.txt';
- unlink($FinalFile);
- echo "<script>location.href = 'dmsr.php'</script>";
- }}
- function mailer(){
- $subject = "DMS Notifier";
- $message = "Hey now. <a href='https://gowansb.powweb.com/dms/dmsr.php'>Login if you have to and check if you want to</a>.";
- $mailto = "";
- $headers = "From: ";
- mail("$mailto", "$subject" , "$message", "$headers");
- }
- ?></center></body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement