function clientDirectory($lLocationID, $lSponProgID, $strIncludeInactive, $strLookupLetter, $lStartRec, $lRecsPerPage) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- if (!bTestForURLHack('showClients')) { return; } $_SESSION[CS_NAMESPACE . 'clientLastDir'] = 'name'; $strLookupLetter = urldecode($strLookupLetter); $displayData = array(); $displayData['bIncludeInactive'] = $bIncludeInactive = $strIncludeInactive == 'Y'; $displayData['bViaLocation'] = $bViaLocation = !is_null($lLocationID); $displayData['bViaSponProg'] = $bViaSponProg = !is_null($lSponProgID); //-------------------------------------- // models, helpers, libraries //-------------------------------------- $this->load->helper('dl_util/directory'); $this->load->helper('dl_util/rs_navigate'); $this->load->helper('clients/client'); $this->load->helper('clients/client_sponsor'); $this->load->model('clients/mclient_locations', 'clsLocation'); $this->load->model('clients/mclients', 'clsClients'); $this->load->library('util/dl_date_time', '', 'clsDataTime'); $this->load->model('sponsorship/msponsorship_programs', 'clsSponProg'); $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $displayData['strRptTitle'] = 'Client Directory'; $strWhereExtra = ''; //------------------------------------------------ // location //------------------------------------------------ if ($bViaLocation) { $this->clsLocation->loadAllLocations(); $displayData['lNumLocations'] = $lNumLocations = $this->clsLocation->lNumLocations; if ($lLocationID <= 0) { $lLocationID = $this->clsLocation->clientLocations[0]->lKeyID; } $this->clsLocation->cl_lKeyID = $lLocationID; $this->clsLocation->loadLocationRec($lLocationID); $displayData['strRptTitle'] .= ': ' . htmlspecialchars($this->clsLocation->strLocation); $strWhereExtra = " AND cr_lLocationID={$lLocationID} "; $displayData['ddlLocations'] = $this->clsLocation->strDDLAllLocations($lLocationID); $displayData['locChange'] = new stdClass(); $displayData['locChange']->frmName = 'frmLocation'; $displayData['locChange']->frmDest = 'clients/client_dir/changeLocation/' . $strIncludeInactive . '/' . urlencode($strLookupLetter) . '/' . $lStartRec . '/' . $lRecsPerPage; } //------------------------------------------------ // program //------------------------------------------------ if ($bViaSponProg) { $this->clsSponProg->loadSponProgsGeneric(false); $displayData['lNumSponProg'] = $lNumSponProg = $this->clsSponProg->lNumSponPrograms; if ($lSponProgID <= 0) { $lSponProgID = $this->clsSponProg->sponProgs[0]->lKeyID; } $strDDL = '<select name="ddlSponProg">' . "\n"; foreach ($this->clsSponProg->sponProgs as $sprog) { if ($sprog->lKeyID == $lSponProgID) { $strSel = 'selected'; $displayData['strRptTitle'] .= ': ' . htmlspecialchars($sprog->strProg); } else { $strSel = ''; } $strDDL .= '<option value="' . $sprog->lKeyID . '" ' . $strSel . '>' . htmlspecialchars($sprog->strProg) . '</option>' . "\n"; } $strDDL .= '</select>' . "\n"; $displayData['ddlSProgs'] = $strDDL; $strWhereExtra = " AND csp_lSponProgID={$lSponProgID} "; $this->clsClients->strInnerExtra = ' INNER JOIN client_supported_sponprogs ON cr_lKeyID=csp_lClientID '; $displayData['progChange'] = new stdClass(); $displayData['progChange']->frmName = 'frmSProg'; $displayData['progChange']->frmDest = 'clients/client_dir/changeSProg/' . $strIncludeInactive . '/' . urlencode($strLookupLetter) . '/' . $lStartRec . '/' . $lRecsPerPage; } //------------------------------------------------ // sanitize the lookup letter //------------------------------------------------ $displayData['strDirLetter'] = $strLookupLetter = strSanitizeLetter($strLookupLetter); initClientReportDisplay($displayData); $displayData['showFields']->bLocation = true; $displayData['strDirLetter'] = $strLookupLetter; $strLinkEnd = urlencode($strLookupLetter) . '/' . $lStartRec . '/' . $lRecsPerPage; $strLabelToggle = ($bIncludeInactive ? 'Hide' : 'Show') . ' inactive clients'; if ($bViaLocation) { $displayData['strLinkBase'] = $strLinkBase = 'clients/client_dir/view/' . $lLocationID . '/' . ($bIncludeInactive ? 'Y' : 'N') . '/'; $displayData['strToggleLink'] = anchor('clients/client_dir/view/' . $lLocationID . '/' . ($bIncludeInactive ? 'N' : 'Y') . '/' . $strLinkEnd, $strLabelToggle); } elseif ($bViaSponProg) { $displayData['strLinkBase'] = $strLinkBase = 'clients/client_dir/sProg/' . $lSponProgID . '/' . ($bIncludeInactive ? 'Y' : 'N') . '/'; $displayData['strToggleLink'] = anchor('clients/client_dir/sProg/' . $lSponProgID . '/' . ($bIncludeInactive ? 'N' : 'Y') . '/' . $strLinkEnd, $strLabelToggle); } else { $displayData['strLinkBase'] = $strLinkBase = 'clients/client_dir/name/' . ($bIncludeInactive ? 'Y' : 'N') . '/'; $displayData['strToggleLink'] = anchor('clients/client_dir/name/' . ($bIncludeInactive ? 'N' : 'Y') . '/' . $strLinkEnd, $strLabelToggle); } $displayData['strDirTitle'] = strDisplayDirectory($strLinkBase, ' class="directoryLetters" ', $strLookupLetter, true, $lStartRec, $lRecsPerPage); //------------------------------------------------ // total # clients for this letter //------------------------------------------------ $displayData['lNumRecsTot'] = $lNumRecsTot = $this->clsClients->lNumClientsViaLetter($strLookupLetter, $bIncludeInactive, $strWhereExtra); $displayData['lNumClients'] = $lNumRecsTot; //------------------------------------------------ // breadcrumbs / page setup //------------------------------------------------ $displayData['mainTemplate'] = array('client/client_directory_view', 'client/rpt_generic_client_list'); $displayData['pageTitle'] = anchor('main/menu/client', 'Clients', 'class="breadcrumb"') . ' | Client Directory'; $displayData['title'] = CS_PROGNAME . ' | Clients'; $displayData['nav'] = $this->mnav_brain_jar->navData(); //------------------------------------------------ // load client directory page //------------------------------------------------ $strWhereExtra .= $this->clsClients->strWhereByLetter($strLookupLetter, $bIncludeInactive); $this->clsClients->loadClientDirectoryPage($strWhereExtra, $lStartRec, $lRecsPerPage); $displayData['lNumDisplayRows'] = $this->clsClients->lNumClients; $displayData['directoryRecsPerPage'] = $lRecsPerPage; $displayData['directoryStartRec'] = $lStartRec; $displayData['clientInfo'] = $this->clsClients->clients; $this->load->vars($displayData); $this->load->view('template'); }
private function importDetailsClient($lImportID, &$displayData, $bViaPTable = false, $logEntry = null) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $this->load->helper('clients/client'); $this->load->helper('clients/client_sponsor'); initClientReportDisplay($displayData); $displayData['strRptTitle'] = 'Client Import'; //------------------------------------------------ // breadcrumbs / page setup //------------------------------------------------ $displayData['mainTemplate'] = array('admin/import_summary_view', 'client/rpt_generic_client_list'); $displayData['pageTitle'] = 'Import Log Details'; $displayData['title'] = CS_PROGNAME . ' | Client Import'; $displayData['nav'] = $this->mnav_brain_jar->navData(); if ($this->clsImport->lNumFIDs > 0) { if ($bViaPTable) { $lCIDs = $this->clsImport->pTableForeignIDsViaImportID($lImportID, $logEntry->lUTableID, $lNumFIDs); } else { $lCIDs = $this->clsImport->foreignIDs; } $this->clsClients->loadClientsViaClientID($lCIDs); $displayData['lNumClients'] = $this->clsClients->lNumClients; $displayData['clientInfo'] = $this->clsClients->clients; } else { $displayData['lNumClients'] = 0; } }
function view($strIncludeInactive = 'N', $strLookupLetter = 'A', $lStartRec = 0, $lRecsPerPage = 50) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $glChapterID; if (!bTestForURLHack('volMgr')) { return; } $_SESSION[CS_NAMESPACE . 'clientLastDir'] = 'name'; $strLookupLetter = urldecode($strLookupLetter); $displayData = array(); $displayData['js'] = ''; $displayData['bIncludeInactive'] = $bIncludeInactive = $strIncludeInactive == 'Y'; $displayData['bViaLocation'] = false; $displayData['bViaSponProg'] = false; //-------------------------------------- // models, helpers, libraries //-------------------------------------- $this->load->helper('dl_util/directory'); $this->load->helper('dl_util/rs_navigate'); $this->load->helper('clients/client'); $this->load->helper('clients/client_sponsor'); $this->load->model('vols/mvol', 'cVols'); $this->load->model('patients/mpatients', 'cPatients'); $this->load->model('patients/mpatient_contacts', 'cPCons'); $this->load->library('util/dl_date_time', '', 'clsDataTime'); $this->load->helper('hospice/link_hospice'); $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); //------------------------------------------------ // stripes //------------------------------------------------ $this->load->model('util/mbuild_on_ready', 'clsOnReady'); $this->clsOnReady->addOnReadyTableStripes(); $this->clsOnReady->closeOnReady(); $displayData['js'] .= $this->clsOnReady->strOnReady; $displayData['strRptTitle'] = 'Patient Directory'; $strWhereExtra = ''; //------------------------------------------------ // sanitize the lookup letter //------------------------------------------------ $displayData['strDirLetter'] = $strLookupLetter = strSanitizeLetter($strLookupLetter); initClientReportDisplay($displayData); $displayData['strDirLetter'] = $strLookupLetter; $strLinkEnd = $lStartRec . '/' . $lRecsPerPage; $strLabelToggle = ($bIncludeInactive ? '<b>Hide</b>' : '<b>Show</b> active and ') . ' inactive patients'; $displayData['strLinkBase'] = $strLinkBase = 'hospice/patients/patient_directory/view/' . ($bIncludeInactive ? 'Y' : 'N') . '/'; $displayData['strToggleLink'] = anchor('hospice/patients/patient_directory/view/' . ($bIncludeInactive ? 'N' : 'Y') . '/' . ($strLookupLetter == '*' ? '%2A' : $strLookupLetter) . '/' . $strLinkEnd, $strLabelToggle); $displayData['strDirTitle'] = strDisplayDirectory($strLinkBase, ' class="directoryLetters" ', $strLookupLetter, true, $lStartRec, $lRecsPerPage); //------------------------------------------------ // total # clients for this letter //------------------------------------------------ $displayData['lNumRecsTot'] = $lNumRecsTot = $this->cPatients->lNumPatientsViaLetter($glChapterID, $strLookupLetter, $bIncludeInactive, $strWhereExtra); $displayData['lNumPatients'] = $lNumRecsTot; //------------------------------------------------ // breadcrumbs / page setup //------------------------------------------------ $displayData['mainTemplate'] = array('hospice/patients/directory_view', 'hospice/patients/rpt_patient_list'); $displayData['pageTitle'] = 'Patient Directory'; $displayData['title'] = CS_PROGNAME . ' | Patients'; $displayData['nav'] = $this->mnav_brain_jar->navData(); //------------------------------------------------ // load client directory page //------------------------------------------------ $strWhereExtra .= $this->cPatients->strWhereByLetter($strLookupLetter, $bIncludeInactive); $this->cPatients->loadPatientDirectoryPage($glChapterID, $strWhereExtra, $lStartRec, $lRecsPerPage); $displayData['lNumDisplayRows'] = $lNumP = $this->cPatients->lNumPatients; $displayData['directoryRecsPerPage'] = $lRecsPerPage; $displayData['directoryStartRec'] = $lStartRec; // load associated volunteers and contacts if ($lNumP > 0) { foreach ($this->cPatients->patients as $pRec) { $lPatientID = $pRec->lKeyID; $this->cVols->loadVolClientAssocViaPatientID($lPatientID, $pRec->volClient); $this->cPCons->loadPContactsViaPatientID($lPatientID, $lDummy, $pRec->pContacts); } } $displayData['patientInfo'] = $pi =& $this->cPatients->patients; $this->load->vars($displayData); $this->load->view('template'); }