<?php include_once __DIR__ . "/../include/header.php"; MSergeev\Core\Lib\Buffer::setTitle("Топливо - Добавление данных о заправке"); use MSergeev\Packages\Icar\Lib; use MSergeev\Core\Lib\Options; if (isset($_REQUEST['car']) && intval($_REQUEST['car']) > 0) { $carID = intval($_REQUEST['car']); } else { $carID = Lib\MyCar::getDefaultCarID(); } if (!($fuelMarkSelected = Options::getOptionInt('icar_last_fuelmark_' . $carID))) { $fuelMarkSelected = 'null'; } if (isset($_POST['action']) && intval($_POST['action']) == 1) { if (Lib\Fuel::addFuelFromPost($_POST)) { echo '<span class="ok">Данные успешно добавлены</span>'; } else { echo '<span class="err">Ошибка добавления данных</span>'; } } //msDebug(Lib\Odo::getMaxOdo($carID)); ?> <form action="" method="post"> <table class="add_ts"> <tr> <td class="title">Автомобиль</td> <td><?php echo Lib\MyCar::showSelectCars("my_car", $carID, 'class="myCar"'); ?> </td>
<?php /** * MSergeev * @package core * @author Mikhail Sergeev * @copyright 2016 Mikhail Sergeev */ use MSergeev\Core\Lib; __include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/data_base.php"); $DB = new Lib\DataBase(); $GLOBALS['DB'] = $DB; __include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/options.php"); Lib\Options::init(); __include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/loader.php"); Lib\Loader::init(); __include_once(Lib\Config::getConfig('CORE_ROOT') . "lib/users.php"); $USER = new Lib\Users(); $GLOBALS['USER'] = $USER; //***** Exception ******** Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "exception/", array("system_exception.php", "argument_exception.php", "db_exception.php", "sql_exception.php", "io_exception.php")); //***** Lib ********* Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "lib/", array(), array("data_base.php", "options.php", "config.php", "loader.php", "users.php")); Lib\Loc::setModuleMessages(); //***** Entity ******** Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "entity/", array("field.php", "scalar_field.php", "date_field.php")); //***** Tables ******** Lib\Loader::includeFiles(Lib\Config::getConfig('CORE_ROOT') . "tables/");
MSergeev\Core\Lib\Loader::IncludePackage("finances"); use MSergeev\Core\Exception; use MSergeev\Core\Lib; $arParams = $arReturn = array(); $arReturn['status'] = 'ok'; $bStatus = true; //Проверка переданных полей if (true) { try { if (isset($_REQUEST['category'])) { $arParams['CATEGORY'] = trim(htmlspecialchars($_REQUEST['category'])); } else { throw new Exception\ArgumentNullException('category'); } if (isset($_REQUEST['status'])) { $arParams['STATUS'] = intval($_REQUEST['status']); } else { throw new Exception\ArgumentNullException('status'); } } catch (Exception\ArgumentNullException $e) { $e->showException(); $arReturn['status'] = 'error'; $bStatus = false; } } if ($bStatus) { Lib\Options::setOption('FINANCES_DEPLOY_' . $arParams['CATEGORY'], $arParams['STATUS']); //$arReturn = array_merge($arReturn,$arParams); } header('Content-Type: application/json'); echo json_encode($arReturn);
<?php include_once __DIR__ . "/../include/header.php"; MSergeev\Core\Lib\Buffer::setTitle("ТО - Добавление данных о прохождении ТО"); use MSergeev\Packages\Icar\Lib; use MSergeev\Core\Lib\Options; if (isset($_REQUEST['car']) && intval($_REQUEST['car']) > 0) { $carID = intval($_REQUEST['car']); } else { $carID = Lib\MyCar::getDefaultCarID(); } $lastTs = Options::getOptionInt('icar_last_ts_' . $carID); $lastExecutor = Options::getOptionInt('icar_last_executor_' . $carID); $lastPoint = Options::getOptionInt('icar_last_executor_' . $carID . '_point'); if (isset($_POST['action']) && intval($_POST['action']) == 1) { if (Lib\Ts::addTsFromPost($_POST)) { echo '<span class="ok">Данные успешно добавлены</span>'; } else { echo '<span class="err">Ошибка добавления данных</span>'; } } //msDebug(Lib\Odo::getMaxOdo($carID)); ?> <form action="" method="post"> <table class="add_ts"> <tr> <td class="title">Автомобиль</td> <td><?php echo Lib\MyCar::showSelectCars("my_car", $carID, 'class="myCar"'); ?> </td>
public static function getDefaultCurrency() { return CoreLib\Options::getOptionStr('finances_default_currency'); }
protected static function getWeatherArray($cityID = null) { try { if (is_null($cityID)) { throw new Exception\ArgumentNullException('cityID'); } if ($cityID <= 0) { throw new Exception\ArgumentOutOfRangeException('cityID', '>0'); } } catch (Exception\ArgumentNullException $e) { $e->showException(); return false; } catch (Exception\ArgumentOutOfRangeException $e2) { $e2->showException(); return false; } $appID = Options::getOptionStr('OWM_APP_ID'); //TODO: В рабочей версии восстановить //if ($weatherXML = simplexml_load_file("http://api.openweathermap.org/data/2.5/forecast?id=".$cityID."&appid=".$appID."&mode=xml&units=metric&lang=ru")) if ($weatherXML = simplexml_load_string('<weatherdata><location><name>Moscow</name><type></type><country>RU</country><timezone></timezone><location altitude="0" latitude="55.75222" longitude="37.615555" geobase="geonames" geobaseid="0"></location></location><credit></credit><meta><lastupdate></lastupdate><calctime>0.0056</calctime><nextupdate></nextupdate></meta><sun rise="2016-10-04T03:39:56" set="2016-10-04T14:54:57"></sun><forecast><time from="2016-10-04T12:00:00" to="2016-10-04T15:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.055" type="rain"></precipitation><windDirection deg="11.0186" code="N" name="North"></windDirection><windSpeed mps="3.46" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="14.84" min="9.71" max="14.84"></temperature><pressure unit="hPa" value="1011.28"></pressure><humidity value="96" unit="%"></humidity><clouds value="broken clouds" all="80" unit="%"></clouds></time><time from="2016-10-04T15:00:00" to="2016-10-04T18:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.26" type="rain"></precipitation><windDirection deg="29.5031" code="NNE" name="North-northeast"></windDirection><windSpeed mps="3.21" name="Light breeze"></windSpeed><temperature unit="celsius" value="12.79" min="8.94" max="12.79"></temperature><pressure unit="hPa" value="1011.89"></pressure><humidity value="96" unit="%"></humidity><clouds value="broken clouds" all="76" unit="%"></clouds></time><time from="2016-10-04T18:00:00" to="2016-10-04T21:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.17" type="rain"></precipitation><windDirection deg="28.0061" code="NNE" name="North-northeast"></windDirection><windSpeed mps="3.58" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="11.2" min="8.63" max="11.2"></temperature><pressure unit="hPa" value="1011.58"></pressure><humidity value="96" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-04T21:00:00" to="2016-10-05T00:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="1.215" type="rain"></precipitation><windDirection deg="47.5038" code="NE" name="NorthEast"></windDirection><windSpeed mps="3.46" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="11.16" min="9.88" max="11.16"></temperature><pressure unit="hPa" value="1011.72"></pressure><humidity value="96" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-05T00:00:00" to="2016-10-05T03:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.405" type="rain"></precipitation><windDirection deg="58.0037" code="ENE" name="East-northeast"></windDirection><windSpeed mps="3.61" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="11.27" min="11.27" max="11.27"></temperature><pressure unit="hPa" value="1012.59"></pressure><humidity value="99" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-05T03:00:00" to="2016-10-05T06:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.025" type="rain"></precipitation><windDirection deg="62.5028" code="ENE" name="East-northeast"></windDirection><windSpeed mps="4.02" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="12.14" min="12.14" max="12.14"></temperature><pressure unit="hPa" value="1013.47"></pressure><humidity value="99" unit="%"></humidity><clouds value="broken clouds" all="56" unit="%"></clouds></time><time from="2016-10-05T06:00:00" to="2016-10-05T09:00:00"><symbol number="802" name="слегка облачно" var="03d"></symbol><precipitation></precipitation><windDirection deg="68.0068" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.1" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="14.15" min="14.15" max="14.15"></temperature><pressure unit="hPa" value="1014.51"></pressure><humidity value="95" unit="%"></humidity><clouds value="scattered clouds" all="32" unit="%"></clouds></time><time from="2016-10-05T09:00:00" to="2016-10-05T12:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.04" type="rain"></precipitation><windDirection deg="66.5046" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.67" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="15" min="15" max="15"></temperature><pressure unit="hPa" value="1015.35"></pressure><humidity value="87" unit="%"></humidity><clouds value="broken clouds" all="64" unit="%"></clouds></time><time from="2016-10-05T12:00:00" to="2016-10-05T15:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.05" type="rain"></precipitation><windDirection deg="58.5007" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.33" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="13.36" min="13.36" max="13.36"></temperature><pressure unit="hPa" value="1016.53"></pressure><humidity value="83" unit="%"></humidity><clouds value="overcast clouds" all="88" unit="%"></clouds></time><time from="2016-10-05T15:00:00" to="2016-10-05T18:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.21" type="rain"></precipitation><windDirection deg="59.5087" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.53" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="11.56" min="11.56" max="11.56"></temperature><pressure unit="hPa" value="1017.88"></pressure><humidity value="87" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-05T18:00:00" to="2016-10-05T21:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.28" type="rain"></precipitation><windDirection deg="59.0015" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.38" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="10.08" min="10.08" max="10.08"></temperature><pressure unit="hPa" value="1019.14"></pressure><humidity value="89" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-05T21:00:00" to="2016-10-06T00:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.21" type="rain"></precipitation><windDirection deg="58.0012" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.36" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="8.95" min="8.95" max="8.95"></temperature><pressure unit="hPa" value="1020.09"></pressure><humidity value="92" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-06T00:00:00" to="2016-10-06T03:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.19" type="rain"></precipitation><windDirection deg="61.002" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.24" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="8.05" min="8.05" max="8.05"></temperature><pressure unit="hPa" value="1020.95"></pressure><humidity value="91" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-06T03:00:00" to="2016-10-06T06:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.08" type="rain"></precipitation><windDirection deg="65.5018" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.41" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="7.78" min="7.78" max="7.78"></temperature><pressure unit="hPa" value="1021.36"></pressure><humidity value="88" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-06T06:00:00" to="2016-10-06T09:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.09" type="rain"></precipitation><windDirection deg="66.5026" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.18" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="8.37" min="8.37" max="8.37"></temperature><pressure unit="hPa" value="1021.75"></pressure><humidity value="84" unit="%"></humidity><clouds value="broken clouds" all="80" unit="%"></clouds></time><time from="2016-10-06T09:00:00" to="2016-10-06T12:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.05" type="rain"></precipitation><windDirection deg="65.002" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.31" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="8.68" min="8.68" max="8.68"></temperature><pressure unit="hPa" value="1021.11"></pressure><humidity value="80" unit="%"></humidity><clouds value="broken clouds" all="80" unit="%"></clouds></time><time from="2016-10-06T12:00:00" to="2016-10-06T15:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.03" type="rain"></precipitation><windDirection deg="64.5009" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.77" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="8.08" min="8.08" max="8.08"></temperature><pressure unit="hPa" value="1020.54"></pressure><humidity value="75" unit="%"></humidity><clouds value="overcast clouds" all="88" unit="%"></clouds></time><time from="2016-10-06T15:00:00" to="2016-10-06T18:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.05" type="rain"></precipitation><windDirection deg="66.5008" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.46" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="7.4" min="7.4" max="7.4"></temperature><pressure unit="hPa" value="1019.95"></pressure><humidity value="76" unit="%"></humidity><clouds value="overcast clouds" all="88" unit="%"></clouds></time><time from="2016-10-06T18:00:00" to="2016-10-06T21:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.03" type="rain"></precipitation><windDirection deg="69.5045" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.06" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="6.7" min="6.7" max="6.7"></temperature><pressure unit="hPa" value="1018.75"></pressure><humidity value="76" unit="%"></humidity><clouds value="overcast clouds" all="88" unit="%"></clouds></time><time from="2016-10-06T21:00:00" to="2016-10-07T00:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.02" type="rain"></precipitation><windDirection deg="69.0002" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.22" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="6.12" min="6.12" max="6.12"></temperature><pressure unit="hPa" value="1017.54"></pressure><humidity value="78" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T00:00:00" to="2016-10-07T03:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.03" type="rain"></precipitation><windDirection deg="68.5041" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.71" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="5.42" min="5.42" max="5.42"></temperature><pressure unit="hPa" value="1015.96"></pressure><humidity value="79" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T03:00:00" to="2016-10-07T06:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.1" type="rain"></precipitation><windDirection deg="68.5001" code="ENE" name="East-northeast"></windDirection><windSpeed mps="6.23" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="5.3" min="5.3" max="5.3"></temperature><pressure unit="hPa" value="1014.52"></pressure><humidity value="82" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T06:00:00" to="2016-10-07T09:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.11" type="rain"></precipitation><windDirection deg="69.0056" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.9" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="6.1" min="6.1" max="6.1"></temperature><pressure unit="hPa" value="1013.57"></pressure><humidity value="79" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T09:00:00" to="2016-10-07T12:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.45" type="rain"></precipitation><windDirection deg="68.0005" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.76" name="Moderate breeze"></windSpeed><temperature unit="celsius" value="6.38" min="6.38" max="6.38"></temperature><pressure unit="hPa" value="1012.41"></pressure><humidity value="82" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T12:00:00" to="2016-10-07T15:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="1.25" type="rain"></precipitation><windDirection deg="66.008" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.17" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="4.98" min="4.98" max="4.98"></temperature><pressure unit="hPa" value="1011.8"></pressure><humidity value="94" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T15:00:00" to="2016-10-07T18:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="1.91" type="rain"></precipitation><windDirection deg="68.5035" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.07" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="4.08" min="4.08" max="4.08"></temperature><pressure unit="hPa" value="1011.41"></pressure><humidity value="99" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T18:00:00" to="2016-10-07T21:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="1.67" type="rain"></precipitation><windDirection deg="70.0028" code="ENE" name="East-northeast"></windDirection><windSpeed mps="4.92" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="3.71" min="3.71" max="3.71"></temperature><pressure unit="hPa" value="1010.59"></pressure><humidity value="99" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-07T21:00:00" to="2016-10-08T00:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="1.09" type="rain"></precipitation><windDirection deg="74.5028" code="ENE" name="East-northeast"></windDirection><windSpeed mps="5.05" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="3.77" min="3.77" max="3.77"></temperature><pressure unit="hPa" value="1009.95"></pressure><humidity value="99" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T00:00:00" to="2016-10-08T03:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="1.72" type="rain"></precipitation><windDirection deg="82.0013" code="E" name="East"></windDirection><windSpeed mps="4.66" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="4.05" min="4.05" max="4.05"></temperature><pressure unit="hPa" value="1009.7"></pressure><humidity value="99" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T03:00:00" to="2016-10-08T06:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="1.05" type="rain"></precipitation><windDirection deg="88.5" code="E" name="East"></windDirection><windSpeed mps="4.28" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="4.83" min="4.83" max="4.83"></temperature><pressure unit="hPa" value="1010.07"></pressure><humidity value="100" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T06:00:00" to="2016-10-08T09:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.42" type="rain"></precipitation><windDirection deg="99.0016" code="E" name="East"></windDirection><windSpeed mps="3.51" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="6.29" min="6.29" max="6.29"></temperature><pressure unit="hPa" value="1010.94"></pressure><humidity value="100" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T09:00:00" to="2016-10-08T12:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.12" type="rain"></precipitation><windDirection deg="91.0023" code="E" name="East"></windDirection><windSpeed mps="3.11" name="Light breeze"></windSpeed><temperature unit="celsius" value="7.68" min="7.68" max="7.68"></temperature><pressure unit="hPa" value="1011.45"></pressure><humidity value="100" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T12:00:00" to="2016-10-08T15:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.09" type="rain"></precipitation><windDirection deg="84.5023" code="E" name="East"></windDirection><windSpeed mps="3.55" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="7.57" min="7.57" max="7.57"></temperature><pressure unit="hPa" value="1012.13"></pressure><humidity value="96" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T15:00:00" to="2016-10-08T18:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.28" type="rain"></precipitation><windDirection deg="87.0088" code="E" name="East"></windDirection><windSpeed mps="3.66" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="7.46" min="7.46" max="7.46"></temperature><pressure unit="hPa" value="1012.84"></pressure><humidity value="97" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T18:00:00" to="2016-10-08T21:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="2.39" type="rain"></precipitation><windDirection deg="90.5005" code="E" name="East"></windDirection><windSpeed mps="3.46" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="7.22" min="7.22" max="7.22"></temperature><pressure unit="hPa" value="1013.75"></pressure><humidity value="98" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-08T21:00:00" to="2016-10-09T00:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="1.13" type="rain"></precipitation><windDirection deg="73.0004" code="ENE" name="East-northeast"></windDirection><windSpeed mps="3.36" name="Gentle Breeze"></windSpeed><temperature unit="celsius" value="6.97" min="6.97" max="6.97"></temperature><pressure unit="hPa" value="1013.71"></pressure><humidity value="98" unit="%"></humidity><clouds value="broken clouds" all="68" unit="%"></clouds></time><time from="2016-10-09T00:00:00" to="2016-10-09T03:00:00"><symbol number="500" name="легкий дождь" var="10n"></symbol><precipitation unit="3h" value="0.04" type="rain"></precipitation><windDirection deg="56.5034" code="ENE" name="East-northeast"></windDirection><windSpeed mps="3.32" name="Light breeze"></windSpeed><temperature unit="celsius" value="6.44" min="6.44" max="6.44"></temperature><pressure unit="hPa" value="1013.93"></pressure><humidity value="99" unit="%"></humidity><clouds value="broken clouds" all="64" unit="%"></clouds></time><time from="2016-10-09T03:00:00" to="2016-10-09T06:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.16" type="rain"></precipitation><windDirection deg="69.0006" code="ENE" name="East-northeast"></windDirection><windSpeed mps="3.16" name="Light breeze"></windSpeed><temperature unit="celsius" value="7.95" min="7.95" max="7.95"></temperature><pressure unit="hPa" value="1014.1"></pressure><humidity value="100" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-09T06:00:00" to="2016-10-09T09:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.38" type="rain"></precipitation><windDirection deg="85.0033" code="E" name="East"></windDirection><windSpeed mps="2.5" name="Light breeze"></windSpeed><temperature unit="celsius" value="9.81" min="9.81" max="9.81"></temperature><pressure unit="hPa" value="1014.6"></pressure><humidity value="100" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time><time from="2016-10-09T09:00:00" to="2016-10-09T12:00:00"><symbol number="500" name="легкий дождь" var="10d"></symbol><precipitation unit="3h" value="0.25" type="rain"></precipitation><windDirection deg="91.0057" code="E" name="East"></windDirection><windSpeed mps="2.51" name="Light breeze"></windSpeed><temperature unit="celsius" value="10.93" min="10.93" max="10.93"></temperature><pressure unit="hPa" value="1014.65"></pressure><humidity value="100" unit="%"></humidity><clouds value="overcast clouds" all="92" unit="%"></clouds></time></forecast></weatherdata>')) { $json = json_encode($weatherXML); $arWeather = json_decode($json, TRUE); return $arWeather; } else { return false; } }
<div class="left-tabs"> <div class="tab-menu"> <div class="tab-1 active" data-id="1" title="Счета"></div> <div class="tab-2" data-id="2" title="Метки"></div> <div class="tab-3" data-id="3" title="Операции"></div> </div> <div class="tab-content"> <div class="content-1"> <a href="<?php echo $path; ?> add_account.php" class="add"> Добавить счет</a> <div class="category"> <?php $arAccounts = Accounts::getAccountsList(); $deploy = array('LIKE' => Lib\Options::getOptionInt('FINANCES_DEPLOY_LIKE'), 'MONEY' => Lib\Options::getOptionInt('FINANCES_DEPLOY_MONEY'), 'ME' => Lib\Options::getOptionInt('FINANCES_DEPLOY_ME'), 'I_AM' => Lib\Options::getOptionInt('FINANCES_DEPLOY_I_AM'), 'INVEST' => Lib\Options::getOptionInt('FINANCES_DEPLOY_INVEST'), 'ESTATE' => Lib\Options::getOptionInt('FINANCES_DEPLOY_ESTATE'), 'BONUS' => Lib\Options::getOptionInt('FINANCES_DEPLOY_BONUS'), 'CAPITAL' => Lib\Options::getOptionInt('FINANCES_DEPLOY_CAPITAL'), 'HIDDEN' => Lib\Options::getOptionInt('FINANCES_DEPLOY_HIDDEN')); //msDebug($deploy); ?> <?php if ($arAccounts) { ?> <?php $section = 'LIKE'; ?> <?php if (isset($arAccounts[$section]) && !empty($arAccounts[$section])) { ?> <div class="header<?php echo $deploy[$section] ? ' open' : ''; ?> " data-id="1" data-cat="<?php
public static function addTsFromPost($post = null) { try { if (is_null($post)) { throw new Exception\ArgumentNullException('_POST'); } } catch (Exception\ArgumentNullException $e) { $e->showException(); return false; } $arAdd = array(); if (!isset($post['my_car']) || intval($post['my_car']) <= 0) { $arAdd['MY_CAR_ID'] = MyCar::getDefaultCarID(); } else { $arAdd['MY_CAR_ID'] = intval($post['my_car']); } if (!isset($post['ts_num'])) { return false; } else { $arAdd['TS_NUM'] = intval($post['ts_num']); } if (!isset($post['date']) || !CoreLib\DateHelper::checkDate($post['date'])) { return false; } else { if (!($arAdd['DATE'] = CoreLib\DateHelper::validateDate($post['date']))) { return false; } } if (!isset($post['executor']) || intval($post['executor']) <= 0) { return false; } else { $arAdd['EXECUTORS_ID'] = intval($post['executor']); } if (!isset($post['cost'])) { return false; } else { $post['cost'] = str_replace(" ", "", $post['cost']); $post['cost'] = str_replace(",", ".", $post['cost']); $post['cost'] = floatval($post['cost']); $arAdd['COST'] = $post['cost']; } if (!isset($post['odo'])) { return false; } else { $post['odo'] = str_replace(" ", "", $post['odo']); $post['odo'] = str_replace(",", ".", $post['odo']); $post['odo'] = floatval($post['odo']); $arAdd['ODO'] = $post['odo']; } if (isset($post['ts_point']) && intval($post['ts_point']) > 0) { $arAdd['POINTS_ID'] = intval($post['ts_point']); } else { if (isset($post['newpoint_address']) || isset($post['newpoint_lat']) && isset($post['newpoint_lon'])) { $arPoint = array(); if (isset($post['newpoint_name']) && strlen($post['newpoint_name']) > 3) { $arPoint['NAME'] = $post['newpoint_name']; } else { $arPoint['NAME'] = '[auto] Сервис'; } if (isset($post['newpoint_address']) && strlen($post['newpoint_address']) > 5) { $arPoint['ADDRESS'] = $post['newpoint_address']; } if (isset($post['newpoint_lat']) && strlen($post['newpoint_lat']) > 2 && (isset($post['newpoint_lon']) && strlen($post['newpoint_lon']) > 2)) { $arPoint['LON'] = $post['newpoint_lon']; $arPoint['LAT'] = $post['newpoint_lat']; } $arPoint['TYPE'] = Points::getPointTypeIdByCode('service'); $arAdd['POINTS_ID'] = Points::createNewPoint($arPoint); } else { return false; } } if (isset($post['comment']) && strlen($post['comment']) > 0) { $arAdd['DESCRIPTION'] = trim(htmlspecialchars($post['comment'])); } if ($addTsID = static::addTs($arAdd)) { CoreLib\Options::setOption('icar_last_ts_' . intval($arAdd['MY_CAR_ID']), $arAdd['TS_NUM']); CoreLib\Options::setOption('icar_last_executor_' . intval($arAdd['MY_CAR_ID']), $arAdd['EXECUTORS_ID']); CoreLib\Options::setOption('icar_last_executor_' . intval($arAdd['MY_CAR_ID']) . '_point', $arAdd['POINTS_ID']); return $addTsID; } else { return false; } }
/** * Сохраняет последнюю использованную марку топлива для автомобиля * * @param int $fuelMark ID марки топлива * @param int $carID ID автомобиля * * @return bool */ protected static function setLastUseFuelMark($fuelMark = null, $carID = null) { try { if (is_null($fuelMark)) { throw new Exception\ArgumentNullException('fuelMark'); } } catch (Exception\ArgumentNullException $e) { $e->showException(); return false; } if (is_null($carID)) { $carID = MyCar::getDefaultCarID(); } if (!CoreLib\Options::setOption('icar_last_fuelmark_' . $carID, $fuelMark)) { return false; } else { return true; } }