示例#1
0
 function display($tpl = null)
 {
     $user = JFactory::getUser();
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $navbar = $params->get('navbar');
     $doma = $params->get('doma_installed');
     $item = $this->get('Item');
     $this->item = $item;
     $this->form = $this->get('Form');
     if ($doma) {
         $maplist = $this->get('Maplist');
         $maps = $this->get('Maps');
     }
     $competition = $this->get('Competition');
     $complists = ListHTraininglogsHelper::getcomplists($user->id);
     $medialist = $this->get('Medialist');
     $media = $this->get('Media');
     $istemphr = $this->get('Ishr');
     // are there HR data in temp table
     $splittimes = $this->get('Splittimes');
     $groupparams = HTraininglogsHelper::getGroupparams();
     $startpoint = $this->get('Startpoint');
     if ($istemphr) {
         $hrdata = $this->get('Hrdata');
     } else {
         $intensities = $this->get('Intensities');
         $technics = $this->get('Technics');
         $tools = $this->get('Tools');
         $this->intensity = $intensities;
         $this->technic = $technics;
         $this->tool = $tools;
         $this->groupparams = $groupparams;
     }
     $this->form->bind($item);
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     $this->item = $item;
     $this->competition = $competition;
     $this->istemphr = $istemphr;
     $this->navbar = $navbar;
     $this->maplist = $maplist;
     $this->medialist = $medialist;
     $this->complists = $complists;
     $this->maps = $maps;
     $this->media = $media;
     $this->split = $splittimes;
     $this->startpoint = $startpoint;
     $this->_prepareDocument();
     if ($istemphr) {
         graphHTraininglogsHelper::prepare_daygraph($hrdata, $groupparams);
         gpsHTraininglogsHelper::prepare_gps_track($hrdata, $groupparams, $hrdata[0]->gpsdetails);
     }
     parent::display($tpl);
 }
示例#2
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $Itemid = JRequest::getVar('Itemid');
     $state = $this->get('State');
     $items = $this->get('Items');
     $search = $this->get('Searchfilter');
     $filterlists = $this->get('Filterlists');
     $this->groupparams = HTraininglogsHelper::getGroupparams();
     $yachs = JRequest::getVar('yachs', 'ttime');
     $sport = JRequest::getVar('sport', '*');
     if (count($items) > 0) {
         $sumitems = $this->get('Sumitems');
         $graphdata = $this->get('Graphdata');
         $gps = $this->get('Gps');
         $this->graphdata = $graphdata;
         $this->gps = $gps;
     }
     //   	JLoader::register('HTraininglogsHelper', JPATH_COMPONENT.'/helpers/helper.php');
     //       $sumitems= HTraininglogsHelper::getSum($period);
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Check whether SearchPage access level allows access.
     $user = JFactory::getUser();
     $this->state = $state;
     $this->items = $items;
     $this->search = $search;
     $this->sumitems = $sumitems;
     //		$this->period = $period;
     $this->Itemid = $Itemid;
     $this->filterlists = $filterlists;
     //print_r($this->filterlists->oparr.'KLLLKKK');
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->_prepareDocument();
     if (count($items) > 0) {
         graphHTraininglogsHelper::prepare_weekgraph($tems, $groupparams, $yachs, $sport);
         $start_points = $model->GetStartpoints($period, $user, $sport);
         gpsHTraininglogsHelper::prepare_startpointmap($start_points);
     }
     parent::display($tpl);
 }
