Code: Select all
<?php
include("includes/config.php");
include("includes/process.php");
include("css/stylesheet.php");
?>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><?php include("header.php"); ?></td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
<style type="text/css">
<!--
body {
margin-left: 00px;
margin-top: 00px;
margin-right: 00px;
margin-bottom: 00px;
}
-->
</style>
<script>
function test()
{
//new Dialog().showMessage('Dialog', document.getElementById('prepid1').getValue());
//document.getElementById('prepid1').setValue(document.getElementById('prepid').getValue());
//document.getElementById('JobsForm').submit();
}
</script>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css"/>
<title><?php echo($application_name)?></title>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" class="page_bg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="9" colspan="4" align="center" valign="middle"></td>
</tr>
<?php
if($error!="")
{
?>
<tr>
<td valign="top" colspan="4"><?php echo $err = ErrorMessage($error);?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="4" ></td>
</tr>
<tr>
<td align="left" > </td>
<td align="left" class="txt_3" > </td>
<td align="left" class="txt_3" >Job List</td>
<td align="left" class="txt_3" >
<?php
$level = $user["level"];
$nextLevelRow = mysql_fetch_array(db_execute_return("Select level from jobs where level>".$level." Order by level DESC Limit 1;"));
$nextLevel = $nextLevelRow["level"];
?>
<div align="right"><span class="txt_8"></span> </div></td>
</tr>
<tr>
<td colspan="2" ></td>
<td ></td>
<td ></td>
</tr>
<tr>
<td colspan="4" align="left" valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="3" align="left" valign="middle" class="txt_7"> </td>
</tr>
<tr>
<td colspan="3" align="center"valign="MIDDLE" class="heading_job_bg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2%"> </td>
<td width="28%" align="left" valign="middle" class="txt_9">Description / Payout</td>
<td width="45%" valign="middle" class="txt_9">Job Requirements </td>
<td width="25%" valign="middle" class="txt_9">Action</td>
</tr>
</table>
<br /> </tr>
<tr>
<td colspan="3" align="left" valign="middle" class="txt_7">
<form id="JobsForm" name="JobsForm" method="post" action="">
<input type="hidden" name="JobPage" id="JobPage" value="1" />
<input type="hidden" name="JobId" id="JobId" value="0" />
<input type="hidden" name="EnergyRequired" id="EnergyRequired" value="0" />
<input type="hidden" name="CourtRequired" id="CourtRequired" value="0" />
<input type="hidden" name="ExperienceGain" id="ExperienceGain" value="0" />
<input type="hidden" name="PayoutStart" id="PayoutStart" value="0" />
<input type="hidden" name="PayoutEnd" id="PayoutEnd" value="0" />
<input type="hidden" name="goodwill" id="goodwill" value="0" />
<input type="hidden" name="prepid1" id="prepid1" value="0" />
<input type="hidden" name="prep_quantity" id="prep_quantity" value="0" />
<?php
$count=0;
//$level = 4;
$result = db_execute_return("Select * from jobs where level<= ".$level." order by level DESC;");
while($row = mysql_fetch_array($result))
{
$name=$row["name"];
$desc=$row["description"];
$payout_start=$row["payout_start"];
$payout_end=$row["payout_end"];
$experience=$row["experience"];
$energy_required=$row["energy_required"];
$group_required=$row["group_required"];
$group_goodwill_points = $row["goodwill_points"];
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
if($count>0)
{
?>
<tr>
<td colspan="4" align="left" valign="middle"></td>
</tr>
<?php
}
?>
<tr>
<td width="4" height="22"> </td>
<td width="208" class="txt_10"><?php echo $name;?></td>
<td class="farhan">Required:</td><td width="215" rowspan="2" class="txt_10" align="left">
<?php
$prepflag = 0 ;
$result2 = db_execute_return("SELECT weapons.name,weapons.image_small,jobs_requirement.quantity,`jobs_requirement`.item_type FROM `jobs_requirement`,`weapons` WHERE `jobs_requirement`.item_id = `weapons`.id and `jobs_requirement`.job_id = ".$row["id"]." and `jobs_requirement`.item_type = 'weapon' ");
while($row2 = mysql_fetch_array($result2))
{
echo '<span style="font-size:9px;">'.$row2["quantity"].' x </span>';
?>
<img src="<?php echo $server_url.'images/weapons/'.$row2["image_small"];?>" title="<?php echo $row2["quantity"].' '.$row2["name"];?>" width="30" />
<?php
}
if(db_execute_count("SELECT job_prep.name, job_prep.image, jobs_requirement.quantity
FROM `jobs_requirement` , `job_prep`
WHERE `jobs_requirement`.item_id = `job_prep`.id
AND `jobs_requirement`.job_id = '".$row["id"]."'
AND `jobs_requirement`.item_type = 'job_prep';") > 0)
{
$prepflag = 1;
$prepImage = mysql_fetch_assoc(db_execute_return("SELECT job_prep.id,job_prep.name, job_prep.image, jobs_requirement.quantity
FROM `jobs_requirement` , `job_prep`
WHERE `jobs_requirement`.item_id = `job_prep`.id
AND `jobs_requirement`.job_id = '".$row["id"]."'
AND `jobs_requirement`.item_type = 'job_prep';"));
echo 'Prep req. <span style="font-size:9px;">'.$prepImage["quantity"].'</span>';
?>
<img src="<?php echo $server_url.'images/job_prep/'.$prepImage["image"];?>" title="<?php echo $prepImage["quantity"].' '.$prepImage["name"];?>" width="30" />
<?php
}
?>
</td>
<td width="189" rowspan="2" align="center"><table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" > <div align="center"> <span class="jobs_bttn_bg" >
<?php
if($prepflag == 1)
{
?>
<input name="DoJob" id="DoJob" type="submit" class="button_silver" value="Do This Job!"
onclick="document.getElementById('JobId').setValue(<?php echo $row["id"];?> );document.getElementById('EnergyRequired').setValue(<?php echo $energy_required;?>);document.getElementById('CourtRequired').setValue(<?php echo $group_required;?>);document.getElementById('ExperienceGain').setValue(<?php echo $experience;?>);document.getElementById('PayoutStart').setValue(<?php echo $payout_start;?>);document.getElementById('PayoutEnd').setValue(<?php echo $payout_end;?>);document.getElementById('goodwill').setValue('<?php echo $group_goodwill_points;?>');document.getElementById('prepid1').setValue(<?php echo $prepImage["id"];?>);document.getElementById('prep_quantity').setValue('<?php echo $prepImage["quantity"];?>');" />
<?php
}
else
{
?>
<input name="DoJob" id="DoJob" type="submit" class="button_silver" value="Do This Job!" onclick="document.getElementById('JobId').setValue(<?php echo $row["id"];?>);document.getElementById('EnergyRequired').setValue(<?php echo $energy_required;?>);document.getElementById('CourtRequired').setValue(<?php echo $group_required;?>);document.getElementById('ExperienceGain').setValue(<?php echo $experience;?>);document.getElementById('PayoutStart').setValue(<?php echo $payout_start;?>);document.getElementById('PayoutEnd').setValue(<?php echo $payout_end;?>);document.getElementById('goodwill').setValue(<?php echo $group_goodwill_points;?>);" />
<?php
}
?>
</span> </div></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
<td class="txt_10"><span class="txt_m">Payout: $<?php echo $payout_start;?> - $<?php echo $payout_end;?></span></td>
<td width="140" class="txt_12">Energy: <?php echo $energy_required;?>
<br />
<span class="txt_1">
<?php echo($favorpoints_name)?>: <?php echo $group_goodwill_points;?></span></td>
</tr>
<tr>
<td> </td>
<td class="txt_10"><span class="txt_1">Experience: +<?php echo $experience;?><br />
</span></td>
<td colspan="2" class="txt_10"> </td>
<td> </td>
</tr>
<tr>
<td colspan="5" align="left" valign="middle" class="line_sep"> </td><br>
</tr>
</table>
<?php
$count++;
}
?>
</form> </td>
</tr>
</table> </td>
</tr>
<tr>
<td colspan="4" align="center" valign="middle" ></td>
</tr>
<tr>
<td colspan="4" align="center" valign="middle" ></td>
</tr>
<tr>
<td colspan="4" align="left" valign="middle" style="padding-left:8px;" class="txt_3" >Job-Prep</td>
</tr>
<tr>
<td colspan="4" align="center" valign="top class="heading_job_bg" > </td>
</tr>
<tr>
<td colspan="4" align="center" valign="middle" >
<?php
$count=0;
//$level = 4;
$result = db_execute_return("Select * from job_prep where level<= ".$level." order by level DESC;");
$t = mysql_num_rows($result);
if($t > 0)
{
while($row = mysql_fetch_array($result))
{
$name=$row["name"];
$image = $row["image"];
$desc=$row["description"];
$payout_start=$row["payout_start"];
$payout_end=$row["payout_end"];
$experience=$row["experience"];
$energy_required=$row["energy_required"];
$group_required=$row["group_required"];
?>
<form id="prepForm<?php echo $row["id"];?>" name="prepForm<?php echo $row["id"];?>" method="post" action="">
<input type="hidden" name="JobPrep" id="JobPrep" value="1" />
<input type="hidden" name="JobId" id="JobId" value="<?php echo $row["id"];?>" />
<input type="hidden" name="EnergyRequired" id="EnergyRequired" value="<?php echo $energy_required;?>" />
<input type="hidden" name="ExperienceGain" id="ExperienceGain" value="<?php echo $experience;?>" />
<input type="hidden" name="PayoutStart" id="PayoutStart" value="<?php echo $payout_start;?>" />
<input type="hidden" name="PayoutEnd" id="PayoutEnd" value="<?php echo $payout_end;?>" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<td colspan="4" align="left" valign="middle"> </td>
<td> </td>
</tr>
<tr>
<td width="4" height="22"> </td>
<td width="209" class="txt_10"><?php echo $name;?></td>
<td class="farhan">Required:</td>
<td width="215" rowspan="2" class="txt_11" align="left">
<?php
$result2 = db_execute_return("SELECT distinct weapons.name,weapons.image_small,jobs_requirement.quantity FROM `jobs_requirement`,`weapons`,`job_prep` WHERE `jobs_requirement`.item_id = `weapons`.id and `jobs_requirement`.job_id = ".$row["id"]." and `jobs_requirement`.item_type = 'job_prep'");
while($row2 = mysql_fetch_array($result2))
{
echo '<span style="font-size:9px;">'.$row2["quantity"].' x </span>';
?>
<img src="<?php echo $server_url.'images/weapons/'.$row2["image_small"];?>" title="<?php echo $row2["quantity"].' '.$row2["name"];?>" width="30" />
<?php
}
$owned = GetPrepQuantityUser($user_id,$row["id"]);
?>
</td>
<td width="189" rowspan="2" align="center"> <div align="left" style="padding-left:8px; color:#FFFFFF;"><strong>Owned:
<?php echo $owned;?></strong></div>
<table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" > <div align="center"> <span class="jobs_bttn_bg" >
<?php
echo '<input name="DoJob" id="DoJob" type="submit" class="button_silver" value="Do This Job!" onclick="document.getElementById(\'JobId\').setValue('.$row["id"].');document.getElementById(\'EnergyRequired\').setValue('.$energy_required.');document.getElementById(\'CourtRequired\').setValue('.$group_required.');document.getElementById(\'ExperienceGain\').setValue('.$experience.');document.getElementById(\'PayoutStart\').setValue('.$payout_start.');document.getElementById(\'PayoutEnd\').setValue('.$payout_end.');" />';
?>
</span> </div></td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
<td class="txt_10"><span class="txt_m">Payout: $<?php echo $payout_start;?>
- $<?php echo $payout_end;?></span></td>
<td width="140" class="txt_12">Energy: <?php echo $energy_required;?>
<br /> </td>
</tr>
<tr>
<td height="19"> </td>
<td valign="top" class="txt_10"><span class="txt_1">Experience:
+<?php echo $experience;?></span></td>
<td colspan="2" class="txt_10"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class="txt_10"><span class="txt_1"><img src="<?php echo $server_url.'images/job_prep/'.$image;?>" title="<?php echo $name;?>" width="30" /><br />
</span></td>
<td colspan="2" class="txt_10"> </td>
<td> </td>
</tr>
<tr>
<td colspan="5" align="left" valign="middle" class="line_sep"> </td>
</tr>
</table>
<?php
?>
</form>
<?php
}
}
?>
</td>
</tr>
<tr>
<td colspan="4" align="center" valign="middle" ><?php include_once("footer.php");?></td>
</tr>
<tr><td colspan="4"> </td></tr>
</table>
</td>
</tr>
</table>

