{source}
<!-- You can place html anywhere within the source tags -->
<script language="javascript" type="text/javascript">
// You can place JavaScript like this
</script>
<?php
// You can place PHP like this
$db=mysql_pconnect('mysql.etisp.et','ordadb','test@123');
if(!$db)
{
echo 'could not connect to server';
exit;
}
//mysql_select_db('vacancy');
if(!mysql_select_db('ordadb')){
echo 'database not connected';
}
$result=mysql_query("select * from jos_jobpost ");
echo "<Table border=2 cellpadding=5 cellspacing=5 border-color=#000000 bgcolor=#FF0066>
<tr bgcolor=#00CC33>
<td width='auto'>No</td>
<td width=10>Position </td>
<td width='auto'>Exep</td>
<td width='auto'>Description</td>
<td width='auto'>No of Required</td>
<td width='auto'>Payment</td>
<td width='auto'>DeadLine Date</td>
<td width='auto'>Action</td>
</tr>";
$i=1;
echo "<caption>Available Job List</caption>";
while($row = mysql_fetch_array($result)) {
echo "<tr bgcolor=#F3F9FF> <td>".$i."</td>";
$currentID=$row['j_id'];
echo "<td>".$row['j_position'] . "</td><td>" . $row['j_experiance'] . "</td><td> " . $row['j_educationlevel']. " in ". $row['j_educationtype']." " .
$row['j_description'] . " </td><td>" . $row['j_noofrequired'] . "</td><td> " . $row['j_payement'] . "</td><td>" . $row['j_deadlinedate'] ."</td>
<td> <form action=index.php?option=com_content&view=article&id=59:delete-vacancy&catid=37:vacancy-maneger method=POST>
<INPUT TYPE=HIDDEN NAME=ID value= ".$currentID." /><input type=submit value=Delete></form>
<form action=index.php?option=com_content&view=article&id=42:edit-vacancy&catid=37:vacancy-maneger method=POST>
<INPUT TYPE=HIDDEN NAME=jid value= ".$currentID." /><input type=submit value=Edit name=update></form>
</td> ";
echo "</tr>";
$i++;
}
echo "</table>";
?>
{/source}
{source}
<!-- You can place html anywhere within the source tags -->
<script language="javascript" type="text/javascript">
// You can place JavaScript like this
</script>
<?php
// You can place PHP like this
$position =$_POST['position'];
$level=$_POST['level'];
$exp=$_POST['Exp'];
$edulevel=$_POST['edulevel'];
$edutype=$_POST['edutype'];
$pay=$_POST['payment'];
$nofreq=$_POST['noofrequired'];
$des=$_POST['des'];
$dld=$_POST['dld'];
$position =addslashes($position);
$level=addslashes($level);
$exp=addslashes($exp);
$edulevel=addslashes($edulevel);
$edutype=addslashes($edutype);
$pay=addslashes($pay);
$nofreq=addslashes($nofreq);
$des=addslashes($des);
$dld=addslashes($dld);
$todays_date = date("Y-m-d");
$today = strtotime($todays_date);
$dldate = strtotime($dld);
if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $dld, $parts)){
if(checkdate($parts[2],$parts[3],$parts[1])){
if ($dldate > $today)
goto a;
else
echo "The deadline date was past so you cannot add past date ,Please insert deadline date after Today's Date";
exit;
}
else{
echo "INvalid date,Check date either the month or day out of boundary 12 months, and 29,30,31 days acoording to months ";
exit;
}
}
else{
echo "date formate is not correct,please insert in this format YYYY-MM-DD";
exit;
}
a:
$db=mysql_pconnect("mysql.etisp.et","ordadb","test@123");
if(!$db)
{
echo 'could not connect to server';
exit;
}
//mysql_select_db('vacancy');
if(!mysql_select_db('ordadb')){
echo 'database not connected';
}
$result=mysql_query("insert into jos_jobpost values ('','$position', '$level', '$exp', '$edulevel', '$edutype', '$pay', '$nofreq', '$des' ,'$dld')");
if($result)
echo "<font size=22>";
echo mysql_affected_rows().'JOB IS Posted ';
echo "</font>";
?>
{/source}
{source}
<!-- You can place html anywhere within the source tags -->
<script language="javascript" type="text/javascript">
// You can place JavaScript like this
</script>
<?php
$db=mysql_pconnect('mysql.etisp.et','ordadb','test@123');
if(!$db)
{
echo 'could not connect to server';
exit;
}
if(!mysql_select_db('ordadb')){
echo 'database not connected';
}
$jid =$_POST['jid'];
echo " <label></label><input type=hidden name=jid value=" .$jid. "><br />";
$result=mysql_query("SELECT * FROM jos_jobpost where j_id=$jid");
$row = mysql_fetch_array($result);
?>
<form action="index.php?option=com_content&view=article&id=60:edit-vacancy-data&catid=37:vacancy-maneger" method="POST">
<input type="hidden" name="joid" value="<? echo "$row[j_id]"?>"><br/>
Position <input type="text" name="position" maxlength="25" value="<? echo "$row[j_position]"?>"><br/>
Level <select name="level" value="" >
<option></option>
<option>PS 1</option>
<option>PS 2</option>
<option>PS 3</option>
<option>PS 4</option>
<option>PS 5</option>
<option>PS 6</option>
<option>PS 7</option>
<option>PS 8</option>
</select><br/>
Experiance <input type="text" name="Exp" maxlength="25" value="<? echo "$row[j_experiance]"?>"><br/>
Education Level<select name="edulevel" >
<option >10+1</option>
<option>10+2</option>
<option>10+3</option>
<option>Diploma</option>
<option>Bachelor of Science </option>
<option>Bachelor of Art</option>
<option>Masters</option>
<option>PHD</option>
<option>Professor</option>
</select><br/>
<?php
echo 'Education Type'."<select name='edutype'>";
$result1=mysql_query("select * from jos_educationtype ");
while($row1 = mysql_fetch_array($result1)) {
echo "<option>". $row1['Type'] . "<br /> </option>";
}
echo "</select> <br/>";
?>
Payment <input type="text" name="payment" maxlength="25"value="<? echo "$row[j_payement]"?>"><br/>
No of Requireicsd <input type="text" name="noofrequired" maxlength="25" value="<? echo "$row[j_noofrequired]"?>"><br/>
Description <br/> <textarea cols="50" rows="10" name="des" ></textarea ><br/>
DeadLine Date <input type="text" name="dld" maxlength="25" value="<? echo "$row[j_deadlinedate]"?>">(use yyyy-mm-dd format)<br/>
<input type="Submit" name="submit value" value="Update Job">
</form>
<?
mysql_close($db);
?>
{/source}
Vacancy Announcement
Job vacancy
Job Title- Admin and Finance officer
Duty station- Woreilu
{source}
<!-- You can place html anywhere within the source tags -->
<script language="javascript" type="text/javascript">
// You can place JavaScript like this
</script>
<pre>
<form action="index.php?option=com_content&view=article&id=45:insert-to-database&catid=37:vacancy-maneger&Itemid=29" method="POST">
Position <input type="text" name="position" maxlength="25"><br/>
Level <select name="level">
<option>PS 1</option>
<option>PS 2</option>
<option>PS 3</option>
<option>PS 4</option>
</select><br/>
Experiance <input type="text" name="Exp" maxlength="25"><br/>
Education Level <select name="edulevel">
<option>10+1</option>
<option>10+2</option>
<option>10+3</option>
<option>Diploma</option>
<option>Bachelor of Science </option>
<option>Bachelor of Art</option>
<option>Masters</option>
<option>PHD</option>
<option>Professor</option>
</select><br/>
<?php
$db=mysql_pconnect('mysql.etisp.et','ordadb','test@123');
if(!$db)
{
echo 'could not connect to server';
exit;
}
if(!mysql_select_db('ordadb')){
echo 'database not connected';
}
echo 'Education Type'."<select name='edutype'>";
$result=mysql_query("select * from jos_educationtype ");
while($row = mysql_fetch_array($result)) {
echo "<option>". $row['Type'] . "<br /> </option>";
}
echo " </select> <br/>";
mysql_close($db);
?>
Payment <input type="text" name="payment" maxlength="25"><br/>
No of Requireicsd <input type="text" name="noofrequired" maxlength="25"><br/>
Description <br/> <textarea cols="50" rows="10" name="des"></textarea><br/>
DeadLine Date <input type="text" name="dld" maxlength="25">(use yyyy-mm-dd format)<br/>
<input type="submit" value="Job Post">
</form>
</pre>
{/source}