Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*------------includes--------------*/
- include ('./includes/connections.php');
- include ('./includes/brain_file.php');
- include ('./includes/style_top.php');
- /*------------includes--------------*/
- if($pl['my_jail'] > gmtime() || $pl['my_hosp'] > gmtime())
- {
- echo "<center><hr width='75%'/>Sorry this page is not viewable while in jail or hospital!<hr width='75%'/></center>";
- include ('./includes/style_bottom.php');
- exit();
- }
- if($_GET['action']) {
- if(!in_array($_GET['action'], array('interview','quit','promote','special'))) {
- echo "<center>Invalid action!</center>";
- include ('./includes/style_bottom.php');
- exit();
- }
- }
- $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'index';
- switch($_GET['action'])
- {
- case 'interview':
- job_interview();
- break;
- case 'quit':
- quit_job();
- break;
- case 'special':
- job_specials();
- break;
- case 'promote':
- promote_me();
- break;
- default:
- job_index();
- break;
- }
- function job_index()
- {
- global $pl;
- $job = array();
- $q_ry = array();
- $q_ry = "SELECT `my_job`,`my_job_rank`,`armypoints`,`grocpoints`,`casipoints`,
- `medipoints`,`educpoints`,`lawpoints`,`my_comp`
- FROM `members_extra`
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $job = mysql_query($q_ry);
- $job = mysql_fetch_array($job);
- if(!$job['my_job']) {
- if(!$job['my_job'] && !$job['my_comp'])
- {
- header('location:newspaper.php?page=jobs');
- }
- else
- {
- header('location:companies.php');
- }
- }
- else
- {
- $myjob = array();
- $mj = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `system_jobs`
- WHERE `job_ID` = '".mysql_real_escape_string($job['my_job'])."'";
- $myjob = mysql_query($q_ry) or die(mysql_error());
- $mj = mysql_fetch_array($myjob);
- echo "<center><main>",htmlentities($mj['job_NAME']),"</main><hr width='80%'/></center>";
- $stat = array();
- $st = array();
- $q_ry = array();
- $q_ry = "SELECT `my_labor`,`my_intelligence`,`my_endurance`
- FROM `memberstats`
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $stat = mysql_query($q_ry);
- $st = mysql_fetch_array($stat);
- $rank = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `system_job_ranks`
- WHERE `r_ID` = '".mysql_real_escape_string($job['my_job_rank'])."'";
- $rank = mysql_query($q_ry);
- $mjr = array();
- $mjr = mysql_fetch_array($rank);
- echo "<center><table width='80%'><tr>
- <td align='center'> </td></tr><tr>
- <td align='center' cellpadding='15'>
- You are currently in the ",htmlentities($mj['job_NAME']),"!
- You receive ".money_alter($mjr['r_WAGES'])." at midnight RC time every day!<br/>
- You also get ",number_format($mjr['r_MANUALGAIN'])," Manual labour,
- ",number_format($mjr['r_INTELGAIN'])," Intelligence,
- ",number_format($mjr['r_ENDURGAIN'])," Endurance
- and ".($mjr['r_POINTS']*$pl['my_level'])." ",htmlentities($mj['job_NAME'])," points!
- </td></tr><tr>
- <td align='center'> </td>
- </tr></table>
- <hr width='80%'/></center>";
- $pr = array();
- $jbr = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `system_job_ranks`
- WHERE `r_ID` > '".mysql_real_escape_string($mjr['r_ID'])."'
- AND `r_MANUALNEED` <= '".mysql_real_escape_string($st['my_labor'])."'
- AND `r_INTELNEED` <= '".mysql_real_escape_string($st['my_intelligence'])."'
- AND `r_ENDURNEED` <= '".mysql_real_escape_string($st['my_endurance'])."'
- AND `r_JOB` = '".mysql_real_escape_string($mj['job_ID'])."' ORDER BY `r_ID` ASC LIMIT 1";
- $pr = mysql_query($q_ry);
- if(!mysql_num_rows($pr))
- {
- echo "";
- }
- else
- {
- $jbr=mysql_fetch_array($pr);
- echo "<center><table width='85%'><tr>
- <td align='center'> </td></tr><tr>
- <td align='center'>
- <b>You can upgrade to ",htmlentities($jbr['r_NAME']),"! Click the 'Get promoted' link!
- It will cost ".number_format($jbr['r_UPCOST'])." ",htmlentities($mj['job_NAME'])," points to upgrade.</b>
- </td></tr><tr>
- <td align='center'> </td>
- </tr></table>
- <hr width='80%'/></center>";
- }
- if($mj['job_NAME']=='Army') { $job['points']=$job['armypoints']; }
- if($mj['job_NAME']=='Grocer') { $job['points']=$job['grocpoints']; }
- if($mj['job_NAME']=='Casino') { $job['points']=$job['casipoints']; }
- if($mj['job_NAME']=='Medical') { $job['points']=$job['medipoints']; }
- if($mj['job_NAME']=='Education') { $job['points']=$job['educpoints']; }
- if($mj['job_NAME']=='Law') { $job['points']=$job['lawpoints']; }
- echo "<center><table width = '80%' cellspacing = '0' border = '0'><tr>
- <td colspan='3' cellpadding='15' align='center'> </td></tr><tr>
- <td align='center'>Rank: <font color='green'>",htmlentities($mjr['r_NAME']),"</font></td>
- <td align='center'>Income: <font color='green'>+".money_alter($mjr['r_WAGES'])."</font></td>
- <td align='center'>",htmlentities($mj['job_NAME'])," points:
- <font color='green'>".number_format($job['points'])."</font></td>
- </tr><tr>
- <td align='center'>
- Endurance: <font color='green'>".number_format($st['my_endurance'])."</font>
- </td>
- <td align='center'>
- Intelligence: <font color='green'>".number_format($st['my_intelligence'])."</font>
- </td>
- <td align='center'>
- Manual labour: <font color='green'>".number_format($st['my_labor'])."</font>
- </td>
- </tr><tr>
- <td colspan='3' cellpadding='15' align='center'> </td></tr>
- </table><hr width='80%'/></center>";
- echo "<center><table width = '80%' cellspacing = '1' class = 'rounded'>
- <tr><td colspan='5' align='center'> </tr>
- <tr><td colspan='5' align='center'><font size='2'><b>Ranks:</b></font></tr>
- <tr><td colspan='5' align='center'> </tr>
- <tr bgcolor=#8F8F8F><th colspan='2'><small>Job</small></th>
- <th colspan='3'><small>Stats needed</small></th></tr>";
- $num = array();
- $jranks = array();
- $rks = array();
- $num=0;
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `system_job_ranks`
- WHERE `r_JOB` = '".mysql_real_escape_string($mj['job_ID'])."'
- ORDER BY `r_ID` ASC";
- $jranks = mysql_query($q_ry);
- while($rks = mysql_fetch_array($jranks))
- {
- $num++;
- $odd="#CCCCCC";
- $even="#e3e3e3";
- if ($num % 2) {
- $color="$even";
- } else {
- $color="$odd";
- }
- echo "<tr bgcolor=$color>
- <td align='left'><small>Rank: ",htmlentities($rks['r_NAME']),"</small></td>
- <td align='left'><small>Income: ".money_alter($rks['r_WAGES'])." a day</small></td>
- <td align='left'><small>Manual: ".number_format($rks['r_MANUALNEED'])."</small></td>
- <td align='left'><small>Intelligence: ".number_format($rks['r_INTELNEED'])."</small></td>
- <td align='left'><small>Endurance: ".number_format($rks['r_ENDURNEED'])."</small></td>
- </tr>";
- }
- echo "<tr bgcolor=#8F8F8F><td colspan='5' align='center'> </td></tr>
- <tr><td align='center' colspan='5'> </td></tr></table>
- <hr width='80%'/></center>";
- echo "<form action='job.php?action=special' method='post'>
- <center><table width = '80%' cellspacing = '1' class = 'rounded'>
- <tr><td colspan='2' align='left'> </td></tr>
- <tr><td colspan='2' align='center'><font size='2'><b>Specials unlocked:</b></font></td>
- </tr><tr><td colspan='2' align='left'> </td></tr>
- <tr bgcolor=#8F8F8F>
- <th colspan='2'> </th></tr>";
- $num = array();
- $js = array();
- $sp = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `job_specials`
- WHERE `jsJOB` = '".mysql_real_escape_string($mj['job_ID'])."'
- AND `jsRANK` <= '".mysql_real_escape_string($mjr['r_ID'])."'
- ORDER BY `jsID` ASC";
- $num=0;
- $js = mysql_query($q_ry);
- if(!mysql_num_rows($js))
- {
- print "<tr bgcolor=#e3e3e3><td colspan='2'>This Job has no Speacials</td></tr>";
- }
- else
- {
- while($sp = mysql_fetch_array($js))
- {
- $num++;
- $odd="#CCCCCC";
- $even="#e3e3e3";
- if ($num % 2) {
- $color="$even";
- } else {
- $color="$odd";
- }
- echo "<tr bgcolor=$color>
- <td align='left'>",htmlentities($sp['jsNAME']),"</td>
- <td align='left'><center><input type='radio' name='ID' value='{$sp['jsID']}' /></td></tr>";
- }
- }
- echo "<tr bgcolor=#8F8F8F><td colspan='2' align='center'><input type='submit' value='Do special'></td>
- </tr><tr><td colspan='2' align='center'> </td></tr>
- </table></center></form><hr width='80%'>
- <center><table width = '80%' border = '0'><tr>
- <td align='center' width='50%'><a href='job.php?action=promote'>> Get Promoted</a></td>
- <td align='center' width='50%'><a href='job.php?action=quit'>> Quit job</a></td>
- </table><hr width='80%'/></center>";
- }
- }
- function job_interview()
- {
- echo "<center><main>Interview</main><hr width = '80%'>";
- global $pl;
- $myjob = array();
- $q_ry = array();
- $q_ry = "SELECT `my_job`,`my_comp`
- FROM `members_extra`
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";;
- $myjob = mysql_query($q_ry);
- $mj = array();
- $mj = mysql_fetch_array($myjob);
- if(valid_XID($_GET['XID'])!=TRUE)
- {
- echo "<center>".errors_(XID)."</center>";
- include('./includes/style_bottom.php');
- exit();
- }
- else if($mj['my_job'])
- {
- echo "You already have a job! Leave that one before trying to start another job.
- <hr width = '80%'>><a href='newspaper.php?page=jobs'>Back</a><hr width = '80%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- else if($mj['my_comp'])
- {
- echo "<center>You already have a job! Leave that one before trying to start another job.</center>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $_GET['XID']=abs(intval($_GET['XID']));
- $thisjob = array();
- $job = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `system_jobs`
- WHERE `job_ID` = '".mysql_real_escape_string($_GET['XID'])."'";
- $thisjob = mysql_query($q_ry);
- if(!mysql_num_rows($thisjob))
- {
- echo "<center>".errors_(XID)."</center>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $job = mysql_fetch_array($thisjob);
- echo "
- <table width = '80%' border = '0'><tr><td align = 'left'>
- Hello ",htmlentities($pl['playername']),", i am ",htmlentities($job['job_OWNER']),"
- <br/><br/>
- ",htmlentities($job['job_DESC']),"<br/><br/>";
- $wrank = array();
- if($_GET['XID'] == '1')
- {
- $wrank = "toparmyrank";
- }
- if($_GET['XID'] == '2')
- {
- $wrank = "topgrocerrank";
- }
- if($_GET['XID'] == '3')
- {
- $wrank = "topcasinorank";
- }
- if($_GET['XID'] == '4')
- {
- $wrank = "medicaltoprank";
- }
- if($_GET['XID'] == '5')
- {
- $wrank = "educationtoprank";
- }
- if($_GET['XID'] == '6')
- {
- $wrank = "lawtoprank";
- }
- $alrank = array();
- $ar = array();
- $q_ry = array();
- $q_ry = "SELECT {$wrank}
- FROM `members_extra`
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $alrank = mysql_query($q_ry);
- $ar = mysql_fetch_array($alrank);
- if($ar[$wrank]>0)
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `my_job` = '".mysql_real_escape_string($_GET['XID'])."',
- `my_job_rank` = '".mysql_real_escape_string($ar[$wrank])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "Thank you. You can start now.</td></tr></table><hr width ='80%'/>
- ><a href='job.php'>Okay</a></center>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $stat = array();
- $st = array();
- $q_ry = array();
- $q_ry = "SELECT `my_labor`,`my_intelligence`,`my_endurance`
- FROM `memberstats`
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $stat = mysql_query($q_ry);
- $st = mysql_fetch_array($stat);
- $rank = array();
- $rk = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `system_job_ranks`
- WHERE `r_JOB` = '".mysql_real_escape_string($_GET['XID'])."'
- AND `r_MANUALNEED` <= '".mysql_real_escape_string($st['my_labor'])."'
- AND `r_INTELNEED` <= '".mysql_real_escape_string($st['my_intelligence'])."'
- AND `r_ENDURNEED` <= '".mysql_real_escape_string($st['my_endurance'])."'
- ORDER BY `r_ID` ASC
- LIMIT 1";
- $rank = mysql_query($q_ry);
- $rk = mysql_fetch_array($rank);
- if(!mysql_num_rows($rank))
- {
- echo "Sorry, Your stats are not good enough yet.</td></tr></table><hr width ='80%'/>
- ><a href='job.php'>Okay</a></center>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `my_job` = '".mysql_real_escape_string($_GET['XID'])."',
- `my_job_rank` = '".mysql_real_escape_string($rk['r_ID'])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "Thank you. You can start now.</td></tr></table><hr width ='80%'/>
- ><a href='job.php'>Okay</a></center>";
- include('./includes/style_bottom.php');
- exit();
- }
- }
- }
- }
- }
- function quit_job()
- {
- echo "<center><main>Quit job</main><hr width = '75%'>";
- $gotjob = array();
- $q_ry = array();
- $q_ry = "SELECT `my_job`
- FROM `members_extra`
- WHERE `my_job` > 0
- AND `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $gotjob = mysql_query($q_ry);
- if(!mysql_num_rows($gotjob))
- {
- echo "<center>You dont have a job to quit!
- <hr width = '75%'>><a href='newspaper.php'>Okay</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `my_job` = '0',
- `my_job_rank` = '0'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "<center>You have quit your job!
- <hr width = '75%'>><a href='newspaper.php'>Okay</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- }
- function promote_me()
- {
- global $pl;
- echo "<center><main>Promotion</main><hr width = '75%'>";
- $gotjob = array();
- $gj = array();
- $q_ry = array();
- $q_ry = "SELECT `my_job`,`my_job_rank`
- FROM `members_extra`
- WHERE `my_job` > 0
- AND `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $gotjob = mysql_query($q_ry);
- if(!mysql_num_rows($gotjob))
- {
- echo "<center>You dont have a job to get promoted with!
- <hr width = '75%'>><a href='newspaper.php'>Okay</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $gj = mysql_fetch_array($gotjob);
- $stat = array();
- $st = array();
- $q_ry = array();
- $q_ry = "SELECT `my_labor`,`my_intelligence`,`my_endurance`
- FROM `memberstats`
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $stat = mysql_query($q_ry);
- $st = mysql_fetch_array($stat);
- $pr = array();
- $jbr = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `system_job_ranks`
- WHERE `r_ID` > '".mysql_real_escape_string($gj['my_job_rank'])."'
- AND `r_MANUALNEED` <= '".mysql_real_escape_string($st['my_labor'])."'
- AND `r_INTELNEED` <= '".mysql_real_escape_string($st['my_intelligence'])."'
- AND `r_ENDURNEED` <= '".mysql_real_escape_string($st['my_endurance'])."'
- AND `r_JOB` = '".mysql_real_escape_string($gj['my_job'])."' ORDER BY `r_ID` ASC LIMIT 1";
- $pr = mysql_query($q_ry);
- if(!mysql_num_rows($pr))
- {
- echo "<center>You dont have enough stats to get promoted yet!
- <hr width = '75%'>><a href='job.php'>Okay</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $jbr=mysql_fetch_array($pr);
- $wrank = array();
- if($gj['my_job'] == '1')
- {
- $wrank = "toparmyrank";
- }
- if($gj['my_job'] == '2')
- {
- $wrank = "topgrocerrank";
- }
- if($gj['my_job'] == '3')
- {
- $wrank = "topcasinorank";
- }
- if($gj['my_job'] == '4')
- {
- $wrank = "medicaltoprank";
- }
- if($gj['my_job'] == '5')
- {
- $wrank = "educationtoprank";
- }
- if($gj['my_job'] == '6')
- {
- $wrank = "lawtoprank";
- }
- if($gj['my_job']=='1') { $job['points']='armypoints'; }
- if($gj['my_job']=='2') { $job['points']="grocpoints"; }
- if($gj['my_job']=='3') { $job['points']="casipoints"; }
- if($gj['my_job']=='4') { $job['points']="medipoints"; }
- if($gj['my_job']=='5') { $job['points']="educpoints"; }
- if($gj['my_job']=='6') { $job['points']="lawpoints"; }
- $epoints = array();
- $q_ry = array();
- $q_ry = "SELECT {$job['points']}
- FROM `members_extra`
- WHERE {$job['points']} >= '".mysql_real_escape_string($jbr['r_UPCOST'])."'
- AND `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $epoints = mysql_query($q_ry);
- if(!mysql_num_rows($epoints))
- {
- echo "<center>Sorry ",htmlentities($pl['playername']),",
- You dont have enough points to be promoted to a ",htmlentities($jbr['r_NAME']),"!
- <hr width = '75%'>><a href='job.php'>Okay</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `my_job_rank` = '".mysql_real_escape_string($jbr['r_ID'])."',
- {$wrank} = '".mysql_real_escape_string($jbr['r_ID'])."',
- {$job['points']} = {$job['points']} - '".mysql_real_escape_string($jbr['r_UPCOST'])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "<center>Congratulations ",htmlentities($pl['playername']),",
- You have been promoted to a ",htmlentities($jbr['r_NAME']),"!
- <hr width = '75%'>><a href='job.php'>Okay</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- }
- }
- }
- function job_specials()
- {
- global $pl;
- $_POST['ID'] = abs(intval($_POST['ID']));
- echo "<center><main>Job specials</main><hr width = '75%'>";
- if(!$_POST['ID'])
- {
- echo "Error, Invalid ID!";
- }
- else
- {
- $q_ry = array();
- $q_ry = "SELECT `my_job`,`my_job_rank`,
- `armypoints`,`grocpoints`,`casipoints`,`medipoints`,`educpoints`,`lawpoints`
- FROM `members_extra`
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- $myjob = array();
- $myjob = mysql_query($q_ry);
- $mj = array();
- $mj = mysql_fetch_array($myjob);
- if(!$mj['my_job'] || !$mj['my_job_rank'])
- {
- echo "Error, You dont have a job!";
- }
- else
- {
- $valid_array = array(1=>array(1,2,3,4,5,6),
- 2=>array(7,8),
- 3=>array(9,10),
- 4=>array(11,12,13,14,15),
- 5=>array(16),
- 6=>array(17));
- $valid_array = $valid_array[$mj['my_job']];
- if(!in_array($_POST['ID'], $valid_array))
- {
- echo "Error, Invalid ID!";
- }
- else
- {
- //Army job specials!!!!!!!!!!!!
- if($mj['my_job'] == '1')
- {
- $needed_rank = array(1=>1,2=>2,3=>4,4=>5,5=>7,6=>8);
- $points = "army|" . $mj['armypoints'];
- $points = explode("|", $points);
- if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
- {
- echo "Error, You have not earnt this job special yet!";
- }
- else
- {
- //Army job special 1
- if($_POST['ID'] == '1')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap each ".$points[0]." point for 0.001 strength<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'text' name = 'amount' value = ''>
- <input type = 'submit' name = 'use' value = 'Swap points for strength'>
- </td></tr></table></form>";
- }
- else
- {
- $_POST['amount'] = abs(intval($_POST['amount']));
- if(!$_POST['amount'])
- {
- echo "Error, You must select a valid ammount!";
- }
- else
- {
- if($mj['armypoints'] < $_POST['amount'])
- {
- echo "Error, You dont have enough army points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
- ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> strength?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `memberstats`
- SET `my_strength` = `my_strength` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> strength!";
- }
- }
- }
- }
- }
- //Army job special 1
- //Army job special 2
- if($_POST['ID'] == '2')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap each ".$points[0]." point for 0.001 defence<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'text' name = 'amount' value = ''>
- <input type = 'submit' name = 'use' value = 'Swap points for defence'>
- </td></tr></table></form>";
- }
- else
- {
- $_POST['amount'] = abs(intval($_POST['amount']));
- if(!$_POST['amount'])
- {
- echo "Error, You must select a valid ammount!";
- }
- else
- {
- if($mj['armypoints'] < $_POST['amount'])
- {
- echo "Error, You dont have enough army points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
- ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> defence?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `memberstats`
- SET `my_defence` = `my_defence` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> defence!";
- }
- }
- }
- }
- }
- //Army job special 2
- //Army job special 3
- if($_POST['ID'] == '3')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 10,000 ".$points[0]." point + \$5,000 to spy<br/>
- Enter the id of the person you wish to spy on below<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points
- & <b>".money_alter($pl['wallet'])."</b><br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'text' name = 'user' value = ''>
- <input type = 'submit' name = 'use' value = 'Spy on someone'>
- </td></tr></table></form>";
- }
- else
- {
- $_POST['user'] = abs(intval($_POST['user']));
- if(!$_POST['user'])
- {
- echo "Error, You must select a valid id!";
- }
- else
- {
- $q_ry = array();
- $q_ry = "SELECT m.playername,m.wallet,s.*
- FROM `members` AS m
- INNER JOIN `memberstats` AS s
- ON m.playerid = s.playerid
- WHERE m.playerid = '".mysql_real_escape_string($_POST['user'])."'";
- $real = array();
- $real = mysql_query($q_ry);
- if(!mysql_num_rows($real))
- {
- echo "Error, Id not reconised!";
- }
- else
- {
- if($pl['wallet'] < 5000)
- {
- echo "Error, You dont have enough money!";
- }
- else
- {
- if($mj['armypoints'] < 10000)
- {
- echo "Error, You dont have enough army points!";
- }
- else
- {
- $r = array();
- $r = mysql_fetch_array($real);
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to spy on <b>".htmlentities($r['playername'])."</b>?
- <br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'user' value = '".$_POST['user']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $cshi=rand(1,9);
- $s=rand(1,9);
- $g=rand(1,9);
- $d=rand(1,9);
- $sp=rand(1,9);
- if($cshi > 7) { $money="".money_alter($r['wallet']).""; }
- else { $money="<font color=red>failed to retrieve</font>"; }
- if($s > 5) { $strength=$r['my_strength']; }
- else { $strength="<font color=red>failed to retrieve</font>"; }
- if($g > 5) { $defence=$r['my_defence']; }
- else { $defence="<font color=red>failed to retrieve</font>"; }
- if($d > 5) { $dexterity=$r['my_dexterity']; }
- else { $dexterity="<font color=red>failed to retrieve</font>"; }
- if($sp > 5) { $speed=$r['my_speed']; }
- else { $speed="<font color=red>failed to retrieve</font>"; }
- echo "You pay the spy to spy on <b>",htmlentities($r['playername']),"</b>,
- The spy manages to get the following information!.<br/><br/>
- ",htmlentities($r['playername']),"'s Money: <b>$money</b><br/>
- ",htmlentities($r['playername']),"'s Speed: <b>$speed</b><br/>
- ",htmlentities($r['playername']),"'s Strength: <b>$strength</b><br/>
- ",htmlentities($r['playername']),"'s Defence: <b>$defence</b><br/>
- ",htmlentities($r['playername']),"'s Dexterity: <b>$dexterity</b>";
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `armypoints` = `armypoints` - '10000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `members`
- SET `wallet` = `wallet` - '5000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- }
- }
- }
- }
- }
- }
- }
- //Army job special 3
- //Army job special 4
- if($_POST['ID'] == '4')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap each ".$points[0]." point for 0.001 speed<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'text' name = 'amount' value = ''>
- <input type = 'submit' name = 'use' value = 'Swap points for speed'>
- </td></tr></table></form>";
- }
- else
- {
- $_POST['amount'] = abs(intval($_POST['amount']));
- if(!$_POST['amount'])
- {
- echo "Error, You must select a valid ammount!";
- }
- else
- {
- if($mj['armypoints'] < $_POST['amount'])
- {
- echo "Error, You dont have enough army points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
- ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> speed?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `memberstats`
- SET `my_speed` = `my_speed` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> speed!";
- }
- }
- }
- }
- }
- //Army job special 4
- //Army job special 5
- if($_POST['ID'] == '5')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 25,000 ".$points[0]." points for a weapon<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap for a weapon'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['armypoints'] < 25000)
- {
- echo "Error, You dont have enough army points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap 25,000 army points for a weapon?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $giveout = array();
- $itid = array();
- $giveout=rand(1,3);
- if($giveout == 1) { $itid=22; } else if($giveout == 2) { $itid=25; } else if($giveout == 3) { $itid=60; }
- $iti = array();
- $ii = array();
- $q_ry = array();
- $q_ry = "SELECT *
- FROM `items`
- WHERE `item_id` = '".mysql_real_escape_string($itid)."'";
- $iti = mysql_query($q_ry);
- $ii = mysql_fetch_array($iti);
- i_credit($_SESSION['playerid'], $itid, 1);
- echo "You walk in the army inventory room where you find many guns.<br/>
- You hear someone coming and decide to grab the first gun at hand.<br/>
- You manage to gain a <b>".htmlentities($ii['item_name'])."</b>!";
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `armypoints` = `armypoints` - '25000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- }
- }
- }
- }
- //Army job special 5
- //Army job special 6
- if($_POST['ID'] == '6')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap each ".$points[0]." point for 0.001 dexterity<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'text' name = 'amount' value = ''>
- <input type = 'submit' name = 'use' value = 'Swap points for dexterity'>
- </td></tr></table></form>";
- }
- else
- {
- $_POST['amount'] = abs(intval($_POST['amount']));
- if(!$_POST['amount'])
- {
- echo "Error, You must select a valid ammount!";
- }
- else
- {
- if($mj['armypoints'] < $_POST['amount'])
- {
- echo "Error, You dont have enough army points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
- ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> dexterity?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `memberstats`
- SET `my_dexterity` = `my_dexterity` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> dexterity!";
- }
- }
- }
- }
- }
- //Army job special 6
- }
- }
- //Army job specials!!!!!!!!!!!!
- //Grocer job specials!!!!!!!!!!!!
- if($mj['my_job'] == '2')
- {
- $needed_rank = array(7=>11,8=>13);
- $points = "grocer|" . $mj['grocpoints'];
- $points = explode("|", $points);
- if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
- {
- echo "Error, You have not earnt this job special yet!";
- }
- else
- {
- //Grocer job special 1
- if($_POST['ID'] == '7')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap each ".$points[0]." point for 0.001 speed<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'text' name = 'amount' value = ''>
- <input type = 'submit' name = 'use' value = 'Swap points for speed'>
- </td></tr></table></form>";
- }
- else
- {
- $_POST['amount'] = abs(intval($_POST['amount']));
- if(!$_POST['amount'])
- {
- echo "Error, You must select a valid ammount!";
- }
- else
- {
- if($mj['grocpoints'] < $_POST['amount'])
- {
- echo "Error, You dont have enough grocer points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
- ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> speed?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `grocpoints` = `grocpoints` - '".mysql_real_escape_string($_POST['amount'])."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `memberstats`
- SET `my_speed` = `my_speed` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
- for <b>".($_POST['amount']*0.001)."</b> speed!";
- }
- }
- }
- }
- }
- //Grocer job special 1
- //Grocer job special 2
- if($_POST['ID'] == '8')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 100 ".$points[0]." points for cash<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <small>The amount you gain is random!</small><br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Steal cash'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['grocpoints'] < 100)
- {
- echo "Error, You dont have enough grocer points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap 100 ".$points[0]." points for cash?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $gain = rand(1000,5000);
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `grocpoints` = `grocpoints` - '100'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `members`
- SET `wallet` = `wallet` + '".mysql_real_escape_string($gain)."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You walk in the shop office.<br/>
- You see a petty cash box and grab it.<br/>
- You manage to gain a <b>".money_alter($gain)."</b>!";
- }
- }
- }
- }
- //Grocer job special 2
- }
- }
- //Grocer job specials!!!!!!!!!!!!
- //Casino job specials!!!!!!!!!!!!
- if($mj['my_job'] == '3')
- {
- $needed_rank = array(9=>16,10=>19);
- $points = "casino|" . $mj['casipoints'];
- $points = explode("|", $points);
- if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
- {
- echo "Error, You have not earnt this job special yet!";
- }
- else
- {
- //Casino job special 1
- if($_POST['ID'] == '9')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 1,000 ".$points[0]." points for 25 ".$points[0]." tokens<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap points for tokens'>
- </td></tr></table></form>";
- }
- else
- {
- $_POST['amount'] = abs(intval($_POST['amount']));
- if($mj['casipoints'] < 1000)
- {
- echo "Error, You dont have enough casino points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>1,000</b>
- ".$points[0]." points
- for 25 casino tokens?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `casipoints` = `casipoints` - '1000',
- `my_ctokens` = `my_ctokens` + '25'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>1,000</b> ".$points[0]." points
- for 25 casino tokens!";
- }
- }
- }
- }
- //Casino job special 1
- //Casino job special 2
- if($_POST['ID'] == '10')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 100 ".$points[0]." points for cash<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <small>The amount you gain is random!</small><br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Steal cash'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['casipoints'] < 100)
- {
- echo "Error, You dont have enough casino points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap 100 ".$points[0]." points for cash?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $gain = rand(800,6000);
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `casipoints` = `casipoints` - '100'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `members`
- SET `wallet` = `wallet` + '".mysql_real_escape_string($gain)."'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You walk in the casino office.<br/>
- You see a box of chips.<br/>
- You cash them in at the cashing in booth.<br/>
- You manage to gain a <b>".money_alter($gain)."</b>!";
- }
- }
- }
- }
- //Casino job special 2
- }
- }
- //Casino job specials!!!!!!!!!!!!
- //Medical job specials!!!!!!!!!!!!
- if($mj['my_job'] == '4')
- {
- $needed_rank = array(11=>22,12=>21,13=>23,14=>24,15=>28);
- $points = "medical|" . $mj['medipoints'];
- $points = explode("|", $points);
- if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
- {
- echo "Error, You have not earnt this job special yet!";
- }
- else
- {
- //Medical job special 1
- if($_POST['ID'] == '11')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 1,000 ".$points[0]." points for +1 life<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap points for life'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['medipoints'] < 1000)
- {
- echo "Error, You dont have enough medical points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format(1000)."</b>
- ".$points[0]." points
- for +1 life?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `medipoints` = `medipoints` - '1000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `members`
- SET `my_maxlife` = `my_maxlife` + '1'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format(1000)."</b> ".$points[0]." points
- for +1 life!";
- }
- }
- }
- }
- //Medical job special 1
- //Medical job special 2
- if($_POST['ID'] == '12')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 2,000 ".$points[0]." points for a
- small first aid kit<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap points for sfak'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['medipoints'] < 2000)
- {
- echo "Error, You dont have enough medical points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format(2000)."</b>
- ".$points[0]." points
- for a small first aid kit?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `medipoints` = `medipoints` - '2000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- i_credit($_SESSION['playerid'], 17, 1);
- echo "You have swapped <b>".number_format(2000)."</b> ".$points[0]." points
- for a small first aid kit!";
- }
- }
- }
- }
- //Medical job special 2
- //Medical job special 3
- if($_POST['ID'] == '13')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 4,000 ".$points[0]." points for a
- first aid kit<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap points for fak'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['medipoints'] < 4000)
- {
- echo "Error, You dont have enough medical points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format(4000)."</b>
- ".$points[0]." points
- for a first aid kit?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `medipoints` = `medipoints` - '4000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- i_credit($_SESSION['playerid'], 29, 1);
- echo "You have swapped <b>".number_format(4000)."</b> ".$points[0]." points
- for a first aid kit!";
- }
- }
- }
- }
- //Medical job special 3
- //Medical job special 4
- if($_POST['ID'] == '14')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 7,500 ".$points[0]." points for a
- morphine<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap points for morphine'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['medipoints'] < 7500)
- {
- echo "Error, You dont have enough medical points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format(7500)."</b>
- ".$points[0]." points
- for a morphine?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `medipoints` = `medipoints` - '7500'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- i_credit($_SESSION['playerid'], 8, 1);
- echo "You have swapped <b>".number_format(7500)."</b> ".$points[0]." points
- for a morphine!";
- }
- }
- }
- }
- //Medical job special 4
- }
- }
- //Medical job specials!!!!!!!!!!!!
- //Education job specials!!!!!!!!!!!!
- if($mj['my_job'] == '5')
- {
- $points = "education|" . $mj['educpoints'];
- $points = explode("|", $points);
- if(29 > $mj['my_job_rank'])
- {
- echo "Error, You have not earnt this job special yet!";
- }
- else
- {
- //Education job special 1
- if($_POST['ID'] == '16')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 10,000 ".$points[0]." points for +100 intelligence<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap points for intelligence'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['educpoints'] < 10000)
- {
- echo "Error, You dont have enough education points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format(10000)."</b>
- ".$points[0]." points
- for +100 intelligence?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `educpoints` = `educpoints` - '10000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `memberstats`
- SET `my_intelligence` = `my_intelligence` + '100'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format(10000)."</b> ".$points[0]." points
- for +100 intelligence!";
- }
- }
- }
- }
- //Education job special 1
- }
- }
- //Education job specials!!!!!!!!!!!!
- //Law job specials!!!!!!!!!!!!
- if($mj['my_job'] == '6')
- {
- $points = "law|" . $mj['lawpoints'];
- $points = explode("|", $points);
- if(36 > $mj['my_job_rank'])
- {
- echo "Error, You have not earnt this job special yet!";
- }
- else
- {
- //Law job special 1
- if($_POST['ID'] == '17')
- {
- if(!$_POST['use'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Below you can swap 10,000 ".$points[0]." points for +100 endurance<br/>
- You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'submit' name = 'use' value = 'Swap points for endurance'>
- </td></tr></table></form>";
- }
- else
- {
- if($mj['lawpoints'] < 10000)
- {
- echo "Error, You dont have enough law points!";
- }
- else
- {
- if(!$_POST['confirm'])
- {
- echo "<form action = 'job.php?action=special' method = 'post'>
- <table width = '50%' class = 'rounded'>
- <tr><td align = 'center'>
- Are you sure you wish to swap <b>".number_format(10000)."</b>
- ".$points[0]." points
- for +100 endurance?<br/>
- <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
- <input type = 'hidden' name = 'use' value = '1'>
- <input type = 'submit' name = 'confirm' value = 'Continue'>
- </td></tr></table></form>";
- }
- else
- {
- $q_ry = array();
- $q_ry = "UPDATE `members_extra`
- SET `lawpoints` = `lawpoints` - '10000'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- $q_ry = array();
- $q_ry = "UPDATE `memberstats`
- SET `my_endurance` = `my_endurance` + '100'
- WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
- mysql_query($q_ry);
- echo "You have swapped <b>".number_format(10000)."</b> ".$points[0]." points
- for +100 endurance!";
- }
- }
- }
- }
- //Law job special 1
- }
- }
- //Law job specials!!!!!!!!!!!!
- }
- }
- }
- echo "<hr width = '75%'>><a href='job.php'>Back</a><hr width = '75%'>";
- }
- include('./includes/style_bottom.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement