Exemple #1
0
            } else {
                $session->message(join("<br>", $info->errors));
                redirect_to("more_info.php?id={$hotel->id}");
            }
        }
    } else {
        if (empty($_POST['check_in']) || empty($_POST['check_out']) || empty($_POST['cancel']) || empty($_POST['pet'])) {
            $message = "you have to fill all the fields";
        } else {
            $info = new Rules();
            $info->hotel_id = $hotel->id;
            $info->check_in = $_POST['check_in'];
            $info->check_out = $_POST['check_out'];
            $info->cancel = $_POST['cancel'];
            $info->pet = $_POST['pet'];
            if ($info->save()) {
                redirect_to("page.php?id={$hotel->id}");
            } else {
                $session->message(join("<br>", $info->errors));
                redirect_to("more_info.php?id={$hotel->id}");
            }
        }
    }
}
?>
<!DOCTYPE html>
<html>
<head>
	<title></title>
	<link rel="stylesheet" type="text/css" href="../css/style.css">
	<link rel="stylesheet" type="text/css" href="../css/login.css">