<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="<?=$path;?>images/navigation/featured_box/featured_left.gif" width="14" height="29"></td>
                <td class="featuredHeader">Search Jobs</td>
                <td><img src="<?=$path;?>images/navigation/featured_box/featured_cor.gif" width="29" height="29"></td>
              </tr>
          </table></td>
          <td align="right">&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td>
      <table align=center border=0 cellpadding=0 cellspacing=0 width="100%">
        <tr>
          <td height=10 width=10><img height=10 src="<?=$path;?>images/navigation/featured_box/box_1.gif" width=10></td>
          <td background="<?=$path;?>images/navigation/featured_box/box_top.gif" class="darkBlueBold"><img src="<?=$path;?>images/navigation/spacer.gif" width="1" height="1"></td>
          <td width=10><img height=10 src="<?=$path;?>images/navigation/featured_box/box_2.gif" width=12></td>
        </tr>
        <tr>
          <td background="<?=$path;?>images/navigation/featured_box/box_left.gif"></td>
          <td align="left" valign="top"><form name="postcv" method="get" action="index.php">
              <table width="100%"  border="0" cellspacing="0" cellpadding="3">
                <tr> 
                  <td width="80">Job category:</td>
                  <td nowrap><? if (strlen ($start)<1){$start=0;}$range=30;
				  $queryjob_cat = "SELECT * FROM  job_cat WHERE active='yes' ORDER BY order_seq ASC";
			$resultjob_cat = mysql_query ($queryjob_cat);
			$NumberOfFieldsjob_cat=mysql_num_rows($resultjob_cat);
			if ($NumberOfFieldsjob_cat <> 0){?>
                      <select name="job_cat_id" class="input" id="job_cat_id">
                        <option value="" selected>CHOOSE CATEGORY</option>
                        <? while($linejob_cat = mysql_fetch_array($resultjob_cat)){?>
                        <option value="<? echo $linejob_cat["job_cat_id"];?>"<? if($linejob_cat["job_cat_id"]==$_GET['job_cat_id']) echo " selected";?>><? echo $linejob_cat["title_en"];?></option>
                        <? }?>
                      </select>
                    *
                    <? }else{?>
                    No Categories exist yet
                  <? }?></td>
                  <td width="70">&nbsp;</td>
                  <td><span class="right"><span class="moreInfo">
                    </span></span></td>
                </tr>
                <tr>
                  <td>Job Location:</td>
                  <td nowrap><span class="right"><span class="moreInfo">
                    <? $querydistricts = "SELECT * FROM  districts WHERE active='yes' ORDER BY order_seq ASC";

			$resultdistricts = mysql_query ($querydistricts);

			if (mysql_num_rows($resultdistricts) <> 0){?>
                    <select class="input" name="Location" id="Location">
                      <option value="" selected>All</option>
                      <? while($linedistricts = mysql_fetch_array($resultdistricts)){?>
                      <option value="<?=$linedistricts["title_en"];?>"<? if($linedistricts["title_en"]==$_GET['Location']) echo " selected";?>>
                      <?=$linedistricts["title_en"]; ?>
                      </option>
                      <? }?>
                    </select>
                    <? }else{?>
No districts added yet.
<? }?>
                  </span></span></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td>
                  	<input type="hidden" name="jobs_step" value="jobs_listing">
                  	<input name="module_page" type="hidden" id="module_page" value="my_jobs">
                  </td>
                  <td width="160"><input name="Submit" type="submit"  class="input" id="Submit" value="Search">
                  </td>
                  <td width="70">&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td width="160">&nbsp;</td>
                  <td width="70">&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
              </table>
              <? if($_GET['Submit']=="Search"){
if($_GET['job_cat_id']<1){?>
              Please select a Job Category!!
              <? }else{
if (strlen ($start)<1){$start=0;}$range=50;
$query_job_cvs = "SELECT * FROM job_jobs WHERE job_cat_id='{$_GET['job_cat_id']}'";
if($_GET["Location"]<>"")$query_job_cvs .= " AND Location LIKE '%{$_GET['Location']}%'";
$line_config=mysql_fetch_assoc(mysql_query("SELECT * FROM job_config"));
$NeedActivation=$line_config["NeedActivation"];
$DaysToLive=$line_config["DaysToLive"];
$Expiration=$line_config["Expiration"];
if($NeedActivation=="yes")$query_job_cvs .=" AND active='yes'";
if($Expiration=="yes")$query_job_cvs .=" AND added_on >= NOW() - INTERVAL $DaysToLive DAY";
//echo $query_job_cvs;
 $query_job_cvs .= " ORDER BY added_on DESC, added_on_time DESC";
$result_job_cvs = mysql_query ($query_job_cvs);
$NumberOfFields=mysql_num_rows($result_job_cvs);
if(mysql_num_rows($result_job_cvs)>0){
 $query_job_cvs .= " LIMIT $start, $range";
$result_job_cvs = mysql_query ($query_job_cvs);
?>
              <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                <tr bgcolor="#D9ECFF">
                  <td colspan="3" class="darkBlueBold">Results:</td>
                </tr>
                <tr>
                  <td class="pharmacyheader">Job title </td>
                  <td class="pharmacyheader">Job Location(s)</td>
                  <td class="pharmacyheader">Company name </td>
                </tr>
                <?	$count=1;while($line_job_cvs = mysql_fetch_assoc($result_job_cvs)){?>
                <tr<? if($count>1){echo " bgcolor=#F5FAFF";$count=0;}?>>
                  <td><a href="index.php?module_page=my_jobs&jobs_step=jobs_details&job_jobs_id=<?=$line_job_cvs["job_jobs_id"];?>">
                    <?=$line_job_cvs["JobTitle"];?>
                  </a></td>
                  <td width="40%">
                    <? echo ereg_replace(";",", ",$line_job_cvs["Location"]);?></td>
                  <td><?=$line_job_cvs["CompanyName"];?></td>
                </tr>
                <? $count++;}?>
              </table>
              <hr size="1" noshade>
              <table width="100%" border="0" cellspacing="0" cellpadding="11">
                <tr>
                  <td align="center" class="arialbw">
                    <div class="tahomasb"><span>Results
                          <?=$start+1;?>
        -
        <? if($NumberOfFields>$start+$range){$end=$start+$range;}else{$end=$NumberOfFields;}echo $end;?>
        out of
        <?=$NumberOfFields;?>
        <br>
        <? 	$pagesrange=2;					  
$pages=$NumberOfFields/$range;
$vars="job_cat_id={$_GET['job_cat_id']}&Location={$_GET['Location']}&Submit={$_GET['Submit']}&module_page=my_jobs&jobs_step=jobs_listing";
//$search=base64_encode(serialize($search));
if(($start/$range)<=$pagesrange){$startrange=0;}else{$startrange=$start/$range-$pagesrange;$prev=$start-$range;$startmsg="<a href='$PHP_SELF?start=$prev&$vars'>Previous</a>  <a href='$PHP_SELF?start=&$vars'>1</a> . . .  ";}

if(($startrange+(2*$pagesrange)+1)>=$pages){$endrange=$pages;}else{$endrange=$startrange+(2*$pagesrange)+1;$nex=$start+$range;$endpage=ceil($pages);$end=floor($pages)*$range;$endmsg="  . . .  <a href='$PHP_SELF?start=$end&$vars'>$endpage</a> <a href='$PHP_SELF?start=$nex&$vars'>Next</a>";}

						  echo "<span>$startmsg</span>";for ($noofpage = $startrange; $noofpage < $endrange; $noofpage++) {

				  if ($start<>$noofpage*$range){?>
        <a href="<? echo $PHP_SELF; ?>?start=<? echo $noofpage*$range; echo"&$vars";?>">
        <? }?>
        <? echo $noofpage+1;?></a>&nbsp;
        <? } echo "<span>$endmsg</span>";?>
                  </span></div></td>
                </tr>
              </table>
              <? }else{?><span  class="darkBlueBold">No results found!!</span><? }}}?>
              <input type="hidden" name="jobs_step" value="jobs_listing">
              <input type="hidden" name="module_page" value="my_jobs"/>
          </form></td>
          <td background="<?=$path;?>images/navigation/featured_box/box_right.gif"></td>
        </tr>
        <tr>
          <td height=12 width=10><img height=12 src="<?=$path;?>images/navigation/featured_box/box_3.gif" width=10></td>
          <td background="<?=$path;?>images/navigation/featured_box/box_bot.gif"><img src="<?=$path;?>images/navigation/spacer.gif" width="1" height="1"></td>
          <td><img height=12 src="<?=$path;?>images/navigation/featured_box/box_4.gif" width=12></td>
        </tr>
    </table></td>
  </tr>
</table>
