update-input

wip
Subhodip Ghosh 2023-05-08 16:20:44 +05:30
parent 75a91cc670
commit 0469b48bcb
4 changed files with 232 additions and 123 deletions

View File

@ -14,6 +14,10 @@ export default function addSchoolForm() {
toddlers: event.target.toddlers.value,
early_start_programme: event.target.early_start_programme.value,
interakto: event.target.interakto.value,
school_agreement: event.target.school_agreement,
// school_contact_number : event.target.school_contact_number,
// school_email_id : event.target.school_email_id,
}
const JSONdata = JSON.stringify(data)
const endpoint = 'https://management.beanstalkedu.com/items/school'
@ -26,8 +30,8 @@ export default function addSchoolForm() {
}
const response = await fetch(endpoint, options)
// const result = await response.json()
// alert(`Is this your full name: ${result.data}`)
const result = await response.json()
alert(`Is this your full name: ${result.data}`)
}
return (
<main>
@ -44,6 +48,14 @@ export default function addSchoolForm() {
<label htmlFor="school" className='text-xl font-bold'>School Name</label>
<input type="text" name="schoolName" placeholder='School Name' className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="school_contact_number" className='text-xl font-bold'>School Contact Number</label>
<input type="text" name="school_contact_number" id="school_contact_number" placeholder='School Contact Number ' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="school_email_id" className='text-xl font-bold'>School Email ID</label>
<input type="text" name="school_email_id" id="school_email_id" placeholder='School Email ID ' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="country" className='text-xl font-bold'>Country</label>
<input type="text" name="country" placeholder='Country' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
@ -120,6 +132,10 @@ export default function addSchoolForm() {
<option value="December"> December</option>
</select>
</div>
<div className='flex flex-col w-full'>
<label htmlFor="school_agreement" className='text-xl font-bold pt-4'>Upload School Agreement</label>
<input type="file" name="school_agreement" id="school_agreement" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex justify-center pt-8'>
<a href="/school-list"><button type='submit' className='bg-[#FE4501] hover:shadow-2xl hover:shadow-[#F2B705] p-2.5 rounded-lg px-10 rounded-tl-full rounded-br-full hover:scale-110 active:scale-75 duration-200 text-xl font-bold text-white cursor-pointer'>Submit Now</button></a>
{/* <input type="submit" value="Submit Now" className='bg-[#FE4501] hover:shadow-2xl hover:shadow-[#F2B705] p-2.5 rounded-lg px-10 rounded-tl-full rounded-br-full hover:scale-110 active:scale-75 duration-200 text-xl font-bold text-white cursor-pointer' /> */}

View File

@ -1,18 +1,22 @@
// https://management.beanstalkedu.com/items/school
// import React from 'react';
import React, { useState, useEffect } from 'react';
import Image from 'next/image'
import NavBar from '../components/NavBar'
import { type } from 'os';
import { data } from 'autoprefixer';
// import { Inter } from 'next/font/google'
export default function addUserForm (){
const [school, setData] = useState("");
const [school, setSchool] = useState("");
useEffect(() => {
fetch('https://management.beanstalkedu.com/items/school')
.then( (response) => response.json() )
.then( (data) => setData(data) )
}, []);
console.log(school)
fetch(`https://management.beanstalkedu.com/items/school`).
then(res => res.json())
.then(data => {
setSchool(data.data[0])
})
}, [])
// console.log(school);
const handleFormsubmit = async (event) => {
event.preventDefault()
const data = {
@ -49,27 +53,27 @@ export default function addUserForm (){
<input type="text" name="user" id="user" placeholder='ex. xyz@email.com' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="lang" className='text-xl font-bold'>School name</label>
<select name="lang" id="lang" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
{/* <option value="" selected>-Select-</option> */}
<label htmlFor="" className='text-xl font-bold'>School name</label>
<select name="" id="" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
{/* {school.map(data=>
<option value="Bengali"></option>
<option value={data.name}>{data.name}</option>
)} */}
<option value="">{school.name}</option>
</select>
</div>
<div className='flex flex-col w-full pt-4'>
{/* <div className='flex flex-col w-full pt-4'>
<label htmlFor="school" className='text-xl font-bold'>School Name</label>
<input type="text" name="school" id="school" placeholder='School Name' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div> */}
<div className='flex flex-col w-full pt-4'>
<label htmlFor="school_contact_number" className='text-xl font-bold'>School Contact Number</label>
<input type="text" name="school_contact_number" id="school_contact_number" placeholder='School Contact Number ' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="plan" className='text-xl font-bold'>Plan</label>
<select name="plan" id="plan" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<option value="0" selected>-Select-</option>
<option value="Anual">Anual</option>
<option value="Early-Start-Program">Early Start Program</option>
<option value="Toddlers">Toddlers</option>
<option value="Interakto">Interakto</option>
</select>
<label htmlFor="school_email_id" className='text-xl font-bold'>School Email ID</label>
<input type="text" name="school_email_id" id="school_email_id" placeholder='School Email ID ' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="class" className='text-xl font-bold'>Class</label>
@ -81,9 +85,84 @@ export default function addUserForm (){
<option value="PG">PG</option>
</select>
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="plan" className='text-xl font-bold'>Plan</label>
<div className='grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-y-2 pt-2 '>
<div className='flex flex-row place-items-center'>
<label className='cursor-pointer' htmlFor="Anual">Anual</label>&nbsp;
<input type="checkbox" name="Anual" id="Anual" value='Anual' className='check-box'/>
</div>
<div className='flex flex-row place-items-center'>
<label className='cursor-pointer' htmlFor="Toddler">Toddler</label>&nbsp;
<input type="checkbox" name="Toddler" id="Toddler" value='Toddler' className='check-box'/>
</div>
<div className='flex flex-row place-items-center'>
<label className='cursor-pointer' htmlFor="Interakto">Interakto</label>&nbsp;
<input type="checkbox" name="Interakto" id="Interakto" value='Interakto' className='check-box'/>
</div>
<div className='flex flex-row place-items-center col-span-2'>
<label className='cursor-pointer md:whitespace-nowrap' htmlFor="Early_Start_program">Early Start Program</label>&nbsp;
<input type="checkbox" name="Early_Start_program" id="Early_Start_program" value='Early_Start_program' className='check-box'/>
</div>
</div>
</div>
{/* <div className='flex flex-col w-full pt-4'>
<label htmlFor="plan" className='text-xl font-bold'>Plan</label>
<select name="plan" id="plan" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<option value="0" selected>-Select-</option>
<option value="Anual">Anual</option>
<option value="Early-Start-Program">Early Start Program</option>
<option value="Toddlers">Toddlers</option>
<option value="Interakto">Interakto</option>
</select>
</div> */}
<div className='flex flex-col w-full pt-4'>
<label htmlFor="lang" className='text-xl font-bold'>Language</label>
<select name="lang" id="lang" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<div className='grid grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-y-2 pt-2'>
<div className=''>
<label className='cursor-pointer' htmlFor="Bengali">Bengali</label>&nbsp;
<input type="checkbox" name="Bengali" id="Bengali" value='Bengali' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="English">English</label>&nbsp;
<input type="checkbox" name="English" id="English" value='English' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Hindi">Hindi</label>&nbsp;
<input type="checkbox" name="Hindi" id="Hindi" value='Hindi' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Urdu">Urdu</label>&nbsp;
<input type="checkbox" name="Urdu" id="Urdu" value='Urdu' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Punjabi">Punjabi</label>&nbsp;
<input type="checkbox" name="Punjabi" id="Punjabi" value='Punjabi' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Telugu">Telugu</label>&nbsp;
<input type="checkbox" name="Telugu" id="Telugu" value='Telugu' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Marathi">Marathi</label>&nbsp;
<input type="checkbox" name="Marathi" id="Marathi" value='Marathi' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Nepali">Nepali</label>&nbsp;
<input type="checkbox" name="Nepali" id="Nepali" value='Nepali' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Kannada">Kannada</label>&nbsp;
<input type="checkbox" name="Kannada" id="Kannada" value='Kannada' className='check-box'/>
</div>
<div className=''>
<label className='cursor-pointer' htmlFor="Gujrati">Gujrati</label>&nbsp;
<input type="checkbox" name="Gujrati" id="Gujrati" value='Gujrati' className='check-box'/>
</div>
</div>
{/* <select name="lang" id="lang" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
<option value="" selected>-Select-</option>
<option value="Bengali"> Bengali</option>
<option value="English"> English</option>
@ -95,7 +174,7 @@ export default function addUserForm (){
<option value="Nepali"> Nepali</option>
<option value="Kannada"> Kannada</option>
<option value="Gujrati"> Gujrati</option>
</select>
</select> */}
</div>
<div className='flex flex-col w-full pt-4'>
<label htmlFor="start_month" className='text-xl font-bold'>Start Month</label>

0
src/styles/Checkbox.css Normal file
View File

View File

@ -15,7 +15,21 @@
--background-end-rgb: 0, 0, 0;
}
}
.check-box {
border:2px solid white;
box-shadow:0 0 0 2px #FE4501;
appearance:none;
width:15px;
height:15px;
background-color:#fff;
transition:all ease-in .2s;
cursor: pointer;
}
.check-box:checked{
background-color:#FE4501;
transform: scale(1.2);
border-radius: 2px;
}
/* body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(