PHP Code:
<?php
class coupon {
private $couponid;
private $couponamount;
private $error;
public function __construct() {
$this->coupon = mysql_real_escape_string($_POST['coupon_1'].'-'.$_POST['coupon_2'].'-'.$_POST['coupon_3']);
$this->couponamount = mysql_real_escape_string($_POST['couponamount']);
$this->error = array();
}
public function check_coupon() {
if(mysql_num_rows(mysql_query("SELECT * FROM homepage.coupon WHERE coupon = '$this->coupon'")) !== 1) {
return false;
} else {
return true;
}
}
public function ceck_send() {
if(!empty($s)) {
if(mysql_num_rows(mysql_query("SELECT * FROM account.account WHERE login = '$this->send'")) !== 1) {
return false;
} else {
return true;
}
}
}
public function api_error() {
if(!$this->check_coupon()) { $this->error[] = 'Der Coupon ist fehlerhaft, bitte überprüfen sie ihre eingabe'; }
if(!$this->check_send()) { $this->error[] = 'Der Empfänger existiert nicht, bitte überprüfen sie ihre eingabe'; }
}
}
?>
</body>
</html>
coupon.php
PHP Code:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.coupon_send').click(function(){
$('#coupon_send').slideToggle('slow');
$('#coupon_my').slideUp('slow');
$('#coupon_buy').slideUp('slow');
});
$('.coupon_buy').click(function(){
$('#coupon_buy').slideToggle('slow');
$('#coupon_send').slideUp('slow');
$('#coupon_my').slideUp('slow');
});
$('.coupon_my').click(function(){
$('#coupon_my').slideToggle('slow');
$('#coupon_buy').slideUp('slow');
$('#coupon_send').slideUp('slow');
});
$('.1').click(function(){
$('#2').slideUp('slow');
$('#1').slideToggle('slow');
});
$('.2').click(function(){
$('#1').slideUp('slow');
$('#2').slideToggle('slow');
});
});
</script>
<div class="con-ui con-top"><h2>Coupon Verwaltung</h2></div>
<div class="con-ui con-post"><div class="con-wrapper">
<?php
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
error_reporting(0);
include_once('coupon.class.php');
$coupon = new coupon;
if(isset($_POST['coupon_add']) && $_POST['coupon_add'] == 'Coupon erstellen') {
$coupon->add_coupon();
echo '<br />';
}
?>
<div id="coupon_add" style="display:none; float:left; width:400px;">
Bitte geben sie den Guthaben des Coupons ein (nur Zahlen)<br><br>
<form action="index.php?s=admin&a=coupon" method="post">
<input type="text" size="11" name="couponamount"/> Coins<br>
<input type="submit" name="coupon_add" value="Coupon erstellen" />
</form>
<hr style="width:400px; float:left;" />
</div>
<b>Willkommen in der Coupon Verwaltung.</b><br /><br />
Coupon heißt auf Deutsch Gutschein, mit den Gutscheinen Kannst du dein Konto aufladen.<br />
Gutscheine können gekauft oder verschenkt werden, diese Werden auch bei Events und verlosungen verschenkt.
<hr />
<b><span class="coupon_send" style="cursor:pointer;"><a>Coupon einlösen</a></span></b> |
<b><span class="coupon_buy" style="cursor:pointer;"><a>Coupon Kaufen</a></span></b> |
<b><span class="coupon_my" style="cursor:pointer;"><a>Meine Coupons</a></span></b>
<hr />
<div id="coupon_send" style="display:none;">
<br />
<input type="radio" name="type" value="1" class="1" /> Ich möchte den Coupon für mich einlösen.<br /><br />
<div id="1" style="display:none;">
<table width="300" border="0">
<tr>
<td width="108">Coupon Code:</td>
<td width="182"><input type="code_1" size="4" /> - <input type="code_2" size="4" /> - <input type="code_3" size="4" /></td>
</tr>
</table>
<input type="submit" value="Einzahlen" />
</div>
<br />
<input type="radio" name="type" value="2" class="2"/> Ich möchte den Coupon für ein Freund einlösen.
<div id="2" style="display:none;">
<br />
<table width="300" border="0">
<tr>
<td width="108">Coupon Code:</td>
<td width="182"><input type="code_1" size="4" /> - <input type="code_2" size="4" /> - <input type="code_3" size="4" /></td>
</tr>
<tr>
<td width="108">Empfänger:</td>
<td width="182"><input type="code_1" size="16" /></td>
</tr>
</table>
<input type="submit" value="Versenden" />
</div>
</div>
<div id="coupon_buy" style="display:none;">
<table width="400" border="0" cellspacing="10" cellpadding="10">
<tr>
<td width="108">Paysafecard:</td>
<td width="220"><input type="code_1" size="4" /> - <input type="code_2" size="4" /> - <input type="code_3" size="4" /> - <input type="code_3" size="4" /></td>
</tr>
<tr>
<td width="108">Passwort:</td>
<td width="182"><input type="code_1" size="6" /> (fals vorhanden)</td>
</tr>
<tr>
<td width="108">Wert:</td>
<td width="182"><select name="amount"><option value="10"> 10 </option><option value="25"> 25 </option><option value="50"> 50 </option><option value="100"> 100 </option></select> Euro</td>
</tr>
</table>
<input type="submit" value="Einzahlen" />
</div>
<div id="coupon_my">
<table width="430" border="0" cellspacing="2" cellpadding="10">
<tr>
<th colspan="4"><hr /></th>
</tr>
<tr>
<th width="122" align="left">Coupon Code</th>
<th width="73" align="left">Wert (Coins)</th>
<th width="76" align="left">Auszahlung</th>
<th width="49">Status</th>
</tr>
<tr>
<th colspan="4"><hr /></th>
</tr>
<tr>
<td width="122">CDJ5-8S8D-K865</td>
<td width="73">12560</td>
<td width="76">Auszahlung</td>
<td width="49" align="center">Padding</td>
</table>
</div>
<?php } else { echo 'Zugriff verweigert'; } ?>
</div></div>
<div class="con-ui con-bt"></div>
###############
Habs auf meiner alten Festplatte gefunden.
#ich weiß nicht, woher ichs hab
#ich weiß nicht, wozu es gut sein soll
#ich weiß nicht, wie es funzt
#ich weiß, dass es ein couponsystem ist, oder so, glaub ich
#wenns pub sein sollte, schickt mir bitte den Link & sagt nicht einfach 'ist pub', ihr Streuner