rilana Posted April 19, 2008 Share Posted April 19, 2008 Hy guyes, I boght a PHP Programm a long time ago to Use it for a headhunter. Now I have to make a change to it and I got no clue how to do this. I have a form <form action=JobSearch3.php method=post> <table align = left> <tr> <td colspan=2 align=left valign="top"> <p><img src="../../pics/jobsuche.jpg" alt="arbeitnehmer" width="500" height="266"></p></td> </tr> <tr> <td width="90" align="left" valign="top"><span class="inhaltTitel">Region: </span></td> <td width="450" align="left" valign="top"> <font size="2" face="Arial, Helvetica, sans-serif"> <select name="region" style=width:154> <OPTION VALUE="" selected="selected">Ganze Schweiz</OPTION> <OPTION VALUE="Linkes Seeufer">Linkes Seeufer</OPTION> <OPTION VALUE="Rechtes Seeufer">Rechtes Seeufer</OPTION> <option value="Glarnerland">Glarnerland</option> <option value="Graubünden">Graubünden</option> <option value="ZH Oberland">Zürich Oberland</option> <OPTION VALUE="ZH City">Zürich City</OPTION> </select> <br> <br> </font></td> </tr> and a List action which I dont understand so good. I made changes to it bevor, but now I am stuck and dont evan know where to beginn. <? include_once "../conn.php"; $day = date(d); $month = date(m); $year = date(Y); $del = "delete from job_post where EXday = \"$day\" and EXmonth = \"$month\" and EXyear = \"$year\" "; $rdel = mysql_query($del) or die(mysql_error()); $sch = array(); if (!empty($position)) { $sch[] = "position like '%$_REQUEST[position]%'"; } if (!empty($bereich)) { $sch[] = "bereich like '%$_REQUEST[bereich]%'"; } if (!empty($anstellung)) { $sch[] = "anstellung like '%$_REQUEST[anstellung]%'"; } if (!empty($region)) { $sch[] = "region like '%$_REQUEST[region]%'"; } if (!$ByPage) $ByPage=25; if (!$Start) $Start=0; if($sm == 'or') { $qs = "select * from job_post ".(($sch)?"where ".join(" or ", $sch):"")." order by erfasst, ERyear DESC, ERmonth DESC, ERday DESC limit $Start,$ByPage"; $qss = "select * from job_post ".(($sch)?"where ".join(" or ", $sch):"") . " order by erfasst, ERyear DESC, ERmonth DESC, ERday DESC"; } elseif($sm == 'and') { $qs = "select * from job_post ".(($sch)?"where ".join(" and ", $sch):"")." order by erfasst, ERyear DESC, ERmonth DESC, ERday DESC limit $Start,$ByPage"; $qss = "select * from job_post ".(($sch)?"where ".join(" and ", $sch):"") . " order by erfasst, ERyear DESC, ERmonth DESC, ERday DESC"; } $rqs = mysql_query($qs) or die(mysql_error()); $rqss = mysql_query($qss) or die(mysql_error()); $rr = mysql_num_rows($rqss); if($rr == '0') { echo "<br><br><left> <font class=\"inhalt\">Ihre Suche ergab keinen Treffer.</left><br>"; exit; } elseif($rr == '1') { echo "<br><br><left> <font class=\"inhalt\">Ihre Suche ergab einen Treffer. </left><br>"; } elseif($rr > '1') { echo "<br><br><left> <font class=\"inhalt\">Ihre Suche ergab $rr Treffer. </left><br>"; } $col = "cococo"; echo "<br><table align=center width=500 cellspacing=0> <tr bgcolor=#cccccc class=\"inhaltTitel\"> <td>Position </td><td width=80><font class=\"inhaltTitel\">Bereich </td><td width=80>Anstellung </td><td width=50><font class=\"inhaltTitel\">Datum</td></tr>"; while($as = mysql_fetch_array($rqs)) { //$ex13 = date('d', mktime(0,0,0, $as[EXmonth] - date(m), $as[EXday] - date(d), $as[EXyear] - date(Y))); $day = date(d); $month = date(m); $year = date(Y); $EXdate = "$as[EXyear]"."-"."$as[EXmonth]"."-"."$as[EXday]"; $today = date("d-m-Y"); $ERdate = "$as[ERday]"."-"."$as[ERmonth]"."-"."$as[ERyear]"; if($as[erfasst] == "fake") { $colin = "$today"; } else { $colin = "$ERdate"; } $dnes = "$year"."-"."$month"."-"."$day"; $qd = "select to_days('$EXdate') - to_days('$dnes')"; $rqd = mysql_query($qd) or die(mysql_error()); $ex13 = mysql_fetch_array($rqd); if($col == "cococo") { $col = "F2F2F2"; } else { $col = "cococo"; } echo "<tr bgcolor=\"$col\" style=\"font-size:12\"> <td class=inhalt><a class=TN href=\"JobInfo.php?job_id=$as[job_id]\" class=bmnu> $as[position] </a></td><td class=inhalt> $as[bereich] </td><td align=left class=inhalt> $as[anstellung] </td> <td align=left class=inhalt> $colin </td> </tr>"; } if($sm == 'or') { $qs2 = "select * from job_post ".(($sch)?"where ".join(" or ", $sch):""); } elseif($sm == 'and') { $qs2 = "select * from job_post ".(($sch)?"where ".join(" and ", $sch):""); } $rqs2 = mysql_query($qs2) or die(mysql_error()); $rr2 = mysql_num_rows($rqs2); echo "</table>"; echo "<table width=500 align=center> <tr><br></tr> <tr>"; if ($rr2 <= $ByPage && $Start == '0') { } if ( $Start > 0 ) { $nom1 = $Start - $ByPage; echo "<td align=left class=inhalt><a class=TN href=\"JobSearch3.php?sm=$sm&position=$position®ion=$region&bereich=$bereich&anstellung=$anstellung&datum=$datum&target_company=$target_company&relocate=$relocate&country=$country&city=$city&kw=$kw&Start=$nom1\">zurück</a></td>"; } if ($rr2 > $Start + $ByPage || ($Start == 0 && $rr2 > $ByPage)) { $nom = $Start + $ByPage; echo "<td align=right class=inhalt><a class=TN href=\"JobSearch3.php?sm=$sm&position=$position®ion=$region&bereich=$bereich&anstellung=$anstellung&datum=$datum&target_company=$target_company&relocate=$relocate&country=$country&city=$city&kw=$kw&Start=$nom\">nächste Seite</a></td>"; } echo "</tr></table>"; ?> The Problem is <OPTION VALUE="" selected="selected">Ganze Schweiz</OPTION> (means all switzerland). When I set the value of region to whole switzerland I originally thaught it's suposed to output just all the input. But now I am runnting into a problem. When the region is set to any other possibilitys for example "ZH City" the output should be all the jobs with the region of ZH City + the jobs with the region set to Ganze Schweiz. Can anyone please give me a hint on where I have to start? I dont understand these wierd variables used like qs2 and sm.... Thanks a lot!!!! Link to comment https://forums.phpfreaks.com/topic/101867-changing-an-output-list-function/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.