示例#3
0
 function display($tpl = null)
 {
     $user = JFactory::getUser();
     $model = $this->getModel('sessions');
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->navbar = $params->get('navbar');
     $doma_installed = $params->get('doma_installed');
     $Itemid = JRequest::getVar('Itemid');
     $date1 = JRequest::getVar('date');
     $yachs = JRequest::getVar('yachs', 'ntime');
     $sport = JRequest::getVar('sport', '*');
     $this->yachsarr = array(JHTML::_('select.option', 'ntime', JText::_('COM_HTRAININGLOGS_TIME')), JHTML::_('select.option', 'etime', JText::_('COM_HTRAININGLOGS_ETIME')), JHTML::_('select.option', 'km', JText::_('COM_HTRAININGLOGS_KM')));
     $this->sportarray = $model->getsportartarray($user);
     $currentpage = JRequest::getVar('page', 'weekpage');
     $period = $this->_getPeriod($date1, $currentpage, $user);
     $groupparams = HTraininglogsHelper::getGroupparams();
     $page = $model->getpageviewportlets($currentpage);
     $this->Itemid = $Itemid;
     $this->currentpage = $currentpage;
     $this->groupparams = $groupparams;
     $this->period = $period;
     $this->tdate = $this->period->enddat->format('Y-m-d');
     $this->page = $page;
     $this->yachs = $yachs;
     $this->sport = $sport;
     $summaryitems = $model->getSummeryItems($period, $yachs, $sport);
     $this->summaryitems = $summaryitems;
     //	print_r($page);exit;
     if ($page->sum_table) {
     }
     //end:summary view
     if ($page->hr_graph || $page->gpstrack_map || $page->gpstrack_olmap || $page->day_table) {
         $sessions = $model->getSessions($period, $user, $sport);
         if ($page->hr_graph || $page->gpstrack_map || $page->gpstrack_olmap) {
             $sessions = $model->getSessiondetails($sessions);
             if ($page->hr_graph) {
                 graphHTraininglogsHelper::prepare_daygraph($sessions, $groupparams);
             }
             if ($page->gpstrack_map) {
                 $sessions_gps = $model->getGPSdetails($period);
                 $this->sessions_gps = $sessions_gps;
                 gpsHTraininglogsHelper::prepare_gps_track($sessions, $groupparams, $sessions_gps);
             }
             if ($page->gpstrack_olmap) {
                 $sessions_gpsextent = $model->getGPSExtent($period);
                 if ($doma_installed) {
                     $this->sessions_omaps = $model->getOMaps($period);
                 }
                 $this->olmapdetails = gpsHTraininglogsHelper::prepare_gps_oltrack($sessions, $groupparams, $sessions_gpsextent);
             }
         }
         if ($page->day_table) {
             $sessions = $model->getSessionIntensities($sessions);
         }
         $this->sessions = $sessions;
     }
     if ($page->week_table || $page->week_graph) {
         $weekitems = $model->GetWeekItems($period, $user, $yachs, $sport);
         if ($page->week_table) {
             $this->weekitems = $weekitems;
         }
         if ($page->week_graph) {
             graphHTraininglogsHelper::prepare_weekgraph($weekitems, $groupparams, $yachs, $sport, $page->week_graph);
         }
     }
     if ($page->month_table || $page->month_graph) {
         $monthitems = $model->GetMonthItems($period, $user, $yachs, $sport);
         if ($page->month_table) {
             $this->monthitems = $monthitems;
         }
         if ($page->month_graph) {
             $graphitems = $model->GetMonthGraphItems($monthitems->itemsfull, $monthitems->itemsback, $period);
             graphHTraininglogsHelper::prepare_monthgraph($graphitems, $groupparams, $yachs, $sport, $page->month_graph);
         }
     }
     if ($page->year_table || $page->year_graph) {
         $yearitems = $model->GetYearItems($period, $user, $yachs, $sport);
         if ($page->year_graph) {
             //$yeargraphdata	= $model->GetYearGraphdata($period,$user);
             graphHTraininglogsHelper::prepare_yeargraph($yearitems, $groupparams, $yachs, $sport, $page->year_graph);
         }
         if ($page->year_table) {
             $this->yearitems = $yearitems;
         }
     }
     if ($page->life_table || $page->life_graph) {
         $lifeitems = $model->GetLifeItems($period, $user, $yachs, $sport);
         if ($page->life_graph) {
             graphHTraininglogsHelper::prepare_lifegraph($lifeitems, $groupparams, $yachs, $sport, $page->life_graph);
         }
         if ($page->life_table) {
             $this->lifeitems = $lifeitems;
         }
     }
     if ($page->startpoint_map) {
         $start_points = $model->GetStartpoints($period, $user, $sport);
         gpsHTraininglogsHelper::prepare_startpointmap($start_points);
     }
     if ($page->fitness_data || $page->fitness_graphs) {
         $fitnessdataitembased = $model->getFitnessdataitembased($period, $user);
         $fitnessdatavaluebased = $model->getFitnessdatavaluebased($period, $user);
         if ($page->fitness_data) {
             $this->fitnessdataitembased = $fitnessdataitembased;
             $this->fitnessdatavaluebased = $fitnessdatavaluebased;
             $this->fitnessblog = $model->getfitnessblog($period, $page, $user);
         }
         if ($page->fitness_graphs) {
             $fitnessgraphitembased = $model->getfitnessgraphitembased($fitnessdataitembased, $period, $user);
             $fitnessgraphvaluebased = $model->getfitnessgraphvaluebased($fitnessdatavaluebased, $period, $user, $currentpage);
             graphHTraininglogsHelper::prepare_fitnessitembasedgraph($fitnessdataitembased, $fitnessgraphitembased);
             graphHTraininglogsHelper::prepare_fitnessvaluebasedgraph($fitnessdatavaluebased, $fitnessgraphvaluebased);
         }
     }
     if ($currentpage == 'daypage') {
         $this->heading = JText::_('COM_HTRAININGLOGS_DAYPAGEVIEW');
         $this->datetext = $this->period->enddat->format('d. m. Y');
     } else {
         if ($currentpage == 'weekpage') {
             $this->heading = JText::_('COM_HTRAININGLOGS_WEEKPAGE');
             $this->datetext = $this->period->anfdat->format('d. m.') . ' - ' . $this->period->enddat->format('d. m. Y');
         } else {
             if ($currentpage == 'monthpage') {
                 $this->heading = JText::_('COM_HTRAININGLOGS_MONTHPAGE');
                 $this->datetext = $this->period->anfdat->format('d. m.') . ' - ' . $this->period->enddat->format('d. m. Y');
             } else {
                 if ($currentpage == 'yearpage') {
                     $this->heading = JText::_('COM_HTRAININGLOGS_YEARPAGE');
                     $this->datetext = $this->period->anfdat->format('d. m. Y') . ' - ' . $this->period->enddat->format('d. m. Y');
                 } else {
                     if ($currentpage == 'lifepage') {
                         $this->heading = JText::_('COM_HTRAININGLOGS_LIFEPAGEVIEW');
                         $this->datetext = $this->period->anfdat->format('d. m. Y') . ' - ' . $this->period->enddat->format('d. m. Y');
                     }
                 }
             }
         }
     }
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->_prepareDocument();
     parent::display($tpl);
 }