示例#1
0
        $hotel->info = $_POST['info'];
        if ($hotel->update()) {
            redirect_to("page.php?id={$hotel->id}");
        }
    } else {
        $message = "You have to fill all the fields";
    }
}
if (isset($_POST['submit'])) {
    if (isset($_FILES['slika'])) {
        $num = count($_FILES['slika']['name']);
        for ($i = 0; $i < $num; $i++) {
            $photo = new Photograph();
            $photo->hotel_id = $hotel->id;
            if ($_FILES['slika']['error'][$i] == 0) {
                if ($photo->upload_images($_FILES['slika']['name'][$i], $_FILES['slika']['tmp_name'][$i], $_FILES['slika']['type'][$i], $_FILES['slika']['size'][$i])) {
                    $message = "Photographs successfully uploaded";
                } else {
                    $message = join('<br>', $photo->errors);
                }
            } else {
                $message = "Can't upload <b>" . $_FILES['slika']['name'][$i] . "</b><br/>";
            }
        }
    }
}
?>
<!DOCTYPE html>
<html>
<head>
	<title></title>