Example #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);
 }
Example #2
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $model = $this->getModel('plansessions');
     $user = JFactory::getUser();
     $this->state = $this->get('State');
     $trainingbook = $app->getUserState("com_htraininglogs.filter.trainingbook", NULL);
     $this->trainingbook = $trainingbook;
     $params = $app->getParams();
     $doma_installed = $params->get('doma_installed');
     $date1 = $this->state->get('filter.date1');
     $yachs = $this->state->get('filter.yachs');
     $currentpage = $this->state->get('filter.currentpage');
     $period = HTraininglogsHelper::getPeriod($date1, $currentpage, $trainingbook->user_id);
     $groupparams = HTraininglogsHelper::getGroupparams();
     $portlets = $model->getpageviewportlets($currentpage, $trainingbook);
     $this->currentpage = $currentpage;
     $this->groupparams = $groupparams;
     $this->period = $period;
     $this->yachs = $yachs;
     $this->tdate = $this->period->enddat->format('Y-m-d');
     $this->portlets = $portlets;
     $portletarray = array();
     $itemarray = array();
     $this->results = array();
     foreach ($portlets as $i => $portlet) {
         $portletexists = array_search($portlet->view_data, $portletarray);
         if (!$portletexists) {
             $plansessionshelper = $portlet->view_data . 'HTraininglogsHelper';
             JLoader::register($plansessionshelper, JPATH_COMPONENT . '/sessionshelpers/' . $portlet->view_data . 'helper.php');
             $this->items[$i] = $plansessionshelper::getItems($period, $user, $yachs, $sport, $currentpage);
             $itemarray[$i] = $this->items[$i];
         } else {
             $this->items[$i] = $itemarray[$portletexists];
         }
         $this->results[$i] = count($this->items[$i]);
         if (file_exists(JPATH_COMPONENT . '/plansessionshelpers/' . $portlet->title . 'posthelper.php')) {
             $plansessionsposthelper = $portlet->title . 'post' . 'HTraininglogsHelper';
             JLoader::register($plansessionsposthelper, JPATH_COMPONENT . '/plansessionshelpers/' . $portlet->title . 'posthelper.php');
             $this->items[$i] = $plansessionsposthelper::postprocess($this->items[$i], $groupparams, $user, $yachs, $sport, $period);
         }
         array_push($portletarray, $portlet->view_data);
     }
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->_preparePageheader($currentpage);
     $this->_prepareDocument();
     parent::display($tpl);
 }
Example #3
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);
 }
Example #4
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);
 }