/**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     // Uncomment the following line if you want to create a template
     // tailored for this page:
     $path = $this->pathModuleRoot . 'templates/';
     // Otherwise use the standard Templates for the site:
     //$path = SITE_PATH_TEMPLATES;
     // get a list of all the semesters associated with this year
     $semesterManager = new RowManager_SemesterManager();
     $semesterManager->setYearID($this->year_id);
     $semesterList = $semesterManager->getListIterator();
     $semesterArray = $semesterList->getDropListArray();
     // echo "<pre>".print_r( $semesterArray, true)."</pre>";
     // changed on June 4, 2009 by RM to reflect that we are now longer collecting certain fields
     // $semStatsFieldsOfInterest = "semesterreport_avgPrayer,semesterreport_avgWklyMtg,semesterreport_numStaffChall,semesterreport_numInternChall,semesterreport_numFrosh,semesterreport_numStaffDG,semesterreport_numInStaffDG,semesterreport_numStudentDG,semesterreport_numInStudentDG,semesterreport_numSpMultStaffDG,semesterreport_numSpMultStdDG";
     $semStatsFieldsOfInterest = "semesterreport_numStaffChall,semesterreport_numInternChall,semesterreport_numFrosh,semesterreport_numSpMultStaffDG,semesterreport_numSpMultStdDG";
     $semStatsFieldArray = explode(",", $semStatsFieldsOfInterest);
     // changed on June 4, 2009 by RM to reflect that we are no longer collecting certain fields
     // $perStatsFieldsOfInterest = "weeklyReport_1on1SpConv,weeklyReport_1on1SpConvStd,weeklyReport_1on1GosPres,weeklyReport_1on1GosPresStd,weeklyReport_1on1HsPres,weeklyReport_1on1HsPresStd,weeklyReport_7upCompleted,weeklyReport_7upCompletedStd,weeklyReport_cjVideo,weeklyReport_mda,weeklyReport_otherEVMats,weeklyReport_rlk,weeklyReport_siq";
     $perStatsFieldsOfInterest = "weeklyReport_1on1SpConv,weeklyReport_1on1SpConvStd,weeklyReport_1on1GosPres,weeklyReport_1on1GosPresStd,weeklyReport_1on1HsPres";
     $perStatsFieldArray = explode(",", $perStatsFieldsOfInterest);
     $prcTotals = array();
     $semesterStatsArray = array();
     foreach ($semesterArray as $semesterID => $desc) {
         // init the personal stats array
         foreach ($perStatsFieldArray as $key => $fieldName) {
             $personalMinStatsArray[$fieldName][$semesterID] = 0;
         }
         // GET INDICATED DECISIONS
         $prcManager = new RowManager_PRCManager();
         $prcManager->setSemester($semesterID);
         $prcManager->setCampus($this->campus_id);
         $prcList = $prcManager->getListIterator();
         $totalPRC = $prcList->getNumRows();
         $prcTotals[$semesterID] = $totalPRC;
         // GET SEMESTER STATS
         $semReportManager = new RowManager_SemesterReportManager($semesterID, $this->campus_id);
         $semReportManager->setFieldsOfInterest($semStatsFieldsOfInterest);
         $valuesArray = $semReportManager->getArrayOfValues();
         // echo "<pre>".print_r( $valuesArray, true)."</pre>";
         foreach ($semStatsFieldArray as $key => $fieldName) {
             $num = 0;
             if (isset($valuesArray[$fieldName])) {
                 $num = $valuesArray[$fieldName];
             }
             $semesterStatsArray[$fieldName][$semesterID] = $num;
         }
         // foreach semStatsFieldArray
         // GET CAMPUS TEAM EXPOSURE STATS
         $exposureTypeManager = new RowManager_ExposureTypeManager();
         $exIt = $exposureTypeManager->getListIterator();
         $exIt->setFirst();
         while ($exIt->moveNext()) {
             $anEx = $exIt->getCurrent(new RowManager_ExposureTypeManager());
             $typeID = $anEx->getID();
             $weekManager = new RowManager_WeekManager();
             $weekManager->setSemesterID($semesterID);
             $moreStatsManager = new RowManager_MoreStatsManager();
             $moreStatsManager->setExposureTypeID($typeID);
             $moreStatsManager->setCampusID($this->campus_id);
             $multiTableManager = new MultiTableManager();
             $multiTableManager->addRowManager($weekManager);
             $multiTableManager->addRowManager($moreStatsManager, new JoinPair($weekManager->getJoinOnWeekID(), $moreStatsManager->getJoinOnWeekID()));
             $listIterator = $multiTableManager->getListIterator();
             $listIterator->setFirst();
             $dataArray = array();
             $expTotal = 0;
             while ($listIterator->moveNext()) {
                 $anItem = $listIterator->getCurrent(new RowManager_MoreStatsManager());
                 $expTotal += $anItem->getNumExposures();
             }
             $campusTeamMinArray[$anEx->getLabel()][$semesterID] = $expTotal;
         }
         // all exposureTypes
         // GET PERSONAL MINISTRY STATS
         $weekManager = new RowManager_WeekManager();
         $weekManager->setSemesterID($semesterID);
         $weeklyReport = new RowManager_WeeklyReportManager();
         $weeklyReport->setCampusID($this->campus_id);
         $multiTableManager = new MultiTableManager();
         $multiTableManager->addRowManager($weekManager);
         $multiTableManager->addRowManager($weeklyReport, new JoinPair($weekManager->getJoinOnWeekID(), $weeklyReport->getJoinOnWeekID()));
         $listIterator = $multiTableManager->getListIterator();
         $listIterator->setFirst();
         $expTotal = 0;
         while ($listIterator->moveNext()) {
             $aReport = $listIterator->getCurrent(new RowManager_WeeklyReportManager());
             $dataArray = $aReport->getArrayOfValues();
             foreach ($perStatsFieldArray as $key => $fieldName) {
                 $personalMinStatsArray[$fieldName][$semesterID] += $dataArray[$fieldName];
             }
         }
     }
     // foreach semesterArray
     $prcArray = array("Indicated Decisions" => $prcTotals);
     /*
      * Update any label tags ...
      */
     // example:
     // $name = $user->getName();
     // $this->labels->setLabelTag( '[Title]', '[userName]', $name);
     $campusJumpLinkSelectedValue = $this->linkValues['campusJumpLink'] . $this->campus_id;
     $yearJumpLinkSelectedValue = $this->linkValues['yearJumpLink'] . $this->year_id;
     // NOTE:  this parent method prepares the $this->template with the
     // common Display data.
     $this->prepareTemplate($path);
     $this->template->set('semesterArray', $semesterArray);
     // the actual stats
     $this->template->set('personalMinStatsArray', $personalMinStatsArray);
     $this->template->set('prcArray', $prcArray);
     $this->template->set('campusTeamMinArray', $campusTeamMinArray);
     $this->template->set('semesterStatsArray', $semesterStatsArray);
     $this->template->set('semStatsLink', $this->linkValues['semStatsLink']);
     $this->template->set('campusTeamLink', $this->linkValues['campusTeamLink']);
     $this->template->set('indDecLink', $this->linkValues['indDecLink']);
     $this->template->set('personalMinLink', $this->linkValues['personalMinLink']);
     $this->template->set('campusJumpLinkSelectedValue', $campusJumpLinkSelectedValue);
     $this->template->set('yearJumpLinkSelectedValue', $yearJumpLinkSelectedValue);
     // campus list
     $jumpLink = $this->linkValues['campusJumpLink'];
     $campusArray = array();
     $this->campusListIterator->setFirst();
     while ($this->campusListIterator->moveNext()) {
         $campusObject = $this->campusListIterator->getCurrent(new RowManager_CampusManager());
         $region_id = $campusObject->getRegionID();
         // only include Canadian campuses
         if ($region_id == 1 || $region_id == 2 || $region_id == 3) {
             $campusArray[$jumpLink . $campusObject->getID()] = $campusObject->getLabel();
         }
     }
     // echo '<pre>'.print_r($campusArray, true ).'</pre>';
     $this->template->set('list_campus_id', $campusArray);
     // year list
     $jumpLink = $this->linkValues['yearJumpLink'];
     $yearArray = array();
     $yearManager = new RowManager_YearManager();
     $this->yearListIterator = $yearManager->getListIterator();
     $this->yearListIterator->setFirst();
     while ($this->yearListIterator->moveNext()) {
         $yearObject = $this->yearListIterator->getCurrent(new RowManager_YearManager());
         $yearArray[$jumpLink . $yearObject->getID()] = $yearObject->getLabel();
     }
     // echo '<pre>'.print_r($campusArray, true ).'</pre>';
     $this->template->set('list_year_id', $yearArray);
     // uncomment this line if you are creating a template for this page
     $templateName = 'page_CampusYearSummary.php';
     // otherwise use the generic site template
     //$templateName = '';
     return $this->template->fetch($templateName);
 }
 /**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     // Uncomment the following line if you want to create a template
     // tailored for this page:
     $path = $this->pathModuleRoot . 'templates/';
     // Otherwise use the standard Templates for the site:
     //$path = SITE_PATH_TEMPLATES;
     /*
      * Update any label tags ...
      */
     // example:
     // $name = $user->getName();
     // $this->labels->setLabelTag( '[Title]', '[userName]', $name);
     $regionJumpLinkSelectedValue = $this->linkValues['regionJumpLink'] . $this->region_id;
     $semesterJumpLinkSelectedValue = $this->linkValues['semesterJumpLink'] . $this->semester_id;
     // NOTE:  this parent method prepares the $this->template with the
     // common Display data.
     $this->prepareTemplate($path);
     $this->template->set('regionJumpLinkSelectedValue', $regionJumpLinkSelectedValue);
     $this->template->set('semesterJumpLinkSelectedValue', $semesterJumpLinkSelectedValue);
     // changed by RM on June 4, 2009 to reflect new reporting guidelines
     // $fieldsOfInterest = "weeklyReport_1on1SpConv,weeklyReport_1on1SpConvStd,weeklyReport_1on1GosPres,weeklyReport_1on1GosPresStd,weeklyReport_1on1HsPres,weeklyReport_1on1HsPresStd,weeklyReport_7upCompleted,weeklyReport_7upCompletedStd,weeklyReport_cjVideo,weeklyReport_mda,weeklyReport_otherEVMats,weeklyReport_rlk,weeklyReport_siq";
     $fieldsOfInterest = "weeklyReport_1on1SpConv,weeklyReport_1on1SpConvStd,weeklyReport_1on1GosPres,weeklyReport_1on1GosPresStd,weeklyReport_1on1HsPres";
     $fieldsArray = explode(",", $fieldsOfInterest);
     // changed by RM on June 4, 2009 to reflect new reporting guidelines, we are no longer collecting these measurements
     // $semesterReportFields = 'semesterreport_avgPrayer,semesterreport_avgWklyMtg,semesterreport_numStaffChall,semesterreport_numInternChall,semesterreport_numFrosh,semesterreport_numStaffDG,semesterreport_numInStaffDG,semesterreport_numStudentDG,semesterreport_numInStudentDG,semesterreport_numSpMultStaffDG,semesterreport_numSpMultStdDG';
     $semesterReportFields = '';
     $semesterReportFieldArray = explode(",", $semesterReportFields);
     // other 'weekly campus stats', based on exposure type
     /*
     // no longer need the exposure type fields of interest - RM June 4, 2009
             $exposureFieldsOfInterest = "";
             $exposureFieldsArray = array();
             $exposureTypePrefix = "expType";
             $isFirst = true;
             $exposureTypeManager = new RowManager_ExposureTypeManager();
             $exIt = $exposureTypeManager->getListIterator();
             $exIt->setFirst();
             while( $exIt->moveNext() )
             {
                 $anEx = $exIt->getCurrent( new RowManager_ExposureTypeManager() );
                 $typeID = $anEx->getID();
                 $fieldName = $exposureTypePrefix.$typeID;
                 $exposureFieldsArray[$typeID] = $fieldName;
                 if ( !$isFirst )
                 {
                     $exposureFieldsOfInterest .= ',';
                 }
                 $exposureFieldsOfInterest .= $fieldName;
                 $isFirst = false;
             } // while
     */
     // removed concatentation of $semesterReportFields and $exposureFieldsOfInterest - June 4, 2009 by RM
     // $fieldsOfInterest = 'prcTotal,'.$fieldsOfInterest . ',' . $semesterReportFields . ','. $exposureFieldsOfInterest;
     $fieldsOfInterest = 'prcTotal,' . $fieldsOfInterest;
     // get all the campuses for the given region
     $campusManager = new RowManager_CampusManager();
     $campusManager->setRegionID($this->region_id);
     $campusListIt = $campusManager->getListIterator();
     $campusInfoArray = array();
     $campusListIt->setFirst();
     while ($campusListIt->moveNext()) {
         $sumArray = array();
         foreach ($fieldsArray as $key => $fieldName) {
             $sumArray[$fieldName] = 0;
         }
         $campusObj = $campusListIt->getCurrent(new RowManager_CampusManager());
         $campusID = $campusObj->getID();
         $indCampusInfo = new IndCampusSemesterInfo();
         $indCampusInfo->campusID = $campusID;
         $indCampusInfo->shortName = $campusObj->getShortDesc();
         // check if an entry exists in the table for
         $weeklyReport = new RowManager_WeeklyReportManager();
         $weeklyReport->setCampusID($campusID);
         $weekManager = new RowManager_WeekManager();
         $weekManager->setSemesterID($this->semester_id);
         $multiTableManager = new MultiTableManager();
         $multiTableManager->addRowManager($weeklyReport);
         $multiTableManager->addRowManager($weekManager, new JoinPair($weeklyReport->getJoinOnWeekID(), $weekManager->getJoinOnWeekID()));
         $listIterator = $multiTableManager->getListIterator();
         $listIterator->setFirst();
         $dataArray = array();
         while ($listIterator->moveNext()) {
             $aWklyReport = $listIterator->getCurrent(new RowManager_WeeklyReportManager());
             $dataArray = $aWklyReport->getArrayOfValues();
             $this->combineValues($sumArray, $dataArray);
         }
         // $indCampusInfo->dataArray = array('weeklyReport_1on1SpConv'=>7,'weeklyReport_1on1SpConvStd'=>21);
         $indCampusInfo->dataArray = $sumArray;
         // get semster stats
         $semesterCampusReport = new RowManager_SemesterReportManager($this->semester_id, $campusID);
         $campusDataArray = $semesterCampusReport->getArrayOfValues();
         if (count($campusDataArray) <= 0) {
             // no data
             // echo 'no data<br/>';
             foreach ($semesterReportFieldArray as $key => $semFieldName) {
                 // put zeros into the array
                 $campusDataArray[$semFieldName] = 0;
             }
         }
         // echo '<pre>'.print_r($campusDataArray, true).'</pre>';
         // combine personal ministry totals array with other semester stats
         $indCampusInfo->dataArray = array_merge($indCampusInfo->dataArray, $campusDataArray);
         // add the 'campus weekly stats'
         $exposureTypeManager = new RowManager_ExposureTypeManager();
         $exIt = $exposureTypeManager->getListIterator();
         $exIt->setFirst();
         while ($exIt->moveNext()) {
             $anEx = $exIt->getCurrent(new RowManager_ExposureTypeManager());
             // echo $anEx->getLabel().'->'.$anEx->getID().'<br/>';
             $typeID = $anEx->getID();
             $sumThisType = 0;
             // get the sum of all the exposures of this type, this semester
             $moreManager = new RowManager_MoreStatsManager();
             $moreManager->setCampusID($campusID);
             $moreManager->setExposureTypeID($typeID);
             $wkManager = new RowManager_WeekManager();
             $wkManager->setSemesterID($this->semester_id);
             $multiTableManager = new MultiTableManager();
             $multiTableManager->addRowManager($moreManager);
             $multiTableManager->addRowManager($wkManager, new JoinPair($moreManager->getJoinOnWeekID(), $wkManager->getJoinOnWeekID()));
             $listIterator = $multiTableManager->getListIterator();
             $listIterator->setFirst();
             while ($listIterator->moveNext()) {
                 $moreStatsObj = $listIterator->getCurrent(new RowManager_MoreStatsManager());
                 $sumThisType += $moreStatsObj->getNumExposures();
             }
             // while
             // echo 'campusID['.$campusID.'] semesterID['.$this->semester_id.'] typeID['.$typeID.'] total['.$sumThisType.']<br/>';
             $indCampusInfo->dataArray[$exposureFieldsArray[$typeID]] = $sumThisType;
         }
         // while
         // add the number of indicated decisions
         $prcManager = new RowManager_PRCManager();
         $prcManager->setSemester($this->semester_id);
         $prcManager->setCampus($campusID);
         $prcList = $prcManager->getListIterator();
         $numPRC = $prcList->getNumRows();
         // echo $numPRC.'<br/>';
         $indCampusInfo->dataArray['prcTotal'] = $numPRC;
         $campusInfoArray[] = $indCampusInfo;
     }
     $this->template->set('campusInfoArray', $campusInfoArray);
     $this->template->set('fieldsOfInterest', $fieldsOfInterest);
     $campusSummaryJumpLink = $this->linkValues['campusSummaryJumpLink'];
     $campusSummaryJumpLink = str_replace('SSS', $this->semester_id, $campusSummaryJumpLink);
     // in case where semester was not provided (usual case)
     // look up the year associated with this semester
     $semObj = new RowManager_SemesterManager($this->semester_id);
     $year_id = $semObj->getYearID();
     $campusSummaryJumpLink = str_replace('YYY', $year_id, $campusSummaryJumpLink);
     // in case where semester was not provided (usual case)
     /*$personalMinLink = $this->linkValues['campusPersonalJumpLink'];
             $personalMinLink = str_replace( 'SSS', $this->semester_id, $personalMinLink ); // in case where semester was not provided (usual case)
             
             $campusWideLink =  $this->linkValues['campusWideJumpLink'];
             $campusWideLink =  str_replace( 'SSS', $this->semester_id, $campusWideLink ); // in case where semester was not provided (usual case)
             
             $indicatedDecLink =  $this->linkValues['indicatedDecLink'];
             $indicatedDecLink =  str_replace( 'SSS', $this->semester_id, $indicatedDecLink ); // in case where semester was not provided (usual case)
     
             $this->template->set('linksArray', array('[personalMin]'=>$personalMinLink, '[campusWideMin]'=>$campusWideLink, '[decLink]'=>$indicatedDecLink ) );*/
     $this->template->set('linksArray', array('[campusSummaryJumpLink]' => $campusSummaryJumpLink));
     // semester list
     $jumpLink = $this->linkValues['semesterJumpLink'];
     $semesterArray = array();
     $semesterManager = new RowManager_SemesterManager();
     $semesterListIterator = $semesterManager->getListIterator();
     $semesterListIterator->setFirst();
     while ($semesterListIterator->moveNext()) {
         $semesterObject = $semesterListIterator->getCurrent(new RowManager_SemesterManager());
         $semesterArray[$jumpLink . $semesterObject->getID()] = $semesterObject->getLabel();
     }
     // echo '<pre>'.print_r($campusArray, true ).'</pre>';
     $this->template->set('list_semester_id', $semesterArray);
     // region list
     $jumpLink = $this->linkValues['regionJumpLink'];
     $regionManager = new RowManager_RegionManager();
     $regionListIt = new ListIterator($regionManager);
     $regionArray = $regionListIt->getDropListArray(null, $jumpLink);
     // echo '<pre>'.print_r( $regionArray, true ).'</pre>';
     $this->template->set('list_region_id', $regionArray);
     // uncomment this line if you are creating a template for this page
     $templateName = 'page_RegionalSemesterReport.php';
     // otherwise use the generic site template
     //$templateName = '';
     return $this->template->fetch($templateName);
 }
