Spaces:
Runtime error
Runtime error
translated
Browse files- templates/index.html +18 -18
templates/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet" />
|
| 8 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
| 9 |
-
<title>
|
| 10 |
</head>
|
| 11 |
|
| 12 |
<body>
|
|
@@ -18,29 +18,29 @@
|
|
| 18 |
<div id="Model1" class="Model bg-gradient-to-r from-purple-400 to-purple-700 text-gray-800">
|
| 19 |
<section class="flex flex-col justify-between item-center p-8 min-h-screen md:flex-row">
|
| 20 |
<main class="bg-white p-16 rounded-lg">
|
| 21 |
-
<h1 class="text-3xl font-bold mb-8">
|
| 22 |
|
| 23 |
<form enctype="multipart/form-data" class="flex flex-col" id="upload_form">
|
| 24 |
-
<label for="age" class="mb-2">
|
| 25 |
-
<input type="text" name="age" placeholder="
|
| 26 |
|
| 27 |
-
<label for="sex" class="mt-4 mb-2">
|
| 28 |
<select name="sex" id="sex" class="p-4 bg-gray-100 rounded-md">
|
| 29 |
-
<option value="1">
|
| 30 |
-
<option value="0">
|
| 31 |
</select>
|
| 32 |
|
| 33 |
-
<label for="smoker" class="mt-4 mb-2">
|
| 34 |
<select name="smoker" id="smoker" class="p-4 bg-gray-100 rounded-md">
|
| 35 |
-
<option value="1">
|
| 36 |
-
<option value="0">
|
| 37 |
</select>
|
| 38 |
|
| 39 |
<label for="bmi" class="mt-4 mb-2">BMI:</label>
|
| 40 |
<input type="text" name="bmi" placeholder="BMI" required="required" class="p-4 bg-gray-100 rounded-md" />
|
| 41 |
|
| 42 |
-
<label for="children" class="mt-4 mb-2">
|
| 43 |
-
<input type="text" name="children" placeholder="
|
| 44 |
|
| 45 |
<label for="region" class="mt-4 mb-2">Region:</label>
|
| 46 |
<select name="region" id="region" class="p-4 bg-gray-100 rounded-md">
|
|
@@ -51,7 +51,7 @@
|
|
| 51 |
</select>
|
| 52 |
|
| 53 |
<button type="submit" class="flex justify-center align-center mt-8 p-4 bg-gradient-to-r from-purple-400 to-purple-700 text-white rounded-md">
|
| 54 |
-
|
| 55 |
<line x1="5" y1="12" x2="19" y2="12"></line>
|
| 56 |
<polyline points="12 5 19 12 12 19"></polyline>
|
| 57 |
</svg>
|
|
@@ -60,7 +60,7 @@
|
|
| 60 |
</main>
|
| 61 |
<section class="mt-8 h-full flex-auto rounded-lg md:mt-0 md:ml-8">
|
| 62 |
<div class="bg-white p-16 rounded-lg">
|
| 63 |
-
<h1 class="text-2xl mb-8">
|
| 64 |
<h2 class="text-5xl font-bold">$<span id="insurance_cost">0.00</span></h2>
|
| 65 |
<div class="mt-8">
|
| 66 |
<p id="respAge"></p>
|
|
@@ -128,11 +128,11 @@
|
|
| 128 |
contentType: false,
|
| 129 |
success: function (response) {
|
| 130 |
// Handle the response data
|
| 131 |
-
$('#respAge').html("<strong>
|
| 132 |
-
$('#respSex').html("<strong>
|
| 133 |
-
$('#respSmoker').html("<strong>
|
| 134 |
$('#respBmi').html("<strong>BMI:</strong> " + response.bmi);
|
| 135 |
-
$('#respChildren').html("<strong>
|
| 136 |
$('#respRegion').html("<strong>Region:</strong> " + response.region);
|
| 137 |
$('#insurance_cost').html(response.insurance_cost);
|
| 138 |
console.log(response);
|
|
|
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet" />
|
| 8 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
| 9 |
+
<title>Insurance Cost Prediction Application</title>
|
| 10 |
</head>
|
| 11 |
|
| 12 |
<body>
|
|
|
|
| 18 |
<div id="Model1" class="Model bg-gradient-to-r from-purple-400 to-purple-700 text-gray-800">
|
| 19 |
<section class="flex flex-col justify-between item-center p-8 min-h-screen md:flex-row">
|
| 20 |
<main class="bg-white p-16 rounded-lg">
|
| 21 |
+
<h1 class="text-3xl font-bold mb-8">Predict Your Insurance Cost:</h1>
|
| 22 |
|
| 23 |
<form enctype="multipart/form-data" class="flex flex-col" id="upload_form">
|
| 24 |
+
<label for="age" class="mb-2">Age</label>
|
| 25 |
+
<input type="text" name="age" placeholder="Age" required="required" class="p-4 bg-gray-100 rounded-md" />
|
| 26 |
|
| 27 |
+
<label for="sex" class="mt-4 mb-2">Gender:</label>
|
| 28 |
<select name="sex" id="sex" class="p-4 bg-gray-100 rounded-md">
|
| 29 |
+
<option value="1">Male</option>
|
| 30 |
+
<option value="0">Female</option>
|
| 31 |
</select>
|
| 32 |
|
| 33 |
+
<label for="smoker" class="mt-4 mb-2">Smoker:</label>
|
| 34 |
<select name="smoker" id="smoker" class="p-4 bg-gray-100 rounded-md">
|
| 35 |
+
<option value="1">Yes</option>
|
| 36 |
+
<option value="0">No</option>
|
| 37 |
</select>
|
| 38 |
|
| 39 |
<label for="bmi" class="mt-4 mb-2">BMI:</label>
|
| 40 |
<input type="text" name="bmi" placeholder="BMI" required="required" class="p-4 bg-gray-100 rounded-md" />
|
| 41 |
|
| 42 |
+
<label for="children" class="mt-4 mb-2">Children:</label>
|
| 43 |
+
<input type="text" name="children" placeholder="Children" required="required" class="p-4 bg-gray-100 rounded-md" />
|
| 44 |
|
| 45 |
<label for="region" class="mt-4 mb-2">Region:</label>
|
| 46 |
<select name="region" id="region" class="p-4 bg-gray-100 rounded-md">
|
|
|
|
| 51 |
</select>
|
| 52 |
|
| 53 |
<button type="submit" class="flex justify-center align-center mt-8 p-4 bg-gradient-to-r from-purple-400 to-purple-700 text-white rounded-md">
|
| 54 |
+
PREDICT NOW<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right ml-4">
|
| 55 |
<line x1="5" y1="12" x2="19" y2="12"></line>
|
| 56 |
<polyline points="12 5 19 12 12 19"></polyline>
|
| 57 |
</svg>
|
|
|
|
| 60 |
</main>
|
| 61 |
<section class="mt-8 h-full flex-auto rounded-lg md:mt-0 md:ml-8">
|
| 62 |
<div class="bg-white p-16 rounded-lg">
|
| 63 |
+
<h1 class="text-2xl mb-8">Your estimate insurance cost:</h1>
|
| 64 |
<h2 class="text-5xl font-bold">$<span id="insurance_cost">0.00</span></h2>
|
| 65 |
<div class="mt-8">
|
| 66 |
<p id="respAge"></p>
|
|
|
|
| 128 |
contentType: false,
|
| 129 |
success: function (response) {
|
| 130 |
// Handle the response data
|
| 131 |
+
$('#respAge').html("<strong>Age:</strong> " + response.age + " tahun");
|
| 132 |
+
$('#respSex').html("<strong>Gender:</strong> " + response.sex);
|
| 133 |
+
$('#respSmoker').html("<strong>Smoker:</strong> "+ response.smoker);
|
| 134 |
$('#respBmi').html("<strong>BMI:</strong> " + response.bmi);
|
| 135 |
+
$('#respChildren').html("<strong>Children:</strong> " + response.children);
|
| 136 |
$('#respRegion').html("<strong>Region:</strong> " + response.region);
|
| 137 |
$('#insurance_cost').html(response.insurance_cost);
|
| 138 |
console.log(response);
|