Thema: ..::www.DeeoNe.de-D1Infusionen::.. :: MyBuddySystem und Geschenke System

Geschrieben von matze am 15-09-2020 13:54
#6

Probier diese Datei mal.

admin.php

Code
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: admin.php
| Author: Jürgen Carstensen
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+----------------------------------------------------*
| MWN Geschenke System
| Angepasst und erweitert für ScoreSystem 1.0
| ScoreSystem 1.0 erhältlich unter:
| http://www.phpfus...ortclub.de
| Author: JC Drago /
| Web: http://www.my-web...
| Copyright holder of the original code: Starefossen
| http://starefosse...
+----------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES."templates/admin_header.php";
include INFUSIONS."mwn_geschenke_system/infusion_db.php";
if (!checkrights("MWNG")) { redirect(BASEDIR."index.php"); }

// Prüfen ist ScoreSystem da
if (file_exists(INFUSIONS."scoresystem_panel/scoresystem.php")) {
include INFUSIONS."mwn_geschenke_system/locale/German_score.php";
// Prüfen Ende
} else {
include INFUSIONS."mwn_geschenke_system/locale/German_gold.php";
}

if(isset($_POST['aendern'])){

if($_POST['scoresystem'] == '0' AND $_POST['goldsystem'] == ""){$_POST['goldsystem'] = "1";
}

dbquery("UPDATE ".DB_MWN_GESCHENKE_BEZAHLEN." SET scoresystem = '".$_POST['scoresystem']."', goldsystem = '".$_POST['goldsystem']."'");
redirect(FUSION_SELF.$aidlink."&status=we");
}
if(isset($_GET['del']) && isnum($_GET['del'])){
$result = dbquery("DELETE FROM ".DB_MWN_GESCHENKE." WHERE geschenke_id='".$_GET['del']."'");
redirect(FUSION_SELF.$aidlink."&status=dm");
}

if(!empty($_POST['add_geschenke'])){
$geschenke_image = stripinput($_POST['geschenke_image']);
$geschenke_price = stripinput($_POST['geschenke_price']);
$geschenke_stock = stripinput($_POST['geschenke_stock']);
$geschenke_text = stripinput($_POST['geschenke_text']);
$geschenke_bought = stripinput($_POST['geschenke_bought']);
$result = dbquery("INSERT INTO ".DB_MWN_GESCHENKE." (geschenke_image, geschenke_price, geschenke_stock, geschenke_text, geschenke_bought) VALUES('$geschenke_image', '$geschenke_price', '$geschenke_stock', '$geschenke_text', '$geschenke_bought')");
redirect(FUSION_SELF.$aidlink."&status=sm");
}

if(!empty($_POST['edit_geschenke'])){
$geschenke_id = stripinput($_POST['geschenke_id']);
$geschenke_image = stripinput($_POST['geschenke_image']);
$geschenke_price = stripinput($_POST['geschenke_price']);
$geschenke_stock = stripinput($_POST['geschenke_stock']);
$geschenke_text = stripinput($_POST['geschenke_text']);
$geschenke_bought = stripinput($_POST['geschenke_bought']);
$result = dbquery("UPDATE ".DB_MWN_GESCHENKE." SET geschenke_image='$geschenke_image', geschenke_price='$geschenke_price', geschenke_stock='$geschenke_stock', geschenke_text='$geschenke_text', geschenke_bought='$geschenke_bought' WHERE geschenke_id='$geschenke_id'");
redirect(FUSION_SELF.$aidlink."&status=em");
}

opentable($locale['mwn_geschenke200']);

if(IsSeT($_GET['status']) && $_GET['status'] == "sm") {
echo "<center><table class='tbl-border' width='800'>
   <tr>
      <td class='tbl1' align='center'><font color='red'><strong>".$locale['mwn_geschenke221']."</strong></font></td>
   </tr>
</table></center><br>";

tablebreak();
}

if(IsSeT($_GET['status']) && $_GET['status'] == "dm") {
echo "<center><table class='tbl-border' width='800'>
   <tr>
      <td class='tbl1' align='center'><font color='red'><strong>".$locale['mwn_geschenke220']."</strong></font></td>
   </tr>
</table></center><br>";

tablebreak();
}

if(IsSeT($_GET['status']) && $_GET['status'] == "em") {
echo "<center><table class='tbl-border' width='800'>
   <tr>
      <td class='tbl1' align='center'><font color='red'><strong>".$locale['mwn_geschenke228']."</strong></font></td>
   </tr>
</table></center><br>";

tablebreak();
}
if(IsSeT($_GET['status']) && $_GET['status'] == "we") {
echo "<center><table class='tbl-border' width='800'>
   <tr>
      <td class='tbl1' align='center'><font color='red'><strong>".$locale['mwn_geschenke224']."</strong></font></td>
   </tr>
</table></center><br>";

tablebreak();
}

// Einstellen Socore oder Gold
$result = dbquery ("SELECT * FROM ".DB_MWN_GESCHENKE_BEZAHLEN."");
$data=dbarray($result);

if($data['scoresystem'] == '0'){
$scoresystemgold_status = "<font color='green'><b>Score</b></font>";
}else{
$scoresystemgold_status = "<font color='red'><b>Gold</b></font>";
}

echo "<table width='450'>
   <tr>";
   echo "&nbsp;<b>Einstellungen:</b><br>";
            
      echo "<hr>
      <tr>
        <td>".$locale['mwn_geschenke205']."</td>
        <td>$scoresystemgold_status</td>
      </tr>";

echo "<form action='".FUSION_SELF."' method='post'>

<tr>
<td>".$locale['mwn_geschenke206']."</td>
<td><select name='scoresystem' size='1' class='textbox'>";

