/home/mip/public_html_/old-website/func_proc2.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>Untitled Document</title>
<style type="text/css">
<!--
.style2 {
	font-size: 10px;
	font-family: tahoma;
	color: #FFFFFF;
}
.style1 {	font-size: 12px;
	font-family: Arial, Helvetica, sans-serif;
	color: #FFFFFF;
}
-->
</style>
</head>

<body background="images/back.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="800" border="0" cellpadding="0" cellspacing="0" align="center">
  <!--DWLayoutTable-->
  <tr>
    <td height="178" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--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"><img src="images/bgs.jpg" width="3" height="4" /></td>
          <td width="599" align="center" background="images/bg.jpg"><img src="images/banner.jpg" width="542" height="175" /></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td width="195" rowspan="3" valign="top" background="images/bgl.gif" 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"><!--DWLayoutEmptyCell-->&nbsp;</td>
      </tr>
      <tr>
        <td width="31" height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td width="165"><img src="images/home.png" width="121" height="17" /></td>
      </tr>
      <tr>
        <td height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td><img src="images/profile.png" width="121" height="17" /></td>
      </tr>
      <tr>
        <td height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td><img src="images/vission.png" width="121" height="17" /></td>
      </tr>
      <tr>
        <td height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td><img src="images/mission.png" width="121" height="17" /></td>
      </tr>
      <tr>
        <td height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td><img src="images/job.png" width="121" height="17" /></td>
      </tr>
      <tr>
        <td height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td><img src="images/apply.png" width="121" height="17" /></td>
      </tr>
      <tr>
        <td height="47" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td><img src="images/support.png" width="121" height="34" /></td>
      </tr>
      <tr>
        <td height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td><img src="images/services.png" width="136" height="17" /></td>
      </tr>
      <tr>
        <td height="33" valign="top"><img src="images/bullet.png" width="19" height="20" /></td>
        <td valign="middle"><img src="images/contact.png" width="136" height="17" /></td>
      </tr>
      <tr>
        <td height="146" colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</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="434" valign="top">
<?
}

