get_massiv( 'otzyv', $a, 'id' ); $num = $db -> num; break; case 'clearimg': require_once 'api/php/list_file.php'; $filesm=list_file ( 'img/' . $_SERVER['SERVER_NAME'] . '/tovar' ); echo count ($filesm); //\DB::set('UPDATE `tasks` SET `status`="' . $_POST['status'] . '" WHERE `id` = "' . $_POST['id'] . '"'); break; case 'savePos': $id = \DB::getValue("SELECT `id` FROM `admin_el_pos` WHERE `elem`=?", $_POST['elem']); if ($id) \DB::set( "UPDATE `admin_el_pos` SET `x`=?, `y`=? WHERE `elem` = ?", array( $_POST['x'], $_POST['y'], $_POST['elem'] ) ); else \DB::add("INSERT INTO `admin_el_pos` (`x`, `y`, `elem`) VALUES(?,?,?)", array( $_POST['x'], $_POST['y'], $_POST['elem'] )); break; case 'getPos': $pos = \DB::getAll("SELECT * FROM `admin_el_pos`"); echo \json::to_j($pos); break; } ?>