<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/

$page['allow_guests'] = true;
require_once('./includes/core.php');
require_once('./includes/session.php');
$lang->addLocale("credits.credits");

$page['id'] = "jobs";
$page['name'] = 'Job Market';
$page['bodyid'] = "home";
$page['cat'] = "bussiness";
require_once('./templates/community_header.php');
?>
<div id="container">
	<div id="content" style="position: relative" class="clearfix">
    <div id="column1" class="column">

				<div class="habblet-container ">
						<div class="cbb clearfix green ">

							<h2 class="title">Create Corp
							</h2>

						<script src="<?php echo PATH; ?>/web-gallery/static/js/credits.js" type="text/javascript"></script>
<p class="credits-countries-select">
<?php
$getinfo = mysql_query("SELECT * FROM jobs_ranks WHERE open_spots > 0");
$getnumrows = mysql_num_rows($getinfo);
if($getnumrows < 0) {
   echo "Sorry, but there's no jobs currently available.";
}else{
?>
<center>
<form name="post" action="" method="post">
Corp Name:<br />
<input type="text" name="corp_name" /><br />
<br />
Corp Deposit:<br />
<input type="text" name="corp_deposit" /><br />
<i>* you must put atleast 500 credits in your corp to start</i><br />
<br />
Corp HQ:<br />
<input type="text" name="corp_hq" /><br />
<br />
<input type="submit" name="corp_submit" value="Create Corp" />
</form>
</center>
</p>
<?php
   //while($r = mysql_fetch_array($getinfo)){
   //   $getmoreinfo = mysql_query("SELECT * FROM jobs_corps WHERE id = '$r[corp_id]'");
   //   $s = mysql_fetch_array($getmoreinfo);
   //   echo '<strong>'.$r['motto'].'</strong><br />Employer: '.$s['corp_name'].'<br />Vacancies: '.$r['open_spots'].'<br />Salary: <i>'.$r['pay'].'</i><br /><a href="jobs_apply?id='.$r[id].'">Apply Here</a><br/><br/>';
   //}
}
?>
<script type="text/javascript">
L10N.put("credits.navi.read_more", "Read more");
L10N.put("credits.navi.close_fulltext", "Close instructions");
PaymentMethodHabblet.init();
</script>


					</div>

				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>


</div>
<div id="column2" class="column">
				<div class="habblet-container ">
						<div class="cbb clearfix brown ">

							<h2 class="title">My Corps
							</h2>
						<div id="purse-habblet">

<div class="box-content">
<?php
$getinfo = mysql_query("SELECT * FROM users WHERE name = '".$user->name."'");
$info = mysql_fetch_array($getinfo);
$getevenmoreinfo = mysql_query("SELECT * FROM jobs_corps WHERE owner = '".$info['id']."'");
$corpcount = mysql_num_rows($getevenmoreinfo);
if($corpcount > 0) {
      while($s = mysql_fetch_array($getevenmoreinfo)) {
            echo '<a href="jobs_edit?id='.$s['id'].'">'.$s['corp_name'].'</a><br />';
      }
}else{
      echo 'Sorry, but you do not have any corps.';
}
//}
?>
</div>
</div>


<script type="text/javascript">
	new PurseHabblet();
</script>


					</div>
				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

</div>
<script type="text/javascript">
HabboView.run();
</script>
<?php require_once('./templates/community_footer.php'); ?>
