admin page v1
This commit is contained in:
25
inc/spot.php
25
inc/spot.php
@@ -327,6 +327,31 @@ class Spot extends Main
|
||||
return self::getJsonResult(true, '');
|
||||
}
|
||||
|
||||
public function getAdminSettings() {
|
||||
return self::getJsonResult(true, '', array('projects'=>$this->oProject->getProjects()));
|
||||
}
|
||||
|
||||
public function setAdminSettings($sField, $sValue) {
|
||||
$bSuccess = false;
|
||||
$sDesc = '';
|
||||
|
||||
switch($sField) {
|
||||
case 'codename':
|
||||
$bSuccess = $this->oProject->setProjectCodeName($sValue);
|
||||
break;
|
||||
case 'active_from':
|
||||
case 'active_to':
|
||||
$bSuccess = $this->oProject->setActivePeriod($sValue, mb_substr($sField, 7));
|
||||
break;
|
||||
case 'timezone':
|
||||
$bSuccess = $this->oProject->setTimeZone($sValue);
|
||||
break;
|
||||
}
|
||||
if(!$bSuccess) $sDesc = 'Issue committing to DB';
|
||||
|
||||
return self::getJsonResult($bSuccess, $sDesc, array('values'=>$this->oProject->getProject()));
|
||||
}
|
||||
|
||||
public static function DecToDMS($dValue, $sType='lat') {
|
||||
if($sType=='lat') $sDirection = ($dValue >= 0)?'N':'S';
|
||||
else $sDirection = ($dValue >= 0)?'E':'W';
|
||||
|
||||
Reference in New Issue
Block a user