37 lines
816 B
PHP
37 lines
816 B
PHP
|
|
<?
|
||
|
|
|
||
|
|
namespace controller\themes\merakomis\fot\budget;
|
||
|
|
|
||
|
|
use ms\ms\structure\msControllerTable;
|
||
|
|
use themes\merakomis\Emp;
|
||
|
|
use themes\merakomis\fot\Budget;
|
||
|
|
|
||
|
|
class Api extends msControllerTable {
|
||
|
|
|
||
|
|
static $class = 'themes\merakomis\fot\Budget';
|
||
|
|
|
||
|
|
static function math()
|
||
|
|
{
|
||
|
|
$year = 2025;
|
||
|
|
$month = 3;
|
||
|
|
$b = Budget::get($year,$month);
|
||
|
|
Budget::math($b[Budget::$ID],$month);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
static function updateFromTable()
|
||
|
|
{
|
||
|
|
$id = intval($_POST['id']?:$_GET['id']);
|
||
|
|
$value = cfloatval($_POST['value']?:$_GET['value']);
|
||
|
|
$res = [];
|
||
|
|
if(Emp::$IS_AUTH || true){
|
||
|
|
$r = Budget::updateById($id,[Budget::$MONEY=>$value,Budget::$CHANGED=>1]);
|
||
|
|
Budget::math($id);
|
||
|
|
$res['status'] = $r;
|
||
|
|
}
|
||
|
|
echo je($res);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|