} echo json_encode(true); return; } } elseif (is_string($_POST['arr_data'])) { $data = $_POST['arr_data']; $table = $_POST['table']; $field = $_POST['field']; if ($table == 'roominess_mav' || $table == 'roominess_mob') { $int = (int) preg_replace("/[^0-9]/", '', $data); $sql = "INSERT INTO " . $table . "(" . $field . ",int_val) VALUE ('{$data}','{$int}')"; } else { $sql = "INSERT INTO " . $table . "(" . $field . ") VALUE ('{$data}')"; } $insert = new Insert(); $result = $insert->addInFilter($sql); echo json_encode($result); return; } } /*if(isset($_POST['water_resistance']) && !empty($_POST['water_resistance'])) { $water_resistance = $_POST['water_resistance']; $sql = "INSERT INTO water_resistance(name) VALUE ('$water_resistance')"; $insert = new Insert(); $insert->addInFilter($sql); } if(isset($_POST['frame']) && !empty($_POST['frame'])) { $frame = $_POST['frame']; $sql = "INSERT INTO frame_tents(name_frame) VALUE ('$frame')"; $insert = new Insert();