예제 #3
0
  * semesterreport_id [INTEGER]  Unique id
  * semesterreport_avgPrayer [INTEGER]  Average attendence at prayer meetings over the semester
  * semesterreport_avgWklyMtg [INTEGER]  The average attendence at the weekly meetings over the semester.
  * semesterreport_numStaffChall [INTEGER]  Number of people challenged to staff
  * semesterreport_numInternChall [INTEGER]  number challenged to an internship
  * semesterreport_numFrosh [INTEGER]  number of frosh involved
  * semesterreport_numStaffDG [INTEGER]  number of staff led DGs
  * semesterreport_numInStaffDG [INTEGER]  number of students in staff led DGs
  * semesterreport_numStudentDG [INTEGER]  number of student led DGs
  * semesterreport_numInStudentDG [INTEGER]  number of students in student-led DGs
  * semesterreport_numSpMultStaffDG [INTEGER]  Number of SP mults in staff led DGs
  * semesterreport_numSpMultStdDG [INTEGER]  Number of sp mults in student led DGs
  * semester_id [INTEGER]  id of the semester
  * campus_id [INTEGER]  id of the campus
  */
 $SemesterReport = new RowManager_SemesterReportManager();
 $SemesterReport->dropTable();
 $SemesterReport->createTable();
 /*
  * PrcMethod Table
  *
  * Manages methods by which people PRC
  *
  * prcMethod_id [INTEGER]  unique id
  * prcMethod_desc [STRING]  Textual description of the prc method
  */
 $PrcMethod = new RowManager_PrcMethodManager();
 $PrcMethod->dropTable();
 $PrcMethod->createTable();
 /*
  * PRC Table