if($data['scoresystem'] == '0'){
echo "<option value='0' selected>".$locale['mwn_geschenke207']."</option><option value='1'>".$locale['mwn_geschenke208']."</option>";
}else{
echo "<option value='0'>".$locale['mwn_geschenke207']."</option><option value='1' selected>".$locale['mwn_geschenke208']."</option>";
}      
echo "<tr><td></td>
        <td><input type='submit' name='aendern' value='&Auml;ndern' class='button'></td>
     </tr></form>";
// Ende

echo "<form action='".FUSION_SELF."' method='post'>";
      
      echo "<tr>
        <td>".$locale['mwn_geschenke202']."</td>
        <td><select name='geschenke_image' class='textbox' style='width:225px;'>";
   
        echo makefileopts(makefilelist(INFUSIONS."mwn_geschenke_system/images/", ".|..|index.php"));

        echo "</select>
      </td>
   </tr>
   <tr>
      <td>".$locale['mwn_geschenke203'].":</td>
      <td><input type='text' name='geschenke_price' class='textbox' style='width:225px;' value='100' /></td>
   </tr>
   <tr>
      <td>".$locale['mwn_geschenke218'].":</td>
      <td><input type='text' name='geschenke_stock' class='textbox' style='width:225px;' value='50' /></td>
   </tr>
   <tr>
      <td>".$locale['mwn_geschenke223'].":</td>
      <td><input type='text' name='geschenke_text' class='textbox' style='width:225px;' value='Das ist ein Geschenk f&uuml;r Dich.' /></td>
   </tr>
   <tr>
      <td>&nbsp;</td>
      <td><input type='submit' class='button' name='add_geschenke' value='".$locale['mwn_geschenke204']."' /></td>
   </tr>
</table>
</form>";

closetable();

if(isset($_GET['edit']) && isnum($_GET['edit'])){

opentable($locale['mwn_geschenke226']);

$result2 = dbquery("SELECT * FROM ".DB_MWN_GESCHENKE." WHERE geschenke_id='".$_GET['edit']."'");
      $data2 = dbarray($result2);
      $geschenke_id = stripinput($_GET['edit']);
      $geschenke_image = $data2['geschenke_image'];
      $geschenke_price = $data2['geschenke_price'];
      $geschenke_stock = $data2['geschenke_stock'];
      $geschenke_text = $data2['geschenke_text'];
echo "<table width='450'>";
echo "<form action='".FUSION_SELF."' method='post'>";
      
      echo "<tr>
        <td>".$locale['mwn_geschenke212'].":</td>
        <td><input type='hidden' name='geschenke_id' value='$geschenke_id'>
        <input type='hidden' name='geschenke_image' value='$geschenke_image'><img src='".INFUSIONS."mwn_geschenke_system/images/".$geschenke_image."' /></td>
   </tr>
   <tr>
      <td>".$locale['mwn_geschenke203'].":</td>
      <td><input type='text' name='geschenke_price' class='textbox' style='width:225px;' value='".$geschenke_price."' /></td>
   </tr>
   <tr>
      <td>".$locale['mwn_geschenke218'].":</td>
      <td><input type='text' name='geschenke_stock' class='textbox' style='width:225px;' value='".$geschenke_stock."' /></td>
   </tr>
   <tr>
      <td>".$locale['mwn_geschenke223'].":</td>
      <td><input type='text' name='geschenke_text' class='textbox' style='width:225px;' value='".$geschenke_text."' /></td>
   </tr>
   <tr>
      <td>&nbsp;</td>
      <td><input type='submit' class='button' name='edit_geschenke' value='".$locale['mwn_geschenke227']."' /></td>
   </tr>
</table>
</form>";
closetable();
}

tablebreak();

opentable($locale['mwn_geschenke210']);
$result = dbquery("SELECT * FROM ".DB_MWN_GESCHENKE." ORDER BY geschenke_id DESC");
if(dbrows($result)){
echo "<center><table class='tbl-border' width='500'>
   <tr>
      <td class='tbl1' align='center'><b>".$locale['mwn_geschenke211']."</b></td>
      <td class='tbl1' align='center'><b>".$locale['mwn_geschenke212']."</b></td>
      <td class='tbl1' align='center'><b>".$locale['mwn_geschenke213']."</b></td>
      <td class='tbl1' align='center'><b>".$locale['mwn_geschenke216']."</b></td>
      <td class='tbl1' align='center'><b>".$locale['mwn_geschenke219']."</b></td>
      <td class='tbl1' align='center'><b>".$locale['mwn_geschenke214']."</b></td>
   </tr>";
while($data = dbarray($result)){
echo "<tr>
   <td class='tbl1' align='center'>".$data['geschenke_id']."</td>";
echo "   <td class='tbl1' align='center'>
      <img src='".INFUSIONS."mwn_geschenke_system/images/".$data['geschenke_image']."' alt='".$data['geschenke_image']."' />
   </td>
   <td class='tbl1' align='center'>
      ".$data['geschenke_price']." ".$locale['mwn_geschenke217']."
   </td>
   <td class='tbl1' align='center'>
      ".$data['geschenke_bought']."/".$data['geschenke_stock']."
   </td>
   <td class='tbl1' align='center'>
      ".$data['geschenke_text']."
   </td>
   <td class='tbl1' align='center'>
<a href='".FUSION_SELF.$aidlink."&del=".$data['geschenke_id']."'>".$locale['mwn_geschenke215']."</a>
<a href='".FUSION_SELF.$aidlink."&amp;edit=".$data['geschenke_id']."'>".$locale['mwn_geschenke225']."</a>
</td></tr>";
}
echo "</table></center>";
} else {
echo "<center><b>".$locale['mwn_geschenke222']."</b></center>";
}
closetable();

echo "</td>\n";
require_once THEMES."templates/footer.php";
?>