Ejemplo n.º 1
0
 /**
  * Set general info 
  */
 protected function setGeneralInfo()
 {
     if (strlen(SessionAccountHandler::getName()) > 0) {
         $this->XML->AthleteLog->Athlete->addAttribute('Name', SessionAccountHandler::getName());
     }
     $this->Activity->addAttribute('StartTime', $this->timeToString($this->Context->activity()->timestamp()));
     $this->Activity->Duration->addAttribute('TotalSeconds', (int) $this->Context->activity()->duration());
     $this->Activity->Distance->addAttribute('TotalMeters', 1000 * $this->Context->activity()->distance());
     $this->Activity->Calories->addAttribute('TotalCal', $this->Context->activity()->calories());
 }
Ejemplo n.º 2
0
 /**
  * Parse all post values 
  */
 public function parsePostData()
 {
     if ($_POST['name'] != SessionAccountHandler::getName()) {
         DB::getInstance()->update('account', SessionAccountHandler::getId(), 'name', $_POST['name']);
     }
     if ($_POST['allow_mails'] != SessionAccountHandler::getAllowMails()) {
         DB::getInstance()->update('account', SessionAccountHandler::getId(), 'allow_mails', $_POST['allow_mails']);
     }
     if ($_POST['language'] != SessionAccountHandler::getLanguage()) {
         DB::getInstance()->update('account', SessionAccountHandler::getId(), 'language', $_POST['language']);
         Language::setLanguage($_POST['language']);
         echo Ajax::wrapJS('document.cookie = "lang=" + encodeURIComponent("' . addslashes($_POST['language']) . '");');
         Ajax::setReloadFlag(Ajax::$RELOAD_PAGE);
     }
     if ($_POST['new_pw'] != '') {
         $this->tryToChangePassword();
     }
 }