<?php // $Id: index.php,v 1.3 2005/08/30 07:10:58 tora60 Exp $
/************************************
 pragmaMx  Content Management System
 Copyright (c) 2007 pragmaMx Dev Team - http://pragmaMx.org
 ***********************************
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 ***********************************
*/

# die Tabelle {prefix}_diesewoche muss eingerichtet sein !!


if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

$GLOBALS["index"] = 1;

function eintraege()
{
  $sql = "SELECT * FROM ".$GLOBALS['prefix']."_diesewoche;";
  $result = sql_query($sql);
  while ($row = sql_fetch_assoc($result))
  {
    $content[] = $row;
  }
  return $content;
}

function eintrag_loeschen($id)
{
 sql_query("DELETE FROM ".$GLOBALS['prefix']."_diesewoche WHERE id = '".$id."';"); 
}

$eintraege = eintraege();  

include("header.php");

OpenTable();
?>
 <table>
  <tr>
   <td>ID</td>
   <td>Datum</td>
   <td>Beschreibung</td>
   <td>Aktion</td>
  </tr>
  <?if(count($eintraege) > 0) :?>
   <? foreach($eintraege as $row) :?>
   <tr>
    <td><?=$row['id'] ?></td>
    <td><?=$row['Datum'] ?></td>
    <td><?=$row['Beschreibung'] ?></td>
    <td><a href="modules.php?name=dieseWoche&amp;file=uebersicht&amp;delete=<?=$row['id']?>">[L&ouml;schen]</a></td>
   </tr>
   <?endforeach;?>
  <?endif;?>
 </table>
<?
CloseTable()
include("footer.php");

?>