function do_rightContent(){
$sqltoday = date ("Y-m-d");

$jobs = getdata("SELECT * FROM webjobs ORDER BY posting_date DESC,position limit 6");
echo mysql_error();

$ann = getdata("SELECT * FROM announcement ORDER BY event_id ASC,title limit 5");

$num_jobs = count($jobs);

$num_ann = count($ann); 
?>
<table width="177" height="314" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="177" height="144" scope="col" valign="top"><table width="159" height="144" border="0" cellpadding="0" cellspacing="0" align="right">
                    <tr>
                      <th width="159" height="22" scope="col"><img src="images/jobo.gif" width="177" height="33" /></th>
                    </tr>
                    <tr>
                      <td height="62" background="images/yo.gif" scope="col" align="left"><table width="170" height="100" border="0" bordercolor="whiteviolet" valign="top">
                        <ul type="circle">
                          <? for($i=1;$i<=$num_jobs;$i++){ ?>
                          <tr>
                            <td style="padding-left:10px;" valign="top" class="style1"><a href="page_job.php?webjob_id=<?=$jobs[$i][webjob_id]?>">
                            
                            </a>
                              <table width="150" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <th width="26" scope="col"><img src="images/b_let.jpg" width="9" height="10" /></th>
                                  <td width="124" scope="col"><a href="page_job.php?webjob_id=<?=$jobs[$i][webjob_id]?>">
									<?php echo strtoupper($jobs[$i]['position']); ?>
                                  </a></td>
                                </tr>
                              </table></td>
                          </tr>
                          <? } if($num_jobs>=5){?>
                          <tr>
                            <td align="right"><span class="style5"><a href="jobs.php">More Jobs</a>&nbsp;</span></td>
                          </tr>
                          <? } ?>
                        </ul>
                      </table></td>
                    </tr>
                    <tr>
                      <th height="11" scope="col"><img src="images/buttom1.gif" width="177" height="11" /></th>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <th height="20" scope="col">&nbsp;</th>
              </tr>
              <tr>
                <td height="120" scope="col" valign="top"><table width="159" height="107" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <th width="159" height="22" scope="col"><img src="images/announce.gif" width="177" height="33" /></th>
                    </tr>
                    <tr>
                      <td height="63" background="images/yo.gif" scope="col"><table border="0" height="100">
                        <ul type="circle">
                          <? for($i=1;$i<=$num_ann;$i++){ ?>
                          <tr>
                            <td width="169" height="40" class="style1" style="padding-bottom:10px; padding-left:10px;" align="left"><table width="162" 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="141" rowspan="2" scope="col"><br />
                              <a href="announcements.php?id=<?=$ann[$i]['id']?>">
                                
                                  <?=$ann[$i]['title']?><br />
                              <?=substr($ann[$i]['announcement'],0,75)?>
                              ...                                </a><a href="announcements.php?id=<?=$ann[$i]['id']?>">Read more</a> </td>
                              </tr>
                              <tr>
                                <th scope="col">&nbsp;</th>
                              </tr>
                            </table></td>
                          </tr>
                          <? } if($num_ann>=2){?>
                          <tr>
                            <td align="right" class="style1"><a href="announcements_all.php">More Announcements</a>&nbsp;</td>
                          </tr>
                          <? } ?>
                        </ul>
                      </table></td>
                    </tr>
                    <tr>
                      <th height="11" scope="col"><img src="images/buttom1.gif" width="177" height="11" /></th>
                    </tr>
                </table></td>
              </tr>
      </table>
<table width="595" height="223" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <th width="296" height="223" scope="col"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="316" height="32" align="center" valign="top"><img src="images/jobs.gif" width="147" height="32" /></td>
      </tr>
      <tr>
        <td height="186"><table width="170" height="100" border="0" bordercolor="whiteviolet" valign="top">
                        <ul type="circle">
                          <? for($i=1;$i<=$num_jobs;$i++){ ?>
                          <tr>
                            <td style="padding-left:10px;" valign="top" class="style1"><a href="page_job.php?webjob_id=<?=$jobs[$i][webjob_id]?>">
                            
                            </a>
                              <table width="150" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <th width="26" scope="col"><img src="images/b_let.jpg" width="9" height="10" /></th>
                                  <td width="124" scope="col"><a href="page_job.php?webjob_id=<?=$jobs[$i][webjob_id]?>">
									<?php echo strtoupper($jobs[$i]['position']); ?>
                                  </a></td>
                                </tr>
                              </table></td>
                          </tr>
                          <? } if($num_jobs>=5){?>
                          <tr>
                            <td align="right"><span class="style5"><a href="jobs.php">More Jobs</a>&nbsp;</span></td>
                          </tr>
                          <? } ?>
                        </ul>
                      </table></td>
      </tr>
    </table></th>
    <th width="1" background="images/bgs1.jpg" scope="col"><img src="images/bgs1.jpg" width="3" height="4" /></th>
    <th 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="208" height="32" /></td>
      </tr>
      <tr>
        <td height="186">&nbsp;</td>
      </tr>
    </table></th>
  </tr>
</table><p>&nbsp;</p></td>
  </tr>
  <tr>
    <td valign="top" background="images/bg.jpg">
	<?
}
function do_footer()
{
?>
	<table width="602" height="60" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td align="center" scope="col"><p class="style2">HOME | COMPANY PROFILE | VISION | MISSION | JOB OPENINGS | APPLY ONLINE | STAFF &amp; FACILITIES <br />
          PROGRAM &amp; SERVICES | CONTACT  US<br />
        Copyright &copy; International Manpower Services</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">&rsaquo;</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">&bull;</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'>&raquo;<a href='view_jobs.php?&id=".$jobs['position']."'>&nbsp;&nbsp;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.
{

$jobs = getdata("SELECT * FROM webjobs ORDER BY posting_date DESC,position");
$more_jobs = getdata("SELECT * FROM country,webjobs WHERE country.country = webjobs.country ORDER BY webjobs.posting_date DESC,webjobs.country");


?>
<table width="80%" background="images/bckgrnd_style.jpg" style="background-position:top" id="middle">
  <tr bgcolor="#ca8c02">
    <td align="center" class="style11"><strong>Job Name</strong></td>
    <td align="center" class="style11"><strong> Posting Date </strong></td>
    <td align="center" class="style11"><strong>Country</strong></td>
  </tr>
  <tr>
    <td colspan="3" height="8">&nbsp;</td>
  </tr>
<?

//counter for numbers.
for($counter=1; $counter<=count($jobs); ++$counter)
{
?>

  <tr>
    <td id="announcementlink"><a href="view_job.php?webjobid=<?=$jobs[$counter][webjobid]?>">
	<?php echo strtoupper($jobs[$counter]['position']); ?></a></td>
    <td class="style4"><?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>
<?
} //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().
?>