/home/mip/public_html_/old-website/old/func_proc.php
<?php
//require for the configuration in connection of database.
require_once("config.php");
require_once("func_select.php");
function do_html_header() //functions for header.
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>MIP International Manpower Services</title>
<style type="text/css">
<!--
.style1 { font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
color: #FFFFFF;
padding:15px;
}
.style2 {
font-size: 10px;
font-family: tahoma;
color: #FFFFFF;
}
.style3 {
font-size: 11px;
font-family: Arial, Helvetica, sans-serif;
color: #FFFFFF;
}
.style3 a:link {
color: #FFFFFF;
text-decoration: none;
}
.style3 a:visited {
text-decoration: none;
color: #CCCCCC;
}
.style3 a:hover {
text-decoration: underline;
color: #FFFFFF;
}
.style3 .style8 a:active {
text-decoration: none;
color: #FFFFFF;
}
.style4 { font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
color: #FFFFFF;
}
.style8 a:link {
font-family: Arial, Helvetica, sans-serif;
text-decoration: none;
font-size: 12px;
color: #CCCCCC;
}
.style8 {
font-family: "Myriad Pro";
font-size: 12px;
color: #CCCCCC;
}
.style8 a:active {
text-decoration: none;
color: #FFFFFF;
}
.style8 a:visited {
text-decoration: none;
color: #CCCCCC;
}
-->
</style>
</head>
<body background="images/bg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border:solid; border-width:2px; border-color:#666666;">
<!--DWLayoutTable-->
<tr>
<td height="178" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!--DWLayoutTable-->
<tr>
<td width="195" height="178" valign="top"><img src="images/logo.jpg" width="194" height="178" /></td>
<td width="3" valign="top" background="images/bgs.jpg" style="background-repeat:repeat-y" bgcolor="#FFFFFF"><img src="images/bgs.jpg" width="3" height="4" /></td>
<td width="599" align="center" background="images/bg.jpg"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="542" height="175">
<param name="movie" value="banner.swf" />
<param name="quality" value="high" />
<embed src="banner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="542" height="175"></embed>
</object></td>
</tr>
</table></td>
</tr>
<tr>
<td width="195" rowspan="3" valign="top" background="images/bgl.gif" bgcolor="#FFFFFF" style="background-repeat:repeat-x; background-position:bottom">
<?
}
function do_menu()
{
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bg_enu.gif" style="background-repeat:no-repeat">
<!--DWLayoutTable-->
<tr>
<td height="19" colspan="2" valign="top"><img src="images/spacer.gif" width="196" height="1" /></td>
</tr>
<tr>
<td width="29" height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td width="170"><a href="index.php"><img src="images/home.png" width="121" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td><a href="company_profile.php"><img src="images/profile.png" width="121" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td><a href="vision.php"><img src="images/vission.png" width="121" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td><a href="mission.php"><img src="images/mission.png" width="121" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td><a href="program_services.php"><img src="images/services.png" width="136" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td><a href="support_staff&facilities.php"><img src="images/support.png" width="121" height="34" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td><a href="view_jobs.php"><img src="images/job.png" width="121" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td><a href="submit.php"><img src="images/apply.png" width="121" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td valign="middle"><a href="request_form.php"><img src="images/fom.png" width="139" height="25" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td valign="middle"><a href="announcements_all.php"><img src="images/announcement.png" width="114" height="12" border="0" /></a></td>
</tr>
<tr>
<td height="33" align="center"><img src="images/bullet.png" width="19" height="20" /></td>
<td valign="middle"><a href="contact_us.php"><img src="images/contact.png" width="136" height="17" border="0" /></a></td>
</tr>
<tr>
<td height="146" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
</table></td>
<td width="3" rowspan="3" valign="top" background="images/bgs.jpg" style="background-repeat:repeat-y"><img src="images/bgs.jpg" width="3" height="4" /></td>
<td width="598" valign="top" background="images/bg.jpg"></td>
</tr>
<tr>
<td height="418" valign="top" background="images/bg.jpg">
<?
}
function do_rightContent(){
$sqltoday = date ("Y-m-d");
$jobs = getdata(" select * from webjobs where posting_date <= '$sqltoday' and (closing_date > '$sqltoday' or closing_date ='0000-00-00') order by posting_date desc limit 6");
echo mysql_error();
$ann = getdata("select * from announcement where posting_date <= '$sqltoday' and (closing_date > '$sqltoday' or closing_date ='0000-00-00') order by posting_date desc limit 2");
$num_jobs = count($jobs);
$num_ann = count($ann);
?>
<table width="595" height="218" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="19" colspan="3" align="center"><img src="images/separator1.jpg" width="481" height="24" /></td>
</tr>
<tr>
<td width="296" height="218" scope="col"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="316" height="23" align="center" valign="top"><img src="images/jobs.gif" width="134" height="26" /></td>
</tr>
<tr>
<td height="186" valign="top" style="padding-left:10px;"><table width="257" height="71" border="0" bordercolor="whiteviolet" valign="top">
<ul type="circle">
<? for($i=1;$i<=$num_jobs;$i++){ ?>
<tr>
<td colspan="2" valign="top" style="padding-left:10px;"><a href="page_job.php?webjob_id=<?=$jobs[$i][webjob_id]?>">
</a>
<table width="243" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="26" scope="col"><img src="images/b_let.jpg" width="9" height="10" /></td>
<td width="217" align="left" scope="col" class="style3"><a href="view_job.php?webjobid=<?=$jobs[$i]['webjobid']?>">
<?php echo strtoupper($jobs[$i]['position']); ?>
</a></td>
</tr>
</table></td>
</tr>
<? } if($num_jobs>=5){?>
<tr>
<td width="153" height="22" align="right"><img src="images/bullet.png" width="19" height="20" /></td>
<td width="95" align="left"><span class="style8"><a href="view_jobs.php" class="style8">MORE JOBS</a> </span></td>
</tr>
<? } ?>
</ul>
</table></td>
</tr>
</table></td>
<th width="3" background="images/bgs1.jpg" scope="col"><img src="images/bgs1.jpg" width="3" height="4" /></th>
<td width="297" scope="col"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="299" height="27" align="center" valign="top"><img src="images/announce.gif" width="199" height="22" /></td>
</tr>
<tr>
<td height="186" valign="top"><table border="0" height="84">
<ul type="circle">
<? for($i=1;$i<=$num_ann;$i++){ ?>
<tr>
<td height="40" colspan="2" align="left" style="padding-bottom:10px; padding-left:10px;"><table width="227" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="21" height="26" scope="col"><img src="images/b_let.jpg" width="9" height="10" /></th>
<td width="206" rowspan="2" scope="col" class="style3">
<a href="view_announcement.php?event_id=<?=$ann[$i]['event_id']?>">
<?=$ann[$i]['title']?>
<br />
<?=substr($ann[$i]['announcement'],0,75)?>
... </a><a href="view_announcement.php?id=<?=$ann[$i]['id']?>">Read more</a> </td>
</tr>
<tr>
<th scope="col"> </th>
</tr>
</table></td>
</tr>
<? } if($num_ann>=2){?>
<tr>
<td width="153" height="22" align="right" bordercolor="whiteviolet"><img src="images/bullet.png" width="19" height="20" /></td>
<td width="134" align="left" class="style8" ><a href="announcements_all.php" class="style8">READ MORE </a></td>
</tr>
<? } ?>
</ul>
</table></td>
</tr>
</table></td>
</tr>
</table>
<?
}
function do_footer()
{
?>
</td>
</tr>
<tr>
<td align="center" valign="top" background="images/bg.jpg">
<img src="images/seaparator2.jpg" width="481" height="24" />
<table width="602" height="60" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" scope="col"><p class="style2"><span class="style3"><a href="index.php" class="style3">HOME</a> | <a href="company_profile.php" class="style3">COMPANY PROFILE</a> | <a href="vision.php">VISION</a> | <a href="mission.php">MISSION</a> |<a href="program_services.php"> PROGRAM & SERVICES </a> |<a href="support_staff&facilities.php"> STAFF & FACILITIES </a>l </span><span class="style3"><a href="view_jobs.php">JOB OPENINGS</a><br />
</span><span class="style3"> <a href="submit.php">APPLY ONLINE l </a> <a href="request_form.php">MANPOWER REQUEST FORM</a> l<a href="announcements_all.php"> ANNOUNCEMENTS</a> | <a href="contact_us.php">CONTACT US</a></span><br />
Copyright © MIP International Manpower Services<br />
<br />
</p>
</td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>
<?
}
?>
<?php
function do_announcement() //functions for announcement.
{
$jobs = getdata("SELECT * FROM announcement ORDER BY event_id ASC,title limit 5");
//echo mysql_error().mysql_affected_rows();
//counter for numbers.
for($counter=1; $counter<=count($jobs); ++$counter)
{
?>
<tr>
<td width="5%" valign="top">›</td>
<td width="95%" class="style6" id="announcementlink"><a href="view_announcement.php?event_id=<?=$jobs[$counter]['event_id']?>">
<?php echo strtoupper($jobs[$counter]['title']); ?></a></td>
</tr>
<tr>
<td colspan="2" height="5px"></td>
</tr>
<?php
} //end for for($counter=1; $counter<=count($jobs); ++$counter).
if (count($jobs)>4) { //limit to 5 only.
echo "<br>";
echo "<font size='-1' style='padding-left:3'><strong><a href='view_announcement.php?&id=".$jobs['title']."'>More Announcement...</a></strong></font>";
echo "<br><br>";
} //end for if (count($jobs)>5).
} //end for function do_announcement().
function do_list_jobs() //functions for job openings.
{
$jobs = getdata("SELECT * FROM webjobs ORDER BY posting_date DESC,position limit 6");
//echo mysql_error().mysql_affected_rows();
//counter for numbers.
for($counter=1; $counter<=count($jobs); ++$counter)
{
?>
<tr>
<td valign="top">•</td>
<td align="left" id="joblink"><a href="view_job.php?webjobid=<?=$jobs[$counter]['webjobid']?>">
<?php echo strtoupper($jobs[$counter]['position']); ?></a></td>
</tr>
<?php
} //end for for($counter=1; $counter<=count($jobs); ++$counter).
if (count($jobs)>5) { //limit to 5.
echo "<tr>";
echo "<td colspan='3' align='right' id='morejoblink'><span class='style5'>»<a href='view_jobs.php?&id=".$jobs['position']."'> More Jobs</a></span></td>";
echo "</tr>";
} //end for if (count($jobs)>5).
} //end for function do_list_jobs().
function do_all_list_jobs() //functions for all job openings.
{
$sqltoday = date("Y-m-d");
$jobs = getdata(" select * from webjobs where posting_date <= '$sqltoday' and (closing_date > '$sqltoday' or closing_date ='0000-00-00') order by posting_date desc");
$more_jobs = getdata("SELECT * FROM country,webjobs WHERE country.country = webjobs.country ORDER BY webjobs.posting_date DESC,webjobs.country");
?>
<div align="center">
<table width="80%" background="images/bckgrnd_style.jpg" style="background-position:top">
<tr bgcolor="#ca8c02">
<td align="center" class="style4"><strong>Job Name</strong></td>
<td align="center" class="style4"><strong> Posting Date </strong></td>
<td align="center" class="style4"><strong>Country</strong></td>
</tr>
<tr>
<td colspan="3" height="8"> </td>
</tr>
<?
//counter for numbers.
for($counter=1; $counter<=count($jobs); ++$counter)
{
?>
<tr>
<td class="style3"><a href="view_job.php?webjobid=<?=$jobs[$counter][webjobid]?>">
<?php echo strtoupper($jobs[$counter]['position']); ?></a></td>
<td class="style4" align="center"><?php echo strtoupper($jobs[$counter]['posting_date']); ?></td>
<td align="center" class="style4"><?php echo strtoupper($jobs[$counter]['country']); ?></td>
</tr>
<?php
} //end for for($counter=1; $counter<=count($jobs); ++$counter).
?>
</table>
</div>
<?
} //end for function do_list_jobs_2().
function do_all_announcement() //functions for all announcement.
{
$jobs = getdata("SELECT * FROM annnouncement ORDER BY event_id ASC,title");
$more_jobs = getdata("SELECT * FROM announcement ORDER BY event_id ASC,title");
//counter for numbers.
for($counter=1; $counter<=count($jobs); ++$counter)
{
?>
<tr>
<td class="box10"><a href="view_announcement.php?event_id=<?=$jobs[$counter][event_id]?>">
<?php echo strtoupper($jobs[$counter]['title']); ?></a></td>
<td class="box10"><?php echo strtoupper($jobs[$counter]['announcement']); ?></td>
</tr>
<?php
} //end for for($counter=1; $counter<=count($jobs); ++$counter).
} //end for function do_all_announcement().
?>
<?
function dateformat1($mysqldate,$style=""){
list($year,$month,$day) = explode("-", $mysqldate);
settype($year, "integer");
settype($month, "integer");
settype($day, "integer");
if(!$style) $style="M d, Y";
if($year != '0000' && $month !='00' && $day !='00')
@$return_date = date("$style",mktime(0,0,0,$month,$day,$year));
if($day == '00' && $month != '00')
@$return_date = date("M Y",mktime(0,0,0,$month,"01",$year));
if($month == '00' && $year != '0000')
@$return_date = "$year";
if($return_date)
return $return_date;
else return;
}
?>