Re: General PHP question I figured it out.
I did something like this, this is obviously not the end all, I'm still writing, but this works for now.
if ($task == 'showJob') {
$query = "SELECT user_id, job_id, job_title, job_desc, job_url, job_st, job_company, job_city FROM #__jobsearch_job_id"
. "\n WHERE user_id='".$my->id."'";
$database->setQuery( $query );
$rows = $database->loadObjectList();
if ($rows[0]) {
echo "<table>";
echo "\n<tr>";
echo "\n<td width=\"5%\">" . "Job ID" . "</td>";
echo "\n<td width=\"20%\">" . "Job Title" . "</td>";
echo "\n<td width=\"50%\">" . "Job Description" . "</td>";
echo "\n<td width=\"15%\">" . "Job City" . " " . $row->job_st . "</td>";
echo "\n<td width=\"10%\">" . "Job Link" . "</td>";
echo "</tr>\n";
//echo highlight_string(print_r($rows,true),true);
foreach ($rows as $row) {
$COLORCOUNT++;
if ($COLORCOUNT % 2 == 0 ) {
$CELLCOLOR = "p1";
} else {
$CELLCOLOR = "p2";
}
echo "\n<tr>";
echo "\n<td class=\"" . $CELLCOLOR . "NiftyBody\">" . $row->job_id . "</td>";
echo "\n<td class=\"" . $CELLCOLOR . "NiftyBody\">" . $row->job_title . "</td>";
echo "\n<td class=\"" . $CELLCOLOR . "NiftyBody\">" . $row->job_desc . "</td>";
echo "\n<td class=\"" . $CELLCOLOR . "NiftyBody\">" . $row->job_city . " " . $row->job_st . "</td>";
echo "\n<td class=\"" . $CELLCOLOR . "NiftyBody\">" . "<a href=\"". $row->job_url . "\">View Job</a></td>";
echo "</tr>\n";
}
echo "</table>\n";
}else {
echo "You Have No Jobs In Your List.<br> You can use our search and click the <b>Add to My Jobs</b> Link on each search result.";
}
echo $database->getErrorMsg();
}
If anyone sees anything that I should change lemme know.
Chris |