public function bInDirectoryViaCurrentStatus($lClientID)
 {
     //---------------------------------------------------------------------
     // dummy until status structure set up
     //---------------------------------------------------------------------
     whereAmI();
     die;
     return true;
 }
function screamForHelp($strMsg, $bRecNotFound = false, $strUserErr = '')
{
    //----------------------------------------------------------------------
    //
    //----------------------------------------------------------------------
    global $gbDev;
    if ($bRecNotFound) {
        $strUserErr = 'The record you requested was not found. It may have been deleted.<br>' . $strUserErr;
    } else {
        if ($strUserErr == '') {
            $strUserErr = 'This page is currently under construction.';
        }
    }
    echoT('
      <table class="error">
         <tr>
            <td class="error">
               <img src="' . DL_IMAGEPATH . '/misc/errorIcon.png" title="Error!" border="0"><br>' . $strUserErr . '
            </td>
         </tr>
      </table><br><br>');
    if ($gbDev) {
        whereAmI();
        echoT('<blockquote><font face="Courier New">
           <font color="RED">
              <b>An error has occurred while processing your form!<br><br>

              This is an unexpected situation and should be reviewed by technical support.</b><br><br>
           </font>

           We apologize for this inconvenience.<br><br>
           <br>');
        //-------------------------------------------------------
        // include key version info for users to cut and paste
        //-------------------------------------------------------
        echoT('<table width="80%" class="errorReport">');
        //------------------------------
        // reported error
        //------------------------------
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>Reported Error:</b>
              </td>
              <td class="errorReport">' . $strMsg . '
              </td>
          </tr>');
        //------------------------------
        // mysql version
        //------------------------------
        $CI =& get_instance();
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>mysql version:</b>
              </td>
              <td class="errorReport">' . mysqli_get_server_info($CI->db->conn_id) . '
              </td>
          </tr>');
        //------------------------------
        // php version
        //------------------------------
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>php version:</b>
              </td>
              <td class="errorReport">' . phpversion() . '
              </td>
          </tr>');
        //------------------------------
        // http server version
        //------------------------------
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>http server:</b>
              </td>
              <td class="errorReport">' . $_SERVER['SERVER_SOFTWARE'] . '
              </td>
          </tr>');
        //------------------------------
        // http user agent
        //------------------------------
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>http user agent:</b>
              </td>
              <td class="errorReport">' . $_SERVER['HTTP_USER_AGENT'] . '
              </td>
          </tr>');
        //------------------------------
        // request URI
        //------------------------------
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>request URI:</b>
              </td>
              <td class="errorReport">' . htmlspecialchars($_SERVER['REQUEST_URI']) . '
              </td>
          </tr>');
        //------------------------------
        // code version
        //------------------------------
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>Code Version:</b>
              </td>
              <td class="errorReport">' . number_format(CSNG_CODE_VERSION, 3) . '
              </td>
          </tr>');
        //------------------------------
        // schema level
        //------------------------------
        echoT('<tr>
              <td class="errorReport" nowrap valign="top">
                 <b>DB Schema Level:</b>
              </td>
              <td class="errorReport">' . number_format(CSNG_DB_VERSION, 3) . '
              </td>
          </tr>');
        echoT('</table>');
        echoT('</blockquote><br>');
        echoT('<pre>');
        debug_print_backtrace();
        echoT('</pre>');
    }
    exit;
}
 public function loadEvents()
 {
     //-----------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------
     global $gdteNow;
     if ($this->bCurrentFuture) {
         $strWhereDate = ' AND vem_dteEventEndDate >= ' . strPrepDate($gdteNow) . ' ';
     } elseif ($this->bPastEvents) {
         $strWhereDate = ' AND vem_dteEventEndDate < ' . strPrepDate($gdteNow) . ' ';
     } elseif ($this->bAllEvents) {
         $strWhereDate = '';
     } else {
         whereAmI();
         die;
     }
     $this->loadEventsGeneric($strWhereDate);
 }
function rs_navigate_lTotPagesCalcs($lTotRecs, $lRecsPerPage)
{
    //---------------------------------------------------------------------
    // Utility to return the total number of pages, based on the total
    // number of records and the records displayed per page
    //
    //  INPUTS
    //     $lTotRecs  - the total number of records
    //     $lRecsPerPage - the number of records to display per screen display
    //
    //   OUTPUTS
    //     (function, integer) - total pages to display
    //---------------------------------------------------------------------
    if ($lRecsPerPage <= 0) {
        whereAmI();
    }
    $lTotPages = (int) ($lTotRecs / $lRecsPerPage);
    if ($lTotPages * $lRecsPerPage != $lTotRecs) {
        ++$lTotPages;
    }
    return $lTotPages;
}
 function viewHoursViaEvent($strViaShift, $lEventID)
 {
     //-------------------------------------------------------------------------
     //
     //-------------------------------------------------------------------------
     $this->load->helper('dl_util/verify_id');
     verifyID($this, $lEventID, 'event ID');
     $displayData = array();
     $displayData['lEventID'] = $lEventID = (int) $lEventID;
     $displayData['bViaShift'] = $bViaShift = strtoupper($strViaShift) == 'TRUE';
     //------------------------------------------------
     // libraries / models / utilities
     //------------------------------------------------
     $params = array('enumStyle' => 'terse');
     $this->load->library('generic_rpt', $params);
     $this->load->model('vols/mvol_event_dates', 'clsVolEventDates');
     $this->load->model('vols/mvol_event_hours', 'clsVolHours');
     $this->load->model('vols/mvol_event_dates_shifts', 'clsShifts');
     $this->load->model('vols/mvol_event_dates_shifts_vols', 'clsSV');
     $this->load->model('vols/mvol_events', 'clsVolEvents');
     $this->load->helper('dl_util/web_layout');
     $this->load->helper('dl_util/time_date');
     $displayData['lNumShifts'] = $lNumShifts = $this->clsShifts->lNumShifsTotViaEventID($lEventID);
     $displayData['lNumVols'] = $lNumVols = $this->clsSV->lTotVolsAssignedViaEventID($lEventID);
     $displayData['mainTemplate'] = 'vols/vol_hours_via_event_shift';
     if ($lNumShifts > 0 && $lNumVols > 0) {
         if ($bViaShift) {
             $this->clsShifts->loadShiftsViaEventID($lEventID);
             $idx = 0;
             foreach ($this->clsShifts->shifts as $shift) {
                 $lShiftID = $shift->lKeyID;
                 $this->clsVolHours->volEventHoursViaShift($lShiftID);
                 $shift->lNumVolsInShift = $this->clsVolHours->lNumVolsInShift;
                 if ($shift->lNumVolsInShift > 0) {
                     $shift->vols = array();
                     $jIdx = 0;
                     foreach ($this->clsVolHours->volEHrs as $vHours) {
                         $shift->vols[$jIdx] = new stdClass();
                         $shift->vols[$jIdx]->dHoursWorked = $vHours->dHoursWorked;
                         $shift->vols[$jIdx]->lVolShiftAssignID = $vHours->lVolShiftAssignID;
                         $shift->vols[$jIdx]->lPeopleID = $vHours->lPeopleID;
                         $shift->vols[$jIdx]->lVolID = $vHours->lVolID;
                         $shift->vols[$jIdx]->strFName = $vHours->strFName;
                         $shift->vols[$jIdx]->strLName = $vHours->strLName;
                         $shift->vols[$jIdx]->strAddr1 = $vHours->strAddr1;
                         $shift->vols[$jIdx]->strAddr2 = $vHours->strAddr2;
                         $shift->vols[$jIdx]->strCity = $vHours->strCity;
                         $shift->vols[$jIdx]->strState = $vHours->strState;
                         $shift->vols[$jIdx]->strCountry = $vHours->strCountry;
                         $shift->vols[$jIdx]->strZip = $vHours->strZip;
                         ++$jIdx;
                     }
                 }
                 ++$idx;
             }
             $displayData['shifts'] =& $this->clsShifts->shifts;
         } else {
             whereAmI();
             die;
         }
     }
     $this->clsVolEvents->loadEventsViaEID($lEventID);
     $displayData['strEventName'] = $this->clsVolEvents->events[0]->strEventName;
     $displayData['contextSummary'] = $this->clsVolEvents->volEventHTMLSummary(0);
     //--------------------------
     // breadcrumbs
     //--------------------------
     $displayData['title'] = CS_PROGNAME . ' | Volunteer Hours';
     $displayData['pageTitle'] = anchor('main/menu/vols', 'Volunteers', 'class="breadcrumb"') . ' | ' . anchor('volunteers/events_schedule/viewEventsList', 'Event List', 'class="breadcrumb"') . ' | ' . anchor('volunteers/events_record/viewEvent/' . $lEventID, 'Event', 'class="breadcrumb"') . ' | Volunteer Hours';
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $this->load->vars($displayData);
     $this->load->view('template');
 }
 private function strVolHoursSumReport(&$sRpt, $lStartRec, $lRecsPerPage)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $this->hrsSumOpts($sRpt, $bUseYear, $lYear, $bUseMon, $lMon, $bUseVolID, $lVolID);
     $strLimit = " LIMIT {$lStartRec}, {$lRecsPerPage} ";
     $strTab = 'tmp_vol_hrs';
     $strWhere = '1';
     if ($bUseVolID) {
         $cVol = new mvol();
         whereAmI();
         die;
     } elseif ($bUseMon) {
         $strMonth = strXlateMonth($lMon);
         $strTitle = 'Volunteer Summary for ' . $strMonth . ' ' . $lYear;
         $strFail = 'There are no volunteer hours for ' . $strMonth . ' ' . $lYear;
     } else {
         $strTitle = 'Volunteer Summary for the Year ' . $lYear;
         $strFail = 'There are no volunteer hours for the year ' . $lYear;
     }
     $sqlStr = "SELECT SUM(vsa_dHoursWorked) AS dHours,\n              pe_strFName, pe_strLName, tmphr_lVolID\n           FROM {$strTab}\n              INNER JOIN vol_events_dates_shifts_assign ON vsa_lKeyID            = tmphr_lEventAssignID\n              INNER JOIN volunteers                     ON tmphr_lVolID          = vol_lKeyID\n              INNER JOIN people_names                   ON vol_lPeopleID         = pe_lKeyID\n\n           WHERE {$strWhere}\n           GROUP BY tmphr_lVolID\n           ORDER BY pe_strLName, pe_strFName, tmphr_lVolID;";
     $query = $this->db->query($sqlStr);
     $lNumRows = $query->num_rows();
     if ($lNumRows == 0) {
         return '<br><i>' . $strFail . '.</i><br>';
     }
     $strOut = '
       <table class="enpRptC">
          <tr>
             <td class="enpRptTitle" colspan="5">' . $strTitle . '
             </td>
          </tr>';
     $strOut .= '
          <tr>
             <td class="enpRptLabel" >
                Vol ID
             </td>
             <td class="enpRptLabel" >
                Volunteer
             </td>
             <td class="enpRptLabel" >
                Total Hours
             </td>
             <td class="enpRptLabel" >
                Details
             </td>
          </tr>';
     foreach ($query->result() as $row) {
         $lVolID = $row->tmphr_lVolID;
         $strOut .= '
         <tr class="makeStripe">
            <td class="enpRpt">' . str_pad($lVolID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_Volunteer($lVolID, 'View volunteer record', true) . '
            </td>
            <td class="enpRpt">' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '
            </td>
            <td class="enpRpt" style="text-align: right; padding-right: 3px;">' . number_format($row->dHours, 2) . '
            </td>
            <td class="enpRpt" style="text-align: center;">' . strLinkView_VolDetailHrsViaYrMon($lYear, $lMon, $lVolID, 'View details', true) . '
         </tr>';
     }
     $strOut .= '</table><br>';
     return $strOut;
 }