mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
cancel apply patch
This commit is contained in:
@@ -1,112 +0,0 @@
|
||||
<?php
|
||||
require "../include/bittorrent.php";
|
||||
dbconn();
|
||||
loggedinorreturn();
|
||||
if (get_user_class() < UC_SYSOP) {
|
||||
stderr("Sorry", "Access denied.");
|
||||
}
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$sender_id = ($_POST['sender'] == 'system' ? 0 : (int)$CURUSER['id']);
|
||||
$dt = date("Y-m-d H:i:s");
|
||||
$msg = trim($_POST['msg']);
|
||||
$amount = $_POST['amount'];
|
||||
if (!$msg || !$amount)
|
||||
stderr("Error","Don't leave any fields blank.");
|
||||
if(!is_numeric($amount))
|
||||
stderr("Error","amount must be numeric");
|
||||
$updateset = $_POST['clases'];
|
||||
if (is_array($updateset)) {
|
||||
foreach ($updateset as $class) {
|
||||
if (!is_valid_id($class) && $class != 0)
|
||||
stderr("Error","Invalid Class");
|
||||
}
|
||||
}else{
|
||||
if (!is_valid_id($updateset) && $updateset != 0)
|
||||
stderr("Error","Invalid Class");
|
||||
}
|
||||
$subject = trim($_POST['subject']);
|
||||
$page = 1;
|
||||
$size = 10000;
|
||||
while (true) {
|
||||
$messages = [];
|
||||
$userIdArr = [];
|
||||
$users = \App\Models\User::query()->whereIn('class', $updateset)->forPage($page, $size)->get(['id']);
|
||||
if ($users->isEmpty()) {
|
||||
break;
|
||||
}
|
||||
foreach ($users as $user) {
|
||||
$userIdArr[] = $user->id;
|
||||
$messages[] = [
|
||||
'sender' => $sender_id,
|
||||
'receiver' => $user->id,
|
||||
'added' => $dt,
|
||||
'subject' => $subject,
|
||||
'msg' => $msg,
|
||||
];
|
||||
}
|
||||
\App\Models\User::query()->whereIn('id', $userIdArr)->increment('attendance_card', $amount);
|
||||
\App\Models\Message::query()->insert($messages);
|
||||
$page++;
|
||||
}
|
||||
header(sprintf("Location: %s?sent=1", $_SERVER['PHP_SELF']));
|
||||
}
|
||||
|
||||
stdhead("Add Attendance card", false);
|
||||
$allClass = array_chunk(\App\Models\User::$classes, 4, true);
|
||||
?>
|
||||
<table class=main width=737 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>
|
||||
<div align=center>
|
||||
<h1>Add attendance card to all staff members and users:</a></h1>
|
||||
<form method=post action=<?php echo $_SERVER['PHP_SELF']?>>
|
||||
<?php
|
||||
|
||||
if (isset($_GET["returnto"]) || $_SERVER["HTTP_REFERER"])
|
||||
{
|
||||
?>
|
||||
<input type=hidden name=returnto value="<?php echo htmlspecialchars($_GET["returnto"]) ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"])?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<table cellspacing=0 cellpadding=5>
|
||||
<?php
|
||||
if (isset($_GET["sent"]) && $_GET["sent"] == 1) {
|
||||
?>
|
||||
<tr><td colspan=2 class="text" align="center"><font color=red><b>Attendance card has been added and inform message has been sent.</font></b></tr></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr><td class="rowhead" valign="top">Amount </td><td class="rowfollow"><input type=number name=amount size=10></td></tr>
|
||||
<tr>
|
||||
<td class="rowhead" valign="top">Add to</td><td class="rowfollow">
|
||||
<table style="border: 0" width="100%" cellpadding="0" cellspacing="0">
|
||||
<?php foreach ($allClass as $bulk) {?>
|
||||
<tr>
|
||||
<?php foreach ($bulk as $key => $value) {?>
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="<?php echo $key?>">
|
||||
</td>
|
||||
<td style="border: 0"><?php echo $value['text'] ?></td>
|
||||
<?php }?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="rowhead" valign="top">Subject </td><td class="rowfollow"><input type=text name=subject size=82></td></tr>
|
||||
<tr><td class="rowhead" valign="top">Reason </td><td class="rowfollow"><textarea name=msg cols=80 rows=5><?php echo $body ?? ''?></textarea></td></tr>
|
||||
<tr>
|
||||
<td class="rowfollow" colspan=2><div align="center"><b>Operator: </b>
|
||||
<?php echo $CURUSER['username']?>
|
||||
<input name="sender" type="radio" value="self" checked>
|
||||
System
|
||||
<input name="sender" type="radio" value="system">
|
||||
</div></td></tr>
|
||||
<tr><td class="rowfollow" colspan=2 align=center><input type=submit value="Do It!" class=btn></td></tr>
|
||||
</table>
|
||||
<input type=hidden name=receiver value=<?php echo $receiver ?? ''?>>
|
||||
</form>
|
||||
|
||||
</div></td></tr></table>
|
||||
<br />
|
||||
NOTE: Do not use BB codes. (NO HTML)
|
||||
<?php
|
||||
stdfoot();
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
require "../include/bittorrent.php";
|
||||
dbconn();
|
||||
loggedinorreturn();
|
||||
if (get_user_class() < UC_MODERATOR)
|
||||
stderr("Error", "Access denied.");
|
||||
$seedBonusAll = [
|
||||
1 => 100,
|
||||
2 => 1000,
|
||||
3 => 10000,
|
||||
];
|
||||
$selectName = 'seed_bonus_type';
|
||||
$select = '<select name="' . $selectName . '">';
|
||||
foreach ($seedBonusAll as $key => $value) {
|
||||
$select .= sprintf('<option value="%s">%s</option>', $key, $value);
|
||||
}
|
||||
$select .= '</select>';
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST")
|
||||
{
|
||||
if (isset($_POST['doit']) && $_POST['doit'] == 'yes') {
|
||||
if (empty($_POST[$selectName]) || !isset($seedBonusAll[$_POST[$selectName]])) {
|
||||
stderr("Error", "Invalid form data: $selectName.");
|
||||
}
|
||||
$seedBonusIncrease = $seedBonusAll[$_POST[$selectName]];
|
||||
sql_query("UPDATE users SET seedbonus = seedbonus + $seedBonusIncrease WHERE status='confirmed'");
|
||||
stderr("Bonus", "$seedBonusIncrease bonus point is sent to everyone...");
|
||||
die;
|
||||
}
|
||||
|
||||
if ($_POST["username"] == "" || $_POST["seedbonus"] == "" || $_POST["seedbonus"] == "")
|
||||
stderr("Error", "Missing form data.");
|
||||
$username = sqlesc($_POST["username"]);
|
||||
$seedbonus = sqlesc($_POST["seedbonus"]);
|
||||
|
||||
sql_query("UPDATE users SET seedbonus=seedbonus + $seedbonus WHERE username=$username") or sqlerr(__FILE__, __LINE__);
|
||||
$res = sql_query("SELECT id FROM users WHERE username=$username");
|
||||
$arr = mysql_fetch_row($res);
|
||||
if (!$arr)
|
||||
stderr("Error", "Unable to update account.");
|
||||
header("Location: " . get_protocol_prefix() . "$BASEURL/userdetails.php?id=".htmlspecialchars($arr[0]));
|
||||
die;
|
||||
}
|
||||
stdhead("Update Users Upload Amounts");
|
||||
?>
|
||||
<h1>Update Users Bonus Amounts</h1>
|
||||
<?php
|
||||
begin_main_frame("",false, 30);
|
||||
begin_main_frame("Add to Specific User",false,30);
|
||||
echo "<form method=\"post\" action=\"amountbonus.php\">";
|
||||
print("<table width=100% border=1 cellspacing=0 cellpadding=5>\n");
|
||||
?>
|
||||
<tr><td class="rowhead">User name</td><td class="rowfollow"><input type="text" name="username" size="30"/></td></tr>
|
||||
<tr><td class="rowhead">Bonus</td><td class="rowfollow"><input type="text" name="seedbonus" size="5"/></td></tr>
|
||||
<tr><td colspan="2" class="toolbox" align="center"><input type="submit" value="Okay" class="btn"/></td></tr>
|
||||
<?php end_table();?>
|
||||
</form>
|
||||
<?php end_main_frame();?>
|
||||
<?php begin_main_frame("Send bonus point to everyone",false,30);?>
|
||||
<form action="amountbonus.php" method="post">
|
||||
<table width=100% border=1 cellspacing=0 cellpadding=5>
|
||||
<tr>
|
||||
<td class="rowhead">Bonus</td>
|
||||
<td class="rowfollow"><?php echo $select?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="toolbox" align="center" colspan="2">
|
||||
<input type = "hidden" name = "doit" value = "yes" />
|
||||
<input type="submit" class="btn" value="Okay" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php end_table();?>
|
||||
</form>
|
||||
<?php
|
||||
end_main_frame();
|
||||
end_main_frame();
|
||||
stdfoot();
|
||||
@@ -1,128 +0,0 @@
|
||||
<?php
|
||||
require "../include/bittorrent.php";
|
||||
dbconn();
|
||||
loggedinorreturn();
|
||||
if (get_user_class() < UC_SYSOP)
|
||||
stderr("Sorry", "Access denied.");
|
||||
stdhead("Add Upload", false);
|
||||
?>
|
||||
<table class=main width=737 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>
|
||||
<div align=center>
|
||||
<h1>Add upload to all staff members and users:</a></h1>
|
||||
<form method=post action=takeamountupload.php>
|
||||
<?php
|
||||
|
||||
if (isset($_GET["returnto"]) || $_SERVER["HTTP_REFERER"])
|
||||
{
|
||||
?>
|
||||
<input type=hidden name=returnto value="<?php echo htmlspecialchars($_GET["returnto"]) ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"])?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<table cellspacing=0 cellpadding=5>
|
||||
<?php
|
||||
if (isset($_GET["sent"]) && $_GET["sent"] == 1) {
|
||||
?>
|
||||
<tr><td colspan=2 class="text" align="center"><font color=red><b>Upload amount has been added and inform message has been sent.</font></b></tr></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr><td class="rowhead" valign="top">Amount </td><td class="rowfollow"><input type=text name=amount size=10> (in GB)</td></tr>
|
||||
<tr>
|
||||
<td class="rowhead" valign="top">Add to</td><td class="rowfollow">
|
||||
<table style="border: 0" width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="0">
|
||||
</td>
|
||||
<td style="border: 0">Peasant</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="1">
|
||||
</td>
|
||||
<td style="border: 0">User</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="2">
|
||||
</td>
|
||||
<td style="border: 0">Power User</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="3">
|
||||
</td>
|
||||
<td style="border: 0">Elite User</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="4">
|
||||
</td>
|
||||
<td style="border: 0">Crazy User</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="5">
|
||||
</td>
|
||||
<td style="border: 0">Insane User</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="6">
|
||||
</td>
|
||||
<td style="border: 0">Veteran User</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="7">
|
||||
</td>
|
||||
<td style="border: 0">Extreme User</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="8">
|
||||
</td>
|
||||
<td style="border: 0">Ultimate User</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="9">
|
||||
</td>
|
||||
<td style="border: 0">Nexus Master</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="10">
|
||||
</td>
|
||||
<td style="border: 0">VIP</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="11">
|
||||
</td>
|
||||
<td style="border: 0">Uploader</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="12">
|
||||
</td>
|
||||
<td style="border: 0">Moderator</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="13">
|
||||
</td>
|
||||
<td style="border: 0">Administrator</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="14">
|
||||
</td>
|
||||
<td style="border: 0">SysOp</td>
|
||||
|
||||
<td style="border: 0" width="20"><input type="checkbox" name="clases[]" value="15">
|
||||
</td>
|
||||
<td style="border: 0">Staff Leader</td>
|
||||
|
||||
<td style="border: 0"> </td>
|
||||
<td style="border: 0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="rowhead" valign="top">Subject </td><td class="rowfollow"><input type=text name=subject size=82></td></tr>
|
||||
<tr><td class="rowhead" valign="top">Reason </td><td class="rowfollow"><textarea name=msg cols=80 rows=5><?php echo $body ?? ''?></textarea></td></tr>
|
||||
<tr>
|
||||
<td class="rowfollow" colspan=2><div align="center"><b>Operator: </b>
|
||||
<?php echo $CURUSER['username']?>
|
||||
<input name="sender" type="radio" value="self" checked>
|
||||
System
|
||||
<input name="sender" type="radio" value="system">
|
||||
</div></td></tr>
|
||||
<tr><td class="rowfollow" colspan=2 align=center><input type=submit value="Do It!" class=btn></td></tr>
|
||||
</table>
|
||||
<input type=hidden name=receiver value=<?php echo $receiver ?? ''?>>
|
||||
</form>
|
||||
|
||||
</div></td></tr></table>
|
||||
<br />
|
||||
NOTE: Do not user BB codes. (NO HTML)
|
||||
<?php
|
||||
stdfoot();
|
||||
Reference in New Issue
Block a user