//Security if (!isset($_SESSION['iUserID'])) { Redirect("Default.php"); exit; } // Handle URL via _GET first $sSearchTerm = FilterInput($_GET["term"], 'string'); $sSearchType = FilterInput($_GET["searchtype"], 'string'); //Are we looking for an individual? Most commonly from main search. if ($sSearchType == "person") { $fetch = 'SELECT per_ID, per_FirstName, per_LastName, CONCAT_WS(" ",per_FirstName,per_LastName) AS fullname, per_fam_ID FROM `person_per` WHERE per_FirstName LIKE \'%' . $sSearchTerm . '%\' OR per_LastName LIKE \'%' . $sSearchTerm . '%\' OR per_Email LIKE \'%' . $sSearchTerm . '%\' OR CONCAT_WS(" ",per_FirstName,per_LastName) LIKE \'%' . $sSearchTerm . '%\' LIMIT 15'; $result = mysql_query($fetch); $return = array(); while ($row = mysql_fetch_array($result)) { if ($sSearchType == "person") { $values['id'] = $row['per_ID']; $values['famID'] = $row['per_fam_ID']; $values['per_FirstName'] = $row['per_FirstName']; $values['per_LastName'] = $row['per_LastName']; $values['value'] = $row['per_FirstName'] . " " . $row['per_LastName']; } array_push($return, $values); } } else { // the original code - for searching for a family (commonly from adding deposits) $familyArray = getFamilyList($sDirRoleHead, $sDirRoleSpouse, null, $sSearchTerm); foreach ($familyArray as $fam_ID => $fam_Data) { $return[] = array("value" => $fam_Data, "id" => $fam_ID); } } echo json_encode($return);
function buildFamilySelect($iFamily, $sDirRoleHead, $sDirRoleSpouse) { //Get Families for the drop-down $familyArray = getFamilyList($sDirRoleHead, $sDirRoleSpouse); foreach ($familyArray as $fam_ID => $fam_Data) { $html .= "<option value=\"" . $fam_ID . "\""; if ($iFamily == $fam_ID) { $html .= " selected"; } $html .= ">" . $fam_Data; } return $html; }
$iClassification = 0; } if (isset($_POST["SortBy"])) { $sSortBy = $_POST["SortBy"]; } else { $sSortBy = "name"; } if (isset($_POST["AssignStartNum"])) { $iAssignStartNum = $_POST["AssignStartNum"]; } else { $iAssignStartNum = 1; } // get the array of envelopes of interest, indexed by family id $envelopesByFamID = getEnvelopes($iClassification); // get the array of family name/description strings, also indexed by family id $familyArray = getFamilyList($sDirRoleHead, $sDirRoleSpouse, $iClassification); asort($familyArray); //Get Classifications for the drop-down $sSQL = "SELECT * FROM list_lst WHERE lst_ID = 1 ORDER BY lst_OptionSequence"; $rsClassifications = RunQuery($sSQL); while ($aRow = mysql_fetch_array($rsClassifications)) { extract($aRow); $classification[$lst_OptionID] = $lst_OptionName; } require "Include/Header.php"; ?> <form method="post" action="ManageEnvelopes.php" name="ManageEnvelopes"> <?php $duplicateEnvelopeHash = array(); $updateEnvelopes = 0; // Service the action buttons