Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
universe:earth:officers3 [ 9 Feb 2008 19:23] jamesuniverse:earth:officers3 [20 Apr 2011 13:04] (current) – and then added the semi-colon! james
Line 4: Line 4:
  
 // 11 work out how many applicants.  // 11 work out how many applicants. 
-$apps = 10;+$apps = rand (20,60);
  
 // set up some arrays as lookups for the values from the d10 rolls // set up some arrays as lookups for the values from the d10 rolls
 $prev = array ("Pilot", "Astronaut", "Pacifier Pilot", "Command", "Astronaut", "Technical", "Legal", "Medical", "Logistics", "Marine"); $prev = array ("Pilot", "Astronaut", "Pacifier Pilot", "Command", "Astronaut", "Technical", "Legal", "Medical", "Logistics", "Marine");
-$crim = array ("Dodgy", "Murky", "Minor Offences", "Minor Offences", "Clean", "Clean", "Clean", "Clean", "Clean", "Clean");+$crim = array ("Colonial Fleet", "Battle Fleet", "Fleet Support", "Naval Staff", "Training", "Port Staff", "Special Duties", "Shipyard", "Naval Staff", "Naval Academy", "Command", "Command", "Admiralty", "Command");
 $refs = array ("Poor", "Guarded", "Guarded", "Guarded", "Average", "Good", "Good", "Good", "Excellent", "Excellent"); $refs = array ("Poor", "Guarded", "Guarded", "Guarded", "Average", "Good", "Good", "Good", "Excellent", "Excellent");
 +$Ranks = array ("Ensign", "Lieutenant", "Lt.Commander", "Commander", "Captain", "Flag Captain", "Rear Admiral", "Vice Admiral", "Admiral of the White", "Admiral of the Black","Grand Admiral");
  
 // set up a table inside a form so that the chosen applicants can be taken forwards to the next stage.  // set up a table inside a form so that the chosen applicants can be taken forwards to the next stage. 
Line 18: Line 19:
        <table width = 85% cellpadding = 1>\n        <table width = 85% cellpadding = 1>\n
        <tr> \n        <tr> \n
-         <td>App \n +         <td><b>Last 4 \n 
-         <td>Firstname \n +         <td><b>Current Rank \n 
-         <td>Surname \n +         <td><b>Firstname \n 
-         <td>Gender \n +         <td><b>Surname \n 
-         <td>Homeworld \n +         <td><b>Branch \n 
-         <td>Performance \n +         <td><b>Current Location \n 
-         <td>Disciplinary \n +         <td><b>New Posting \n
-         <td>Branch \n+
        </tr>";         </tr>"; 
 $appl=1; $appl=1;
 +$rank=0;
 // for each applicant then roll the various dice and then set the variables // for each applicant then roll the various dice and then set the variables
 do do
Line 58: Line 59:
     $Homeworld="Earth, Q0";     $Homeworld="Earth, Q0";
     $gen=rand(0,9);     $gen=rand(0,9);
-      if($gen > 5)+      if($gen > 2)
         {         {
           // set the necessary connection variables to connect to MySQL           // set the necessary connection variables to connect to MySQL
Line 95: Line 96:
   {   {
     extract($row);     extract($row);
 +    $LastName = $Surname; 
 +    next($row);
  
 // then randomly take a firstname of the correct gender from the same list // then randomly take a firstname of the correct gender from the same list
Line 114: Line 117:
 // $sql2 = 'SELECT * FROM `Names` WHERE Gender=$sex ORDER BY Rand() LIMIT 2'; // $sql2 = 'SELECT * FROM `Names` WHERE Gender=$sex ORDER BY Rand() LIMIT 2';
 // $FirstName = $names["FirstName"]; // $FirstName = $names["FirstName"];
 +$last4 = $appl + rand (1000,9799);
 +$promote = $promote + 1 + $rank + rand (0,6);
 +
 +if ($promote>35)
 +     {$rank++; $promote=0;}
 +$PQ = $Quadrant;
 +$move = rand (0,10);
 +if ($move>7) 
 +    {
 +     if($PQ==0) {$PQ=rand(0,8);}
 +     if($PQ>0) {$PQ = rand(0,1) * rand (0,8);}
 +     }
  
  
 echo " echo "
        <tr> \n        <tr> \n
-         <td>$appl \n+         <td>$last4 \n 
 +         <td>$Ranks[$rank] \n
          <td>$Forename \n          <td>$Forename \n
-         <td>$Surname \n +         <td>$LastName \n
-         <td>$sex \n +
-         <td>$Homeworld \n +
-         <td>$refs[$RefCheck] \n +
-         <td>$crim[$CrimCheck] \n+
          <td>$prev[$Experience] \n          <td>$prev[$Experience] \n
 +         <td>$Homeworld \n
 +         <td>$crim[$CrimCheck], Q$PQ \n
        </tr>";        </tr>";
 +
 $appl++; $appl++;
        
Print/export
QR Code
QR Code Randomly Generated Officers (generated for current page)