Advertisement
somdcomputerguy

dmsr.php

Mar 25th, 2025 (edited)
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.76 KB | Source Code | 0 0
  1. <? require_once('common.php'); checkUser(); ?>
  2. <!DOCTYPE html>
  3. <html><head>
  4. <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
  5. <meta http-equiv='Content-Language' content='EN'>
  6. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
  7. <title>DMS</title>
  8. <style>
  9. body {
  10.   font-size: 1.3em;
  11.   font-size-adjust: from-font;
  12.   font-variant: small-caps;
  13.   color: orange;
  14.   background: rgba(0, 0, 0, 1);
  15. }
  16.  
  17. button {
  18.   margin: 1px;
  19.   padding: 3px 5px;
  20.   font-size: 12px;
  21.   border-radius: 3px;
  22. }
  23. </style></head><body>
  24. <center><br><br><div id='dateTime'></div>
  25. <script src='dtscript.js'></script>
  26.  
  27. <?
  28. if(isset($_GET['hgen'])) { hgenesis(); }
  29. if(isset($_GET['update'])) { update(); }
  30. if(isset($_GET['logout'])) { logoutUser(); }
  31.  
  32. date_default_timezone_set('America/New_York');
  33.  
  34. $CurrenTime = time();
  35. $FinalTime  = '+25 days 25 minutes';
  36. $FinalFile  = 'dmsr.txt';
  37. $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";
  38.  
  39. if(!file_exists($FinalFile)) { file_put_contents($FinalFile, $CurrenTime); }
  40.  
  41. $FinalCon = file_get_contents($FinalFile); $FinalConStr = date($datestr, $FinalCon);
  42.  
  43. echo "<br>Switch closed $FinalConStr<br><br>Update by " .  date ($datestr, strtotime($FinalTime, $FinalCon));
  44.  
  45. if(strtotime($FinalTime, $FinalCon) < $CurrenTime){
  46.     echo "<br><br><strong>Deadline!</strong><br>";
  47.     //unlink($FinalFile);
  48.     // mailer();
  49.     }
  50.  
  51. if ((isset($_SESSION['validUser'])) && ($_SESSION['validUser'] == true)){
  52. echo "<br><br><button onclick=window.location.replace('?logout')>Log out</button>&ensp;&ensp;<button onclick=window.location.replace('?update')>Update</button>"; } else {echo "<br><br><button onclick=window.location.replace('login.php')>Logged out</button>&ensp;&ensp;";
  53. if(strtotime($FinalTime, $FinalCon) < $CurrenTime){echo "&ensp;&ensp;<button onclick=window.location.replace('?hgen')>HGenesis</button>";}
  54. }
  55.  
  56. function update(){
  57.     if ((isset($_SESSION['validUser'])) && ($_SESSION['validUser'] == true)){
  58.     date_default_timezone_set('America/New_York');
  59.    
  60.     $CurrenTime = time();
  61.     $FinalFile  = 'dmsr.txt'; $NotifyFile = 'dmsr_notify.txt';
  62.  
  63.     file_put_contents($FinalFile, $CurrenTime); echo "<script>location.href = 'dmsr.php'</script>";
  64. }}
  65.  
  66. function hgenesis(){
  67.     if ((isset($_SESSION['validUser'])) && ($_SESSION['validUser'] == true)){
  68.         $FinalFile  = 'dmsr.txt';
  69.         unlink($FinalFile);
  70.         echo "<script>location.href = 'dmsr.php'</script>";
  71. }}
  72.  
  73. function mailer(){
  74. $subject = "DMS Notifier";
  75. $message = "Hey now. <a href='https://gowansb.powweb.com/dms/dmsr.php'>Login if you have to and check if you want to</a>.";
  76. $mailto  = "";
  77. $headers = "From: ";
  78.  
  79. mail("$mailto", "$subject" , "$message", "$headers");
  80. }
  81.  
  82. ?></center></body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement