I created this new staffapp script because after alot of people applying for staff they all mailed me asking when will they get mail if they in or not. So this function will give you a chance to automatically decline or choose them for the postion they chose. It simple but will save you some hassle :).
create file staffapps.php
<?php
session_start();
require "global_func.php";
if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
if($_POST['app'])
{
mysql_query("INSERT INTO staffapps VALUES('',$userid,'{$_POST['pos']}','{$_POST['app']}')", $c) or die("Your staff application could not be processed. Make sure you have filled out the form completely");
print "Staff application processed. You will receive a mail in less than 3 days with our decision. Good luck";
}
else
{
print "Staff Application
Position: AdminSecretaryAssistant
Why do you deserve the position?:
{$_GET['app']}
";
}
$h->endpage();
?>
add this to admin.php
case 'appview': app_view(); break;
case 'appaccept': app_accept(); break;
case 'appdeny': app_deny(); break;
[[url='admin.php?action=appview']Staff Apps[/url]]
function app_view()
{
global $ir,$c,$h,$userid;
print "Staff Applications
3=Admin
5=Secretary
6=Assistant
If you find any other member positions please report it to a game owner right away!
</pre>
<table width="80%">Applicant ID PositionApplication </table>
<font color="#0000FF">Accept</font>[/url]<br>[url='admin.php?action=appdeny&ID={$r[']<font color="#FF0000">Decline</font>[/url]<br>";<br>}<br>print "<br>";<br>}<br>function app_accept()<br>{<br>global $ir,$c,$h,$userid;<br>$_GET['ID'] = abs((int) $_GET['ID']);<br>mysql_query("DELETE FROM staffapps WHERE appID={$_GET['ID']}",$c);<br>mysql_query("UPDATE users SET user_level='{$_GET['staff']}' WHERE userid='{$_GET['user']}'",$c);<br>mysql_query("INSERT INTO mail VALUES('', 0, 'System', '{$_GET['user']}', unix_timestamp(),'Your application' ,'Congrats, your application has been reviwed and you are now a staff member. Please view our rules so you do not loose this job.')",$c);<br>print "App Accepted<br><br>[url='admin.php?action=appview']> Back[/url]";<br>}<br>function app_deny()<br>{<br>global $ir,$c,$h,$userid;<br>$_GET['ID'] = abs((int) $_GET['ID']);<br>mysql_query("DELETE FROM staffapps WHERE appID={$_GET['ID']}",$c);<br>mysql_query("INSERT INTO mail VALUES('', 0, 'System', '{$_GET['user']}', unix_timestamp(),'Your application' ,'Our staff has reviewed your staff application and unfortunately we feel you are not qualified to be a staff member. Feel free to fill in another application.')",$c);<br>print "App Denied<br><br>[url='admin.php?action=appview']> Back[/url]"
and add this table in mysql
CREATE TABLE `staffapps` (
`appID` int(11) NOT NULL auto_increment,
`applicant` int(11) NOT NULL default '0',
`position` varchar(255) NOT NULL default '',
`application` longtext NOT NULL,
PRIMARY KEY (`appID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
make sure to change the user_level if they incorrect. currently its
3=Admin
5=Secretary
6=Assistant
if your running on dabs codes it should be correct.
alos visit my game deadlywarsonline.com. not open yet but it will be soon. :). im also looking for some staff if interested once opened.