Employer view application that applied by employee.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aquilina
Forum Commoner
Posts: 30
Joined: Wed Sep 21, 2011 1:23 am

Employer view application that applied by employee.

Post by aquilina »

once employee applied the job employer can view whos applied for the job.. But mine one is viewing all the employee even the employee didnt apply for it..

Below is the code for employer viewing the application that applied by employee..


Code: Select all

<div id="main">
<div class="h3">Check Application</div>
<div class="mainbox">
<?php
if (isset($_SESSION['employer_id']))
$con = mysql_connect("localhost","root","") or die (mysql_error());
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("job_seeks", $con);
$result = mysql_query("SELECT application_employee_id, application_job_id, employee_user.usernamejob FROM application LEFT JOIN employee_user ON application_employee_id=employee_id ");
while($row = mysql_fetch_array($result))
  {
    echo "
    <form method='POST'>
    <tr><td class=list align=left><b>Applied User :</b></td><td class=list><a href="."?page=user_detail"."> ".$row['usernamejob']."</a><br></td></tr>";
    echo "</td></tr></table>";
  }
echo "</tbody>";
echo "</table>";

mysql_close($con);
?>
</div>
</div>

And here is code for employee who want apply the job

Code: Select all

<div class="h3">Application</div>
<div class="mainbox">
<ul id="features">
<?php
if (isset($_SESSION['usernamejob']))
echo "<br />You already appplied for the job<br />";
else
    die ('You must be logged in!');
?>
<?php
$employer_id = $_GET['employer_id'];

if (isset($_SESSION['employee_id']))
$conn = mysql_connect("localhost","root","") or die ("Cannot connect!");
mysql_select_db("job_seeks") or die("cannot find the db");
$date = date("Y-m-d");
$query = mysql_query("SELECT * FROM application") or die(mysql_error());
$sql = 'INSERT INTO application (application_job_id, application_employee_id, date) VALUES ("'.$employer_id.'", "'.$_SESSION['employee_id'].'", "'.$date.'")';
$result = mysql_query($sql) or die(mysql_error());
?>
</ul>
</div>
Post Reply