Subversion Repositories Transart_hsartstorage

Rev

Blame | Last modification | View Log | RSS feed

<?
if (isset($_SESSION)) {
session_destroy();
}
?>
<?php require_once('Connections/Transart.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['login'])) {
  $loginUsername=$_POST['login'];
  $password=md5($_POST['passwort']);
  $MM_fldUserAuthorization = "benutzer_level";
  $MM_redirectLoginSuccess = "main/index.php";
  $MM_redirectLoginFailed = "main/error.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_Transart, $Transart);
        
  $LoginRS__query=sprintf("SELECT benutzer_login, benutzer_passwort, benutzer_level FROM benutzer WHERE benutzer_login=%s AND benutzer_passwort=%s",
  GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $Transart) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    $loginStrGroup  = mysql_result($LoginRS,0,'benutzer_level');
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;       

    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];  
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<?
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Transart Login</title>
<script type="text/javascript" src="scripts/jquery/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery/jquery-ui/jquery-ui.js"></script>
<script type="text/javascript" src="semantic/semantic.min.js"></script>
<link rel="stylesheet" type="text/css" href="semantic/semantic.min.css">
<link href="stil.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table class="master_tabelle">
  <tr>
    <td valign="top"><table width="400" border="0" cellspacing="0">
      <tr>
        <td><p><img src="img/logo.png" width="206" height="41" /></p>
          <p>&nbsp;</p></td>
                  <td><a class="ui violet circular label">V1.107</a></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td valign="top"><?
                /////// Deklariere Globale SESSION VARIABLEN
                $_SESSION['datumaktuell']=date("Y-m-d");
                ?></td>
        <td valign="top">&nbsp;</td>
        <td valign="top">&nbsp;</td>
        <td valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top"><form ACTION="<?php echo $loginFormAction; ?>" id="form1" name="form1" method="POST">
          <table class="ui inverted grey table">
            <tr>
              <td>Login</td>
              <td><label>
                <input name="login" type="text" id="login" />
                <script type="text/javascript">
                          document.form1.login.focus();
                          </script>
              </label></td>
            </tr>
            <tr>
              <td>Passwort</td>
              <td><label>
                <input name="passwort" type="password" id="passwort" />
                </label></td>
            </tr>
            </table>
            <input name="button" type="submit" id="button" value="Senden" class="ui teal button active"/>
          </form>        </td>
        <td valign="top">&nbsp;</td>
        <td valign="top">&nbsp;</td>
        <td valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>
        <table class="ui inverted grey table">
        <?php
// Die Datei test.xml enthält ein XML-Dokument mit einem Wurzel-Element
// und mindestens einem Element /[root]/title.

if ($xml = simplexml_load_file('http://rss.orf.at/news.xml')) {

    //print_r($xml);
        
           foreach ($xml->item as $item) {
                 echo "<tr>";  
                 echo "<td>".$item->title."</td>"; echo "<td><a href='".$item->link."' target='_blank'>";
                  ?>
                  <button class="ui icon button">
                <i class="right arrow icon"></i>
</button>
                   <?php 
                 echo "</a></td>"; 
                 echo '</tr>';
        }
} else {
    exit('Konnte File nicht öffnen.');
}
?>
        </table>
        </td>
        <td>&nbsp;</td>
        <td valign="top"><div id="mylocation">-</div></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>
                </td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>
        </td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>    </td>
  </tr>
</table>

</body>
</html>