/** * function __construct * <pre> * Initialize the Class ... * </pre> * @param $sortBy [STRING] the field name to sort list by * @return [void] */ function __construct($sortBy = '') { $searchManager = new RowManager_FamilyManager(); // NOTE: if you need to narrow the field of the search then uncommnet // the following and set the proper search criteria. //$searchManager->setValueByFieldName('module_isCommonLook', '1' ); $searchManager->setSortOrder($sortBy); parent::__construct($searchManager); }
/** * function __construct * <pre> * Initialize the Class ... * </pre> * @param $template_id [INTEGER] value used to initialize the list. * @param $sortBy [STRING] the field name to sort list by * @return [void] */ function __construct($template_id = -1, $sortBy = '') { //print (moduleEmailTemplates::MULTILINGUAL_SERIES_KEY); $searchManager = new RowManager_EmailTemplateManager($template_id); $searchManager->setAppID(moduleEmailTemplates::MULTILINGUAL_SERIES_KEY); // NOTE: if you need to narrow the field of the search then uncommnet // the following and set the proper search criteria. $searchManager->setValueByFieldName("template_id", $template_id); //$searchManager->setValueByFieldName('module_isCommonLook', '1' ); $searchManager->setSortOrder($sortBy); parent::__construct($searchManager); }
/** * function __construct * <pre> * Initialize the Class ... * </pre> * @param $sortBy [STRING] the field name to sort list by * @return [void] */ function __construct($requireRegion = false, $getOnlyNS = false, $includeChildren = false, $includeAlumni = false, $sortBy = '', $excludeSpouse = false) { $this->requireRegion = $requireRegion; $multiTableManager = new MultiTableManager(); // ----- STEP ONE: Deal with the ren table $renManager = new RowManager_HrdbRenManager(); /* if( $getOnlyNS ) { $renManager->setEmployeeStatus('NS'); } */ $multiTableManager->addRowManager($renManager); if ($getOnlyNS) { // we also need to $condition = $multiTableManager->constructSearchCondition($renManager->getFieldEmployeeStatus(), OP_EQUAL, 'NS'); $condition .= ' OR '; $condition .= $multiTableManager->constructSearchCondition($renManager->getFieldEmployeeStatus(), OP_EQUAL, 'ANS'); $multiTableManager->addSearchCondition($condition); } if (!$includeChildren) { $multiTableManager->constructSearchCondition($renManager->getFieldIdentifierFamilyPosition(), OP_NOT_EQUAL, "Child", true); } if ($excludeSpouse) { $multiTableManager->constructSearchCondition($renManager->getFieldIdentifierFamilyPosition(), OP_NOT_EQUAL, 'Spouse', true); } // STEP ONE COMPLETE // ----- STEP TWO: Join with the family table $familyManager = new RowManager_FamilyManager(); if (!$includeAlumni) { // we want only those who are not alumni $familyManager->setAlumni(false); } $multiTableManager->addRowManager($familyManager, new JoinPair($renManager->getJoinOnFamilyID(), $familyManager->getJoinOnFamilyID())); // STEP TWO COMPLETE // ------ STEP THREE: Check if region is needed if ($requireRegion) { // assignment $assManager = new RowManager_HrdbAssignmentManager(); $multiTableManager->addRowManager($assManager, new JoinPair($renManager->getJoinOnAssignmentID(), $assManager->getJoinOnAssignmentID())); // city $cityManager = new RowManager_HrdbCityManager(); $multiTableManager->addRowManager($cityManager, new JoinPair($assManager->getJoinOnCityID(), $cityManager->getJoinOnCityID())); // province $provinceManager = new RowManager_ProvinceManager(); $multiTableManager->addRowManager($provinceManager, new JoinPair($cityManager->getJoinOnProvinceID(), $provinceManager->getJoinOnProvinceID())); // region $regionManager = new RowManager_HrdbRegionManager(); $multiTableManager->addRowManager($regionManager, new JoinPair($provinceManager->getJoinOnRegionID(), $regionManager->getJoinOnRegionID())); } // STEP THREE COMPLETE $multiTableManager->setSortOrder($sortBy); parent::__construct($multiTableManager, 'RowManager_HrdbRenManager'); }
/** * function getHTML * <pre> * This method returns the HTML data generated by this object. * </pre> * @return [STRING] HTML Display data. */ function getHTML() { // Make a new Template object $path = SITE_PATH_TEMPLATES; // Replace $path with the following line if you want to create a // template tailored for this page: //$path = $this->pathModuleRoot.'templates/'; // store the link values // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['add'] = $this->labels->getLabel('[Add]'); $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; // store any additional link Columns // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); // store the page labels // NOTE: use this location to update any label tags ... // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); $this->prepareTemplate($path); // store the Row Manager's XML Node Name // $this->template->set( 'rowManagerXMLNodeName', RowManager_GroupManager::XML_NODE_NAME ); $this->template->set('rowManagerXMLNodeName', MultiTableManager::XML_NODE_NAME); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'group_id'); /* * Set up any additional data transfer to the Template here... */ // get a list of the different group types $groupType = new RowManager_GroupTypeManager(); $groupTypeList = new ListIterator($groupType); $groupArray = $groupTypeList->getDropListArray(); $this->template->set('list_groupType_id', $groupArray); // echo "<pre>Group:".print_r($groupArray, true)."</pre>"; // get a list of all campus_ids $campus = new RowManager_CampusManager(); $campus->setSortOrder('campus_desc'); $campusList = new ListIterator($campus); $campusArray = $campusList->getDropListArray(); //echo "<pre>Campus:".print_r($campusArray, true)."</pre>"; $this->template->set('list_campus_id', $campusArray); $templateName = 'siteDataList.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_ViewGroups.php'; 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; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->campusaccess_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List // // NOTE: Hobbe, here are the original two lines that I moved to below // // $xmlNodeName = RowManager_EventAdminCampusAssignmentManager::XML_NODE_NAME; // $this->template->set( 'rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'campusaccess_id'); // Russ' Debugging Methodoloy // 1. Try and create a multi-table manager that returns the // result set I want and put it into and array. Then figure // out why that is not making it through to the template. // // Result: Hobbe, indeed you were creating the multi-table // manager correctly (I just renamed the one row manager), // otherwise your code was fine. // // 2. Ok, try and figure out why the template doesn't like // XML it is getting. // // a. first I check another example (FormProcessor_AddSuperAdmin) // of where an adminbox type template is generated. Yes, it // appears we are sending the xml properly // // b. i notice the call to ->set('primaryKeyFieldName', ... ) // in the example I'm checking, that too seems to be okay // // c. I notice the xmlNodeName parameter being set in the // templates, i realize that we are not setting this properly // and refactor the code a little to get the xmlNodeName from // the multitablemanager instead. // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $campusAdminManager = new RowManager_EventAdminCampusAssignmentManager(); //*** ADDED JOIN TO FILTER BY EVENT ***/ $eventAdminManager = new RowManager_EventAdminAssignmentManager(); // echo "The eventID is [".$this->event_id."]<br/>"; $eventAdminManager->setEventID($this->event_id); $multiTableManager = new MultiTableManager(); $multiTableManager->addRowManager($campusAdminManager); $multiTableManager->addRowManager($eventAdminManager, new JoinPair($eventAdminManager->getJoinOnEventAdminID(), $campusAdminManager->getJoinOnEventAdminID())); // code to check the result set in the multi-table manager // $i = 0; // $listIt = $multiTableManager->getListIterator(); // $listIt->setFirst(); // while( $listIt->moveNext() ) // { // echo "ith [".$i."] element"; // $i++; // } // end multi-table manager check // $this->dataList = $multiTableManager->getListIterator(); // echo "<pre>List: ".print_r($this->dataList,true)."</pre>"; //*** END ADD ***/ $this->dataList = $multiTableManager->getListIterator(); // Hobbe, I added/moved these two lines and now it works! // It has to do with how the template understands the // XML that it is passed $xmlNodeName = $this->dataList->getRowManagerXMLNodeName(); $this->template->set('rowManagerXMLNodeName', $xmlNodeName); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ $eventAdmin = new RowManager_EventAdminAssignmentManager(); $eventAdmin->setEventID($this->event_id); $viewer = new RowManager_ViewerManager(); $multiTableManager2 = new MultiTableManager(); $multiTableManager2->addRowManager($eventAdmin); $multiTableManager2->addRowManager($viewer, new JoinPair($eventAdmin->getJoinOnViewerID(), $viewer->getJoinOnViewerID())); // $multiTableManager2->constructSearchCondition( 'event_id', '=', $this->event_id, true ); $multiTableManager2->setSortOrder('viewer_userID'); $multiTableManager2->setLabelTemplate('viewer_userID', '[viewer_userID]'); $listIterator = $multiTableManager2->getListIterator(); // code to check the result set in the multi-table manager /* echo "<pre>List: ".print_r($listIterator,true)."</pre>"; $i = 0; $listIt = $multiTableManager2->getListIterator(); $listIt->setFirst(); while( $listIt->moveNext() ) { echo "ith [".$i."] element"; $i++; } */ // end multi-table manager check // echo print_r($listIterator,true); /* $viewer = new RowManager_ViewerManager(); $viewer->setSortOrder( 'viewer_userID' ); $viewerList = new ListIterator($viewer); $viewerArray = $viewerList->getDropListArray(); */ $viewerArray = $listIterator->getDropListArray(); //$listIterator $this->template->set('list_eventadmin_id', $viewerArray); // echo print_r($viewerArray,true); $campus = new RowManager_CampusManager(); // $campus->setEventID( $this->event_id); $campus->setSortOrder('campus_id'); $campusList = new ListIterator($campus); $campusArray = $campusList->getDropListArray(); $this->template->set('list_campus_id', $campusArray); $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_AddCampusAdmin.php'; 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; // The weeks $weekManager = new RowManager_WeekManager(); $weekManager->setSemesterID($this->semester_id); $weekManager->setSortByDate(); $staffArray = array(); // figure out all the people we want to report on $isCD = $this->permManager->isCD(); if ($isCD) { // get all the people from this campus who have reported stats $wklyReportManager = new RowManager_WeeklyReportManager(); $wklyReportManager->setCampusID($this->campus_id); $anotherWeekManager = new RowManager_WeekManager(); $anotherWeekManager->setSemesterID($this->semester_id); $multiTableManager = new MultiTableManager(); $multiTableManager->addRowManager($wklyReportManager); $multiTableManager->addRowManager($anotherWeekManager, new JoinPair($wklyReportManager->getJoinOnWeekID(), $anotherWeekManager->getJoinOnWeekID())); $this->listIterator = $multiTableManager->getListIterator(); $this->listIterator->setFirst(); while ($this->listIterator->moveNext()) { $reportRow = $this->listIterator->getCurrent(new RowManager_WeeklyReportManager()); $staffArray[] = $reportRow->getStaffID(); } $staffArray = array_unique($staffArray); // echo '<pre>'.print_r($staffArray, true).'</pre>'; } else { // just get the stats for the staff viewing the page $staffArray[] = $this->staff_id; } $infoArray = array(); foreach ($staffArray as $indx => $staffID) { //IndSemesterInfo $indInfo = new IndSemesterInfo(); $staffManager = new RowManager_StaffManager($staffID); $personID = $staffManager->getPersonID(); $personManager = new RowManager_PersonManager($personID); $personManager->setLabelTemplateLastNameFirstName(); $indInfo->staffName = $personManager->getLabel(); $indInfo->staffID = $staffID; // calendar $indInfo->calendar = array(); $currentMonth = 0; // actual data // dataArray[weekID] = arrayOfData $indInfo->dataArray = array(); $weekList = new ListIterator($weekManager); $weekList->setFirst(); while ($weekList->moveNext()) { $week = $weekList->getCurrent(new RowManager_WeekManager()); $weekID = $week->getID(); // setup stuff for the calendar in the report $endDate = $week->getEndDate(); list($year, $month, $day) = explode('-', $endDate); $month = ltrim($month, "0"); // $day = ltrim($day, "0"); if ($currentMonth != $month) { // echo 'start new array<br/>'; $currentMonth = $month; } $indInfo->calendar[$currentMonth][$day] = $weekID; // end calendar stuff // check if an entry exists in the table for $weeklyReport = new RowManager_WeeklyReportManager($weekID, $staffID, $this->campus_id); if ($weeklyReport->isLoaded()) { // echo $week->getEndDate() . ' loaded <br/>'; $indInfo->dataArray[$weekID] = $weeklyReport->getArrayOfValues(); // echo '<pre>'.print_r( $weeklyReport->getArrayOfValues() ).'</pre>'; } else { $indInfo->dataArray[$weekID] = null; // echo $week->getEndDate() . ' NOT loaded <br/>'; } } // echo '<pre>'.print_r($calendar,true).'</pre>'; $infoArray[] = $indInfo; } /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); $campusJumpLinkSelectedValue = $this->linkValues['campusJumpLink'] . $this->campus_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( 'calendar', $calendar ); // $this->template->set( 'dataArray', $dataArray ); $this->template->set('infoArray', $infoArray); $this->template->set('campusJumpLinkSelectedValue', $campusJumpLinkSelectedValue); $this->template->set('semesterJumpLinkSelectedValue', $semesterJumpLinkSelectedValue); // 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(); 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); // semester list $jumpLink = $this->linkValues['semesterJumpLink']; $semesterArray = array(); $semesterManager = new RowManager_SemesterManager(); $this->semesterListIterator = $semesterManager->getListIterator(); $this->semesterListIterator->setFirst(); while ($this->semesterListIterator->moveNext()) { $semesterObject = $this->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); // uncomment this line if you are creating a template for this page $templateName = 'page_StaffSemesterReport.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. * * ON JAN 2, 2008 Russ made two changes to this page to restore the original functionality... they are documented below. * ON JAN 8, 2008 Hobbe added conditional statements to allow registration record searches IF viewer has Reg. Sys. Super Admin privs. */ function getHTML() { // Uncomment the following line if you want to create a template // tailored for this page: $privManager = new PrivilegeManager($this->viewer->getID()); if ($privManager->isSuperAdmin() == true) { $path = SITE_PATH_TEMPLATES; } else { // Changed by RM from using the assignment below on Jan 2, 2008. $path = $this->pathModuleRoot . 'templates/'; } // Otherwise use the standard Templates for the site: // $path = SITE_PATH_TEMPLATES; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); // $this->linkLabels[ 'cont' ] = $this->labels->getLabel( '[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->registration_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_RegistrationManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'registration_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. if ($this->person_id != '') { $dataAccessManager = new RowManager_RegistrationManager(); $dataAccessManager->setPersonID($this->person_id); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new PriceRuleList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); } // else // { // $this->dataList = array(); // // $this->template->setXML( 'dataList', $this->dataList->getXML() ); // } /* * Add any additional data required by the template here */ $person = new RowManager_PersonManager(); $person->setLabelTemplateLastNameFirstName(); // $field->setPersonID( $this->person_id); $person->setSortOrder('person_lname, person_fname'); $personList = new ListIterator($person); $personArray = $personList->getDropListArray(); $this->template->set('list_person_id', $personArray); $notice = "<br><b>NOTE:</b> Duplicate names may appear if a person has multiple records."; $this->template->set('note_person_id', $notice); $event = new RowManager_EventManager(); // $field->setPersonID( $this->person_id); $eventList = new ListIterator($event); $eventArray = $eventList->getDropListArray(); $this->template->set('list_event_id', $eventArray); $status = new RowManager_StatusManager(); $statusList = new ListIterator($status); $statusArray = $statusList->getDropListArray(); $this->template->set('list_registration_status', $statusArray); // // $nameFields = 'person_lname,person_fname'; // $template = '[person_lname], [person_fname]'; // $this->dataManager->setLabelTemplate( $nameFields, $template ); if ($privManager->isSuperAdmin() == true) { $templateName = 'siteSearchFormDataList.php'; //'page_HrdbHome.php'; } else { // Changed by RM on Jan 2, 2008 - We can't have just anybody being able to access this data. $templateName = 'page_HrdbHome.php'; } // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditPriceRules.php'; 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; // store the page labels in XML format... // NOTE: use this location to update any label tags ... // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // temporarily reset the form values so the defaults show up properly in the jumplists $this->formValues['week_id'] = $this->linkValues['weekJumpLink'] . $this->week_id; $this->formValues['campus_id'] = $this->linkValues['campusJumpLink'] . $this->campus_id; // NOTE: this parent method prepares the $this->template with the // common Form data. $this->prepareTemplate($path); /* * Form related Template variables: */ // store the button label $this->template->set('buttonText', $this->labels->getLabel('[Update]')); // Insert the date start/end values for the following date fields: // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * Add any additional data required by the template here */ // week list $jumpLink = $this->linkValues['weekJumpLink']; $weekManager = new RowManager_WeekManager(); $weekManager->setSortOrder('week_endDate'); $weekList = new ListIterator($weekManager); $jumpList = $weekList->getDropListArray(null, $jumpLink); $this->template->set('list_week_id', $jumpList); // campus list $jumpLink = $this->linkValues['campusJumpLink']; $campusArray = array(); $this->campusListIterator->setFirst(); while ($this->campusListIterator->moveNext()) { $campusObject = $this->campusListIterator->getCurrent(new RowManager_CampusManager()); $campusArray[$jumpLink . $campusObject->getID()] = $campusObject->getLabel(); } // echo '<pre>'.print_r($campusArray, true ).'</pre>'; $this->template->set('list_campus_id', $campusArray); // add the definitions at the bottom of the page /*$defsContent = new Template($this->pathModuleRoot.'templates/'); $a = $defsContent->fetch( 'moreDefs.tpl.php' ); $this->template->set( 'footerContent', $a );*/ // uncomment this line if you are creating a template for this page //$templateName = 'page_StaffAdditionalWeeklyStats.php'; // otherwise use the generic admin box template $templateName = 'siteFormSingle.php'; 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; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->pricerules_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_PriceRuleManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'pricerules_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $dataAccessManager = new RowManager_PriceRuleManager(); $dataAccessManager->setEventID($this->event_id); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new PriceRuleList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ $field = new RowManager_FieldManager(); $field->setEventID($this->event_id); $field->setSortOrder('fields_id'); $fieldList = new ListIterator($field); $fieldArray = $fieldList->getDropListArray(); $this->template->set('list_fields_id', $fieldArray); $priceRuleType = new RowManager_PriceRuleTypeManager(); $priceRuleType->setSortOrder('priceruletypes_id'); $priceRuleTypeList = new ListIterator($priceRuleType); $priceRuleTypeArray = $priceRuleTypeList->getDropListArray(); $this->template->set('list_priceruletypes_id', $priceRuleTypeArray); $notice = "<b>NOTE:</b> For checkbox 'Form Attribute' rules use '1' for checked box and '0' for unchecked box."; $this->template->set('note_pricerules_value', $notice); $templateName = 'siteFormDataList.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditPriceRules.php'; 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; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->cctransaction_id); $this->formValues['form_name'] = 'ccTransForm'; // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_CreditCardTransactionManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'cctransaction_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $dataAccessManager = new RowManager_CreditCardTransactionManager(); $dataAccessManager->setSortOrder($this->sortBy); $dataAccessManager->setRegID($this->reg_id); // $this->dataList = new CreditCardTransactionList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); // replace card type IDs with card type descriptions /* $cardTypes = new RowManager_CreditCardTypeManager(); $cardTypesList = $cardTypes->getListIterator(); $cardTypesArray = $cardTypesList->getDataList(); // echo "<pre>".print_r($cardTypesArray,true)."</pre>"; $cardType_info = array(); reset($cardTypesArray); foreach(array_keys($cardTypesArray) as $k) { $cardType = current($cardTypesArray); $cardType_info[$cardType['cctype_id']] = $cardType['cctype_desc']; next($cardTypesArray); } $this->template->set('list_cctype_id', $cardType_info ); */ // get a list of all credit card type IDs $ccType = new RowManager_CreditCardTypeManager(); $ccType->setSortOrder('cctype_id'); $ccTypeList = new ListIterator($ccType); $ccTypeArray = $ccTypeList->getDropListArray(); $this->template->set('list_cctype_id', $ccTypeArray); // replaces 0s and 1s with no's and yes's $boolArray = array(); $boolArray['0'] = 'no'; $boolArray['1'] = 'yes'; $this->template->set('list_cctransaction_processed', $boolArray); /* * Add any additional data required by the template here */ $this->template->set('disableHeading', true); $this->template->set('formAnchor', 'RegCCTransactionForm'); $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditRegistrationCCTransactionsList.php'; 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; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // temporarily reset the form values so the defaults show up properly in the jumplists $this->formValues['week_id'] = $this->linkValues['weekJumpLink'] . $this->week_id; $this->formValues['campus_id'] = $this->linkValues['campusJumpLink'] . $this->campus_id; // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->morestats_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_MoreStatsManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'morestats_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $dataAccessManager = new RowManager_MoreStatsManager(); // echo 'This campus ID['.$this->campus_id.']<br/>'; $dataAccessManager->setCampusID($this->campus_id); $dataAccessManager->setWeekID($this->week_id); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new MoreStatsList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ // week list $jumpLink = $this->linkValues['weekJumpLink']; $weekManager = new RowManager_WeekManager(); $weekManager->setSortOrder('week_endDate'); $weekList = new ListIterator($weekManager); $jumpList = $weekList->getDropListArray(null, $jumpLink); $this->template->set('list_week_id', $jumpList); // for looking up the person_id of this staff member $staffManager = new RowManager_StaffManager($this->staff_id); // campus list $assignmentManager = new RowManager_AssignmentsManager(); $assignmentManager->setPersonID($staffManager->getPersonID()); $assignmentManager->setAssignmentStatusID(CA_STAFF); $multiTableManager = new MultiTableManager(); $multiTableManager->addRowManager($assignmentManager); $campusManager = new RowManager_CampusManager(); $campusManager->setSortOrder('campus_desc'); $multiTableManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(), $assignmentManager->getJoinOnCampusID())); $jumpLink = $this->linkValues['campusJumpLink']; $campusList = $multiTableManager->getListIterator(); $campusArray = array(); $campusList->setFirst(); while ($campusList->moveNext()) { $campusObject = $campusList->getCurrent(new RowManager_CampusManager()); $campusArray[$jumpLink . $campusObject->getID()] = $campusObject->getLabel(); } // echo '<pre>'.print_r($campusArray, true ).'</pre>'; $this->template->set('list_campus_id', $campusArray); // method list $typeManager = new RowManager_ExposureTypeManager(); $typeManager->setSortOrder('exposuretype_desc'); $typeList = $typeManager->getListIterator(); $typeArray = $typeList->getDropListArray(); $this->template->set('list_exposuretype_id', $typeArray); $templateName = 'siteFormDataList.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_MoreStats.php'; 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; // NOTE: this parent method prepares the $this->template with the // common Form data. $this->prepareTemplate($path); // TODO: when implementing staff-specific stats reporting, // refer to page_StaffSemesterReport.php in app_cim_stats module /** The frequency values (weeks, days,.. whatever was chosen) **/ //this->freqValManager; // $infoArray = array(); $statNames = array(); //ReportInfo $statReportInfo = new ReportInfo(); /*** Determine which frequency is acting as the parent frequency (i.e. month is parent of week) **/ $freqType = new RowManager_FreqTypeManager($this->freq_id); // $freqType->setFreqID($this->freq_id); $freqTypeList = $freqType->getListIterator(); $freqTypeArray = $freqTypeList->getDataList(); // should be only 1 match for the frequency ID $parent_freq_id = ''; $date_field_id = ''; if (count($freqTypeArray) == 1) { $record = current($freqTypeArray); $parent_freq_id = $record['freq_parent_freq_id']; $date_field_id = $record['freq_parent_date_field_index'] - 1; //IMPORTANT: database stores 1-based index (to allow 0 default) // echo ' freqTypeArray = <pre>'.print_r($freqTypeArray,true).'</pre>'; // echo ' dateFieldValues = <pre>'.print_r($dateFieldValues,true).'</pre>'; // echo ' date field index = '.$date_field_id; } $parentDateValues = array(); $parentIndex = 0; // calendar $statReportInfo->calendar = array(); $currentParentFreqVal = 0; // i.e. could be default starting month value if child stat is 'weekly' // actual data // dataArray[freqValID] = arrayOfData $statReportInfo->dataArray = array(); $freqValList = new ListIterator($this->freqValManager); $freqValList->setFirst(); while ($freqValList->moveNext()) { // TODO: check if below filters properly based on $this->freqValManager $freqVal = $freqValList->getCurrent(new RowManager_FreqValueManager()); // i.e. week for weekly stats $freqValID = $freqVal->getID(); // i.e. weekID for weekly stats // setup stuff for the calendar in the report $freqVal_dateTime = $freqVal->getFreqValue(); // i.e. getEndDate for weekly stats in app_cim_stats $freqVal_date = substr($freqVal_dateTime, 0, 10); $freqVal_time = substr($freqVal_dateTime, 10); // list( $year, $month, $day ) = explode('-', $freqVal_date ); $dateFieldValues = explode('-', $freqVal_date); $timeFieldValues = explode(':', $freqVal_time); // $month = ltrim($month, "0"); // strips '0's from in front of $month... // $day = ltrim($day, "0"); $dateTimeValues = array_merge($dateFieldValues, $timeFieldValues); $parentDateFieldVal = 0; if (isset($dateFieldValues) && $date_field_id >= 0) { $parentDateFieldVal = $dateFieldValues[$date_field_id]; } if ($currentParentFreqVal != $parentDateFieldVal) { // echo 'start new array<br/>'; $currentParentFreqVal = $parentDateFieldVal; } // echo 'parent val = '.$currentParentFreqVal; // $currentParentFreqVal = ltrim($currentParentFreqVal,"0"); // trim any leading zeroes $parentDateValues[$parentIndex] = $currentParentFreqVal; $currentFreqVal = $dateTimeValues[$date_field_id + 1]; // i.e. current freq = (some) hour if the parent = (some) day $statReportInfo->calendar[$currentParentFreqVal][$currentFreqVal] = $freqValID; // i.e. calendar[month][day] = $weekID // end calendar stuff // check if an entry exists in the stat values table for the current freq. value $this->dataManager->clearValues(); $this->dataManager->setFreqValueID($freqValID); $statsManager = new RowManager_StatisticManager(); $freqVal_statVals = new MultiTableManager(); $freqVal_statVals->addRowManager($this->dataManager); $freqVal_statVals->addRowManager($statsManager, new JoinPair($statsManager->getJoinOnStatID(), $this->dataManager->getJoinOnStatID())); $statValsList = $freqVal_statVals->getListIterator(); $statValsArray = $statValsList->getDataList(); // retrieve stat values associated with some freq val (used for display) $stat_name = ''; $stat_val = ''; $freqValStatValsArray = array(); // echo '<br>stat vals array <pre>'.print_r( $statValsArray,true ).'</pre>'; reset($statValsArray); foreach (array_keys($statValsArray) as $key) { $record = current($statValsArray); $stat_name = $record['statistic_name']; $stat_val = $record['statvalues_value']; // re-package array into simpler form for list display use $freqValStatValsArray[$stat_name] = $stat_val; next($statValsArray); } if (count($freqValStatValsArray) > 0) { $statReportInfo->dataArray[$freqValID] = $freqValStatValsArray; // echo 'freq val stat vals array: <pre>'.print_r( $freqValStatValsArray,true ).'</pre>'; } else { $statReportInfo->dataArray[$freqValID] = null; } $parentIndex++; } // echo 'calendar = <pre>'.print_r($statReportInfo->calendar,true).'</pre>'; // $infoArray[] = $statReportInfo; /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // $campusJumpLinkSelectedValue = $this->linkValues['campusJumpLink'].$this->campus_id; // $semesterJumpLinkSelectedValue = $this->linkValues['semesterJumpLink'].$this->semester_id; // // $this->template->set( 'calendar', $calendar ); // $this->template->set( 'dataArray', $dataArray ); // $this->template->set( 'infoArray', $infoArray ); $this->template->set('statReportInfo', $statReportInfo); // echo '<br> stat report: <pre>'.print_r($statReportInfo,true).'</pre>'; $this->template->set('statsArray', $this->stat_names_array); // need to create a static array of parent frequency values (i.e. like list of months as headers for week values) $parent_freqs_array = array(); if (isset($parent_freq_id) && $parent_freq_id > 0) { $parentFreqValues = new RowManager_FreqValueManager(); $parentFreqValues->setFreqID($parent_freq_id); $parentFreqValuesList = $parentFreqValues->getListIterator(); $parentFreqValuesArray = $parentFreqValuesList->getDataList(); $i = 0; reset($parentFreqValuesArray); foreach (array_keys($parentFreqValuesArray) as $key) { $record = current($parentFreqValuesArray); // $date_field_value = $parentDateValues[$i]; // echo "date field = ".$date_field_value; // echo "record = ".$record['freqvalue_desc']; // if ($date_field_value == $record['freqvalue_desc']) // { // $parent_freqs_array[$date_field_value] = $record['freqvalue_desc']; // $i++; // } $freqVal_dateTime = $record['freqvalue_value']; $freqVal_date = substr($freqVal_dateTime, 0, 10); $freqVal_time = substr($freqVal_dateTime, 10); $dateFieldValues = explode('-', $freqVal_date); $timeFieldValues = explode(':', $freqVal_time); $dateTimeValues = array_merge($dateFieldValues, $timeFieldValues); // setup array to have date field value (i.e. one of YYYY, MM, DD, HH, min, sec values) as index // the value is the frequency type description (i.e. 'January' for MM = 01) $parent_freqs_array[$dateFieldValues[$date_field_id]] = $record['freqvalue_desc']; next($parentFreqValuesArray); } // echo "parent freqs = <pre>".print_r($parent_freqs_array,true)."</pre>"; $this->template->set('parentFreqArray', $parent_freqs_array); // // echo 'parent freq id = '.$parent_freq_id; // // echo 'parent freq array = <pre>'.print_r($parent_freqs_array, true).'</pre>'; } // setup stuff for the calendar in the report $freqVal_dateTime = $freqVal->getFreqValue(); // i.e. getEndDate for weekly stats in app_cim_stats $freqVal_date = substr($freqVal_dateTime, 0, 10); $freqVal_time = substr($freqVal_dateTime, 10); // list( $year, $month, $day ) = explode('-', $freqVal_date ); $dateFieldValues = explode('-', $freqVal_date); $timeFieldValues = explode(':', $freqVal_time); // $month = ltrim($month, "0"); // strips '0's from in front of $month... // $day = ltrim($day, "0"); $dateTimeValues = array_merge($dateFieldValues, $timeFieldValues); $parentDateFieldVal = 0; if (isset($dateFieldValues) && $date_field_id >= 0) { $parentDateFieldVal = $dateFieldValues[$date_field_id]; } if ($currentParentFreqVal != $parentDateFieldVal) { // echo 'start new array<br/>'; $currentParentFreqVal = $parentDateFieldVal; } // echo 'parent val = '.$currentParentFreqVal; $currentParentFreqVal = ltrim($currentParentFreqVal, "0"); // trim any leading zeroes $parentDateValues[$parentIndex] = $currentParentFreqVal; // Go through scope array and set template scope names for the scopes that were user-selected foreach (array_keys($this->scope_ref_array) as $scope_id) { $scope_ref_id = current($this->scope_ref_array); if ($scope_ref_id > 0) { switch ($scope_id) { case RowManager_ScopeManager::SCOPE_MINISTRY: $ministries = new RowManager_MinistryManager($scope_ref_id); $ministryList = $ministries->getListIterator(); $ministryArray = $ministryList->getDataList(); $record = current($ministryArray); $ministryName = $record['ministry_name']; $this->template->set('ministryName', $ministryName); break; case RowManager_ScopeManager::SCOPE_DIVISION: $divisions = new RowManager_DivisionManager($scope_ref_id); $divList = $divisions->getListIterator(); $divArray = $divList->getDataList(); $record = current($divArray); $divisionName = $record['division_name']; $this->template->set('divisionName', $divisionName); break; case RowManager_ScopeManager::SCOPE_REGION: $regions = new RowManager_StatsRegionManager($scope_ref_id); $regionList = $regions->getListIterator(); $regionArray = $regionList->getDataList(); $record = current($regionArray); $regionName = $record['region_desc']; $this->template->set('regionName', $regionName); break; case RowManager_ScopeManager::SCOPE_LOCATION: $locations = new RowManager_LocationManager($scope_ref_id); $locationList = $locations->getListIterator(); $locationArray = $locationList->getDataList(); $record = current($locationArray); $locationName = $record['location_desc']; $this->template->set('locationName', $locationName); break; } } next($this->scope_ref_array); } /** Retrieve values for $freqDesc and $measName **/ $freqTypes = new RowManager_FreqTypeManager(); $freqTypes->setFreqID($this->freq_id); $freqList = $freqTypes->getListIterator(); $freqArray = $freqList->getDataList(); $freqDesc = ''; if (count($freqArray) == 1) { $record = current($freqArray); $freqDesc = $record['freq_desc']; } $measTypes = new RowManager_MeasureTypeManager(); $measTypes->setMeasureID($this->meas_id); $measList = $measTypes->getListIterator(); $measArray = $measList->getDataList(); $measName = ''; if (count($measArray) == 1) { $record = current($measArray); $measName = $record['meas_name']; } // set [Instr] label value replacement values // $instrVars = $freqDesc.','.$measName; // $this->template->set('instrVars', $instrVars); $this->template->set('measName', $measName); $this->template->set('freqName', $freqDesc); $calcList = $this->calcManager->getListIterator(); $calcArray = $calcList->getDataList(); reset($calcArray); $calcNames = array(); $i = 0; foreach (array_keys($calcArray) as $key) { $record = current($calcArray); $calcNames[$i] = $record['filter_name']; next($calcArray); $i++; } // set the additional calculation values (i.e. 'Total', 'Average', etc) $this->template->set('calcNames', $calcNames); // uncomment this line if you are creating a template for this page $templateName = 'page_StatsReport.tpl.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; // temporarily reset the form values so the defaults show up properly in the jumplists $this->formValues['ministry_id'] = $this->linkValues['ministryJumpLink'] . $this->ministry_id; $this->formValues['division_id'] = $this->linkValues['divisionJumpLink'] . $this->division_id; $this->formValues['region_id'] = $this->linkValues['regionJumpLink'] . $this->region_id; // store the page labels in XML format... // NOTE: use this location to update any label tags ... // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common Form data. $this->prepareTemplate($path); // echo "POST = <pre>".print_r($_POST,true)."</pre>"; /* * Form related Template variables: */ // store the button label $this->template->set('buttonText', $this->labels->getLabel('[Update]')); // Insert the date start/end values for the following date fields: // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * Add any additional data required by the template here */ // $person_manager = new RowManager_PersonManager( $this->person_id ); /**** Populate drop-lists for filtering which statistic input fields to show on next page ****/ $jumpLink = $this->linkValues['ministryJumpLink']; $ministryManager = new RowManager_MinistryManager(); $ministryList = new ListIterator($ministryManager); //$ministryManager->getListIterator( ); $ministryArray = $ministryList->getDropListArray(null, $jumpLink); //added jumplink $this->template->set('list_ministry_id', $ministryArray); $jumpLink2 = $this->linkValues['divisionJumpLink']; $divisionManager = $this->division_manager; // new RowManager_DivisionManager( ); $divisionList = new ListIterator($divisionManager); //$divisionManager->getListIterator( ); $divisionArray = $divisionList->getDropListArray(null, $jumpLink2); //added jumplink $this->template->set('list_division_id', $divisionArray); // echo '<pre>'.print_r($divisionArray,true).'</pre>'; $jumpLink3 = $this->linkValues['regionJumpLink']; $regionManager = $this->region_manager; //new RowManager_StatsRegionManager( ); $regionList = new ListIterator($regionManager); //$regionManager->getListIterator( ); $regionArray = $regionList->getDropListArray(null, $jumpLink3); //added jumplink $this->template->set('list_region_id', $regionArray); $locationManager = $this->location_manager; //new RowManager_LocationManager( ); $locationList = $locationManager->getListIterator(); $locationArray = $locationList->getDropListArray(); $this->template->set('list_location_id', $locationArray); $measureManager = new RowManager_MeasureTypeManager(); $measureList = $measureManager->getListIterator(); $measureArray = $measureList->getDropListArray(); $this->template->set('list_meas_id', $measureArray); $freqTypeManager = new RowManager_FreqTypeManager(); $freqTypeList = $freqTypeManager->getListIterator(); $freqTypeArray = $freqTypeList->getDropListArray(); $this->template->set('list_freq_id', $freqTypeArray); // uncomment this line if you are creating a template for this page //$templateName = 'page_EditMyInfo.php'; // otherwise use the generic admin box template $templateName = 'siteFormSingle.php'; 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; // store the page labels in XML format... // NOTE: use this location to update any label tags ... // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common Form data. $this->prepareTemplate($path); /* * Form related Template variables: */ // store the button label $this->template->set('buttonText', $this->labels->getLabel('[Update]')); $cctransWarning = "<div class='notice'>Do <b>NOT</b> refresh the page or re-click the 'Update' button after initially clicking 'Update'.<br> Wait for the confirmation page to be loaded.</div>"; $this->template->set('specialInfo', $cctransWarning); // Insert the date start/end values for the following date fields: // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * Add any additional data required by the template here */ $provinceManager = new RowManager_ProvinceManager(); $provinceList = $provinceManager->getListIterator(); $provinceArray = $provinceList->getDropListArray(); $this->template->set('list_province_id', $provinceArray); $this->template->set('list_person_local_province_id', $provinceArray); // echo '<pre>'.print_r($provinceArray,true).'</pre>'; // get a list of all credit card type IDs $ccType = new RowManager_CreditCardTypeManager(); $ccType->setSortOrder('cctype_id'); $ccTypeList = new ListIterator($ccType); $ccTypeArray = $ccTypeList->getDropListArray(); $this->template->set('list_cctype_id', $ccTypeArray); $this->ticket_price = FormProcessor_Register::TICKET_PRICE; if (strtotime("now") >= strtotime(FormProcessor_Register::LATE_DATE)) { $this->ticket_price += FormProcessor_Register::LATE_FEE; } $totalChoices = 10; $numTicketChoices = array(); for ($i = 1; $i <= $totalChoices; $i++) { $numTicketChoices[$i] = '' . $i . ' ($' . $this->ticket_price * $i . ')'; } $numTicketChoices[$totalChoices] = $numTicketChoices[$totalChoices] . ' (table)'; $this->template->set('list_num_tickets', $numTicketChoices); $donationLink = 'To make a donation towards this event, click <a href = "https://secure.crusade.org/giving/give_ministry.php">here</a> ' . 'and under "Giving Description" enter the following: "Grey Cup Breakfast - 50050".'; $this->template->set('footerContent', $donationLink); $contactInfo = 'Questions? Send an e-mail to: <a href=mailto:tickets@greycupbreakfast.ca>tickets@greycupbreakfast.ca</a>'; $this->template->set('contactInfo', $contactInfo); // uncomment this line if you are creating a template for this page //$templateName = 'page_EditMyInfo.php'; // otherwise use the generic admin box template $templateName = 'page_RegisterForm.tpl.php'; 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); }
/** * 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; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->fields_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_FieldManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'fields_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $dataAccessManager = new RowManager_FieldManager(); $dataAccessManager->setEventID($this->event_id); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new FieldList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ // get a list of all field type IDs $fieldtype = new RowManager_FieldTypeManager(); $fieldtype->setSortOrder('fieldtype_id'); $fieldtypeList = new ListIterator($fieldtype); $fieldtypeArray = $fieldtypeList->getDropListArray(); $this->template->set('list_fieldtype_id', $fieldtypeArray); // get a list of all data types; DB table = reg_cim_datatypes $type = new RowManager_DataTypeManager(); $type->setSortOrder('datatypes_id'); $typeList = new ListIterator($type); $typeArray = $typeList->getDropListArray(); $this->template->set('list_datatypes_id', $typeArray); //TODO: replace this with a reference to a multi_lingual label constant array... $boolArray = array(); $boolArray['0'] = 'false'; $boolArray['1'] = 'true'; $this->template->set('list_fields_hidden', $boolArray); $this->template->set('list_fields_reqd', $boolArray); // get a list of all field priorities (for some possible future use; for ease, requires priority DB table) /* $priority = new RowManager_FieldManager(); $priority->setSortOrder( 'fields_priority' ); $priorityList = new ListIterator($priority); $priorityArray = $priorityList->getDropListArray(); $this->template->set( 'list_fields_priority', $priorityArray ); */ $templateName = 'siteFormDataList.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditFormFields.php'; 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; // temporarily reset the form values so the defaults show up properly in the jumplists $this->formValues['scope_id'] = $this->linkValues['scopeJumpLink'] . $this->scope_id; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->statistic_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ $jumpLink = $this->linkValues['scopeJumpLink']; $scope = new RowManager_ScopeManager(); // $scope->setScopeID( $this->scope_id ); $scope->setSortOrder('scope_id'); $scopeList = new ListIterator($scope); $scopeArray = $scopeList->getDropListArray(null, $jumpLink); //added jumplink $this->template->set('list_scope_id', $scopeArray); /*** USE JUMP/CHANGE-LIST TO GET THE CHOSEN SCOPE ID ***/ /** THEN CREATE A DROP-LIST WITH APPROPRIATE VALUES (i.e. Regions for scope 'Region') **/ // switch (SCOPE) $scopeRefs = $this->scope_ref_manager; //new RowManager_ScopeManager(); // $scope->setScopeID( $this->scope_id ); // $scope->setSortOrder( 'scope_id' ); $scopeRefsList = new ListIterator($scopeRefs); $scopeRefsArray = $scopeRefsList->getDropListArray(); $this->template->set('list_scope_ref_id', $scopeRefsArray); $statDataType = new RowManager_StatDataTypeManager(); $statDataType->setSortOrder('statistic_type_id'); $statDataTypeList = new ListIterator($statDataType); $dataTypes = $statDataTypeList->getDropListArray(); $this->template->set('list_statistic_type_id', $dataTypes); $freqType = new RowManager_FreqTypeManager(); $freqType->setFreqID($this->freq_id); $freqType->setSortOrder('freq_id'); $freqTypeList = new ListIterator($freqType); $freqTypeArray = $freqTypeList->getDropListArray(); $this->template->set('list_freq_id', $freqTypeArray); $measType = new RowManager_MeasureTypeManager(); $measType->setMeasureID($this->meas_id); $measType->setSortOrder('meas_id'); $measTypeList = new ListIterator($measType); $measTypeArray = $measTypeList->getDropListArray(); $this->template->set('list_meas_id', $measTypeArray); /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_StatisticManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'statistic_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $dataAccessManager = new RowManager_StatisticManager(); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new StatisticList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ $templateName = 'page_EditStatistic.tpl.php'; //'siteFormDataList.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditStatistic.php'; 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; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels //$this->linkLabels[ 'edit' ] = $this->labels->getLabel( '[Edit]' ); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->superadmin_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_SuperAdminAssignmentManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'superadmin_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $dataAccessManager = new RowManager_SuperAdminAssignmentManager(); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new SuperAdminAssignmentList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ // get a list of all viewer_id's $viewer = new RowManager_ViewerManager(); $viewer->setSortOrder('viewer_userID'); $viewerList = new ListIterator($viewer); $viewerArray = $viewerList->getDropListArray(); // set the two arrays (making sure they are properly fliped back to // normal) // $viewerArray = array(); // $viewerArray['812'] = "Russ"; // $viewerArray['2878'] = "Hobbe"; // $viewerArray['2931'] = "DC"; $this->template->set('list_viewer_id', $viewerArray); //array_flip( $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_AddSuperAdmin.php'; 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); // do the join // campuses $campusManager = new RowManager_CampusManager(); $campusManager->setSortOrder('campus_desc'); $multiTableManager = new MultiTableManager(); $multiTableManager->addRowManager($campusManager); // prcs $prcManager = new RowManager_PRCManager(); $multiTableManager->addRowManager($prcManager, new JoinPair($campusManager->getJoinOnCampusID(), $prcManager->getJoinOnCampusID())); // semester $semesterManager = new RowManager_SemesterManager(); // TODO update the semester $semesterManager->setSemesterID(1); $multiTableManager->addRowManager($semesterManager, new JoinPair($prcManager->getJoinOnSemesterID(), $prcManager->getJoinOnSemesterID())); // prc method $prcMethodManager = new RowManager_PrcMethodManager(); $multiTableManager->addRowManager($prcMethodManager, new JoinPair($prcManager->getJoinOnPrcMethodID(), $prcMethodManager->getJoinOnPrcMethodID())); // get ready to make the xml $xmlObject = new XMLObject(); // HEADER //$reportInfoXMLObject = new XMLObject('PRC_REPORT'); //$xmlObject->addXMLObject( $reportInfoXMLObject ); // END HEADER // BODY $bodyXMLObject = new XMLObject('PRC_FOR_SEMESTER'); // construct the iterator $list = new ListIterator($multiTableManager); $list->setFirst(); while ($list->moveNext()) { $itemXMLObject = $list->getCurrentRowXMLObject(false, 'IndividualPRC'); // Finally add this row into the bigger picture $bodyXMLObject->addXMLObject($itemXMLObject); } // multiTableManager->moveNext() $xmlObject->addXMLObject($bodyXMLObject); $xmlDoc = new DOMDocument(); $xmlDoc->loadXML($xmlObject->getXML(false, 'PRCReport')); $numBytesWritten = $xmlDoc->save($this->pathModuleRoot . 'prcReport.xml'); // echo 'Written '.$numBytesWritten.' bytes'; // save the xml data onto the server // return $xmlDoc->saveXML(); // ------- PART 2 -------- // WEEKLY STATS $multiTableManager = new MultiTableManager(); $weeklyManager = new RowManager_WeeklyReportManager(); $multiTableManager->addRowManager($weeklyManager); $campusManager = new RowManager_CampusManager(); $campusManager->setSortOrder('campus_desc'); $multiTableManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(), $weeklyManager->getJoinOnCampusID())); $weekManager = new RowManager_WeekManager(); $multiTableManager->addRowManager($weekManager, new JoinPair($weekManager->getJoinOnWeekID(), $weeklyManager->getJoinOnWeekID())); $staffManager = new RowManager_StaffManager(); $multiTableManager->addRowManager($staffManager, new JoinPair($weeklyManager->getJoinOnStaffID(), $staffManager->getJoinOnStaffID())); $personManager = new RowManager_PersonManager(); $multiTableManager->addRowManager($personManager, new JoinPair($personManager->getJoinOnPersonID(), $staffManager->getJoinOnPersonID())); // get ready to make the xml $xmlObject = new XMLObject(); // HEADER //$reportInfoXMLObject = new XMLObject('PRC_REPORT'); //$xmlObject->addXMLObject( $reportInfoXMLObject ); // END HEADER // BODY $bodyXMLObject = new XMLObject('WEEKLY_FOR_SEMESTER'); // construct the iterator $list = new ListIterator($multiTableManager); $list->setFirst(); while ($list->moveNext()) { $itemXMLObject = $list->getCurrentRowXMLObject(false, 'IndividualWeek'); // Finally add this row into the bigger picture $bodyXMLObject->addXMLObject($itemXMLObject); } // multiTableManager->moveNext() $xmlObject->addXMLObject($bodyXMLObject); $xmlDoc = new DOMDocument(); $xmlDoc->loadXML($xmlObject->getXML(false, 'Report')); $numBytesWritten = $xmlDoc->save($this->pathModuleRoot . 'weeklyReport.xml'); // echo 'Written '.$numBytesWritten.' bytes'; // save the xml data onto the server // return $xmlDoc->saveXML(); // ------- PART 3 -------- $multiTableManager = new MultiTableManager(); $campusStatsManager = new RowManager_MoreStatsManager(); $multiTableManager->addRowManager($campusStatsManager); $campusManager = new RowManager_CampusManager(); $campusManager->setSortOrder('campus_desc'); $multiTableManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(), $campusStatsManager->getJoinOnCampusID())); $weekManager = new RowManager_WeekManager(); $multiTableManager->addRowManager($weekManager, new JoinPair($campusStatsManager->getJoinOnWeekID(), $weekManager->getJoinOnWeekID())); $expTypeManager = new RowManager_ExposureTypeManager(); $multiTableManager->addRowManager($expTypeManager, new JoinPair($campusStatsManager->getJoinOnExpTypeID(), $expTypeManager->getJoinOnExpTypeID())); $count = 0; // get ready to make the xml $xmlObject = new XMLObject(); // HEADER //$reportInfoXMLObject = new XMLObject('PRC_REPORT'); //$xmlObject->addXMLObject( $reportInfoXMLObject ); // END HEADER // BODY $bodyXMLObject = new XMLObject('CAMPUS_REPORT'); // construct the iterator $list = new ListIterator($multiTableManager); $list->setFirst(); while ($list->moveNext()) { $itemXMLObject = $list->getCurrentRowXMLObject(false, 'Activity'); $count++; // Finally add this row into the bigger picture $bodyXMLObject->addXMLObject($itemXMLObject); } // multiTableManager->moveNext() echo 'the count is [' . $count . ']<br/>'; $xmlObject->addXMLObject($bodyXMLObject); $xmlDoc = new DOMDocument(); $xmlDoc->loadXML($xmlObject->getXML(false, 'Report')); $numBytesWritten = $xmlDoc->save($this->pathModuleRoot . 'campusReport.xml'); // echo 'Written '.$numBytesWritten.' bytes'; // save the xml data onto the server // return $xmlDoc->saveXML(); // --------------- // OK DONE! // NOTE: this parent method prepares the $this->template with the // common Display data. $this->prepareTemplate($path); // uncomment this line if you are creating a template for this page $templateName = 'page_Reports.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; // store the page labels in XML format... // NOTE: use this location to update any label tags ... // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common Form data. $this->prepareTemplate($path); /* * Form related Template variables: */ // store the button label $this->template->set('buttonText', $this->labels->getLabel('[Update]')); // Insert the date start/end values for the following date fields: // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * Add any additional data required by the template here */ /* //get a list of campuses that you have access to $campusManager = new RowManager_CampusManager(); $campusManagerList = new ListIterator($campusManager); $campusArray = $campusManagerList->getDropListArray(); $this->template->set('list_campus_id',$campusArray ); $permissionsCampusAdminManager = new RowManager_PermissionsCampusAdminManager(); $permissionsCampusAdminManager->setViewerID($this->viewer->getViewerID()); $permissionsCampusAdminManagerList = new ListIterator($permissionsCampusAdminManager); $permissionsCampusArray = $permissionsCampusAdminManagerList->getDropListArray(); echo"<br>".print_r ($permissionsCampusArray)."<br>"; $this->template->set('list_campus_id',$permissionsCampusArray );*/ // get a list of all group types $groupType = new RowManager_GroupTypeManager(); $groupTypeList = new ListIterator($groupType); $groupArray = $groupTypeList->getDropListArray(); $this->template->set('list_groupType_id', $groupArray); // uncomment this line if you are creating a template for this page //$templateName = 'page_ManageGroup.php'; // otherwise use the generic admin box template $templateName = 'siteFormSingle.php'; return $this->template->fetch($templateName); }
function getScheduleData() { //The array to be send $timeBlocksArray = array(); if ($this->scheduleID < 1) { print "No Schedule found for your ID"; $timeBlocksArray = null; } else { //Returns a row of the database with the scheduleID $scheduleBlocksManager = new RowManager_ScheduleBlocksManager(); $scheduleBlocksManager->setScheduleID($this->scheduleID); //Go through the row returned $scheduleBlocksList = new ListIterator($scheduleBlocksManager); $scheduleBlocksList->setFirst(); $timeBlock = -1; while ($scheduleBlocksList->moveNext()) { //get the time block in that row $blocksManager = $scheduleBlocksList->getCurrent(new RowManager_ScheduleBlocksManager()); $timeBlock = $blocksManager->getTimeBlock(); //save the timeblock to the array and keep looping to get all of them $timeBlocksArray[] = $timeBlock; } } //Pass the data to the template for display return $this->template->set('timeBlocksArray', $timeBlocksArray); }