Location: PHPKode > projects > Db-newsletter > db-newsletter/admin.php
<?
 
/*
Copyright (c) 2007-2008, Daniel Braun

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

session_start();
  
include ("include/mysql.php"); //MySQL Daten laden
  
$sql = mysql_query("SELECT * FROM settings");
 while ($ds = mysql_fetch_object($sql))
 {
  $passwort = $ds -> passwort; //gespeichertes passwort in die variable passwort laden
 } 

 
//Wenn Psswort richtig erstelle session, wenn nicht umleitung
  if(md5($_POST['pw']) == $passwort)
  {
  $_SESSION['db_newsletter'] = "$passwort";  
  }
  
 if($_SESSION['db_newsletter']  != "$passwort")
  {
   include ("include/auth.php"); //MySQL Daten laden
  }
  
  //Anzahl der neu eingetragenen
  $query = "SELECT COUNT(*) FROM liste WHERE status = 'new'";
  $sql   = mysql_query($query);  
  $neu   = mysql_result($sql, 0);
  
  //Anzahl der neu ausgetragenen
  $query = "SELECT COUNT(*) FROM liste WHERE status = 'old'";
  $sql   = mysql_query($query);  
  $alt   = mysql_result($sql, 0); 

  function checkupdates() // AUF UPDATES PRÜFEN
  {
   $vers = "0.991";
   $acvers = file_get_contents('http://web90.max17.info/daniel-braun.com/wb/db-newsletter.vers');
  
   if ( $vers < $acvers)
   {
    echo "<div align = center><a href=\"update.php\" target=\"blank\"><img src = \"gfx/update.gif\"></a></div>";
   }
  }
  
  function checkinstall() //Prüfen ob install.php noch existiert
  {
   if (file_exists("install.php"))
   {
    echo "<font color=red><b>Bitte l&ouml;schen Sie die install.php!</b></font><br>";
   }
  }
  
  function checkpass($passwort) //Prüfen ob Passwort geändert
  {
   if ($passwort == "8a30ec6807f71bc69d096d8e4d501ade")
   {
    echo "<font color=red><b>Bitte &auml;ndern Sie Ihr Passwort!</b></font>";
   }
  }
  
?>

<html>
 
<head>
  <link rel="stylesheet" type="text/css" href="style.css"> 

  <script type="text/javascript">
  function pop(file,windowname,features)
  {
   helpwindow = window.open(file,"Changes","toolbar=no", "location=no");
   helpwindow.focus();
   return false;
  }
  </script> 
 </head>


<br><br><br>
<div align="center"><font size="7"><strong>Willkommen</strong></font></div>
<br><br><br><br><br><br><br>

 <div align="center">
		<b>Es gibt <font color="green"><? echo "$neu"; ?></font> Neuanmeldungen und <font color="red"><? echo "$alt"; ?></font> Austragungen.</b>
		<br><br>
		<font size="2"><a href="changes.php" target="_blank" onclick="return pop('changes.php');">Anzeigen</a> - <a href="edit.php">Weiter</a></font>
 </div>
 
 <?
  checkinstall();//Anzeigen ob install.php noch existiert
  checkpass   ($passwort);//Anzeigen ob Passwort geändert
  checkupdates(); //Anzeigen ob Updates verfügbar sind
 ?>

 

</html>
Return current item: Db-newsletter