Hallo zusammen,
ich bastel grade an einem Job Portal script, doch leider funktioniert die Suche nicht so ganz.
Es gibt 5 Länder zur Auswahl und 11 PLZ Gebiete 0 -9 + Ausland zur Auswahl.
Zur Zeit ist es so, dass die Beschränkung auf die PLZ Gebiete nicht funktioniert. Man wählt Deutschland aus und Gebiet 2xxxx und er spuckt alle aus ganz Deutschland aus.
Ich poste hier mal ein paar Dateien die von Bedeutung sind
conn.php
Jetzt die arbeitgeber suche
employersearch
jetzt die datei die sucht search2.php
nun die datei arbeinehmer jobsuche
nun die letze die diese suche einleitet
Hoffe mir kann da jemand helfen bin echt am verzweifeln....
Lieben gruss
marcel
ich bastel grade an einem Job Portal script, doch leider funktioniert die Suche nicht so ganz.
Es gibt 5 Länder zur Auswahl und 11 PLZ Gebiete 0 -9 + Ausland zur Auswahl.
Zur Zeit ist es so, dass die Beschränkung auf die PLZ Gebiete nicht funktioniert. Man wählt Deutschland aus und Gebiet 2xxxx und er spuckt alle aus ganz Deutschland aus.
Ich poste hier mal ein paar Dateien die von Bedeutung sind
conn.php
PHP-Code:
function select_country($c, $n)
{
$s = "<select name=\"$n\">\n\t";
$countries = $countries = array('Deutschland', 'Spanien', 'Österreich', 'Schweiz', 'Türkei');
while(list(,$v) = each($countries))
{
if(!empty($c))
{
if($c == $v)
{
$s .= "<option value=\"$v\" selected>$v</option>\n\t";
}
else
{
$s .= "<option value=\"$v\">$v</option>\n\t";
}
}
else
{
if($v == "USA")
{
$s .= "<option value=\"$v\" selected>$v</option>\n\t";
}
else
{
$s .= "<option value=\"$v\">$v</option>\n\t";
}
}
}
$s .= "</select>\n\n";
return $s;
}
function target_company($t) {
$tarray = array("Ausland", "0xxxx", "1xxxx", "2xxxx", "3xxxx", "4xxxx", "5xxxx", "6xxxx", "7xxxx", "8xxxx", "9xxxx");
$select = '<select name="target_company">';
while(list($k,$v) = each($tarray))
{
$selected = $t===$v ? 'selected="selected" ' : '';
$select .= "\n\t<option $selected>$v</option>";
}
$select .= "\n</select>";
return $select;
}
employersearch
PHP-Code:
$tc = target_company("", "");
$target_company = str_replace("<select name=\"target_company\">", "<select name=\"target_company\"><option value=\"\">Alle</option>", $tc);
$country = select_country("", "country");
$select_country = str_replace("<select name=\"country\">", "<select name=\"country\"><option value=\"\">Alle</option>", $country);
$select_country = str_replace("<option value=\"Thailand\" selected>", "<option value=\"Thailand\">", $select_country);
//Daten aus dem Formular
</tr>
<tr>
<td align=right>Land: </td>
<td><?=$select_country?></td>
</tr>
<tr>
<td align=right>Plz Gebiet (DE):</td>
<td><?=$target_company?></td>
</tr>
PHP-Code:
if(!empty($_POST))
{
extract($_POST);
}
if(!empty($_GET))
{
extract($_GET);
}
$sch = array();
if (!empty($JobCategory))
{
$sch[] = "job_category like '%$JobCategory%'";
}
if (!empty($careerlevel))
{
$sch[] = "careerlevel = \"$careerlevel\" ";
}
if (!empty($target_company))
{
$sch[] = "target_company = \"$target_company\" ";
}
if (!empty($relocate))
{
$sch[] = "relocate = \"$relocate\" ";
}
if (!empty($country))
{
$sch[] = "country = \"$country\" ";
}
if (!empty($city))
{
$sch[] = "city like '%$city%'";
}
if (!empty($state))
{
$sch[] = "state = \"$state\" ";
}
if(!empty($nationality))
{
$sch[] = "nationality = \"$nationality\" ";
}
if(!empty($sex))
{
$sch[] = "sex = \"$sex\" ";
}
if(!empty($income))
{
$sch[] = "income = \"$income\" ";
}
if(!empty($maritalstatus))
{
$sch[] = "maritalstatus = \"$maritalstatus\" ";
}
if(!empty($age))
{
$ny = date(Y);
$sch[] = " ('$ny' - byear) < '$age' ";
}
if (!empty($kw))
{
$sch[] = "rTitle like '%$kw%' or rPar like '%$kw%' ";
}
if (!$ByPage) $ByPage=5;
if (!$Start) $Start=0;
if($sm == 'or')
{
$qs = "select * from job_seeker_info ".(($sch)?"where ".join(" or ", $sch):"")." limit $Start,$ByPage";
$qss = "select * from job_seeker_info ".(($sch)?"where ".join(" or ", $sch):"");
}
elseif($sm == 'and')
{
$qs = "select * from job_seeker_info ".(($sch)?"where ".join(" and ", $sch):"")." limit $Start,$ByPage";
$qss = "select * from job_seeker_info ".(($sch)?"where ".join(" and ", $sch):"");
}
$rqs = mysql_query($qs) or die(mysql_error());
$rqss = mysql_query($qss) or die(mysql_error());
$rr = mysql_num_rows($rqss);
PHP-Code:
$country = select_country("", "country");
$select_country = str_replace("<select name=\"country\">", "<select name=\"country\"><option value=\"\">Alle</option>", $country);
$select_country = str_replace("<option value=\"Thailand\" selected>", "<option value=\"Thailand\">", $select_country);
$tc = target_company("");
$target_company = str_replace("<select name=\"target_company\">", "<select name=\"target_company\"><option value=\"\">Alle</option>", $tc);
<tr>
<td align=right><b>Land: </b></td>
<td><?=$select_country?></td>
</tr>
<tr>
<td align=right><b>PLZ Bereich: </b></td>
<td><?=$target_company?></td>
</tr>
PHP-Code:
if(!empty($_POST))
{
extract($_POST);
}
if(!empty($_GET))
{
extract($_GET);
}
$sch = array();
if (!empty($position))
{
$sch[] = "position like '%$position%'";
}
if (!empty($country))
{
$sch[] = "CompanyCountry = \"$country\" ";
}
if (!empty($state))
{
$sch[] = "CompanyState = '$state' ";
}
if (!empty($JobCategory))
{
$sch[] = "JobCategory like '%$JobCategory%' ";
}
if (!empty($careerlevel))
{
$sch[] = "j_target = '$careerlevel'";
}
if (!empty($kw))
{
$sch[] = "description like '%$kw%'";
}
if (!empty($target_company))
{
$sch[] = "target_company = \"$target_company\" ";
}
if (!$ByPage) $ByPage=25;
if (!$Start) $Start=0;
if(empty($sm))
{
$sm = "and";
}
if($sm == 'or')
{
$qs = "select * from job_post ".(($sch)?"where ".join(" or ", $sch):"")." limit $Start,$ByPage";
$qss = "select * from job_post ".(($sch)?"where ".join(" or ", $sch):"");
}
elseif($sm == 'and')
{
$qs = "select * from job_post ".(($sch)?"where ".join(" and ", $sch):"")." limit $Start,$ByPage";
$qss = "select * from job_post ".(($sch)?"where ".join(" and ", $sch):"");
}
$rqs = mysql_query($qs) or die(mysql_error());
$rqss = mysql_query($qss) or die(mysql_error());
$rr = mysql_num_rows($rqss);
Hoffe mir kann da jemand helfen bin echt am verzweifeln....
Lieben gruss
marcel
Kommentar