mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 06:57:22 +08:00
invite system add pager
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$sql = "update attendance,attendance_logs set attendance.total_days = attendance.total_days + (select count(*) from attendance_logs where uid = attendance.uid and is_retroactive = 1)";
|
||||
\Illuminate\Support\Facades\DB::update($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
+27
-15
@@ -6,9 +6,20 @@ loggedinorreturn();
|
||||
parked();
|
||||
$id = intval($_GET["id"] ?? 0);
|
||||
$type = unesc($_GET["type"] ?? '');
|
||||
$menuSelected = $_REQUEST['menu'] ?? 'invitee';
|
||||
|
||||
registration_check('invitesystem',true,false);
|
||||
|
||||
function inviteMenu ($selected = "invitee") {
|
||||
global $lang_invite, $id, $CURUSER;
|
||||
begin_main_frame();
|
||||
print ("<div id=\"invitenav\" style='position: relative'><ul id=\"invitemenu\" class=\"menu\">");
|
||||
print ("<li" . ($selected == "invitee" ? " class=selected" : "") . "><a href=\"?id=".$id."&menu=invitee\">".$lang_invite['text_invite_status']."</a></li>");
|
||||
print ("<li" . ($selected == "sent" ? " class=selected" : "") . "><a href=\"?id=".$id."&menu=sent\">".$lang_invite['text_sent_invites_status']."</a></li>");
|
||||
print ("</ul><form style='position: absolute;top:0;right:0' method=post action=invite.php?id=".htmlspecialchars($id)."&type=new><input type=submit ".($CURUSER['invites'] <= 0 ? "disabled " : "")." value='".$lang_invite['sumbit_invite_someone']."'></form></div>");
|
||||
end_main_frame();
|
||||
}
|
||||
|
||||
if (($CURUSER['id'] != $id && get_user_class() < $viewinvite_class) || !is_valid_id($id))
|
||||
stderr($lang_invite['std_sorry'],$lang_invite['std_permission_denied']);
|
||||
if (get_user_class() < $sendinvite_class)
|
||||
@@ -16,7 +27,7 @@ stderr($lang_invite['std_sorry'],$lang_invite['std_only'].get_user_class_name($s
|
||||
$res = sql_query("SELECT username FROM users WHERE id = ".mysql_real_escape_string($id)) or sqlerr();
|
||||
$user = mysql_fetch_assoc($res);
|
||||
stdhead($lang_invite['head_invites']);
|
||||
print("<table width=700 class=main border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");
|
||||
print("<table width=100% class=main border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");
|
||||
|
||||
print("<h1 align=center><a href=\"invite.php?id=".$id."\">".$user['username'].$lang_invite['text_invite_system']."</a></h1>");
|
||||
$sent = htmlspecialchars($_GET['sent'] ?? '');
|
||||
@@ -46,25 +57,27 @@ if ($type == 'new'){
|
||||
$invitation_body = $lang_invite['text_invitation_body'].$CURUSER['username'];
|
||||
//$invitation_body_insite = str_replace("<br />","\n",$invitation_body);
|
||||
print("<form method=post action=takeinvite.php?id=".htmlspecialchars($id).">".
|
||||
"<table border=1 width=737 cellspacing=0 cellpadding=5>".
|
||||
"<table border=1 width=100% cellspacing=0 cellpadding=5>".
|
||||
"<tr align=center><td colspan=2><b>".$lang_invite['text_invite_someone']."$SITENAME ({$inv['invites']}".$lang_invite['text_invitation'].$_s.$lang_invite['text_left'] .")</b></td></tr>".
|
||||
"<tr><td class=\"rowhead nowrap\" valign=\"top\" align=\"right\">".$lang_invite['text_email_address']."</td><td align=left><input type=text size=40 name=email><br /><font align=left class=small>".$lang_invite['text_email_address_note']."</font>".($restrictemaildomain == 'yes' ? "<br />".$lang_invite['text_email_restriction_note'].allowedemails() : "")."</td></tr>".
|
||||
"<tr><td class=\"rowhead nowrap\" valign=\"top\" align=\"right\">".$lang_invite['text_message']."</td><td align=left><textarea name=body rows=8 cols=120>" .$invitation_body.
|
||||
"<tr><td class=\"rowhead nowrap\" valign=\"top\" align=\"right\">".$lang_invite['text_message']."</td><td align=left><textarea name=body rows=10 style='width: 100%'>" .$invitation_body.
|
||||
"</textarea></td></tr>".
|
||||
"<tr><td align=center colspan=2><input type=submit value='".$lang_invite['submit_invite']."'></td></tr>".
|
||||
"</form></table></td></tr></table>");
|
||||
|
||||
} else {
|
||||
|
||||
inviteMenu($menuSelected);
|
||||
if ($menuSelected == 'invitee') {
|
||||
$rel = sql_query("SELECT COUNT(*) FROM users WHERE invited_by = ".mysql_real_escape_string($id)) or sqlerr(__FILE__, __LINE__);
|
||||
$arro = mysql_fetch_row($rel);
|
||||
$number = $arro[0];
|
||||
list($pagertop, $pagerbottom, $limit) = pager(1, $number, "?id=$id&menu=$menuSelected&");
|
||||
|
||||
$ret = sql_query("SELECT id, username, email, uploaded, downloaded, status, warned, enabled, donor, email FROM users WHERE invited_by = ".mysql_real_escape_string($id)) or sqlerr();
|
||||
$ret = sql_query("SELECT id, username, email, uploaded, downloaded, status, warned, enabled, donor, email FROM users WHERE invited_by = ".mysql_real_escape_string($id) . " $limit") or sqlerr();
|
||||
$num = mysql_num_rows($ret);
|
||||
|
||||
print("<table border=1 width=737 cellspacing=0 cellpadding=5>".
|
||||
"<h2 align=center>".$lang_invite['text_invite_status']." ($number)</h2><form method=post action=takeconfirm.php?id=".htmlspecialchars($id).">");
|
||||
print("<table border=1 width=100% cellspacing=0 cellpadding=5>".
|
||||
"<form method=post action=takeconfirm.php?id=".htmlspecialchars($id).">");
|
||||
|
||||
if(!$num){
|
||||
print("<tr><td colspan=7 align=center>".$lang_invite['text_no_invites']."</tr>");
|
||||
@@ -117,21 +130,19 @@ if ($type == 'new'){
|
||||
print("<tr><td colspan=7 align=right><input type=submit style='height: 20px' value=".$lang_invite['submit_confirm_users']."></td></tr>");
|
||||
}
|
||||
print("</form>");
|
||||
print("<tr><td colspan=7 align=center><form method=post action=invite.php?id=".htmlspecialchars($id)."&type=new><input type=submit ".($CURUSER['invites'] <= 0 ? "disabled " : "")." value='".$lang_invite['sumbit_invite_someone']."'></form></td></tr>");
|
||||
}
|
||||
print("</table>");
|
||||
|
||||
print("</table>$pagertop");
|
||||
} elseif ($menuSelected == 'sent') {
|
||||
$rul = sql_query("SELECT COUNT(*) FROM invites WHERE inviter =".mysql_real_escape_string($id)) or sqlerr();
|
||||
$arre = mysql_fetch_row($rul);
|
||||
$number1 = $arre[0];
|
||||
|
||||
list($pagertop, $pagerbottom, $limit) = pager(1, $number1, "?id=$id&menu=$menuSelected&");
|
||||
|
||||
$rer = sql_query("SELECT * FROM invites WHERE inviter = ".mysql_real_escape_string($id)) or sqlerr();
|
||||
$rer = sql_query("SELECT * FROM invites WHERE inviter = ".mysql_real_escape_string($id) . " $limit") or sqlerr();
|
||||
$num1 = mysql_num_rows($rer);
|
||||
|
||||
|
||||
print("<table border=1 width=737 cellspacing=0 cellpadding=5>".
|
||||
"<h2 align=center>".$lang_invite['text_sent_invites_status']." ($number1)</h2>");
|
||||
print("<table border=1 width=100% cellspacing=0 cellpadding=5>");
|
||||
|
||||
if(!$num1){
|
||||
print("<tr align=center><td colspan=6>".$lang_invite['text_no_invitation_sent']."</tr>");
|
||||
@@ -156,7 +167,8 @@ if ($type == 'new'){
|
||||
}
|
||||
}
|
||||
print("</table>");
|
||||
print("</td></tr></table>");
|
||||
print("</td></tr></table>$pagertop");
|
||||
}
|
||||
|
||||
}
|
||||
stdfoot();
|
||||
|
||||
Reference in New Issue
Block a user