Jump to content
MakeWebGames

HITMAN 17

Members
  • Posts

    1,145
  • Joined

  • Last visited

Everything posted by HITMAN 17

  1. Re: The Destroyers   Killah I hate to break the news to you but YOU DONT KNOW ME!!!. You are a second rate pathetic excuse for a coder. I have nothing to explain to you. And no im not 18 so clearly i didnt get it copyrighted. xD you are pathetic you can get lost... dont worry mate im removing the codes anyway starting from scratch thanks for the advise though
  2. Re: [mccode v1] Punch Mod lol bit of topic i love user shops :x
  3. Re: [mccode v2] Parse The Parcel - [Re-Programmed] Give to who: TheLegend Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/thedestr/public_html/staff_parcel.php on line 99 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/thedestr/public_html/staff_parcel.php on line 67
  4. Re: [mccode v2] Parse The Parcel - [Re-Programmed] i cant work out the links what are they
  5. Re: [mccode v2] Parse The Parcel - [Re-Programmed] cron works it just the script doesnt show for staff panel but i fixed the errrors <?php include "sglobals.php"; function die_n($echo) { global $h; echo $echo; $h->endpage(); exit; } switch($_GET['x']) { case 'add': add_p(); break; case 'terminate': terminate_p(); break; case 'give_to': give_p_user(); break; case 'edit_p': edit_p(); break; case 'wgi': whos_got_it(); break; default: 'Use the correct links.'; break; } function edit_p() { global $h,$ir; if($_POST['parcel']) { $p = abs(@intval($_POST['parcel'])); if(mysql_num_rows(mysql_query("SELECT p_ID FROM parcels WHERE p_ID=".$p)) == 0) { die_n('Parcel does not exist.'); } mysql_query("DELETE FROM parcels WHERE p_ID=".$p); mysql_query("UPDATE users SET parcel_got=0, parcel_time=0 WHERE parcel_got=".$p); } echo ' <form action="'.$_SERVER['PHP_SELF'].'?x=edit_p" method="post"> Delete Parcel: <option name="parcel">'; $soc = mysql_query("SELECT p_ID,p_NAME FROM parcels"); while($soc = mysql_fetch_assoc($soc)) { echo '<option value="'.$soc['p_ID'].'">'.$soc['p_NAME'].'</option>'; } echo ' </option> <input type="submit" value="Delete Parcel"> </form>'; function whos_got_it() { global $h,$ir; if($_POST['parcel']) { $p = abs(@intval($_POST['parcel'])); if(mysql_num_rows(mysql_query("SELECT p_ID FROM parcels WHERE p_ID=".$p)) == 0) { die_n("Parcel does not exist!"); } $fetch = mysql_query("SELECT userid,username FROM users WHERE parcel_got=".$p); $soc = mysql_fetch_assoc($fetch); echo '[url="viewuser.php?u='.$soc['userid'].'"]'.$soc['username'].'[/url]'; } echo ' <form action="'.$_SERVER['PHP_SELF'].'?x=wgi" method="post"> Give to who: <option name="parcel">'; $soc = mysql_query("SELECT p_ID,p_NAME FROM parcels"); while($soc = mysql_fetch_assoc($soc)) { echo '<option value="'.$soc['p_ID'].'">'.$soc['p_NAME'].'</option>'; } echo ' </option> <input type="submit" value="Check Who Has This Parcel"> </form>'; } function give_p_user() { global $h,$ir; if($_POST['userid']) { $user = abs(@intval($_POST['userid'])); if(mysql_num_rows(mysql_query("SELECT userid FROM users WHERE userid=".$user)) == 0) { die_n("This user does not exist."); } $parcel = abs(@intval($_POST['parcel'])); if(mysql_num_rows(mysql_query("SELECT p_ID FROM parcels WHERE p_ID=".$parcel)) == 0) { die_n("There is no parcel of this ID!"); } mysql_query("UPDATE users SET parcel_got=".$parcel.",parcel_time=10 WHERE userid=".$user); } echo ' <form action="'.$_SERVER['PHP_SELF'].'?x=give_to" method="post"> Give to who: <option name="p_ID">'; $soc = mysql_query("SELECT userid,username FROM users WHERE laston>unix_timestamp()-1440*60 AND parcel_got=0"); while($soc = mysql_fetch_assoc($soc)) { echo '<option value="'.$soc['userid'].'">'.$soc['username'].'</option>'; } echo ' </option> <input type="submit" value="Give To User"> </form>'; } function terminate_p() { global $h,$ir; if($_POST['p_ID']) { $id = abs(@intval($_POST['p_ID'])); $soc = mysql_query("SELECT p_ID,p_NAME FROM parcels WHERE p_ID=".$id); if(mysql_num_rows($soc) == 0) { die_n("This parcel does not exist."); } $soc = mysql_fetch_assoc($soc); mysql_query("UPDATE users SET parcel_got=0,parcel_time=0 WHERE parcel_got=".$soc['p_ID']); stafflog_add($ir['username'].' has just terminated the parcel '.$soc['p_NAME']); die_n("Parcel successfuly terminated."); } echo ' <form action="'.$_SERVER['PHP_SELF'].'?x=terminate" method="post"> Parcel To Delete: <option name="p_ID">'; $soc = mysql_query("SELECT p_ID,p_NAME FROM parcels"); while($soc = mysql_fetch_assoc($soc)) { echo '<option value="'.$soc['p_ID'].'">'.$soc['p_NAME'].'</option>'; } echo ' </option> <input type="submit" value="Terminate"> </form>'; } function add_p() { global $h,$ir,$c; if($_POST['p_name']) { $name = htmlentities(mysql_real_escape_string(trim($_POST['p_name']))); $wrap = abs(@intval($_POST['p_wrappers'])); $pic = htmlentities($_POST['p_pic']); $cash = abs(@intval($_POST['p_cash'])); $crys = abs(@intval($_POST['p_crystals'])); $item = abs(@intval($_POST['p_item'])); $itmq = abs(@intval($_POST['p_item_qty'])); mysql_query("INSERT INTO parcels (p_NAME,p_WRAPPERS,p_PIC,p_PRIZE_M,p_PRIZE_C,p_PRIZE_I,p_QTY_I) VALUES('".$name."',".$wrap.",'".$pic."',".$cash.",".$crys.",".$item.",".$itmq.")") or die(mysql_error()); stafflog_add("Parcel ".$name." has been created."); die_n("Parcel ".$name." has been created successfuly!"); } echo 'Adding a parcel: <form action="'.$_SERVER['PHP_SELF'].'?x=add" method="post"> Name: <input type="text" name="p_name"> No. Of Wrappers: <input type="text" name="p_wrappers"> Picture: <input type="text" name="p_pic"> Prize Cash: <input type="text" name="p_cash"> Prize Crystals: <input type="text" name="p_crystals"> Prize Item: '.item_dropdown($c,"p_item").' Prize Item QTY: <input type="text" name="p_item_qty"> <input type="submit" value="Create Parcel"> </form>'; } } $h->endpage(); ?>
  6. Re: [Other] Simple Snow Demo
  7. Re: [mccode v2] Parse The Parcel - [Re-Programmed] Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/thedestr/public_html/cron_minute.php on line 46 QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIX_TIMESTAMP(),0,'You have just got the parcel! Click here to unwrap and see if you got the prize!')
  8. Re: [Other] Simple Snow Great works perfectly cheers coldk much better than ullusions as his wudnt work for me
  9. Re: [MCCodes V2] - Parse The Parcel - [Re-Programmed] my crons i not v1 if anything its the code on this thats v1 that you made
  10. Re: [MCCodes V2] - Parse The Parcel - [Re-Programmed] aanyone had a looked and fixed my cron yet
  11. Re: [MCCodes V2] - Parse The Parcel - [Re-Programmed] Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home//public_html/cron_minute.php on line 30 Fatal error: Call to undefined function event_add() in /home//public_html/cron_minute.php on line 33 this is my cron min <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE users set hospital=hospital-1 WHERE hospital>0"); $db->query("UPDATE `users` SET jail=jail-1 WHERE `jail` > 0"); $db->query("UPDATE users SET validated=validated-1 WHERE validated>0"); $db->query("UPDATE users SET validated=0 WHERE validated<0"); $hc=$db->num_rows($db->query("SELECT * FROM users WHERE hospital > 0")); $jc=$db->num_rows($db->query("SELECT * FROM users WHERE jail > 0")); $db->query("UPDATE settings SET conf_value='$hc' WHERE conf_name='hospital_count'"); $db->query("UPDATE settings SET conf_value='$jc' WHERE conf_name='jail_count'"); $fetch_user = mysql_query("SELECT userid,username,parcel_time,parcel_got FROM users WHERE parcel_got!=0"); $soc = mysql_fetch_assoc($fetch_user); //Illusions idea! if($soc['parcel_time'] == 0) { mysql_query("UPDATE users SET parcel_time=0, parcel_got=0 WHERE userid=".$soc['userid']); $data = mysql_query("SELECT userid,username FROM users WHERE laston>unix_timestamp()-1440*60 ORDER BY DESC RAND() LIMIT 1"); $soc_u = mysql_fetch_assoc($data); mysql_query("UPDATE users SET parcel_time=10, parcel_got=".$soc['parcel_got']." WHERE userid=".$soc_u['userid']); event_add($soc_u['userid'],'You have just got the parcel! Click [url="wrappers.php?x=unwrap"]here[/url] to unwrap and see if you got the prize!'); } else { mysql_query("UPDATE users SET parcel_time=parcel_time-1 WHERE userid=".$soc['userid']); } ?>
  12. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] 5 days till christmas i will put a bet on with someone if illusions finishes i will give them +2 if but if he dont you can give me +2 even thoug you will all give me - for this post :(
  13. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] it will be to late when this is done christmas will be gone for another year :(
  14. The Destroyers Great Rpg For Everyone Many Active Players Daily Over 200 Members join now http://www.thedestroyers.co.cc
  15. Re: Hospital/Jail Count stuck i never use that ever it sucks
  16. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] also still missing sql illusions nice try though
  17. Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Parse error: syntax error, unexpected $end in /home/thedestr/public_html/global_func.php on line 453
  18. Re: [MCcode V2] Item Info revamp! ino how to do it and i done it it and doesnt look very good
  19. Re: [Mccodes V2]Phds i have installed just the cron for phds don work correctly
  20. Re: [MCcode V2] Item Info revamp! not on this mod there isnt and this is the only topic of item info made by radio active
  21. Re: [Mccodes V2]Phds great if someone could help
  22. Re: [MCcode V2] Item Info revamp! not bad radi i just need item pictures on it as i added it and work but doesnt look right can you do it please +1
  23. Re: [Mccodes v2] Pass The Parcel / Secret Santa hmm sounds sweet but what if the person has it for more than 10 minutes and doesnt give it
  24. Re: [Mccodes V2]Phds yer emm here is my cron day this is little different and needs fixing <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET u.money=u.money+jr.jrPAY,us.strength=us.strength+jr.jrSTRG,us.labour=us.labour+jr.jrLABOURG,us.IQ=us.IQ+jr.jrIQG,u.exp=u.exp+(jr.jrPAY/20) WHERE u.job > 0 AND u.jobrank > 0") or die("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET u.money=u.money+jr.jrPAY,us.strength=us.strength+jr.jrSTRG,us.labour=us.labour+jr.jrLABOURG,us.IQ=us.IQ+jr.jrIQG WHERE u.job > 0 AND u.jobrank > 0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $db->query("INSERT INTO phds VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev! You also received the {$coud['crNAME']} PHD!')"); } $db->query("TRUNCATE TABLE votes;"); } print "Done!"; ?>   this is why needs fixing You are currently doing the Weapon course, you have -6 days remaining.
  25. Replace Education.php <?php include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } print "<h3>Schooling</h3>"; if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); print "You are currently doing the {$coud['crNAME']}, you have {$ir['cdays']} days remaining."; } else { if($_GET['cstart']) { $_GET['cstart'] = abs((int) $_GET['cstart']); //Verify. $cd=$db->query("SELECT * FROM courses WHERE crID={$_GET['cstart']}"); if($db->num_rows($cd) == 0) { print "You are trying to start a non-existant course!"; } else { $coud=$db->fetch_row($cd); $cdo=$db->query("SELECT * FROM coursesdone WHERE userid=$userid AND courseid={$_GET['cstart']}"); if($ir['money'] < $coud['crCOST']) { print "You don't have enough money to start this course."; $h->endpage(); exit; } if($db->num_rows($cdo) > 0) { print "You have already done this course."; $h->endpage(); exit; } $db->query("UPDATE users SET course={$_GET['cstart']},cdays={$coud['crDAYS']},money=money-{$coud['crCOST']} WHERE userid=$userid"); print "You have started the {$coud['crNAME']}, it will take {$coud['crDAYS']} days to complete."; } } else { //list courses print "Here is a list of available courses."; $q=$db->query("SELECT * FROM courses"); print " <table width=75% cellspacing=1 class='table'><tr style='background:gray;'><th>Course</th><th>Description</th><th>Cost</th><th>Take</th></tr>"; while($r=$db->fetch_row($q)) { $cdo=$db->query("SELECT * FROM coursesdone WHERE userid=$userid AND courseid={$r['crID']}"); if($db->num_rows($cdo)) { $do="[i]Done[/i]"; } else { $do="[url='education.php?cstart={$r[']Take[/url]"; } print "<tr><td>{$r['crNAME']}</td><td>{$r['crDESC']}</td><td>\${$r['crCOST']}</td><td>$do</td></tr>"; } print "</table>"; } } print " Your current PHDs. <table width=40% cellspacing=1 class='table'> <tr><th>PHD</th></tr>"; $gzq=$db->query("SELECT * FROM phds WHERE userid=$userid"); while($gzr=$db->fetch_row($gzq)) { $zgzq=$db->query("SELECT crNAME FROM courses WHERE crID={$gzr['edu']}"); $zgzr=$db->fetch_row($zgzq); print "<tr><td>You have the {$zgzr['crNAME']} PHD.</td></tr>"; } print "</table>"; $h->endpage(); ?> Replace Job.php <?php $jobquery=1; include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } $_GET['interview'] = abs((int) $_GET['interview']); if(!$ir['job']) { if(!$_GET['interview']) { print "You do not yet have a job. A list of jobs is available below. "; $q=$db->query("SELECT * FROM jobs"); print "<table width=75% cellspacing=1 class='table'><tr><th>Name</th><th>Description</th><th>PHD Needed</th><th>Interview</th></tr>"; while($r=$db->fetch_row($q)) { $aphd=$db->query("SELECT crNAME FROM courses WHERE crID={$r['jID']}"); $aphd=$db->fetch_row($aphd); print "<tr><td>{$r['jNAME']}</td><td>{$r['jDESC']}</td><td>"; if($r['jEDU']>0) { print "{$aphd['crNAME']}"; } else { print "None"; } print" <td>[url='job.php?interview={$r[']Go to interview[/url]</td></tr>"; } print "</table>"; } else { $q=$db->query("SELECT j.*,jr.* FROM jobs j LEFT JOIN jobranks jr ON j.jFIRST = jr.jrID WHERE j.jID={$_GET['interview']}"); $r=$db->fetch_row($q); if(!$r['jID']) { die("WTF?..."); } print " <table width=75% cellspacing=1 class='table'> <tr><th>Name</th><th>Says</th></tr>"; print " <tr><td>{$r['jOWNER']}:</td><td>So {$ir['username']}, you were looking for a job with us?</tr></td> <tr><td>{$ir['username']}:</td><td>Yes please!</tr></td>"; $aphd=$db->query("SELECT crNAME FROM courses WHERE crID={$r['jEDU']}"); $aphd=$db->fetch_row($aphd); $phd=$db->query("SELECT edu FROM phds WHERE userid=$userid && edu={$r['jEDU']}"); if($db->num_rows($phd)==0) { print "<tr><td>{$r['jOWNER']}:</td><td>You will need {$aphd['crNAME']} PHD for this job!</tr></td>"; print "<tr><td>{$ir['username']}:</td><td>Okay ill try and get it, thanks!</tr></td> </table>[url='index.php']<center>[b]<h2>Go Home</h2>[/b]</center>[/url]"; } elseif($ir['strength'] >= $r['jrSTRN'] && $ir['labour'] >= $r['jrLABOURN'] && $ir['IQ'] >= $r['jrIQN']) { $db->query("UPDATE users SET job={$_GET['interview']},jobrank={$r['jrID']} WHERE userid=$userid;"); print " <tr><td>{$r['jOWNER']}:</td><td>Okay {$ir['username']}, we're good to go, see you tomorrow.</tr></td> <tr><td>{$ir['username']}:</td><td>Thanks!</tr></td> </table> [url='job.php']<center>[b]<h2>GoTo Job</h2>[/b]</center>[/url]"; } else { print " <tr><td>{$r['jOWNER']}:</td><td>Sorry {$ir['username']}, you're not far enough in the game to work in this job.</tr></td> <tr><td>{$ir['username']}:</td><td>Why not? What do I need to do?</tr></td> <tr><td>{$r['jOWNER']}:</td><td>You'll need:"; if($ir['strength'] < $r['jrSTRN']) { $s=$r['jrSTRN']-$ir['strength']; print " $s more strength, "; } if($ir['labour'] < $r['jrLABOURN']) { $s=$r['jrLABOURN']-$ir['labour']; print " $s more labour, "; } if($ir['IQ'] < $r['jrIQN']) { $s=$r['jrIQN']-$ir['IQ']; print " $s more IQ, "; } print "before you'll be able to work here!</tr></td> <tr><td>{$ir['username']}:</td><td>Alright, ill work on it, thanks anyway {$r['jOWNER']}.</tr></td> <tr><td>{$r['jOWNER']}:</td><td>Sorry, but your not what we are looking for.</tr></td> </table>[url='index.php']<center>[b]<h2>Go Back Home</h2>[/b]</center>[/url]"; } } } else { switch($_GET['action']) { case 'quit': quit_job(); break; case 'promote': job_promote(); break; default: job_index(); break; } } function job_index() { global $db, $ir,$c,$userid,$h; print "<h3>Your Job</h3> You currently work in the {$ir['jNAME']}! You receive \${$ir['jrPAY']} each day at 5pm! You also receive {$ir['jrIQG']} IQ, {$ir['jrSTRG']} strength, and {$ir['jrLABOURG']} labour! <table width=50% cellspacing=1 class='table'><tr><td>Strength: {$ir['strength']}</td><td>IQ: {$ir['IQ']}</td></tr><tr><td>Labour: {$ir['labour']}</td><td>Job Rank: {$ir['jrNAME']}</td></tr></table> [b]Job Ranks[/b] <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>Title</th><th>Pay</th><th>Strength Reqd</th><th>IQ Reqd</th><th>Labour Reqd</th></tr>"; $q=$db->query("SELECT * FROM jobranks WHERE jrJOB={$ir['job']} ORDER BY jrPAY ASC;"); while($r=$db->fetch_row($q)) { print "<tr><td>{$r['jrNAME']}</td><td>\${$r['jrPAY']}</td><td>{$r['jrSTRN']}</td><td>{$r['jrIQN']}</td><td>{$r['jrLABOURN']}</td></tr>"; } print "</table> [url='job.php?action=promote']> Try To Get Promoted[/url] [url='job.php?action=quit']> Quit[/url]"; } function job_promote() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM jobranks WHERE jrPAY > {$ir['jrPAY']} AND jrSTRN <= {$ir['strength']} AND jrLABOURN <= {$ir['labour']} AND jrIQN <= {$ir['IQ']} AND jrJOB = {$ir['job']} ORDER BY jrPAY DESC LIMIT 1"); if($db->num_rows($q) == 0) { print "Sorry, you cannot be promoted at this time. [url='job.php']> Back[/url]"; } else { $r=$db->fetch_row($q); $db->query("UPDATE users SET jobrank={$r['jrID']} WHERE userid=$userid"); print "Congrats, you have been promoted to {$r['jrNAME']} [url='job.php']> Back[/url]"; } } function quit_job() { global $db,$ir,$c,$userid,$h; $db->query("UPDATE users SET job=0,jobrank=0 WHERE userid=$userid"); print "You have quit your job! [url='job.php']> Back[/url]"; } $h->endpage(); ?> SQL Replace Staff_jobs.php <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case 'newjob': newjob(); break; case 'jobedit': jobedit(); break; case 'newjobrank': newjobrank(); break; case 'jobrankedit': jobrankedit(); break; case 'jobdele': jobdele(); break; case 'jobrankdele': jobrankdele(); break; default: print "Error: This script requires an action."; break; } function newjob() { global $db,$ir,$userid,$c; if ( $_POST['jNAME']) { $db->query("INSERT INTO jobs VALUES('','{$_POST['jNAME']}', 0, '{$_POST['jDESC']}', '{$_POST['jOWNER']}, '{$_POST['jEDU']}')"); $i=$db->insert_id(); $db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', $i, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})"); $j=$db->insert_id(); $db->query("UPDATE jobs SET jFIRST=$j WHERE jID=$i"); print "Job created! "; } else { print <<<EOF <form action='staff_jobs.php?action=newjob' method='post'> [b]Job Name:[/b] <input class='textbox' type='text' name='jNAME' /> [b]Job Description:[/b] <input class='textbox' type='text' name='jDESC' /> [b]Job Owner:[/b] <input class='textbox' type='text' name='jOWNER' /> <hr>[b]First Job Rank:[/b] [b]Rank Name:[/b] <input class='textbox' type='text' name='jrNAME' /> [b]Pays:[/b] <input class='textbox' type='text' name='jrPAY' /> [b]Gains:[/b] Str: <input class='textbox' type='text' name='jrSTRG' size=3 maxlength=3> Lab: <input class='textbox' type='text' name='jrLABOURG' size=3 maxlength=3> IQ: <input class='textbox' type='text' name='jrIQG' size=3 maxlength=3> [b]Reqs:[/b] Str: <input class='textbox' type='text' name='jrSTRN' size=5 maxlength=5> Lab: <input class='textbox' type='text' name='jrLABOURN' size=5 maxlength=5> IQ: <input class='textbox' type='text' name='jrIQN' size=5 maxlength=5> EOF; print "[b]Course Needed[/b]: ".course_dropdown($c, "jEDU")." <input class='textbox' type='submit' value='Create Job' /></form>"; } } function jobedit() { global $db,$ir,$userid; if ( $_POST['stage2']) { $db->query("UPDATE jobs SET jNAME='{$_POST['jNAME']}', jDESC='{$_POST['jDESC']}', jOWNER='{$_POST['jOWNER']}', jEDU='{$_POST['jEDU']}', jFIRST={$_POST['jFIRST']} WHERE jID={$_POST['jID']}"); print "Job updated! "; } else if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobs WHERE jID={$_POST['jID']}"); $r=$db->fetch_row($q); print <<<EOF <form action='staff_jobs.php?action=jobedit' method='post'> <input class='textbox' type='hidden' name='stage2' value='1'> <input class='textbox' type='hidden' name='jID' value='{$_POST['jID']}'> [b]Job Name:[/b] <input class='textbox' type='text' name='jNAME' value='{$r['jNAME']}'> [b]Job Description:[/b] <input class='textbox' type='text' name='jDESC' value='{$r['jDESC']}'> [b]Job Owner:[/b] <input class='textbox' type='text' name='jOWNER' value='{$r['jOWNER']}'> EOF; print "[b]Course Needed[/b]: ".course_dropdown($c,'jEDU',$r['jEDU'])." [b]First Job Rank:[/b] "; print jobrank_dropdown($c,'jFIRST',$r['jFIRST']); print <<<EOF <input class='textbox' type='submit' value='Edit' /> </form> EOF; } else { print <<<EOF <form action='staff_jobs.php?action=jobedit' method='post'> <input class='textbox' type='hidden' name='stage1' value='1'> Select a job to edit. EOF; print job_dropdown($c, 'jID', -1); print <<<EOF <input class='textbox' type='submit' value='Edit Job' /> </form> EOF; } } function newjobrank() { global $db,$ir,$userid; if ( $_POST['jrNAME']) { $db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', {$_POST['jrJOB']}, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})"); print "Job rank created! "; } else { print <<<EOF <form action='staff_jobs.php?action=newjobrank' method='post'> [b]Rank Name:[/b] <input class='textbox' type='text' name='jrNAME' /> [b]Pays:[/b] <input class='textbox' type='text' name='jrPAY' /> [b]Job:[/b] EOF; print job_dropdown($c,"jrJOB", -1); print <<<EOF [b]Gains:[/b] Str: <input class='textbox' type='text' name='jrSTRG' size=3 maxlength=3> Lab: <input class='textbox' type='text' name='jrLABOURG' size=3 maxlength=3> IQ: <input class='textbox' type='text' name='jrIQG' size=3 maxlength=3> [b]Reqs:[/b] Str: <input class='textbox' type='text' name='jrSTRN' size=5 maxlength=5> Lab: <input class='textbox' type='text' name='jrLABOURN' size=5 maxlength=5> IQ: <input class='textbox' type='text' name='jrIQN' size=5 maxlength=5> <input class='textbox' type='submit' value='Create Job Rank' /></form> EOF; } } function jobrankedit() { global $db,$ir,$userid; if ( $_POST['stage2']) { $db->query("UPDATE jobranks SET jrNAME='{$_POST['jrNAME']}', jrJOB = {$_POST['jrJOB']}, jrPAY= {$_POST['jrPAY']}, jrIQG={$_POST['jrIQG']}, jrLABOURG={$_POST['jrLABOURG']}, jrSTRG={$_POST['jrSTRG']}, jrIQN={$_POST['jrIQN']}, jrLABOURN={$_POST['jrLABOURN']}, jrSTRN={$_POST['jrSTRN']}WHERE jrID={$_POST['jrID']}"); print "Job rank updated! "; } else if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}"); $r=$db->fetch_row($q); print <<<EOF <form action='staff_jobs.php?action=jobrankedit' method='post'> <input class='textbox' type='hidden' name='stage2' value='1'> <input class='textbox' type='hidden' name='jrID' value='{$_POST['jrID']}'> [b]Job Rank Name:[/b] <input class='textbox' type='text' name='jrNAME' value='{$r['jrNAME']}'> [b]Job:[/b] EOF; print job_dropdown($c,'jrJOB',$r['jrJOB']); print <<<EOF [b]Pays:[/b] <input class='textbox' type='text' name='jrPAY' value='{$r['jrPAY']}' /> [b]Gains:[/b] Str: <input class='textbox' type='text' name='jrSTRG' size=3 maxlength=3 value='{$r['jrSTRG']}'> Lab: <input class='textbox' type='text' name='jrLABOURG' size=3 maxlength=3 value='{$r['jrLABOURG']}'> IQ: <input class='textbox' type='text' name='jrIQG' size=3 maxlength=3 value='{$r['jrIQG']}'> [b]Reqs:[/b] Str: <input class='textbox' type='text' name='jrSTRN' size=5 maxlength=5 value='{$r['jrSTRN']}'> Lab: <input class='textbox' type='text' name='jrLABOURN' size=5 maxlength=5 value='{$r['jrLABOURN']}'> IQ: <input class='textbox' type='text' name='jrIQN' size=5 maxlength=5 value='{$r['jrIQN']}'> [b]Job:[/b] <input class='textbox' type='submit' value='Edit' /> </form> EOF; } else { print <<<EOF <form action='staff_jobs.php?action=jobrankedit' method='post'> <input class='textbox' type='hidden' name='stage1' value='1'> Select a job rank to edit. EOF; print jobrank_dropdown($c, 'jrID', -1); print <<<EOF <input class='textbox' type='submit' value='Edit Job Rank' /> </form> EOF; } } function jobrankdele() { global $db,$ir,$userid; if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}"); $jr=$db->fetch_row($q); $_POST['jID']=$jr['jrJOB']; $db->query("DELETE FROM jobranks WHERE jrID={$_POST['jrID']}"); print "Job rank successfully deleted! "; $db->query("UPDATE users u LEFT JOIN jobs j ON u.job=j.jID SET u.jobrank=j.jFIRST WHERE u.job={$_POST['jID']} and u.jobrank={$_POST['jrID']}"); $q=$db->query("SELECT * FROM jobs WHERE jFIRST={$_POST['jrID']}"); if($db->num_rows($q)) { $r=$db->fetch_row($q); print "[b]Warning![/b] The Job {$r['jNAME']} now has no first rank! Please go edit it and include a first rank. "; } } else { print <<<EOF <form action='staff_jobs.php?action=jobrankdele' method='post'> <input class='textbox' type='hidden' name='stage1' value='1'> Select a job rank to delete. EOF; print jobrank_dropdown($c, 'jrID', -1); print <<<EOF <input class='textbox' type='submit' value='Delete Job Rank' /> </form> EOF; } } function jobdele() { global $db,$ir,$userid; if ( $_POST['stage1']) { $db->query("DELETE FROM jobs WHERE jID={$_POST['jID']}"); print "Job rank successfully deleted! "; $db->query("DELETE FROM jobranks WHERE jrJOB={$_POST['jID']}"); print mysql_affected_rows()." job ranks deleted. "; $db->query("UPDATE users SET job=0,jobrank=0 WHERE job={$_POST['jID']}"); } else { print <<<EOF <form action='staff_jobs.php?action=jobdele' method='post'> <input class='textbox' type='hidden' name='stage1' value='1'> Select a job to delete. EOF; print job_dropdown($c, 'jID', -1); print <<<EOF <input class='textbox' type='submit' value='Delete Job' /> </form> EOF; } } function report_clear() { global $db,$db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?>  
×
×
  • Create New...