• HCMC Blogs
  • Moses
  • Maint
  • Mariage
  • Admin
  • Academic
  • Depts
  • ScanCan
  • HumsSites
  • Projects
  • Pro-D
  • ColDesp
  • CanMys
  • LondonMap
  • AdaptiveDB
  • MoM
  • Cascade
  • Landscapes
  • Linguistics
  • CGWP
  • Endings
  • LEMDO
  • DVPP
  • Wendat
  • Announcements

Contact Us on 0800 123 4567 or info@example.com

German Medical Exams

  • Front Page
  • Contact
  • Log in
  • « query fails when more than one item selected in multiselect fields
  • add another search, one still to go »

add filter for Has Nurse or Support Care

Posted by sarneil on 20 Apr 2010 in Activity log
ML asked to be able to filter search results based on whether either of two boolean values in a record were true. Took a couple of tries to figure out how checkboxes behave with regard to the POST array, but I finally figured it out with help from Greg and Martin 1) To report the status of a checkbox in the POST array and use that in PHP to set the state when the page reloads itself. If the checkbox is not checked, then no value is sent in the POST array, so the PHP that checks has to check not the value, but if isset($_POST[checkbox_element_id]). If that returns true, then write 'checked="checked"' into the page and if it returns false, then write nothing. If the PHP writes 'checked=""' or includes the checked attribute at all, then the checkbox is checked. In search.php: $is_nurse_or_support_care_checked = ''; if (isset($_POST['is_nurse_or_support_care_checked'])) { $is_nurse_or_support_care_checked = "yes"; } In includes/searchformbasic.inc: <label for="is_nurse_or_support_care_checked">Has Nurse or Support Care</label> <input name="is_nurse_or_support_care_checked" type="checkbox" id="is_nurse_or_support_care_checked" <?php if ($is_nurse_or_support_care_checked == 'yes') {echo ' checked="checked"'; } ?> value="checked" ></input> To modify the where clause to include only those records in which either of the two affected fields have the value 1 (as opposed to the only other possible value, which is 0) in search.php: if (!empty($is_nurse_or_support_care_checked)) { if (!empty($where)) {$where .= " " . $combine_fields_using_value . " ";} $where .= "("; $where .= "(exams.food_rest = '1') "; $where .= "OR (exams.nursing_care = '1') "; $where .= ")"; }
This entry was posted by Stewart and filed under Activity log.

German Medical Exams

This project will create an xml-based database of medical exam reports from the 16th through 19th centuries in Germany. The database will allow researchers to query medical practices in that time and to infer changes in the administration of medical care and other social changes.
  • Home
  • Recently
  • Archives
  • Categories
  • Latest comments

Search

Categories

  • All
  • Activity log
  • Announcements
  • Tasks

XML Feeds

  • RSS 2.0: Posts
  • Atom: Posts
What is RSS?

Recent Posts

  • allow for AND or OR operator within multiselect fields
  • query fails when more than one item selected in multiselect fields
  • add filter for Has Nurse or Support Care
  • add another search, one still to go
  • update order-by control
  • Add search of treatments textarea
  • Add search of conditions textarea, new report presentation to follow
  • change which fields appear in report
  • fix couple of bugs in sql
  • fix errors in dropdown lists

Sidebar 2

This is the "Sidebar 2" container. You can place any widget you like in here. In the evo toolbar at the top of this page, select "Customize", then "Blog Widgets".

This collection ©2026 by admin • Help • Photo gallery software