====== Applicants ====== $ad=2; $loc=8; $time=20; echo "AD = $ad \n Location = $loc \n Time = $time \n\n

"; if ($ad == 1) { $cost = 1.5 * $time; if ($time == 30) { $ads = 2; } $ads = 1; } if ($ad == 2) { $cost = 5 * $time; if ($time == 10) { $ads = 2; } $ads = 3; } if ($ad == 4) { $cost = 25 * $time; $ads = $ad + ($time/10-1); } $d6 = rand (1,6); $apps = $d6 * $ads * $loc; echo "Number of Applicants ($apps) = Recruiting score for Advertising ($ads) x Location Score ($loc) x 1d6 ($d6)."; echo "
\n Recruitment cost $cost credits
"; echo "

Applicant Details

\n \n \n \n "; $appl=1; do { $CrimCheck=rand(0,9); $Experience=rand(0,9); $RefCheck=rand(0,9); $Gender=rand(0,9); $BirthGender=$Gender; $GenderChanged="No"; if($Gender==0) { $GenderChanged="Yes"; $BirthGender=rand(1,8); $Gender=rand(1,8); } if($Gender==9) { $BirthGender=rand(1,8); } if($Gender<5) { $sex="M"; } elseif($Gender<9) { $sex="F"; } elseif($BirthGender<5) { $sex="M"; } else { $sex="F"; } $Genetics="Natural"; $gen=rand(1,6); if($Experience>8) { $Genetics="Perfect"; } elseif($gen>4) { $Genetics="Perfect"; } // connect to MySQL server and select the IFU database include ("/var/www/html/IFU/sqlconnect.php"); include ("/var/www/html/IFU/sqlconnect2.php"); $db = mysql_select_db('full-moon_info_-_IFU',$connection); // randomly select a group of names from the database $sql = 'SELECT * FROM `Names` ORDER BY Rand() LIMIT 10'; $names = mysql_query($sql); // step through the selected list of names to get a surname and forename from separate rows while ($row=mysql_fetch_array($names,MYSQL_ASSOC)) { extract($row); $LastName = $Surname; next($row); // then randomly take a firstname of the correct gender from the same list if ($Gender==$sex) { $Forename = $FirstName; next($row); extract($row); end($row); } } echo " \n "; $appl++; } while ($appl<=$apps); echo "
App \n Firstname \n Surname \n Gender \n Genetics \n References \n CR Check \n Experience \n Interview? \n Hire? \n
$appl \n $seed2 $FirstName \n $seed1 $Surname \n $sex \n $Genetics \n $RefCheck \n $CrimCheck \n $Experience \n Interview? \n Hire? \n
";