Advertisement
Guest User

Untitled

a guest
Jan 24th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 101.98 KB | None | 0 0
  1. <?php  
  2.    /*------------includes--------------*/
  3.    include ('./includes/connections.php');
  4.    include ('./includes/brain_file.php');
  5.    include ('./includes/style_top.php');
  6.    /*------------includes--------------*/
  7.     if($pl['my_jail'] > gmtime() || $pl['my_hosp'] > gmtime())
  8.     {
  9.     echo "<center><hr width='75%'/>Sorry this page is not viewable while in jail or hospital!<hr width='75%'/></center>";
  10.     include ('./includes/style_bottom.php');
  11.     exit();
  12.     }
  13.    if($_GET['action']) {
  14.    if(!in_array($_GET['action'], array('interview','quit','promote','special'))) {
  15.    echo "<center>Invalid action!</center>";
  16.    include ('./includes/style_bottom.php');
  17.    exit();
  18.    }
  19.    }
  20.    $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'index';
  21.    switch($_GET['action'])
  22.    {
  23.    case 'interview':
  24.    job_interview();
  25.    break;
  26.  
  27.    case 'quit':
  28.    quit_job();
  29.    break;
  30.  
  31.    case 'special':
  32.    job_specials();
  33.    break;
  34.  
  35.    case 'promote':
  36.    promote_me();
  37.    break;
  38.  
  39.    default:
  40.    job_index();
  41.    break;
  42.    }
  43.    function job_index()
  44.   {
  45.    global $pl;
  46.    $job = array();
  47.    $q_ry = array();
  48.    $q_ry = "SELECT `my_job`,`my_job_rank`,`armypoints`,`grocpoints`,`casipoints`,
  49.                   `medipoints`,`educpoints`,`lawpoints`,`my_comp`
  50.            FROM `members_extra`
  51.            WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  52.    $job = mysql_query($q_ry);
  53.    $job = mysql_fetch_array($job);
  54.    if(!$job['my_job']) {
  55.  
  56.    if(!$job['my_job'] && !$job['my_comp'])
  57.   {
  58.    header('location:newspaper.php?page=jobs');
  59.     }
  60.     else
  61.        {
  62.    header('location:companies.php');
  63.   }
  64.  
  65.  
  66.     }
  67.     else
  68.        {
  69.    $myjob = array();
  70.    $mj = array();
  71.    $q_ry = array();
  72.    $q_ry = "SELECT *
  73.            FROM `system_jobs`
  74.            WHERE `job_ID` = '".mysql_real_escape_string($job['my_job'])."'";
  75.    $myjob = mysql_query($q_ry) or die(mysql_error());
  76.    $mj = mysql_fetch_array($myjob);
  77.    echo "<center><main>",htmlentities($mj['job_NAME']),"</main><hr width='80%'/></center>";
  78.    $stat = array();
  79.    $st = array();
  80.    $q_ry = array();
  81.    $q_ry = "SELECT `my_labor`,`my_intelligence`,`my_endurance`
  82.            FROM `memberstats`
  83.            WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  84.    $stat = mysql_query($q_ry);
  85.    $st = mysql_fetch_array($stat);
  86.  
  87.          $rank = array();
  88.          $q_ry = array();
  89.          $q_ry = "SELECT *
  90.                  FROM `system_job_ranks`
  91.                  WHERE `r_ID` = '".mysql_real_escape_string($job['my_job_rank'])."'";
  92.          $rank = mysql_query($q_ry);
  93.          $mjr = array();
  94.          $mjr = mysql_fetch_array($rank);
  95.   echo "<center><table width='80%'><tr>
  96.        <td align='center'>&nbsp;</td></tr><tr>
  97.        <td align='center' cellpadding='15'>
  98.        You are currently in the ",htmlentities($mj['job_NAME']),"!
  99.        You receive ".money_alter($mjr['r_WAGES'])." at midnight RC time every day!<br/>
  100.        You also get ",number_format($mjr['r_MANUALGAIN'])," Manual labour,
  101.                     ",number_format($mjr['r_INTELGAIN'])," Intelligence,
  102.                     ",number_format($mjr['r_ENDURGAIN'])," Endurance
  103.        and ".($mjr['r_POINTS']*$pl['my_level'])." ",htmlentities($mj['job_NAME'])," points!
  104.        </td></tr><tr>
  105.        <td align='center'>&nbsp;</td>
  106.        </tr></table>
  107.  
  108.        <hr width='80%'/></center>";
  109.         $pr = array();
  110.         $jbr = array();
  111.         $q_ry = array();
  112.         $q_ry = "SELECT *
  113.                 FROM `system_job_ranks`
  114.                 WHERE `r_ID` > '".mysql_real_escape_string($mjr['r_ID'])."'
  115.                 AND `r_MANUALNEED` <= '".mysql_real_escape_string($st['my_labor'])."'
  116.                 AND `r_INTELNEED` <= '".mysql_real_escape_string($st['my_intelligence'])."'
  117.                 AND `r_ENDURNEED` <= '".mysql_real_escape_string($st['my_endurance'])."'
  118.                 AND `r_JOB` = '".mysql_real_escape_string($mj['job_ID'])."' ORDER BY `r_ID` ASC LIMIT 1";
  119.         $pr = mysql_query($q_ry);
  120.         if(!mysql_num_rows($pr))
  121.        {
  122.         echo "";
  123.        }
  124.         else
  125.        {
  126.         $jbr=mysql_fetch_array($pr);
  127.         echo "<center><table width='85%'><tr>
  128.              <td align='center'>&nbsp;</td></tr><tr>
  129.              <td align='center'>
  130.              <b>You can upgrade to ",htmlentities($jbr['r_NAME']),"! Click the 'Get promoted' link!
  131.              It will cost ".number_format($jbr['r_UPCOST'])." ",htmlentities($mj['job_NAME'])," points to upgrade.</b>
  132.              </td></tr><tr>
  133.              <td align='center'>&nbsp;</td>
  134.              </tr></table>
  135.              <hr width='80%'/></center>";
  136.               }
  137.                if($mj['job_NAME']=='Army') { $job['points']=$job['armypoints']; }
  138.                if($mj['job_NAME']=='Grocer') { $job['points']=$job['grocpoints']; }
  139.                if($mj['job_NAME']=='Casino') { $job['points']=$job['casipoints']; }
  140.                if($mj['job_NAME']=='Medical') { $job['points']=$job['medipoints']; }
  141.                if($mj['job_NAME']=='Education') { $job['points']=$job['educpoints']; }
  142.                if($mj['job_NAME']=='Law') { $job['points']=$job['lawpoints']; }
  143.               echo "<center><table width = '80%' cellspacing = '0' border = '0'><tr>
  144.                    <td colspan='3' cellpadding='15' align='center'>&nbsp;</td></tr><tr>
  145.                    <td align='center'>Rank: <font color='green'>",htmlentities($mjr['r_NAME']),"</font></td>
  146.                    <td align='center'>Income: <font color='green'>+".money_alter($mjr['r_WAGES'])."</font></td>
  147.                    <td align='center'>",htmlentities($mj['job_NAME'])," points:
  148.                    <font color='green'>".number_format($job['points'])."</font></td>
  149.                    </tr><tr>
  150.                    <td align='center'>
  151.                    Endurance: <font color='green'>".number_format($st['my_endurance'])."</font>
  152.                    </td>
  153.                    <td align='center'>
  154.                    Intelligence: <font color='green'>".number_format($st['my_intelligence'])."</font>
  155.                    </td>
  156.                    <td align='center'>
  157.                    Manual labour: <font color='green'>".number_format($st['my_labor'])."</font>
  158.                    </td>
  159.                    </tr><tr>
  160.                    <td colspan='3' cellpadding='15' align='center'>&nbsp;</td></tr>
  161.                    </table><hr width='80%'/></center>";
  162.                     echo "<center><table width = '80%' cellspacing = '1' class = 'rounded'>
  163.                          <tr><td colspan='5' align='center'>&nbsp;</tr>
  164.                          <tr><td colspan='5' align='center'><font size='2'><b>Ranks:</b></font></tr>
  165.                          <tr><td colspan='5' align='center'>&nbsp;</tr>
  166.                          <tr bgcolor=#8F8F8F><th colspan='2'><small>Job</small></th>
  167.                          <th colspan='3'><small>Stats needed</small></th></tr>";
  168.                           $num = array();
  169.                           $jranks = array();
  170.                           $rks = array();
  171.                           $num=0;
  172.                           $q_ry = array();
  173.                           $q_ry = "SELECT *
  174.                                              FROM `system_job_ranks`
  175.                                              WHERE `r_JOB` = '".mysql_real_escape_string($mj['job_ID'])."'
  176.                                              ORDER BY `r_ID` ASC";
  177.                           $jranks = mysql_query($q_ry);
  178.                           while($rks = mysql_fetch_array($jranks))
  179.                         {
  180.                          $num++;
  181.                               $odd="#CCCCCC";
  182.                               $even="#e3e3e3";
  183.                          if ($num % 2) {
  184.                          $color="$even";
  185.                             } else {
  186.                           $color="$odd";
  187.                          }
  188.                           echo "<tr bgcolor=$color>
  189.                                <td align='left'><small>Rank: ",htmlentities($rks['r_NAME']),"</small></td>
  190.                                <td align='left'><small>Income: ".money_alter($rks['r_WAGES'])." a day</small></td>
  191.                                <td align='left'><small>Manual: ".number_format($rks['r_MANUALNEED'])."</small></td>
  192.                                <td align='left'><small>Intelligence: ".number_format($rks['r_INTELNEED'])."</small></td>
  193.                                <td align='left'><small>Endurance: ".number_format($rks['r_ENDURNEED'])."</small></td>
  194.                                </tr>";
  195.                                       }
  196.                                 echo "<tr bgcolor=#8F8F8F><td colspan='5' align='center'>&nbsp;</td></tr>
  197.                                      <tr><td align='center' colspan='5'>&nbsp;</td></tr></table>
  198.                                      <hr width='80%'/></center>";
  199.  
  200.                           echo "<form action='job.php?action=special' method='post'>
  201.                                <center><table width = '80%' cellspacing = '1' class = 'rounded'>
  202.                                <tr><td colspan='2' align='left'>&nbsp;</td></tr>
  203.                                <tr><td colspan='2' align='center'><font size='2'><b>Specials unlocked:</b></font></td>
  204.                                </tr><tr><td colspan='2' align='left'>&nbsp;</td></tr>
  205.                                <tr bgcolor=#8F8F8F>
  206.                                <th colspan='2'>&nbsp;</th></tr>";
  207.                                 $num = array();
  208.                                 $js = array();
  209.                                 $sp = array();
  210.                                 $q_ry = array();
  211.                                 $q_ry = "SELECT *
  212.                                         FROM `job_specials`
  213.                                         WHERE `jsJOB` = '".mysql_real_escape_string($mj['job_ID'])."'
  214.                                         AND `jsRANK` <= '".mysql_real_escape_string($mjr['r_ID'])."'
  215.                                         ORDER BY `jsID` ASC";
  216.                                 $num=0;
  217.                                 $js = mysql_query($q_ry);
  218.                
  219.              if(!mysql_num_rows($js))
  220.             {
  221.              print "<tr bgcolor=#e3e3e3><td colspan='2'>This Job has no Speacials</td></tr>";
  222.             }
  223.              else
  224.             {
  225.              while($sp = mysql_fetch_array($js))
  226.              {
  227.               $num++;
  228.                  $odd="#CCCCCC";
  229.                  $even="#e3e3e3";
  230.               if ($num % 2) {
  231.               $color="$even";
  232.                  } else {
  233.                $color="$odd";
  234.               }
  235.                echo "<tr bgcolor=$color>
  236.                     <td align='left'>",htmlentities($sp['jsNAME']),"</td>
  237.                     <td align='left'><center><input type='radio' name='ID' value='{$sp['jsID']}' /></td></tr>";
  238.               }
  239.             }
  240.              echo "<tr bgcolor=#8F8F8F><td colspan='2' align='center'><input type='submit' value='Do special'></td>
  241.                   </tr><tr><td colspan='2' align='center'>&nbsp;</td></tr>
  242.                   </table></center></form><hr width='80%'>
  243.  
  244.                   <center><table width = '80%' border = '0'><tr>
  245.                   <td align='center' width='50%'><a href='job.php?action=promote'>&gt; Get Promoted</a></td>
  246.                   <td align='center' width='50%'><a href='job.php?action=quit'>&gt; Quit job</a></td>
  247.                   </table><hr width='80%'/></center>";
  248.              }
  249.              }
  250.              function job_interview()
  251.             {
  252.              echo "<center><main>Interview</main><hr width = '80%'>";
  253.              global $pl;
  254.              $myjob = array();
  255.              $q_ry = array();
  256.              $q_ry = "SELECT `my_job`,`my_comp`
  257.                      FROM `members_extra`
  258.                      WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";;
  259.              $myjob = mysql_query($q_ry);
  260.              $mj = array();
  261.              $mj = mysql_fetch_array($myjob);
  262.  
  263.              if(valid_XID($_GET['XID'])!=TRUE)
  264.             {
  265.              echo "<center>".errors_(XID)."</center>";
  266.              include('./includes/style_bottom.php');
  267.              exit();
  268.             }
  269.          else if($mj['my_job'])
  270.                   {
  271.                    echo "You already have a job! Leave that one before trying to start another job.
  272.                   <hr width = '80%'>&gt;<a href='newspaper.php?page=jobs'>Back</a><hr width = '80%'>";
  273.                    include('./includes/style_bottom.php');
  274.                    exit();
  275.                   }
  276.          else if($mj['my_comp'])
  277.                   {
  278.                    echo "<center>You already have a job! Leave that one before trying to start another job.</center>";
  279.                    include('./includes/style_bottom.php');
  280.                    exit();
  281.                   }
  282.               else
  283.             {
  284.             $_GET['XID']=abs(intval($_GET['XID']));
  285.             $thisjob = array();
  286.             $job = array();
  287.             $q_ry = array();
  288.             $q_ry = "SELECT *
  289.                     FROM `system_jobs`
  290.                     WHERE `job_ID` = '".mysql_real_escape_string($_GET['XID'])."'";
  291.             $thisjob = mysql_query($q_ry);
  292.  
  293.                    if(!mysql_num_rows($thisjob))
  294.                   {
  295.                    echo "<center>".errors_(XID)."</center>";
  296.                          include('./includes/style_bottom.php');
  297.                          exit();
  298.                     }
  299.                      else
  300.                          {
  301.                           $job = mysql_fetch_array($thisjob);
  302.                           echo "
  303.                                <table width = '80%' border = '0'><tr><td align = 'left'>
  304.                                Hello ",htmlentities($pl['playername']),", i am ",htmlentities($job['job_OWNER']),"
  305.                                <br/><br/>
  306.                                ",htmlentities($job['job_DESC']),"<br/><br/>";
  307.                        $wrank = array();
  308.                        
  309.                        if($_GET['XID'] == '1')
  310.                       {
  311.                        $wrank = "toparmyrank";
  312.                       }
  313.                        if($_GET['XID'] == '2')
  314.                       {
  315.                        $wrank = "topgrocerrank";
  316.                       }
  317.                        if($_GET['XID'] == '3')
  318.                       {
  319.                        $wrank = "topcasinorank";
  320.                       }
  321.                        if($_GET['XID'] == '4')
  322.                       {
  323.                        $wrank = "medicaltoprank";
  324.                       }
  325.                        if($_GET['XID'] == '5')
  326.                       {
  327.                        $wrank = "educationtoprank";
  328.                       }
  329.                        if($_GET['XID'] == '6')
  330.                       {
  331.                        $wrank = "lawtoprank";
  332.                       }
  333.                        $alrank = array();
  334.                        $ar = array();
  335.                        $q_ry = array();
  336.                        $q_ry = "SELECT {$wrank}
  337.                                FROM `members_extra`
  338.                                WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  339.                        $alrank = mysql_query($q_ry);
  340.                        $ar = mysql_fetch_array($alrank);
  341.  
  342.  
  343.                        if($ar[$wrank]>0)
  344.                       {
  345.                       $q_ry = array();
  346.                       $q_ry = "UPDATE `members_extra`
  347.                               SET `my_job` = '".mysql_real_escape_string($_GET['XID'])."',
  348.                                   `my_job_rank` = '".mysql_real_escape_string($ar[$wrank])."'
  349.                               WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  350.                       mysql_query($q_ry);
  351.                       echo "Thank you. You can start now.</td></tr></table><hr width ='80%'/>
  352.                            &gt;<a href='job.php'>Okay</a></center>";
  353.                       include('./includes/style_bottom.php');
  354.                       exit();
  355.                       }
  356.                        else
  357.                            {
  358.    $stat = array();
  359.    $st = array();
  360.    $q_ry = array();
  361.    $q_ry = "SELECT `my_labor`,`my_intelligence`,`my_endurance`
  362.            FROM `memberstats`
  363.            WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  364.    $stat = mysql_query($q_ry);
  365.    $st = mysql_fetch_array($stat);
  366.                                 $rank = array();
  367.                                 $rk = array();
  368.                                 $q_ry = array();
  369.                                 $q_ry = "SELECT *
  370.                                         FROM `system_job_ranks`
  371.                                         WHERE `r_JOB` = '".mysql_real_escape_string($_GET['XID'])."'
  372.                                         AND `r_MANUALNEED` <= '".mysql_real_escape_string($st['my_labor'])."'
  373.                                         AND `r_INTELNEED` <= '".mysql_real_escape_string($st['my_intelligence'])."'
  374.                                         AND `r_ENDURNEED` <= '".mysql_real_escape_string($st['my_endurance'])."'
  375.                                         ORDER BY `r_ID` ASC
  376.                                         LIMIT 1";
  377.                                 $rank = mysql_query($q_ry);
  378.                                 $rk = mysql_fetch_array($rank);
  379.                       if(!mysql_num_rows($rank))
  380.                      {
  381.                       echo "Sorry, Your stats are not good enough yet.</td></tr></table><hr width ='80%'/>
  382.                            &gt;<a href='job.php'>Okay</a></center>";
  383.                       include('./includes/style_bottom.php');
  384.                       exit();
  385.                      }
  386.                       else
  387.                           {
  388.                       $q_ry = array();
  389.                       $q_ry = "UPDATE `members_extra`
  390.                               SET `my_job` = '".mysql_real_escape_string($_GET['XID'])."',
  391.                                   `my_job_rank` = '".mysql_real_escape_string($rk['r_ID'])."'
  392.                               WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  393.                       mysql_query($q_ry);
  394.                       echo "Thank you. You can start now.</td></tr></table><hr width ='80%'/>
  395.                            &gt;<a href='job.php'>Okay</a></center>";
  396.                       include('./includes/style_bottom.php');
  397.                       exit();
  398.                      }
  399.                   }
  400.                }
  401.             }
  402.          }
  403.           function quit_job()
  404.          {
  405.            echo "<center><main>Quit job</main><hr width = '75%'>";
  406.            $gotjob = array();
  407.            $q_ry = array();
  408.            $q_ry = "SELECT `my_job`
  409.                    FROM `members_extra`
  410.                    WHERE `my_job` > 0
  411.                    AND `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  412.            $gotjob = mysql_query($q_ry);
  413.            if(!mysql_num_rows($gotjob))
  414.           {
  415.            echo "<center>You dont have a job to quit!
  416.                 <hr width = '75%'>&gt;<a href='newspaper.php'>Okay</a><hr width = '75%'>";
  417.                  include('./includes/style_bottom.php');
  418.                  exit();
  419.           }
  420.            else
  421.                {
  422.             $q_ry = array();
  423.             $q_ry = "UPDATE `members_extra`
  424.                     SET `my_job` = '0',
  425.                         `my_job_rank` = '0'
  426.                     WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  427.             mysql_query($q_ry);
  428.                  echo "<center>You have quit your job!
  429.                 <hr width = '75%'>&gt;<a href='newspaper.php'>Okay</a><hr width = '75%'>";
  430.                  include('./includes/style_bottom.php');
  431.                  exit();
  432.           }
  433.          }
  434.           function promote_me()
  435.         {
  436.            global $pl;
  437.            echo "<center><main>Promotion</main><hr width = '75%'>";
  438.            $gotjob = array();
  439.            $gj = array();
  440.            $q_ry = array();
  441.            $q_ry = "SELECT `my_job`,`my_job_rank`
  442.                    FROM `members_extra`
  443.                    WHERE `my_job` > 0
  444.                    AND `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  445.            $gotjob = mysql_query($q_ry);
  446.            if(!mysql_num_rows($gotjob))
  447.           {
  448.            echo "<center>You dont have a job to get promoted with!
  449.                 <hr width = '75%'>&gt;<a href='newspaper.php'>Okay</a><hr width = '75%'>";
  450.                  include('./includes/style_bottom.php');
  451.                  exit();
  452.           }
  453.            else
  454.                {
  455.                 $gj = mysql_fetch_array($gotjob);
  456.    $stat = array();
  457.    $st = array();
  458.    $q_ry = array();
  459.    $q_ry = "SELECT `my_labor`,`my_intelligence`,`my_endurance`
  460.            FROM `memberstats`
  461.            WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  462.    $stat = mysql_query($q_ry);
  463.    $st = mysql_fetch_array($stat);
  464.  
  465.         $pr = array();
  466.         $jbr = array();
  467.         $q_ry = array();
  468.         $q_ry = "SELECT *
  469.                 FROM `system_job_ranks`
  470.                 WHERE `r_ID` > '".mysql_real_escape_string($gj['my_job_rank'])."'
  471.                 AND `r_MANUALNEED` <= '".mysql_real_escape_string($st['my_labor'])."'
  472.                 AND `r_INTELNEED` <= '".mysql_real_escape_string($st['my_intelligence'])."'
  473.                 AND `r_ENDURNEED` <= '".mysql_real_escape_string($st['my_endurance'])."'
  474.                 AND `r_JOB` = '".mysql_real_escape_string($gj['my_job'])."' ORDER BY `r_ID` ASC LIMIT 1";
  475.         $pr = mysql_query($q_ry);
  476.         if(!mysql_num_rows($pr))
  477.        {
  478.            echo "<center>You dont have enough stats to get promoted yet!
  479.                 <hr width = '75%'>&gt;<a href='job.php'>Okay</a><hr width = '75%'>";
  480.                  include('./includes/style_bottom.php');
  481.                  exit();
  482.           }
  483.         else
  484.        {
  485.         $jbr=mysql_fetch_array($pr);
  486.  
  487.                    $wrank = array();
  488.  
  489.                        if($gj['my_job'] == '1')
  490.                       {
  491.                        $wrank = "toparmyrank";
  492.                       }
  493.                        if($gj['my_job'] == '2')
  494.                       {
  495.                        $wrank = "topgrocerrank";
  496.                       }
  497.                        if($gj['my_job'] == '3')
  498.                       {
  499.                        $wrank = "topcasinorank";
  500.                       }
  501.                        if($gj['my_job'] == '4')
  502.                       {
  503.                        $wrank = "medicaltoprank";
  504.                       }
  505.                        if($gj['my_job'] == '5')
  506.                       {
  507.                        $wrank = "educationtoprank";
  508.                       }
  509.                        if($gj['my_job'] == '6')
  510.                       {
  511.                        $wrank = "lawtoprank";
  512.                       }
  513.  
  514.  
  515.                if($gj['my_job']=='1') { $job['points']='armypoints'; }
  516.                if($gj['my_job']=='2') { $job['points']="grocpoints"; }
  517.                if($gj['my_job']=='3') { $job['points']="casipoints"; }
  518.                if($gj['my_job']=='4') { $job['points']="medipoints"; }
  519.                if($gj['my_job']=='5') { $job['points']="educpoints"; }
  520.                if($gj['my_job']=='6') { $job['points']="lawpoints"; }
  521.  
  522.         $epoints = array();
  523.         $q_ry = array();
  524.         $q_ry = "SELECT {$job['points']}
  525.                 FROM `members_extra`
  526.                 WHERE {$job['points']} >= '".mysql_real_escape_string($jbr['r_UPCOST'])."'
  527.                 AND `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  528.         $epoints = mysql_query($q_ry);
  529.         if(!mysql_num_rows($epoints))
  530.        {
  531.         echo "<center>Sorry ",htmlentities($pl['playername']),",
  532.              You dont have enough points to be promoted to a ",htmlentities($jbr['r_NAME']),"!
  533.                 <hr width = '75%'>&gt;<a href='job.php'>Okay</a><hr width = '75%'>";
  534.                 include('./includes/style_bottom.php');
  535.                 exit();
  536.          }
  537.           else
  538.               {
  539.         $q_ry = array();
  540.         $q_ry = "UPDATE `members_extra`
  541.                 SET `my_job_rank` = '".mysql_real_escape_string($jbr['r_ID'])."',
  542.                     {$wrank} = '".mysql_real_escape_string($jbr['r_ID'])."',
  543.                     {$job['points']} = {$job['points']} - '".mysql_real_escape_string($jbr['r_UPCOST'])."'
  544.                 WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  545.         mysql_query($q_ry);
  546.         echo "<center>Congratulations ",htmlentities($pl['playername']),",
  547.              You have been promoted to a ",htmlentities($jbr['r_NAME']),"!
  548.                 <hr width = '75%'>&gt;<a href='job.php'>Okay</a><hr width = '75%'>";
  549.                 include('./includes/style_bottom.php');
  550.                 exit();
  551.             }
  552.           }
  553.         }
  554.       }
  555.        function job_specials()
  556.       {
  557.          global $pl;
  558.          $_POST['ID'] = abs(intval($_POST['ID']));
  559.          echo "<center><main>Job specials</main><hr width = '75%'>";
  560.          if(!$_POST['ID'])
  561.          {
  562.            echo "Error, Invalid ID!";
  563.          }
  564.          else
  565.             {
  566.                   $q_ry = array();
  567.                   $q_ry = "SELECT `my_job`,`my_job_rank`,
  568.                                  `armypoints`,`grocpoints`,`casipoints`,`medipoints`,`educpoints`,`lawpoints`
  569.                           FROM `members_extra`
  570.                           WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  571.                   $myjob = array();
  572.                   $myjob = mysql_query($q_ry);
  573.                   $mj = array();
  574.                   $mj = mysql_fetch_array($myjob);
  575.                   if(!$mj['my_job'] || !$mj['my_job_rank'])
  576.                   {
  577.                      echo "Error, You dont have a job!";
  578.                   }
  579.                   else
  580.                      {
  581.                        $valid_array = array(1=>array(1,2,3,4,5,6),
  582.                                             2=>array(7,8),
  583.                                             3=>array(9,10),
  584.                                             4=>array(11,12,13,14,15),
  585.                                             5=>array(16),
  586.                                             6=>array(17));
  587.                        $valid_array = $valid_array[$mj['my_job']];
  588.                        if(!in_array($_POST['ID'], $valid_array))
  589.                        {
  590.                          echo "Error, Invalid ID!";
  591.                        }
  592.                        else
  593.                           {
  594.                             //Army job specials!!!!!!!!!!!!
  595.                             if($mj['my_job'] == '1')
  596.                             {
  597.                             $needed_rank = array(1=>1,2=>2,3=>4,4=>5,5=>7,6=>8);
  598.                             $points = "army|" . $mj['armypoints'];
  599.                             $points = explode("|",  $points);
  600.                                   if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
  601.                                   {
  602.                                     echo "Error, You have not earnt this job special yet!";
  603.                                   }
  604.                                   else
  605.                                      {
  606.                                         //Army job special 1
  607.                                         if($_POST['ID'] == '1')
  608.                                         {
  609.                                            if(!$_POST['use'])
  610.                                            {
  611.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  612.                                                 <table width = '50%' class = 'rounded'>
  613.                                                 <tr><td align = 'center'>
  614.                                                 Below you can swap each ".$points[0]." point for 0.001 strength<br/>
  615.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  616.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  617.                                                 <input type = 'text' name = 'amount' value = ''>
  618.                                                 <input type = 'submit' name = 'use' value = 'Swap points for strength'>
  619.                                                 </td></tr></table></form>";
  620.                                            }
  621.                                            else
  622.                                               {
  623.                                                  $_POST['amount'] = abs(intval($_POST['amount']));
  624.                                                  if(!$_POST['amount'])
  625.                                                  {
  626.                                                    echo "Error, You must select a valid ammount!";
  627.                                                  }
  628.                                                  else
  629.                                                  {
  630.                                                  if($mj['armypoints'] < $_POST['amount'])
  631.                                                  {
  632.                                                    echo "Error, You dont have enough army points!";
  633.                                                  }
  634.                                                  else
  635.                                                  {
  636.                                                  if(!$_POST['confirm'])
  637.                                                  {
  638.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  639.                                                 <table width = '50%' class = 'rounded'>
  640.                                                 <tr><td align = 'center'>
  641.                                                 Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
  642.                                                 ".$points[0]." points
  643.                                                 for <b>".($_POST['amount']*0.001)."</b> strength?<br/>
  644.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  645.                                                 <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
  646.                                                 <input type = 'hidden' name = 'use' value = '1'>
  647.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  648.                                                 </td></tr></table></form>";
  649.                                                  }
  650.                                                  else
  651.                                                  {
  652.                                 $q_ry = array();
  653.                                 $q_ry = "UPDATE `members_extra`
  654.                                         SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
  655.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  656.                                 mysql_query($q_ry);
  657.                         $q_ry = array();
  658.                         $q_ry = "UPDATE `memberstats`
  659.                                 SET `my_strength` = `my_strength` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
  660.                                 WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  661.                         mysql_query($q_ry);
  662.                         echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
  663.                                                 for <b>".($_POST['amount']*0.001)."</b> strength!";
  664.                                                  }
  665.                                                  }
  666.                                                  }
  667.                                               }
  668.                                         }
  669.                                         //Army job special 1
  670.  
  671.  
  672.                                         //Army job special 2
  673.                                         if($_POST['ID'] == '2')
  674.                                         {
  675.                                            if(!$_POST['use'])
  676.                                            {
  677.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  678.                                                 <table width = '50%' class = 'rounded'>
  679.                                                 <tr><td align = 'center'>
  680.                                                 Below you can swap each ".$points[0]." point for 0.001 defence<br/>
  681.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  682.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  683.                                                 <input type = 'text' name = 'amount' value = ''>
  684.                                                 <input type = 'submit' name = 'use' value = 'Swap points for defence'>
  685.                                                 </td></tr></table></form>";
  686.                                            }
  687.                                            else
  688.                                               {
  689.                                                  $_POST['amount'] = abs(intval($_POST['amount']));
  690.                                                  if(!$_POST['amount'])
  691.                                                  {
  692.                                                    echo "Error, You must select a valid ammount!";
  693.                                                  }
  694.                                                  else
  695.                                                  {
  696.                                                  if($mj['armypoints'] < $_POST['amount'])
  697.                                                  {
  698.                                                    echo "Error, You dont have enough army points!";
  699.                                                  }
  700.                                                  else
  701.                                                  {
  702.                                                  if(!$_POST['confirm'])
  703.                                                  {
  704.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  705.                                                 <table width = '50%' class = 'rounded'>
  706.                                                 <tr><td align = 'center'>
  707.                                                 Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
  708.                                                 ".$points[0]." points
  709.                                                 for <b>".($_POST['amount']*0.001)."</b> defence?<br/>
  710.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  711.                                                 <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
  712.                                                 <input type = 'hidden' name = 'use' value = '1'>
  713.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  714.                                                 </td></tr></table></form>";
  715.                                                  }
  716.                                                  else
  717.                                                  {
  718.                                 $q_ry = array();
  719.                                 $q_ry = "UPDATE `members_extra`
  720.                                         SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
  721.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  722.                                 mysql_query($q_ry);
  723.                         $q_ry = array();
  724.                         $q_ry = "UPDATE `memberstats`
  725.                                 SET `my_defence` = `my_defence` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
  726.                                 WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  727.                         mysql_query($q_ry);
  728.                         echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
  729.                                                 for <b>".($_POST['amount']*0.001)."</b> defence!";
  730.                                                  }
  731.                                                  }
  732.                                                  }
  733.                                               }
  734.                                         }
  735.                                         //Army job special 2
  736.  
  737.  
  738.                                         //Army job special 3
  739.                                         if($_POST['ID'] == '3')
  740.                                         {
  741.                                            if(!$_POST['use'])
  742.                                            {
  743.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  744.                                                 <table width = '50%' class = 'rounded'>
  745.                                                 <tr><td align = 'center'>
  746.                                                 Below you can swap 10,000 ".$points[0]." point + \$5,000 to spy<br/>
  747.                                                 Enter the id of the person you wish to spy on below<br/>
  748.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points
  749.                                                 & <b>".money_alter($pl['wallet'])."</b><br/>
  750.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  751.                                                 <input type = 'text' name = 'user' value = ''>
  752.                                                 <input type = 'submit' name = 'use' value = 'Spy on someone'>
  753.                                                 </td></tr></table></form>";
  754.                                            }
  755.                                            else
  756.                                               {
  757.                                                  $_POST['user'] = abs(intval($_POST['user']));
  758.                                                  if(!$_POST['user'])
  759.                                                  {
  760.                                                    echo "Error, You must select a valid id!";
  761.                                                  }
  762.                                                  else
  763.                                                  {
  764.                                                  $q_ry = array();
  765.                                                  $q_ry = "SELECT m.playername,m.wallet,s.*
  766.                                                          FROM `members` AS m
  767.                                                          INNER JOIN `memberstats` AS s
  768.                                                          ON m.playerid = s.playerid
  769.                                                        WHERE m.playerid = '".mysql_real_escape_string($_POST['user'])."'";
  770.                                                  $real = array();
  771.                                                  $real = mysql_query($q_ry);
  772.                                                  if(!mysql_num_rows($real))
  773.                                                  {
  774.                                                    echo "Error, Id not reconised!";
  775.                                                  }
  776.                                                  else
  777.                                                  {
  778.                                                  if($pl['wallet'] < 5000)
  779.                                                  {
  780.                                                    echo "Error, You dont have enough money!";
  781.                                                  }
  782.                                                  else
  783.                                                  {
  784.                                                  if($mj['armypoints'] < 10000)
  785.                                                  {
  786.                                                    echo "Error, You dont have enough army points!";
  787.                                                  }
  788.                                                  else
  789.                                                  {
  790.                                                  $r = array();
  791.                                                  $r = mysql_fetch_array($real);
  792.                                                  if(!$_POST['confirm'])
  793.                                                  {
  794.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  795.                                                 <table width = '50%' class = 'rounded'>
  796.                                                 <tr><td align = 'center'>
  797.                                                 Are you sure you wish to spy on <b>".htmlentities($r['playername'])."</b>?
  798.                                                 <br/>
  799.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  800.                                                 <input type = 'hidden' name = 'user' value = '".$_POST['user']."'>
  801.                                                 <input type = 'hidden' name = 'use' value = '1'>
  802.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  803.                                                 </td></tr></table></form>";
  804.                                                  }
  805.                                                  else
  806.                                                  {
  807.                                                  $cshi=rand(1,9);
  808.                                                  $s=rand(1,9);
  809.                                                  $g=rand(1,9);
  810.                                                  $d=rand(1,9);
  811.                                                  $sp=rand(1,9);
  812.  
  813.      if($cshi > 7) { $money="".money_alter($r['wallet']).""; }
  814.                    else { $money="<font color=red>failed to retrieve</font>"; }
  815.  
  816.      if($s > 5) { $strength=$r['my_strength']; }
  817.                    else { $strength="<font color=red>failed to retrieve</font>"; }
  818.  
  819.      if($g > 5) { $defence=$r['my_defence']; }
  820.                    else { $defence="<font color=red>failed to retrieve</font>"; }
  821.  
  822.      if($d > 5) { $dexterity=$r['my_dexterity']; }
  823.                    else { $dexterity="<font color=red>failed to retrieve</font>"; }
  824.  
  825.      if($sp > 5) { $speed=$r['my_speed']; }
  826.                    else { $speed="<font color=red>failed to retrieve</font>"; }
  827.  
  828.  
  829.      echo "You pay the spy to spy on <b>",htmlentities($r['playername']),"</b>,
  830.           The spy manages to get the following information!.<br/><br/>
  831.           ",htmlentities($r['playername']),"'s Money: <b>$money</b><br/>
  832.           ",htmlentities($r['playername']),"'s Speed: <b>$speed</b><br/>
  833.           ",htmlentities($r['playername']),"'s Strength: <b>$strength</b><br/>
  834.           ",htmlentities($r['playername']),"'s Defence: <b>$defence</b><br/>
  835.           ",htmlentities($r['playername']),"'s Dexterity: <b>$dexterity</b>";
  836.                                 $q_ry = array();
  837.                                 $q_ry = "UPDATE `members_extra`
  838.                                         SET `armypoints` = `armypoints` - '10000'
  839.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  840.                                 mysql_query($q_ry);
  841.                                 $q_ry = array();
  842.                                 $q_ry = "UPDATE `members`
  843.                                         SET `wallet` = `wallet` - '5000'
  844.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  845.                                 mysql_query($q_ry);
  846.                                                  }
  847.                                                  }
  848.                                                  }
  849.                                                  }
  850.                                                  }
  851.                                               }
  852.                                         }
  853.                                         //Army job special 3
  854.  
  855.  
  856.  
  857.  
  858.                                         //Army job special 4
  859.                                         if($_POST['ID'] == '4')
  860.                                         {
  861.                                            if(!$_POST['use'])
  862.                                            {
  863.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  864.                                                 <table width = '50%' class = 'rounded'>
  865.                                                 <tr><td align = 'center'>
  866.                                                 Below you can swap each ".$points[0]." point for 0.001 speed<br/>
  867.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  868.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  869.                                                 <input type = 'text' name = 'amount' value = ''>
  870.                                                 <input type = 'submit' name = 'use' value = 'Swap points for speed'>
  871.                                                 </td></tr></table></form>";
  872.                                            }
  873.                                            else
  874.                                               {
  875.                                                  $_POST['amount'] = abs(intval($_POST['amount']));
  876.                                                  if(!$_POST['amount'])
  877.                                                  {
  878.                                                    echo "Error, You must select a valid ammount!";
  879.                                                  }
  880.                                                  else
  881.                                                  {
  882.                                                  if($mj['armypoints'] < $_POST['amount'])
  883.                                                  {
  884.                                                    echo "Error, You dont have enough army points!";
  885.                                                  }
  886.                                                  else
  887.                                                  {
  888.                                                  if(!$_POST['confirm'])
  889.                                                  {
  890.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  891.                                                 <table width = '50%' class = 'rounded'>
  892.                                                 <tr><td align = 'center'>
  893.                                                 Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
  894.                                                 ".$points[0]." points
  895.                                                 for <b>".($_POST['amount']*0.001)."</b> speed?<br/>
  896.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  897.                                                 <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
  898.                                                 <input type = 'hidden' name = 'use' value = '1'>
  899.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  900.                                                 </td></tr></table></form>";
  901.                                                  }
  902.                                                  else
  903.                                                  {
  904.                                 $q_ry = array();
  905.                                 $q_ry = "UPDATE `members_extra`
  906.                                         SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
  907.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  908.                                 mysql_query($q_ry);
  909.                         $q_ry = array();
  910.                         $q_ry = "UPDATE `memberstats`
  911.                                 SET `my_speed` = `my_speed` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
  912.                                 WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  913.                         mysql_query($q_ry);
  914.                         echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
  915.                                                 for <b>".($_POST['amount']*0.001)."</b> speed!";
  916.                                                  }
  917.                                                  }
  918.                                                  }
  919.                                               }
  920.                                         }
  921.                                         //Army job special 4
  922.  
  923.  
  924.  
  925.                                         //Army job special 5
  926.                                         if($_POST['ID'] == '5')
  927.                                         {
  928.                                            if(!$_POST['use'])
  929.                                            {
  930.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  931.                                                 <table width = '50%' class = 'rounded'>
  932.                                                 <tr><td align = 'center'>
  933.                                                 Below you can swap 25,000 ".$points[0]." points for a weapon<br/>
  934.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  935.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  936.                                                 <input type = 'submit' name = 'use' value = 'Swap for a weapon'>
  937.                                                 </td></tr></table></form>";
  938.                                            }
  939.                                            else
  940.                                               {
  941.                                                  if($mj['armypoints'] < 25000)
  942.                                                  {
  943.                                                    echo "Error, You dont have enough army points!";
  944.                                                  }
  945.                                                  else
  946.                                                  {
  947.                                                  if(!$_POST['confirm'])
  948.                                                  {
  949.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  950.                                                 <table width = '50%' class = 'rounded'>
  951.                                                 <tr><td align = 'center'>
  952.                                                 Are you sure you wish to swap 25,000 army points for a weapon?<br/>
  953.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  954.                                                 <input type = 'hidden' name = 'use' value = '1'>
  955.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  956.                                                 </td></tr></table></form>";
  957.                                                  }
  958.                                                  else
  959.                                                  {
  960.      $giveout = array();
  961.      $itid = array();
  962.      $giveout=rand(1,3);
  963.      if($giveout == 1) { $itid=22; } else if($giveout == 2) { $itid=25; } else if($giveout == 3) { $itid=60; }
  964.      $iti = array();
  965.      $ii = array();
  966.      $q_ry = array();
  967.      $q_ry = "SELECT *
  968.              FROM `items`
  969.              WHERE `item_id` = '".mysql_real_escape_string($itid)."'";
  970.      $iti = mysql_query($q_ry);
  971.      $ii = mysql_fetch_array($iti);
  972.  
  973.      i_credit($_SESSION['playerid'], $itid, 1);
  974.  
  975.      echo "You walk in the army inventory room where you find many guns.<br/>
  976.                   You hear someone coming and decide to grab the first gun at hand.<br/>
  977.                   You manage to gain a <b>".htmlentities($ii['item_name'])."</b>!";
  978.                                 $q_ry = array();
  979.                                 $q_ry = "UPDATE `members_extra`
  980.                                         SET `armypoints` = `armypoints` - '25000'
  981.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  982.                                 mysql_query($q_ry);
  983.                                                  }
  984.                                                  }
  985.                                               }
  986.                                         }
  987.                                         //Army job special 5
  988.  
  989.  
  990.  
  991.  
  992.                                         //Army job special 6
  993.                                         if($_POST['ID'] == '6')
  994.                                         {
  995.                                            if(!$_POST['use'])
  996.                                            {
  997.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  998.                                                 <table width = '50%' class = 'rounded'>
  999.                                                 <tr><td align = 'center'>
  1000.                                                 Below you can swap each ".$points[0]." point for 0.001 dexterity<br/>
  1001.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1002.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1003.                                                 <input type = 'text' name = 'amount' value = ''>
  1004.                                                 <input type = 'submit' name = 'use' value = 'Swap points for dexterity'>
  1005.                                                 </td></tr></table></form>";
  1006.                                            }
  1007.                                            else
  1008.                                               {
  1009.                                                  $_POST['amount'] = abs(intval($_POST['amount']));
  1010.                                                  if(!$_POST['amount'])
  1011.                                                  {
  1012.                                                    echo "Error, You must select a valid ammount!";
  1013.                                                  }
  1014.                                                  else
  1015.                                                  {
  1016.                                                  if($mj['armypoints'] < $_POST['amount'])
  1017.                                                  {
  1018.                                                    echo "Error, You dont have enough army points!";
  1019.                                                  }
  1020.                                                  else
  1021.                                                  {
  1022.                                                  if(!$_POST['confirm'])
  1023.                                                  {
  1024.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1025.                                                 <table width = '50%' class = 'rounded'>
  1026.                                                 <tr><td align = 'center'>
  1027.                                                 Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
  1028.                                                 ".$points[0]." points
  1029.                                                 for <b>".($_POST['amount']*0.001)."</b> dexterity?<br/>
  1030.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1031.                                                 <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
  1032.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1033.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1034.                                                 </td></tr></table></form>";
  1035.                                                  }
  1036.                                                  else
  1037.                                                  {
  1038.                                 $q_ry = array();
  1039.                                 $q_ry = "UPDATE `members_extra`
  1040.                                         SET `armypoints` = `armypoints` - '".mysql_real_escape_string($_POST['amount'])."'
  1041.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1042.                                 mysql_query($q_ry);
  1043.                         $q_ry = array();
  1044.                         $q_ry = "UPDATE `memberstats`
  1045.                                 SET `my_dexterity` = `my_dexterity` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
  1046.                                 WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1047.                         mysql_query($q_ry);
  1048.                         echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
  1049.                                                 for <b>".($_POST['amount']*0.001)."</b> dexterity!";
  1050.                                                  }
  1051.                                                  }
  1052.                                                  }
  1053.                                               }
  1054.                                         }
  1055.                                         //Army job special 6
  1056.                                      }
  1057.                             }
  1058.                             //Army job specials!!!!!!!!!!!!
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                             //Grocer job specials!!!!!!!!!!!!
  1064.                             if($mj['my_job'] == '2')
  1065.                             {
  1066.                             $needed_rank = array(7=>11,8=>13);
  1067.                             $points = "grocer|" . $mj['grocpoints'];
  1068.                             $points = explode("|",  $points);
  1069.                                   if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
  1070.                                   {
  1071.                                     echo "Error, You have not earnt this job special yet!";
  1072.                                   }
  1073.                                   else
  1074.                                      {
  1075.  
  1076.                                         //Grocer job special 1
  1077.                                         if($_POST['ID'] == '7')
  1078.                                         {
  1079.                                            if(!$_POST['use'])
  1080.                                            {
  1081.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1082.                                                 <table width = '50%' class = 'rounded'>
  1083.                                                 <tr><td align = 'center'>
  1084.                                                 Below you can swap each ".$points[0]." point for 0.001 speed<br/>
  1085.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1086.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1087.                                                 <input type = 'text' name = 'amount' value = ''>
  1088.                                                 <input type = 'submit' name = 'use' value = 'Swap points for speed'>
  1089.                                                 </td></tr></table></form>";
  1090.                                            }
  1091.                                            else
  1092.                                               {
  1093.                                                  $_POST['amount'] = abs(intval($_POST['amount']));
  1094.                                                  if(!$_POST['amount'])
  1095.                                                  {
  1096.                                                    echo "Error, You must select a valid ammount!";
  1097.                                                  }
  1098.                                                  else
  1099.                                                  {
  1100.                                                  if($mj['grocpoints'] < $_POST['amount'])
  1101.                                                  {
  1102.                                                    echo "Error, You dont have enough grocer points!";
  1103.                                                  }
  1104.                                                  else
  1105.                                                  {
  1106.                                                  if(!$_POST['confirm'])
  1107.                                                  {
  1108.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1109.                                                 <table width = '50%' class = 'rounded'>
  1110.                                                 <tr><td align = 'center'>
  1111.                                                 Are you sure you wish to swap <b>".number_format($_POST['amount'])."</b>
  1112.                                                 ".$points[0]." points
  1113.                                                 for <b>".($_POST['amount']*0.001)."</b> speed?<br/>
  1114.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1115.                                                 <input type = 'hidden' name = 'amount' value = '".$_POST['amount']."'>
  1116.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1117.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1118.                                                 </td></tr></table></form>";
  1119.                                                  }
  1120.                                                  else
  1121.                                                  {
  1122.                                 $q_ry = array();
  1123.                                 $q_ry = "UPDATE `members_extra`
  1124.                                         SET `grocpoints` = `grocpoints` - '".mysql_real_escape_string($_POST['amount'])."'
  1125.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1126.                                 mysql_query($q_ry);
  1127.                         $q_ry = array();
  1128.                         $q_ry = "UPDATE `memberstats`
  1129.                                 SET `my_speed` = `my_speed` + '".mysql_real_escape_string($_POST['amount']*0.001)."'
  1130.                                 WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1131.                         mysql_query($q_ry);
  1132.                         echo "You have swapped <b>".number_format($_POST['amount'])."</b> ".$points[0]." points
  1133.                                                 for <b>".($_POST['amount']*0.001)."</b> speed!";
  1134.                                                  }
  1135.                                                  }
  1136.                                                  }
  1137.                                               }
  1138.                                         }
  1139.                                         //Grocer job special 1
  1140.  
  1141.  
  1142.                                         //Grocer job special 2
  1143.                                         if($_POST['ID'] == '8')
  1144.                                         {
  1145.                                            if(!$_POST['use'])
  1146.                                            {
  1147.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1148.                                                 <table width = '50%' class = 'rounded'>
  1149.                                                 <tr><td align = 'center'>
  1150.                                                 Below you can swap 100 ".$points[0]." points for cash<br/>
  1151.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1152.                                                 <small>The amount you gain is random!</small><br/>
  1153.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1154.                                                 <input type = 'submit' name = 'use' value = 'Steal cash'>
  1155.                                                 </td></tr></table></form>";
  1156.                                            }
  1157.                                            else
  1158.                                               {
  1159.                                                  if($mj['grocpoints'] < 100)
  1160.                                                  {
  1161.                                                    echo "Error, You dont have enough grocer points!";
  1162.                                                  }
  1163.                                                  else
  1164.                                                  {
  1165.                                                  if(!$_POST['confirm'])
  1166.                                                  {
  1167.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1168.                                                 <table width = '50%' class = 'rounded'>
  1169.                                                 <tr><td align = 'center'>
  1170.                                                 Are you sure you wish to swap 100 ".$points[0]." points for cash?<br/>
  1171.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1172.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1173.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1174.                                                 </td></tr></table></form>";
  1175.                                                  }
  1176.                                                  else
  1177.                                                  {
  1178.      $gain = rand(1000,5000);
  1179.  
  1180.                                 $q_ry = array();
  1181.                                 $q_ry = "UPDATE `members_extra`
  1182.                                         SET `grocpoints` = `grocpoints` - '100'
  1183.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1184.                                 mysql_query($q_ry);
  1185.                                 $q_ry = array();
  1186.                                 $q_ry = "UPDATE `members`
  1187.                                         SET `wallet` = `wallet` + '".mysql_real_escape_string($gain)."'
  1188.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1189.                                 mysql_query($q_ry);
  1190.  
  1191.      echo "You walk in the shop office.<br/>
  1192.                   You see a petty cash box and grab it.<br/>
  1193.                   You manage to gain a <b>".money_alter($gain)."</b>!";
  1194.                                                  }
  1195.                                                  }
  1196.                                               }
  1197.                                         }
  1198.                                         //Grocer job special 2
  1199.  
  1200.  
  1201.  
  1202.                                      }
  1203.                             }
  1204.                             //Grocer job specials!!!!!!!!!!!!
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.                             //Casino job specials!!!!!!!!!!!!
  1211.                             if($mj['my_job'] == '3')
  1212.                             {
  1213.                             $needed_rank = array(9=>16,10=>19);
  1214.                             $points = "casino|" . $mj['casipoints'];
  1215.                             $points = explode("|",  $points);
  1216.                                   if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
  1217.                                   {
  1218.                                     echo "Error, You have not earnt this job special yet!";
  1219.                                   }
  1220.                                   else
  1221.                                      {
  1222.  
  1223.                                         //Casino job special 1
  1224.                                         if($_POST['ID'] == '9')
  1225.                                         {
  1226.                                            if(!$_POST['use'])
  1227.                                            {
  1228.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1229.                                                 <table width = '50%' class = 'rounded'>
  1230.                                                 <tr><td align = 'center'>
  1231.                                                 Below you can swap 1,000 ".$points[0]." points for 25 ".$points[0]." tokens<br/>
  1232.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1233.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1234.                                                 <input type = 'submit' name = 'use' value = 'Swap points for tokens'>
  1235.                                                 </td></tr></table></form>";
  1236.                                            }
  1237.                                            else
  1238.                                               {
  1239.                                                  $_POST['amount'] = abs(intval($_POST['amount']));
  1240.                                                  if($mj['casipoints'] < 1000)
  1241.                                                  {
  1242.                                                    echo "Error, You dont have enough casino points!";
  1243.                                                  }
  1244.                                                  else
  1245.                                                  {
  1246.                                                  if(!$_POST['confirm'])
  1247.                                                  {
  1248.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1249.                                                 <table width = '50%' class = 'rounded'>
  1250.                                                 <tr><td align = 'center'>
  1251.                                                 Are you sure you wish to swap <b>1,000</b>
  1252.                                                 ".$points[0]." points
  1253.                                                 for 25 casino tokens?<br/>
  1254.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1255.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1256.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1257.                                                 </td></tr></table></form>";
  1258.                                                  }
  1259.                                                  else
  1260.                                                  {
  1261.                                 $q_ry = array();
  1262.                                 $q_ry = "UPDATE `members_extra`
  1263.                                         SET `casipoints` = `casipoints` - '1000',
  1264.                                             `my_ctokens` = `my_ctokens` + '25'
  1265.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1266.                                 mysql_query($q_ry);
  1267.                         echo "You have swapped <b>1,000</b> ".$points[0]." points
  1268.                                                 for 25 casino tokens!";
  1269.                                                  }
  1270.                                                  }
  1271.                                               }
  1272.                                         }
  1273.                                         //Casino job special 1
  1274.  
  1275.  
  1276.  
  1277.                                         //Casino job special 2
  1278.                                         if($_POST['ID'] == '10')
  1279.                                         {
  1280.                                            if(!$_POST['use'])
  1281.                                            {
  1282.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1283.                                                 <table width = '50%' class = 'rounded'>
  1284.                                                 <tr><td align = 'center'>
  1285.                                                 Below you can swap 100 ".$points[0]." points for cash<br/>
  1286.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1287.                                                 <small>The amount you gain is random!</small><br/>
  1288.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1289.                                                 <input type = 'submit' name = 'use' value = 'Steal cash'>
  1290.                                                 </td></tr></table></form>";
  1291.                                            }
  1292.                                            else
  1293.                                               {
  1294.                                                  if($mj['casipoints'] < 100)
  1295.                                                  {
  1296.                                                    echo "Error, You dont have enough casino points!";
  1297.                                                  }
  1298.                                                  else
  1299.                                                  {
  1300.                                                  if(!$_POST['confirm'])
  1301.                                                  {
  1302.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1303.                                                 <table width = '50%' class = 'rounded'>
  1304.                                                 <tr><td align = 'center'>
  1305.                                                 Are you sure you wish to swap 100 ".$points[0]." points for cash?<br/>
  1306.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1307.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1308.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1309.                                                 </td></tr></table></form>";
  1310.                                                  }
  1311.                                                  else
  1312.                                                  {
  1313.      $gain = rand(800,6000);
  1314.  
  1315.                                 $q_ry = array();
  1316.                                 $q_ry = "UPDATE `members_extra`
  1317.                                         SET `casipoints` = `casipoints` - '100'
  1318.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1319.                                 mysql_query($q_ry);
  1320.                                 $q_ry = array();
  1321.                                 $q_ry = "UPDATE `members`
  1322.                                         SET `wallet` = `wallet` + '".mysql_real_escape_string($gain)."'
  1323.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1324.                                 mysql_query($q_ry);
  1325.  
  1326.      echo "You walk in the casino office.<br/>
  1327.                   You see a box of chips.<br/>
  1328.                   You cash them in at the cashing in booth.<br/>
  1329.                   You manage to gain a <b>".money_alter($gain)."</b>!";
  1330.                                                  }
  1331.                                                  }
  1332.                                               }
  1333.                                         }
  1334.                                         //Casino job special 2
  1335.  
  1336.  
  1337.  
  1338.                                      }
  1339.                             }
  1340.                             //Casino job specials!!!!!!!!!!!!
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.                             //Medical job specials!!!!!!!!!!!!
  1347.                             if($mj['my_job'] == '4')
  1348.                             {
  1349.                             $needed_rank = array(11=>22,12=>21,13=>23,14=>24,15=>28);
  1350.                             $points = "medical|" . $mj['medipoints'];
  1351.                             $points = explode("|",  $points);
  1352.                                   if($needed_rank[$_POST['ID']] > $mj['my_job_rank'])
  1353.                                   {
  1354.                                     echo "Error, You have not earnt this job special yet!";
  1355.                                   }
  1356.                                   else
  1357.                                      {
  1358.                                         //Medical job special 1
  1359.                                         if($_POST['ID'] == '11')
  1360.                                         {
  1361.                                            if(!$_POST['use'])
  1362.                                            {
  1363.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1364.                                                 <table width = '50%' class = 'rounded'>
  1365.                                                 <tr><td align = 'center'>
  1366.                                                 Below you can swap 1,000 ".$points[0]." points for +1 life<br/>
  1367.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1368.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1369.                                                 <input type = 'submit' name = 'use' value = 'Swap points for life'>
  1370.                                                 </td></tr></table></form>";
  1371.                                            }
  1372.                                            else
  1373.                                               {
  1374.                                                  if($mj['medipoints'] < 1000)
  1375.                                                  {
  1376.                                                    echo "Error, You dont have enough medical points!";
  1377.                                                  }
  1378.                                                  else
  1379.                                                  {
  1380.                                                  if(!$_POST['confirm'])
  1381.                                                  {
  1382.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1383.                                                 <table width = '50%' class = 'rounded'>
  1384.                                                 <tr><td align = 'center'>
  1385.                                                 Are you sure you wish to swap <b>".number_format(1000)."</b>
  1386.                                                 ".$points[0]." points
  1387.                                                 for +1 life?<br/>
  1388.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1389.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1390.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1391.                                                 </td></tr></table></form>";
  1392.                                                  }
  1393.                                                  else
  1394.                                                  {
  1395.                                 $q_ry = array();
  1396.                                 $q_ry = "UPDATE `members_extra`
  1397.                                         SET `medipoints` = `medipoints` - '1000'
  1398.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1399.                                 mysql_query($q_ry);
  1400.                                 $q_ry = array();
  1401.                                 $q_ry = "UPDATE `members`
  1402.                                         SET `my_maxlife` = `my_maxlife` + '1'
  1403.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1404.                                 mysql_query($q_ry);
  1405.                         echo "You have swapped <b>".number_format(1000)."</b> ".$points[0]." points
  1406.                                                 for +1 life!";
  1407.                                                  }
  1408.                                                  }
  1409.                                               }
  1410.                                         }
  1411.                                         //Medical job special 1
  1412.  
  1413.  
  1414.  
  1415.                                         //Medical job special 2
  1416.                                         if($_POST['ID'] == '12')
  1417.                                         {
  1418.                                            if(!$_POST['use'])
  1419.                                            {
  1420.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1421.                                                 <table width = '50%' class = 'rounded'>
  1422.                                                 <tr><td align = 'center'>
  1423.                                                 Below you can swap 2,000 ".$points[0]." points for a
  1424.                                                 small first aid kit<br/>
  1425.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1426.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1427.                                                 <input type = 'submit' name = 'use' value = 'Swap points for sfak'>
  1428.                                                 </td></tr></table></form>";
  1429.                                            }
  1430.                                            else
  1431.                                               {
  1432.                                                  if($mj['medipoints'] < 2000)
  1433.                                                  {
  1434.                                                    echo "Error, You dont have enough medical points!";
  1435.                                                  }
  1436.                                                  else
  1437.                                                  {
  1438.                                                  if(!$_POST['confirm'])
  1439.                                                  {
  1440.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1441.                                                 <table width = '50%' class = 'rounded'>
  1442.                                                 <tr><td align = 'center'>
  1443.                                                 Are you sure you wish to swap <b>".number_format(2000)."</b>
  1444.                                                 ".$points[0]." points
  1445.                                                 for a small first aid kit?<br/>
  1446.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1447.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1448.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1449.                                                 </td></tr></table></form>";
  1450.                                                  }
  1451.                                                  else
  1452.                                                  {
  1453.                                 $q_ry = array();
  1454.                                 $q_ry = "UPDATE `members_extra`
  1455.                                         SET `medipoints` = `medipoints` - '2000'
  1456.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1457.                                 mysql_query($q_ry);
  1458.                                 i_credit($_SESSION['playerid'], 17, 1);
  1459.                         echo "You have swapped <b>".number_format(2000)."</b> ".$points[0]." points
  1460.                                                 for a small first aid kit!";
  1461.                                                  }
  1462.                                                  }
  1463.                                               }
  1464.                                         }
  1465.                                         //Medical job special 2
  1466.  
  1467.  
  1468.  
  1469.  
  1470.                                         //Medical job special 3
  1471.                                         if($_POST['ID'] == '13')
  1472.                                         {
  1473.                                            if(!$_POST['use'])
  1474.                                            {
  1475.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1476.                                                 <table width = '50%' class = 'rounded'>
  1477.                                                 <tr><td align = 'center'>
  1478.                                                 Below you can swap 4,000 ".$points[0]." points for a
  1479.                                                 first aid kit<br/>
  1480.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1481.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1482.                                                 <input type = 'submit' name = 'use' value = 'Swap points for fak'>
  1483.                                                 </td></tr></table></form>";
  1484.                                            }
  1485.                                            else
  1486.                                               {
  1487.                                                  if($mj['medipoints'] < 4000)
  1488.                                                  {
  1489.                                                    echo "Error, You dont have enough medical points!";
  1490.                                                  }
  1491.                                                  else
  1492.                                                  {
  1493.                                                  if(!$_POST['confirm'])
  1494.                                                  {
  1495.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1496.                                                 <table width = '50%' class = 'rounded'>
  1497.                                                 <tr><td align = 'center'>
  1498.                                                 Are you sure you wish to swap <b>".number_format(4000)."</b>
  1499.                                                 ".$points[0]." points
  1500.                                                 for a first aid kit?<br/>
  1501.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1502.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1503.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1504.                                                 </td></tr></table></form>";
  1505.                                                  }
  1506.                                                  else
  1507.                                                  {
  1508.                                 $q_ry = array();
  1509.                                 $q_ry = "UPDATE `members_extra`
  1510.                                         SET `medipoints` = `medipoints` - '4000'
  1511.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1512.                                 mysql_query($q_ry);
  1513.                                 i_credit($_SESSION['playerid'], 29, 1);
  1514.                         echo "You have swapped <b>".number_format(4000)."</b> ".$points[0]." points
  1515.                                                 for a first aid kit!";
  1516.                                                  }
  1517.                                                  }
  1518.                                               }
  1519.                                         }
  1520.                                         //Medical job special 3
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.                                         //Medical job special 4
  1527.                                         if($_POST['ID'] == '14')
  1528.                                         {
  1529.                                            if(!$_POST['use'])
  1530.                                            {
  1531.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1532.                                                 <table width = '50%' class = 'rounded'>
  1533.                                                 <tr><td align = 'center'>
  1534.                                                 Below you can swap 7,500 ".$points[0]." points for a
  1535.                                                 morphine<br/>
  1536.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1537.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1538.                                                 <input type = 'submit' name = 'use' value = 'Swap points for morphine'>
  1539.                                                 </td></tr></table></form>";
  1540.                                            }
  1541.                                            else
  1542.                                               {
  1543.                                                  if($mj['medipoints'] < 7500)
  1544.                                                  {
  1545.                                                    echo "Error, You dont have enough medical points!";
  1546.                                                  }
  1547.                                                  else
  1548.                                                  {
  1549.                                                  if(!$_POST['confirm'])
  1550.                                                  {
  1551.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1552.                                                 <table width = '50%' class = 'rounded'>
  1553.                                                 <tr><td align = 'center'>
  1554.                                                 Are you sure you wish to swap <b>".number_format(7500)."</b>
  1555.                                                 ".$points[0]." points
  1556.                                                 for a morphine?<br/>
  1557.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1558.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1559.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1560.                                                 </td></tr></table></form>";
  1561.                                                  }
  1562.                                                  else
  1563.                                                  {
  1564.                                 $q_ry = array();
  1565.                                 $q_ry = "UPDATE `members_extra`
  1566.                                         SET `medipoints` = `medipoints` - '7500'
  1567.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1568.                                 mysql_query($q_ry);
  1569.                                 i_credit($_SESSION['playerid'], 8, 1);
  1570.                         echo "You have swapped <b>".number_format(7500)."</b> ".$points[0]." points
  1571.                                                 for a morphine!";
  1572.                                                  }
  1573.                                                  }
  1574.                                               }
  1575.                                         }
  1576.                                         //Medical job special 4
  1577.                                      }
  1578.                             }
  1579.                             //Medical job specials!!!!!!!!!!!!
  1580.  
  1581.  
  1582.                             //Education job specials!!!!!!!!!!!!
  1583.                             if($mj['my_job'] == '5')
  1584.                             {
  1585.                             $points = "education|" . $mj['educpoints'];
  1586.                             $points = explode("|",  $points);
  1587.                                   if(29 > $mj['my_job_rank'])
  1588.                                   {
  1589.                                     echo "Error, You have not earnt this job special yet!";
  1590.                                   }
  1591.                                   else
  1592.                                      {
  1593.                                         //Education job special 1
  1594.                                         if($_POST['ID'] == '16')
  1595.                                         {
  1596.                                            if(!$_POST['use'])
  1597.                                            {
  1598.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1599.                                                 <table width = '50%' class = 'rounded'>
  1600.                                                 <tr><td align = 'center'>
  1601.                                                 Below you can swap 10,000 ".$points[0]." points for +100 intelligence<br/>
  1602.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1603.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1604.                                                <input type = 'submit' name = 'use' value = 'Swap points for intelligence'>
  1605.                                                 </td></tr></table></form>";
  1606.                                            }
  1607.                                            else
  1608.                                               {
  1609.                                                  if($mj['educpoints'] < 10000)
  1610.                                                  {
  1611.                                                    echo "Error, You dont have enough education points!";
  1612.                                                  }
  1613.                                                  else
  1614.                                                  {
  1615.                                                  if(!$_POST['confirm'])
  1616.                                                  {
  1617.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1618.                                                 <table width = '50%' class = 'rounded'>
  1619.                                                 <tr><td align = 'center'>
  1620.                                                 Are you sure you wish to swap <b>".number_format(10000)."</b>
  1621.                                                 ".$points[0]." points
  1622.                                                 for +100 intelligence?<br/>
  1623.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1624.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1625.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1626.                                                 </td></tr></table></form>";
  1627.                                                  }
  1628.                                                  else
  1629.                                                  {
  1630.                                 $q_ry = array();
  1631.                                 $q_ry = "UPDATE `members_extra`
  1632.                                         SET `educpoints` = `educpoints` - '10000'
  1633.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1634.                                 mysql_query($q_ry);
  1635.                                 $q_ry = array();
  1636.                                 $q_ry = "UPDATE `memberstats`
  1637.                                         SET `my_intelligence` = `my_intelligence` + '100'
  1638.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1639.                                 mysql_query($q_ry);
  1640.                         echo "You have swapped <b>".number_format(10000)."</b> ".$points[0]." points
  1641.                                                 for +100 intelligence!";
  1642.                                                  }
  1643.                                                  }
  1644.                                               }
  1645.                                         }
  1646.                                         //Education job special 1
  1647.  
  1648.                                      }
  1649.                             }
  1650.                             //Education job specials!!!!!!!!!!!!
  1651.  
  1652.  
  1653.  
  1654.                             //Law job specials!!!!!!!!!!!!
  1655.                             if($mj['my_job'] == '6')
  1656.                             {
  1657.                             $points = "law|" . $mj['lawpoints'];
  1658.                             $points = explode("|",  $points);
  1659.                                   if(36 > $mj['my_job_rank'])
  1660.                                   {
  1661.                                     echo "Error, You have not earnt this job special yet!";
  1662.                                   }
  1663.                                   else
  1664.                                      {
  1665.                                         //Law job special 1
  1666.                                         if($_POST['ID'] == '17')
  1667.                                         {
  1668.                                            if(!$_POST['use'])
  1669.                                            {
  1670.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1671.                                                 <table width = '50%' class = 'rounded'>
  1672.                                                 <tr><td align = 'center'>
  1673.                                                 Below you can swap 10,000 ".$points[0]." points for +100 endurance<br/>
  1674.                                                 You have <b>".number_format($points[1])."</b> ".$points[0]." points<br/>
  1675.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1676.                                                <input type = 'submit' name = 'use' value = 'Swap points for endurance'>
  1677.                                                 </td></tr></table></form>";
  1678.                                            }
  1679.                                            else
  1680.                                               {
  1681.                                                  if($mj['lawpoints'] < 10000)
  1682.                                                  {
  1683.                                                    echo "Error, You dont have enough law points!";
  1684.                                                  }
  1685.                                                  else
  1686.                                                  {
  1687.                                                  if(!$_POST['confirm'])
  1688.                                                  {
  1689.                                            echo "<form action = 'job.php?action=special' method = 'post'>
  1690.                                                 <table width = '50%' class = 'rounded'>
  1691.                                                 <tr><td align = 'center'>
  1692.                                                 Are you sure you wish to swap <b>".number_format(10000)."</b>
  1693.                                                 ".$points[0]." points
  1694.                                                 for +100 endurance?<br/>
  1695.                                                 <input type = 'hidden' name = 'ID' value = '".$_POST['ID']."'>
  1696.                                                 <input type = 'hidden' name = 'use' value = '1'>
  1697.                                                 <input type = 'submit' name = 'confirm' value = 'Continue'>
  1698.                                                 </td></tr></table></form>";
  1699.                                                  }
  1700.                                                  else
  1701.                                                  {
  1702.                                 $q_ry = array();
  1703.                                 $q_ry = "UPDATE `members_extra`
  1704.                                         SET `lawpoints` = `lawpoints` - '10000'
  1705.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1706.                                 mysql_query($q_ry);
  1707.                                 $q_ry = array();
  1708.                                 $q_ry = "UPDATE `memberstats`
  1709.                                         SET `my_endurance` = `my_endurance` + '100'
  1710.                                         WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'";
  1711.                                 mysql_query($q_ry);
  1712.                         echo "You have swapped <b>".number_format(10000)."</b> ".$points[0]." points
  1713.                                                 for +100 endurance!";
  1714.                                                  }
  1715.                                                  }
  1716.                                               }
  1717.                                         }
  1718.                                         //Law job special 1
  1719.  
  1720.                                      }
  1721.                             }
  1722.                             //Law job specials!!!!!!!!!!!!
  1723.                           }
  1724.                      }
  1725.             }
  1726.          echo "<hr width = '75%'>&gt;<a href='job.php'>Back</a><hr width = '75%'>";
  1727.       }
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740. include('./includes/style_bottom.php');
  1741. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement