Added a new search and report item
Added a new search and report field (e.g. family status)
For search form, create new form element by adding to searchformbasic.inc
<label for="p_family">Family Status</label>
<a class="DataListButton" onclick="showDataList('p_family_text','p_families','Family Statuses','f_family_id','p_family','n','y');">
<img src="images/buttons/DataListButton.png" alt="Show a list of possible values for this field" title="Show a list of possible values for this field" class="button" /></a>
<input name="p_family" type="text" id="p_family" value="<? print $p_family; ?>" />
On search.php, grab the value from the form on page load:
$p_family = load_data('p_family');
On search.php, extend SELECT clause of $query by appending:
" p_families.p_family_text"
On search.php, do JOIN of exams table and p_families table:
$left_join .= " LEFT JOIN p_families ON (p_families.p_family_id = exams.p_family) ";
On search.php, add to WHERE clause if user has specified a value in the Family field of the search form:
if (!empty($p_family)) {
$where .= make_where_pattern($p_family, 'p_families.p_family_text', $where);
}
On searchresults.inc, grab the family status item from the current row array returned from the search query:
$curPFamily = $row["p_family_text"];
On searchresults.inc, display the family status data:
<th>Family Status</th>
<td><?php echo $curPFamily;?></td>