$countryObj = new GetCountry($_GET['name']); $country = $countryObj->info(); $title = $country['name']; if (!$country) { die("Страна не найдена"); } if (is_numeric($_GET['delete'])) { $data = $db->where('id', $_GET['delete']); $data = $db->where('country_id', $country['id']); $data = $db->delete('Country_point'); } if (is_numeric($_POST['modal_point']) and $_GET['editfile'] == 1) { $file = new PostFile($_POST['modal_point']); if ($_FILES["file"]["name"]) { //замена центральной фотки if (!$file->upload($_FILES)) { $loc = $country['name'] . "?error=" . $file->getErrorMsg(); header("Location: {$loc}"); } else { $loc = $country['name'] . "?add_point=" . $_POST['modal_point'] . '#Point' . $_POST['modal_point']; header("Location: {$loc}"); } } elseif ($_POST['file_url']) { if ($file->uploadFromurl($_POST['file_url'])) { $loc = $country['name'] . "?add_point=" . $_POST['modal_point'] . '#Point' . $_POST['modal_point']; header("Location: {$loc}"); } else { $loc = $country['name'] . "?error=" . $file->getErrorMsg(); header("Location: {$loc}"); } }