main2
parent
27657679d7
commit
4ea8d4d839
BIN
data/appUser.db
BIN
data/appUser.db
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
uname,status,user,type,year,start_month,start_date,end_date,plan,klas,lang,phone,pass,anual,early_start_programme,toddlers,interakto,email,country,state,city,address,school
|
uname,status,user,type,year,start_month,start_date,end_date,plan,klas,lang,phone,pass,annual,early_start_programme,toddlers,interakto,email,country,state,city,address,school
|
||||||
name 1,published,,parent,,Feb,2023-05-14,2024-05-13,,IK2,,70000000011,,Jan,Feb,Mar,Jul,1@email.com,IN,WB,Habra,sample road near landmark,individual
|
name 1,published,,parent,,Feb,2023-05-14,2024-05-13,,IK2,,70000000011,,Jan,Feb,Mar,Jul,1@email.com,IN,WB,Habra,sample road near landmark,individual
|
||||||
name 5,published,,parent,,Feb,2023-05-14,2024-05-13,,IK2,,70000000011,,Jan,Feb,Mar,Jul,5@email.com,IN,WB,Habra,sample road near landmark,individual
|
name 5,published,,parent,,Feb,2023-05-14,2024-05-13,,IK2,,70000000011,,Jan,Feb,Mar,Jul,5@email.com,IN,WB,Habra,sample road near landmark,individual
|
||||||
name 4,published,,parent,,Feb,2023-05-14,2024-05-13,,IK2,,70000000011,,Jan,Feb,Mar,Jul,4@email.com,IN,WB,Habra,sample road near landmark,individual
|
name 4,published,,parent,,Feb,2023-05-14,2024-05-13,,IK2,,70000000011,,Jan,Feb,Mar,Jul,4@email.com,IN,WB,Habra,sample road near landmark,individual
|
||||||
|
|
|
|
@ -0,0 +1 @@
|
||||||
|
<svg width="20px" height="20px" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7.5 4.5L11.5 6.5V14.5H3.5V6.5L7.5 4.5ZM7.5 4.5V0M0 14.5H15M1.5 14.5V8.5H3.5M13.5 14.5V8.5H11.5M6.5 14.5V11.5H8.5V14.5M7.5 0.5H10.5V2.5H7.5M7.5 9.5C6.94772 9.5 6.5 9.05228 6.5 8.5C6.5 7.94772 6.94772 7.5 7.5 7.5C8.05228 7.5 8.5 7.94772 8.5 8.5C8.5 9.05228 8.05228 9.5 7.5 9.5Z" stroke="#ffffff"></path> </g></svg>
|
After Width: | Height: | Size: 595 B |
|
@ -29,7 +29,7 @@ export default function Modal() {
|
||||||
country: event.target.country.value,
|
country: event.target.country.value,
|
||||||
state: event.target.state.value,
|
state: event.target.state.value,
|
||||||
cities: event.target.cities.value,
|
cities: event.target.cities.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -119,8 +119,8 @@ export default function Modal() {
|
||||||
<label htmlFor="phone" className='text-xl font-bold'> Phone</label>
|
<label htmlFor="phone" className='text-xl font-bold'> Phone</label>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="annual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0" >-NA-</option>
|
<option value="0" >-NA-</option>
|
||||||
<option value="January">January</option>
|
<option value="January">January</option>
|
||||||
<option value="February">February</option>
|
<option value="February">February</option>
|
||||||
|
|
|
@ -52,23 +52,23 @@ export default function addSchoolForm() {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
const data = {
|
const data = {
|
||||||
"status":"published",
|
"status":"published",
|
||||||
name: event.target.schoolName.value,
|
sname: event.target.sname.value,
|
||||||
country: event.target.country.value,
|
country: event.target.country.value,
|
||||||
state: event.target.state.value,
|
state: event.target.state.value,
|
||||||
cities: event.target.cities.value,
|
city: event.target.city.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
agreement_expiry_date: event.target.agreement_expiry_date.value,
|
agg_expiry: event.target.agg_expiry.value,
|
||||||
school_agreement: event.target.school_agreement.value,
|
usage_expiry: event.target.usage_expiry.value,
|
||||||
school_contact_number: event.target.school_contact_number.value,
|
phone: event.target.phone.value,
|
||||||
school_email_id: event.target.school_email_id.value,
|
email: event.target.email.value,
|
||||||
|
|
||||||
}
|
}
|
||||||
const JSONdata = JSON.stringify(data)
|
const JSONdata = JSON.stringify(data)
|
||||||
console.log(data)
|
console.log(data)
|
||||||
const endpoint = 'https://management.beanstalkedu.com/items/school'
|
const endpoint = '/api/addSchool'
|
||||||
const options = {
|
const options = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -96,11 +96,11 @@ export default function addSchoolForm() {
|
||||||
<form onSubmit={handleSubmit} className='w-full px-6 md:px-20'>
|
<form onSubmit={handleSubmit} className='w-full px-6 md:px-20'>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="school" className='text-xl font-bold'>School Name</label>
|
<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]' />
|
<input type="text" name="sname" placeholder='School Name' className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="school_email_id" className='text-xl font-bold'> Email ID</label>
|
<label htmlFor="email" className='text-xl font-bold'> 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]' />
|
<input type="text" name="email" id="email" placeholder='School Email ID' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="country" className='text-xl font-bold'>Country</label>
|
<label htmlFor="country" className='text-xl font-bold'>Country</label>
|
||||||
|
@ -120,10 +120,10 @@ export default function addSchoolForm() {
|
||||||
{
|
{
|
||||||
allCities && allCities.length > 0 &&
|
allCities && allCities.length > 0 &&
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="Cities" className='text-xl font-bold'>Cities</label>
|
<label htmlFor="cyti" className='text-xl font-bold'>City</label>
|
||||||
<Select
|
<Select
|
||||||
className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'
|
className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'
|
||||||
name="cities" options={allCities} value={allCities[0].name}
|
name="city" options={allCities} value={allCities[0].name}
|
||||||
// onChange={() => {}}
|
// onChange={() => {}}
|
||||||
/>
|
/>
|
||||||
</div>}
|
</div>}
|
||||||
|
@ -132,8 +132,8 @@ export default function addSchoolForm() {
|
||||||
<PhoneInput className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' name="phone" placeholder="Enter phone number" value={phoneValue} onChange={setphoneValue}/>
|
<PhoneInput className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' name="phone" placeholder="Enter phone number" value={phoneValue} onChange={setphoneValue}/>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'> Annual</label>
|
||||||
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="annual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0" >-NA-</option>
|
<option value="0" >-NA-</option>
|
||||||
<option value="Jan">Jan</option>
|
<option value="Jan">Jan</option>
|
||||||
<option value="Feb">Feb</option>
|
<option value="Feb">Feb</option>
|
||||||
|
@ -168,7 +168,7 @@ export default function addSchoolForm() {
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="early_start_programme" className='text-xl font-bold'>Early Start Program</label>
|
<label htmlFor="early_start_programme" className='text-xl font-bold'>Early Start Programme</label>
|
||||||
<select name="early_start_programme" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="early_start_programme" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0" >-NA-</option>
|
<option value="0" >-NA-</option>
|
||||||
<option value="Jan">Jan</option>
|
<option value="Jan">Jan</option>
|
||||||
|
@ -189,22 +189,26 @@ export default function addSchoolForm() {
|
||||||
<label htmlFor="interakto" className='text-xl font-bold'>Interakto</label>
|
<label htmlFor="interakto" className='text-xl font-bold'>Interakto</label>
|
||||||
<select name="interakto" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="interakto" className='bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="na">-NA-</option>
|
<option value="na">-NA-</option>
|
||||||
<option value="Jan"> Jan</option>
|
<option value="Jan"> Jan</option>
|
||||||
<option value="Feb"> Feb</option>
|
<option value="Feb"> Feb</option>
|
||||||
<option value="Mar"> Mar</option>
|
<option value="Mar"> Mar</option>
|
||||||
<option value="Apr"> Apr</option>
|
<option value="Apr"> Apr</option>
|
||||||
<option value="May"> May</option>
|
<option value="May"> May</option>
|
||||||
<option value="Jun"> Jun</option>
|
<option value="Jun"> Jun</option>
|
||||||
<option value="Jul"> Jul</option>
|
<option value="Jul"> Jul</option>
|
||||||
<option value="Aug"> Aug</option>
|
<option value="Aug"> Aug</option>
|
||||||
<option value="Sept"> Sept</option>
|
<option value="Sept"> Sept</option>
|
||||||
<option value="Nov"> Nov</option>
|
<option value="Nov"> Nov</option>
|
||||||
<option value="Dec"> Dec</option>
|
<option value="Dec"> Dec</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="agreement_expiry_date" className='text-xl font-bold pt-4'>Agreement Expiry Date</label>
|
<label htmlFor="agg_expiry" className='text-xl font-bold pt-4'>Agreement Expiry Date</label>
|
||||||
<input type="date" name="agreement_expiry_date" id="agreement_expiry_date" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input type="date" name="agg_expiry" id="agg_expiry" 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'>
|
||||||
|
<label htmlFor="usage_expiry" className='text-xl font-bold pt-4'>Usage Expiry Date</label>
|
||||||
|
<input type="date" name="usage_expiry" id="usage_expiry" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
{/* <div className='flex flex-col w-full'>
|
{/* <div className='flex flex-col w-full'>
|
||||||
<label htmlFor="school_agreement" className='text-xl font-bold pt-4'>Upload School Agreement</label>
|
<label htmlFor="school_agreement" className='text-xl font-bold pt-4'>Upload School Agreement</label>
|
||||||
|
|
|
@ -102,7 +102,7 @@ export default function addUserForm() {
|
||||||
start_month: event.target.start_month.value,
|
start_month: event.target.start_month.value,
|
||||||
start_date: event.target.start_date.value,
|
start_date: event.target.start_date.value,
|
||||||
end_date: event.target.end_date.value,
|
end_date: event.target.end_date.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -242,8 +242,8 @@ export default function addUserForm() {
|
||||||
{individualValue &&
|
{individualValue &&
|
||||||
<div>
|
<div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="annual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0">-NA-</option>
|
<option value="0">-NA-</option>
|
||||||
<option value="Jan">Jan</option>
|
<option value="Jan">Jan</option>
|
||||||
<option value="Feb">Feb</option>
|
<option value="Feb">Feb</option>
|
||||||
|
|
|
@ -98,7 +98,7 @@ export default function addUserForm() {
|
||||||
start_month: event.target.start_month.value,
|
start_month: event.target.start_month.value,
|
||||||
start_date: event.target.start_date.value,
|
start_date: event.target.start_date.value,
|
||||||
end_date: event.target.end_date.value,
|
end_date: event.target.end_date.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
}
|
}
|
||||||
const JSONdata = JSON.stringify(data)
|
const JSONdata = JSON.stringify(data)
|
||||||
const endpoint = '/api/addUsers'
|
const endpoint = '/api/addUsers'
|
||||||
|
@ -234,8 +234,8 @@ export default function addUserForm() {
|
||||||
{individualValue &&
|
{individualValue &&
|
||||||
<div>
|
<div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<select name="anual"
|
<select name="annual"
|
||||||
className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0">-NA-</option>
|
<option value="0">-NA-</option>
|
||||||
<option value="January">January</option>
|
<option value="January">January</option>
|
||||||
|
@ -256,8 +256,8 @@ export default function addUserForm() {
|
||||||
<label htmlFor="plan" className='text-xl font-bold'>Plan</label>
|
<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='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'>
|
<div className='flex flex-row place-items-center'>
|
||||||
<label className='cursor-pointer' htmlFor="Anual">Anual</label>
|
<label className='cursor-pointer' htmlFor="annual">annual</label>
|
||||||
<input type="checkbox" name="plan" id="Anual" value='Anual' className='check-box'/>
|
<input type="checkbox" name="plan" id="annual" value='annual' className='check-box'/>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-row place-items-center'>
|
<div className='flex flex-row place-items-center'>
|
||||||
<label className='cursor-pointer' htmlFor="Toddler">Toddler</label>
|
<label className='cursor-pointer' htmlFor="Toddler">Toddler</label>
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
export default function handler(req, res) {
|
||||||
|
const sqlite3 = require('sqlite3').verbose();
|
||||||
|
|
||||||
|
// console.log(req.body)
|
||||||
|
// Open a new database connection
|
||||||
|
let sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry = "";
|
||||||
|
|
||||||
|
if(req.body.sname) sname =req.body.sname;
|
||||||
|
// if(req.body.status) status =req.body.status;
|
||||||
|
if(req.body.status) status ="published";
|
||||||
|
if(req.body.phone) phone =req.body.phone;
|
||||||
|
if(req.body.annual) annual =req.body.annual;
|
||||||
|
if(req.body.early_start_programme) early_start_programme =req.body.early_start_programme;
|
||||||
|
if(req.body.toddlers) toddlers =req.body.toddlers;
|
||||||
|
if(req.body.interakto) interakto =req.body.interakto;
|
||||||
|
if(req.body.email) email =req.body.email;
|
||||||
|
if(req.body.country) country =req.body.country;
|
||||||
|
if(req.body.state) state =req.body.state;
|
||||||
|
if(req.body.city) city =req.body.city;
|
||||||
|
if(req.body.address) address =req.body.address;
|
||||||
|
if(req.body.agg_expiry) agg_expiry =req.body.agg_expiry;
|
||||||
|
if(req.body.usage_expiry) usage_expiry =req.body.usage_expiry;
|
||||||
|
|
||||||
|
const db = new sqlite3.Database('data/appUser.db');
|
||||||
|
db.run(`INSERT INTO school (sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [ sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry],
|
||||||
|
function(err) {
|
||||||
|
if (err) {
|
||||||
|
return console.log(err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
|
||||||
|
res.status(200).json({ msg: 'ok' });
|
||||||
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ export default function handler(req, res) {
|
||||||
|
|
||||||
console.log(req.body)
|
console.log(req.body)
|
||||||
// Open a new database connection
|
// Open a new database connection
|
||||||
let uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school="";
|
let uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school="";
|
||||||
|
|
||||||
if(req.body.uname) uname =req.body.uname;
|
if(req.body.uname) uname =req.body.uname;
|
||||||
if(req.body.status) status =req.body.status;
|
if(req.body.status) status =req.body.status;
|
||||||
|
@ -15,10 +15,9 @@ export default function handler(req, res) {
|
||||||
if(req.body.plan) plan =req.body.plan;
|
if(req.body.plan) plan =req.body.plan;
|
||||||
if(req.body.klas) klas =req.body.klas;
|
if(req.body.klas) klas =req.body.klas;
|
||||||
if(req.body.lang) lang =req.body.lang;
|
if(req.body.lang) lang =req.body.lang;
|
||||||
if(req.body.lang) lang =req.body.lang;
|
|
||||||
if(req.body.phone) phone =req.body.phone;
|
if(req.body.phone) phone =req.body.phone;
|
||||||
if(req.body.pass) pass =req.body.pass;
|
if(req.body.pass) pass =req.body.pass;
|
||||||
if(req.body.anual) anual =req.body.anual;
|
if(req.body.annual) annual =req.body.annual;
|
||||||
if(req.body.early_start_programme) early_start_programme =req.body.early_start_programme;
|
if(req.body.early_start_programme) early_start_programme =req.body.early_start_programme;
|
||||||
if(req.body.toddlers) toddlers =req.body.toddlers;
|
if(req.body.toddlers) toddlers =req.body.toddlers;
|
||||||
if(req.body.interakto) interakto =req.body.interakto;
|
if(req.body.interakto) interakto =req.body.interakto;
|
||||||
|
@ -29,7 +28,7 @@ export default function handler(req, res) {
|
||||||
if(req.body.address) address =req.body.address;
|
if(req.body.address) address =req.body.address;
|
||||||
if(req.body.school) school =req.body.school;
|
if(req.body.school) school =req.body.school;
|
||||||
const db = new sqlite3.Database('data/appUser.db');
|
const db = new sqlite3.Database('data/appUser.db');
|
||||||
db.run(`INSERT INTO user (uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [ uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school],
|
db.run(`INSERT INTO user (uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [ uname, status, type, start_month, start_date, end_date, plan, klas, lang, phone, pass, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school],
|
||||||
function(err) {
|
function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return console.log(err.message);
|
return console.log(err.message);
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
export default function handler(req, res) {
|
||||||
|
const sqlite3 = require('sqlite3').verbose();
|
||||||
|
|
||||||
|
console.log(req.body)
|
||||||
|
|
||||||
|
// Open a new database connection
|
||||||
|
let sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry = "";
|
||||||
|
|
||||||
|
if(req.body.sname) sname =req.body.sname;
|
||||||
|
if(req.body.status) status =req.body.status;
|
||||||
|
// if(req.body.status) status ="published";
|
||||||
|
if(req.body.phone) phone =req.body.phone;
|
||||||
|
if(req.body.annual) annual =req.body.annual;
|
||||||
|
if(req.body.early_start_programme) early_start_programme =req.body.early_start_programme;
|
||||||
|
if(req.body.toddlers) toddlers =req.body.toddlers;
|
||||||
|
if(req.body.interakto) interakto =req.body.interakto;
|
||||||
|
if(req.body.email) email =req.body.email;
|
||||||
|
if(req.body.country) country =req.body.country;
|
||||||
|
if(req.body.state) state =req.body.state;
|
||||||
|
if(req.body.city) city =req.body.city;
|
||||||
|
if(req.body.address) address =req.body.address;
|
||||||
|
if(req.body.agg_expiry) agg_expiry =req.body.agg_expiry;
|
||||||
|
if(req.body.usage_expiry) usage_expiry =req.body.usage_expiry;
|
||||||
|
|
||||||
|
const db = new sqlite3.Database('data/appUser.db');
|
||||||
|
console.log(req.body.userId)
|
||||||
|
db.run(`UPDATE school SET sname = ?, status = ?, phone = ?, annual = ?, early_start_programme = ?, toddlers = ?, interakto = ?, email = ?, country = ?, state = ?, city = ?, address = ?, agg_expiry = ?, usage_expiry = ? WHERE id = ? `, [ sname, status, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, agg_expiry, usage_expiry, req.body.schoolId],
|
||||||
|
function(err) {
|
||||||
|
if (err) {
|
||||||
|
res.status(400).json({ msg: 'Err400D' });
|
||||||
|
return console.log(err.message);
|
||||||
|
}
|
||||||
|
res.status(200).json({ msg: 'ok' });
|
||||||
|
}
|
||||||
|
);
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ export default function handler(req, res) {
|
||||||
|
|
||||||
console.log(req.body)
|
console.log(req.body)
|
||||||
// Open a new database connection
|
// Open a new database connection
|
||||||
let uname, status, type, start_month, start_date, end_date, klas, lang, phone, pass, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school="";
|
let uname, status, type, start_month, start_date, end_date, klas, lang, phone, pass, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school="";
|
||||||
|
|
||||||
if(req.body.uname) uname =req.body.uname;
|
if(req.body.uname) uname =req.body.uname;
|
||||||
if(req.body.status) status =req.body.status;
|
if(req.body.status) status =req.body.status;
|
||||||
|
@ -15,7 +15,7 @@ export default function handler(req, res) {
|
||||||
if(req.body.lang) lang =req.body.lang;
|
if(req.body.lang) lang =req.body.lang;
|
||||||
if(req.body.phone) phone =req.body.phone;
|
if(req.body.phone) phone =req.body.phone;
|
||||||
if(req.body.pass) pass =req.body.pass;
|
if(req.body.pass) pass =req.body.pass;
|
||||||
if(req.body.anual) anual =req.body.anual;
|
if(req.body.annual) annual =req.body.annual;
|
||||||
if(req.body.early_start_programme) early_start_programme =req.body.early_start_programme;
|
if(req.body.early_start_programme) early_start_programme =req.body.early_start_programme;
|
||||||
if(req.body.toddlers) toddlers =req.body.toddlers;
|
if(req.body.toddlers) toddlers =req.body.toddlers;
|
||||||
if(req.body.interakto) interakto =req.body.interakto;
|
if(req.body.interakto) interakto =req.body.interakto;
|
||||||
|
@ -27,7 +27,7 @@ export default function handler(req, res) {
|
||||||
if(req.body.school) school =req.body.school;
|
if(req.body.school) school =req.body.school;
|
||||||
const db = new sqlite3.Database('data/appUser.db');
|
const db = new sqlite3.Database('data/appUser.db');
|
||||||
console.log(req.body.userId)
|
console.log(req.body.userId)
|
||||||
db.run(`UPDATE user SET uname = ?, status = ?, type = ?, start_month = ?, start_date = ?, end_date = ?, klas = ?, lang = ?, phone = ?, anual = ?, early_start_programme = ?, toddlers = ?, interakto = ?, email = ?, country = ?, state = ?, city = ?, address = ?, school = ? WHERE id = ? `, [ uname, status, type, start_month, start_date, end_date, klas, lang, phone, anual, early_start_programme, toddlers, interakto, email, country, state, city, address, school, req.body.userId],
|
db.run(`UPDATE user SET uname = ?, status = ?, type = ?, start_month = ?, start_date = ?, end_date = ?, klas = ?, lang = ?, phone = ?, annual = ?, early_start_programme = ?, toddlers = ?, interakto = ?, email = ?, country = ?, state = ?, city = ?, address = ?, school = ? WHERE id = ? `, [ uname, status, type, start_month, start_date, end_date, klas, lang, phone, annual, early_start_programme, toddlers, interakto, email, country, state, city, address, school, req.body.userId],
|
||||||
function(err) {
|
function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
res.status(400).json({ msg: 'Err400D' });
|
res.status(400).json({ msg: 'Err400D' });
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
import csv from 'csv-parser';
|
||||||
|
import fs from 'fs';
|
||||||
|
import sqlite3 from 'sqlite3';
|
||||||
|
|
||||||
|
export default function handler(req,res) {
|
||||||
|
|
||||||
|
|
||||||
|
const DB_NAME = 'data/appUser.db';
|
||||||
|
const TABLE_NAME = 'school';
|
||||||
|
|
||||||
|
const db = new sqlite3.Database(DB_NAME);
|
||||||
|
|
||||||
|
const query = `SELECT * FROM ${TABLE_NAME}`;
|
||||||
|
|
||||||
|
function getAllRows(tableName) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const sql = `SELECT * FROM ${tableName} WHERE id = ?`;
|
||||||
|
db.all(sql, [req.query.school], (err, rows) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data = rows;
|
||||||
|
resolve(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
async function doSomething() {
|
||||||
|
try {
|
||||||
|
const returnData = await getAllRows('school');
|
||||||
|
res.setHeader('Content-Type', 'application/json')
|
||||||
|
res.status(200).json(returnData)
|
||||||
|
// console.log(data);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doSomething();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
import csv from 'csv-parser';
|
||||||
|
import fs from 'fs';
|
||||||
|
import sqlite3 from 'sqlite3';
|
||||||
|
|
||||||
|
export default function handler(req,res) {
|
||||||
|
|
||||||
|
console.log(req.body.school)
|
||||||
|
// const {
|
||||||
|
// query: { name, keyword },
|
||||||
|
// method,
|
||||||
|
// } = req;
|
||||||
|
// console.log(name, keyword, method);
|
||||||
|
|
||||||
|
const DB_NAME = 'data/appUser.db';
|
||||||
|
const TABLE_NAME = 'school';
|
||||||
|
|
||||||
|
// Open a connection to the SQLite database
|
||||||
|
const db = new sqlite3.Database(DB_NAME);
|
||||||
|
|
||||||
|
const query = `SELECT * FROM ${TABLE_NAME}`;
|
||||||
|
|
||||||
|
function getAllRows(tableName) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const sql = `SELECT * FROM ${tableName}`;
|
||||||
|
db.all(sql, [], (err, rows) => {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data = rows;
|
||||||
|
resolve(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
async function doSomething() {
|
||||||
|
try {
|
||||||
|
const returnData = await getAllRows(TABLE_NAME);
|
||||||
|
res.setHeader('Content-Type', 'application/json')
|
||||||
|
res.status(200).json(returnData)
|
||||||
|
// console.log(data);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doSomething();
|
||||||
|
// const returnData = getAllRows('user');
|
||||||
|
// console.log(getAllRows('user'));
|
||||||
|
// const returnData= db.run('SELECT * FROM user');
|
||||||
|
|
||||||
|
// fs.createReadStream('data/user.csv')
|
||||||
|
// .pipe(csv())
|
||||||
|
// .on('data', (data) => {
|
||||||
|
// const values = Object.values(data);
|
||||||
|
// const placeholders = values.map(() => '?').join(',');
|
||||||
|
// const sql = `INSERT INTO ${TABLE_NAME} (${Object.keys(data).join(',')}) VALUES (${placeholders})`;
|
||||||
|
// db.run(sql, values, (err) => {
|
||||||
|
// if (err) {
|
||||||
|
// console.error(err);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
// .on('end', () => {
|
||||||
|
// console.log(`Data inserted successfully into table ${TABLE_NAME}`);
|
||||||
|
|
||||||
|
// // Close the database connection
|
||||||
|
// db.close();
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export default function handler(req, res) {
|
export default function handler(req, res) {
|
||||||
// const sqlite3 = require('sqlite3').verbose();
|
// const sqlite3 = require('sqlite3').verbose();
|
||||||
|
|
||||||
console.log(req.body)
|
// console.log(req.body)
|
||||||
const sqlite3 = require('sqlite3');
|
const sqlite3 = require('sqlite3');
|
||||||
const argon2 = require('argon2');
|
const argon2 = require('argon2');
|
||||||
const jwt = require('jsonwebtoken');
|
const jwt = require('jsonwebtoken');
|
||||||
|
@ -10,43 +10,63 @@ const jwt = require('jsonwebtoken');
|
||||||
const db = new sqlite3.Database('data/appUser.db');
|
const db = new sqlite3.Database('data/appUser.db');
|
||||||
|
|
||||||
// Fetch the user record
|
// Fetch the user record
|
||||||
const username = 'example_user';
|
const username = req.body.email;
|
||||||
const sql = 'SELECT pass FROM user_table WHERE username = ?';
|
// console.log(username)
|
||||||
|
const sql = 'SELECT * FROM user WHERE email = ?';
|
||||||
db.get(sql, [username], async (err, userRecord) => {
|
db.get(sql, [username], async (err, userRecord) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userRecord) {
|
if (userRecord) {
|
||||||
const storedHash = userRecord.password_hash;
|
const storedHash = userRecord.pass;
|
||||||
const providedPassword = 'example_password';
|
console.log(storedHash)
|
||||||
|
const providedPassword = req.body.password;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Verify the provided password with the stored hash
|
// Verify the provided password with the stored hash
|
||||||
const isPasswordValid = await argon2.verify(storedHash, providedPassword);
|
const isPasswordValid = await argon2.verify(storedHash, providedPassword);
|
||||||
|
|
||||||
if (isPasswordValid) {
|
if (isPasswordValid) {
|
||||||
// Passwords match, generate JWT token
|
// Passwords match, generate JWT token
|
||||||
const secretKey = process.env.JWT_SEC;
|
const secretKey = process.env.TOKEN_HEADER_KEY;
|
||||||
const tokenPayload = { username: username };
|
const tokenPayload = {
|
||||||
const jwtToken = jwt.sign(tokenPayload, secretKey, { algorithm: 'HS256' });
|
email:userRecord.email,
|
||||||
|
role: userRecord.type,
|
||||||
|
iat: Math.floor(Date.now() / 1000),
|
||||||
|
exp: Math.floor(Date.now() / 1000) + 3600*24*7,
|
||||||
|
|
||||||
|
};
|
||||||
|
const jwtToken = jwt.sign(tokenPayload, secretKey, { algorithm: 'HS256' });
|
||||||
|
const jwtTokenData ={
|
||||||
|
data:{
|
||||||
|
access_token:jwtToken,
|
||||||
|
role: userRecord.type,
|
||||||
|
email: userRecord.email,
|
||||||
|
expires: 3600*24*7,
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Return the JWT token
|
// Return the JWT token
|
||||||
console.log(jwtToken);
|
res.status(200).json(jwtTokenData);
|
||||||
} else {
|
console.log(jwtToken);
|
||||||
console.log('Invalid password');
|
} else {
|
||||||
}
|
console.log('Invalid password');
|
||||||
} catch (err) {
|
res.status(400).json({err:'400P'});
|
||||||
console.error(err);
|
|
||||||
}
|
}
|
||||||
} else {
|
} catch (err) {
|
||||||
console.log('User not found');
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
res.status(400).json({err:'400U'});
|
||||||
|
console.log('User not found');
|
||||||
|
}
|
||||||
|
|
||||||
// Close the database connection
|
// Close the database connection
|
||||||
db.close();
|
db.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
res.status(200).json({ name: 'John Doe' });
|
// res.status(200).json({ name: 'John Doe' });
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ export default function addSchoolForm() {
|
||||||
country: event.target.country.value,
|
country: event.target.country.value,
|
||||||
state: event.target.state.value,
|
state: event.target.state.value,
|
||||||
cities: event.target.cities.value,
|
cities: event.target.cities.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -100,8 +100,8 @@ export default function addSchoolForm() {
|
||||||
<input type="text" value={school.school_contact_number} onChange={e => setSchool(e.target.value)} name="school_contact_number" />
|
<input type="text" value={school.school_contact_number} onChange={e => setSchool(e.target.value)} name="school_contact_number" />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<input type="text" value={school.anual} onChange={e => setSchool(e.target.value)} />
|
<input type="text" value={school.annual} onChange={e => setSchool(e.target.value)} />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="toddlers" className='text-xl font-bold'>Toddlers</label>
|
<label htmlFor="toddlers" className='text-xl font-bold'>Toddlers</label>
|
||||||
|
|
|
@ -6,62 +6,43 @@ import { useRouter } from 'next/router'
|
||||||
export default function editSchool() {
|
export default function editSchool() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// const updateSchoolData = async (event) => {
|
|
||||||
// const body = new FormData();
|
|
||||||
// body.append("file", agreement.files[0]);
|
|
||||||
// body.append("fName", `${router.query.school}.pdf`);
|
|
||||||
// const response = await fetch("/api/updateUserDetails", {
|
|
||||||
// method: "POST",
|
|
||||||
// body
|
|
||||||
// });
|
|
||||||
// };
|
|
||||||
|
|
||||||
const [school, setSchool] = useState({});
|
const [school, setSchool] = useState({});
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
// console.log(router.query);
|
if(router.query.school && router.query.school>0 ){
|
||||||
// if(router.query.school<1) {
|
console.log(router.query);
|
||||||
// const { sid } = router.query;
|
fetch(`/api/getSchoolDetails?school=${router.query.school}`)
|
||||||
// setSchool(sid)
|
|
||||||
if(router.query.school && router.query.school>1 ){
|
|
||||||
fetch(`https://management.beanstalkedu.com/items/school?school=${router.query.school}`)
|
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
// console.log(data);
|
console.log(data);
|
||||||
setSchool(data.data[0])
|
setSchool(data[0])
|
||||||
// console.log(data.data)
|
// console.log(school)
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// console.log(data.data)
|
|
||||||
|
|
||||||
|
|
||||||
}, [router.query.school]);
|
}, [router.query.school]);
|
||||||
|
|
||||||
const updateSchoolData = async (event) => {
|
const updateSchoolData = async (event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
const data = {
|
const data = {
|
||||||
// schoolId: router.query.school,
|
schoolId: router.query.school,
|
||||||
name: event.target.name.value,
|
sname: event.target.sname.value,
|
||||||
// status: event.target.status.value,
|
status: event.target.status.value,
|
||||||
// uname: event.target.uname.value,
|
country: event.target.country.value,
|
||||||
// country: event.target.country.value,
|
state: event.target.state.value,
|
||||||
// state: event.target.state.value,
|
city: event.target.city.value,
|
||||||
// city: event.target.city.value,
|
annual: event.target.annual.value,
|
||||||
// address: event.target.address.value,
|
toddlers: event.target.toddlers.value,
|
||||||
// start_date: event.target.start_date.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
// end_date: event.target.end_date.value,
|
interakto: event.target.interakto.value,
|
||||||
// school: event.target.school.value,
|
agg_expiry: event.target.agg_expiry.value,
|
||||||
// anual: event.target.anual.value,
|
usage_expiry: event.target.usage_expiry.value,
|
||||||
// toddlers: event.target.toddlers.value,
|
phone: event.target.phone.value,
|
||||||
// early_start_programme: event.target.early_start_programme.value,
|
email: event.target.email.value,
|
||||||
// email: event.target.email.value,
|
|
||||||
// phone: event.target.phone.value,
|
|
||||||
// klas: event.target.klas.value
|
|
||||||
}
|
}
|
||||||
const JSONdata = JSON.stringify(data)
|
const JSONdata = JSON.stringify(data)
|
||||||
// console.log(data)
|
console.log(data)
|
||||||
const endpoint = 'https://management.beanstalkedu.com/items/school'
|
const endpoint = '/api/editSchool'
|
||||||
const options = {
|
const options = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -70,10 +51,11 @@ export default function editSchool() {
|
||||||
body: JSONdata,
|
body: JSONdata,
|
||||||
}
|
}
|
||||||
const response = await fetch(endpoint, options)
|
const response = await fetch(endpoint, options)
|
||||||
|
|
||||||
const result = await response.json()
|
const result = await response.json()
|
||||||
// alert(`Is this your full name: ${result.data}`)
|
// alert(`Is this your full name: ${result.data}`)
|
||||||
alert(`School data updated`)
|
alert(`User data updated`)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -83,65 +65,73 @@ export default function editSchool() {
|
||||||
<section className='container mx-auto px-4 my-16 lg:px-28 xl:px-56 2xl:px-96'>
|
<section className='container mx-auto px-4 my-16 lg:px-28 xl:px-56 2xl:px-96'>
|
||||||
<div
|
<div
|
||||||
className='flex flex-col justify-center place-items-center bg-[#FFF6F2] pt-6 pb-20 rounded-tl-[50px] rounded-br-[50px]'>
|
className='flex flex-col justify-center place-items-center bg-[#FFF6F2] pt-6 pb-20 rounded-tl-[50px] rounded-br-[50px]'>
|
||||||
<div className='flex flex-col justify-center place-items-center'>
|
<div className='inline-flex p-4 '>
|
||||||
<img src="/img/2.svg" alt=""/>
|
<a href="/add-school-form" className="m-2 inline-flex place-items-center justify-center p-2 pl-4 pr-4 bg-[#FE4501] text-white font-bold rounded-full whitespace-nowrap">
|
||||||
<p className='text-2xl md:text-4xl font-bold underline decoration-4 decoration-[#FE4501] pb-10'>Update School Information </p>
|
<img src="/img/4.svg" alt="" />
|
||||||
|
List Users Under This School
|
||||||
|
</a>
|
||||||
|
<div className="place-items-center justify-center m-2 p-2 bg-[#FE4501] text-white font-bold rounded-full whitespace-nowrap">
|
||||||
|
<span className="text-small">CSV Upload </span>
|
||||||
|
<input type="file" />
|
||||||
|
</div>
|
||||||
|
{/* <img src="/img/2.svg" alt=""/> */}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<p className='text-2xl font-bold underline decoration-4 decoration-[#FE4501] pb-10'>Update School Information </p>
|
||||||
<form onSubmit={updateSchoolData} action="" className='w-full px-6 md:px-20'>
|
<form onSubmit={updateSchoolData} action="" className='w-full px-6 md:px-20'>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="school_name" className='text-xl font-bold'>School Name</label>
|
<label htmlFor="sname" className='text-xl font-bold'>School Name</label>
|
||||||
<input value={school.name} onChange={e => setSchool(e.target.value)} type="text" name="school_name" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.sname} onChange={e => setSchool(e.target.value)} type="text" name="sname" className=' bg-white 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="status" className='text-xl font-bold'>Status</label>
|
||||||
|
<input value={school.status} onChange={e => setSchool(e.target.value)} type="text" name="status" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="mobile" className='text-xl font-bold'>Mobile Number</label>
|
<label htmlFor="phone" className='text-xl font-bold'>School contact Number</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="mobile" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.phone} onChange={e => setSchool(e.target.value)} type="text" name="phone" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="email" className='text-xl font-bold'>Email ID</label>
|
<label htmlFor="email" className='text-xl font-bold'> School contact Email ID</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="email" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.email} onChange={e => setSchool(e.target.value)} type="text" name="email" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="country" className='text-xl font-bold'>Country</label>
|
<label htmlFor="country" className='text-xl font-bold'>Country</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="country" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.country} onChange={e => setSchool(e.target.value)} type="text" name="country" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="State" className='text-xl font-bold'>State</label>
|
<label htmlFor="state" className='text-xl font-bold'>State</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="State" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.state} onChange={e => setSchool(e.target.value)} type="text" name="state" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="cities" className='text-xl font-bold'>Cities</label>
|
<label htmlFor="city" className='text-xl font-bold'>Cities</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="cities" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.city} onChange={e => setSchool(e.target.value)} type="text" name="city" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="annual" className='text-xl font-bold'>Annual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>Annual</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="email" name="annual" placeholder='' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'/>
|
<input value={school.annual} onChange={e => setSchool(e.target.value)} type="text" name="annual" placeholder='' className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'/>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="toddlers" className='text-xl font-bold'>Toddlers</label>
|
<label htmlFor="toddlers" className='text-xl font-bold'>Toddlers</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="toddlers" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.toddlers} onChange={e => setSchool(e.target.value)} type="text" name="toddlers" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="early_start_program" className='text-xl font-bold'>Early Start Program</label>
|
<label htmlFor="early_start_programme" className='text-xl font-bold'>Early Start Program</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="early_start_program" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.early_start_programme} onChange={e => setSchool(e.target.value)} type="text" name="early_start_programme" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="interakto" className='text-xl font-bold'>Interakto</label>
|
<label htmlFor="interakto" className='text-xl font-bold'>Interakto</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="interakto" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.interakto} onChange={e => setSchool(e.target.value)} type="text" name="interakto" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="agreement_expiry_date" className='text-xl font-bold'> Agreement Expiry Date: (YYYY-MM-DD)</label>
|
<label htmlFor="usage_expiry" className='text-xl font-bold'> Usage Expiry Date: (YYYY-MM-DD)</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="text" name="agreement_expiry_date" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.usage_expiry} onChange={e => setSchool(e.target.value)} type="text" name="usage_expiry" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full'>
|
||||||
<label htmlFor="agreement_documents" className='text-xl font-bold'>Upload Agreement Document's</label>
|
<label htmlFor="agg_expiry" className='text-xl font-bold'> Agreement Expiry Date: (YYYY-MM-DD)</label>
|
||||||
<input onChange={e => setSchool(e.target.value)} type="file" name="agreement_documents" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={school.agg_expiry} onChange={e => setSchool(e.target.value)} type="text" name="agg_expiry" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
<div className='flex justify-end pt-2'>
|
|
||||||
<button className=' bg-[#FE4501] px-4 py-1.5 rounded-lg text-white'>Download Agreement</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className='flex justify-center pt-8'>
|
<div className='flex justify-center pt-8'>
|
||||||
<button type="submit"
|
<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'>Update
|
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'>Update
|
||||||
|
@ -149,8 +139,21 @@ export default function editSchool() {
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className='flex flex-col w-full'>
|
||||||
|
<label htmlFor="agreement_documents" className='text-xl font-bold'>Upload Agreement Document's</label>
|
||||||
|
<input onChange={e => setSchool(e.target.value)} type="file" name="agreement_documents" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
|
<div className='flex justify-end pt-2'>
|
||||||
|
<button className=' bg-[#FE4501] px-4 py-1.5 rounded-lg text-white'>Download Agreement</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default function addSchoolForm() {
|
||||||
country: event.target.country.value,
|
country: event.target.country.value,
|
||||||
state: event.target.state.value,
|
state: event.target.state.value,
|
||||||
cities: event.target.cities.value,
|
cities: event.target.cities.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -110,8 +110,8 @@ export default function addSchoolForm() {
|
||||||
<input type="text" value={school.school_contact_number} onChange={e => setSchool(e.target.value)} name="school_contact_number" className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input type="text" value={school.school_contact_number} onChange={e => setSchool(e.target.value)} name="school_contact_number" className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<input type="text" value={school.anual} onChange={e => setSchool(e.target.value)} className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input type="text" value={school.annual} onChange={e => setSchool(e.target.value)} className='border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="toddlers" className='text-xl font-bold'>Toddlers</label>
|
<label htmlFor="toddlers" className='text-xl font-bold'>Toddlers</label>
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default function editUser() {
|
||||||
// if(router.query.school<1) {
|
// if(router.query.school<1) {
|
||||||
// const { sid } = router.query;
|
// const { sid } = router.query;
|
||||||
// setSchool(sid)
|
// setSchool(sid)
|
||||||
if(router.query.user && router.query.user>1 ){
|
if(router.query.user && router.query.user>0 ){
|
||||||
fetch(`/api/getUserDetails?user=${router.query.user}`)
|
fetch(`/api/getUserDetails?user=${router.query.user}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
@ -49,7 +49,7 @@ export default function editUser() {
|
||||||
start_date: event.target.start_date.value,
|
start_date: event.target.start_date.value,
|
||||||
end_date: event.target.end_date.value,
|
end_date: event.target.end_date.value,
|
||||||
school: event.target.school.value,
|
school: event.target.school.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -145,8 +145,8 @@ export default function editUser() {
|
||||||
<input value={user.klas} onChange={e => setUser(e.target.value)} type="text" name="klas" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={user.klas} onChange={e => setUser(e.target.value)} type="text" name="klas" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<input value={user.anual} onChange={e => setUser(e.target.value)} type="text" name="anual" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
<input value={user.annual} onChange={e => setUser(e.target.value)} type="text" name="annual" className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="early_start_programme" className='text-xl font-bold'>Early Start Programme</label>
|
<label htmlFor="early_start_programme" className='text-xl font-bold'>Early Start Programme</label>
|
||||||
|
|
|
@ -121,7 +121,7 @@ export default function addUserForm() {
|
||||||
start_month: event.target.start_month.value,
|
start_month: event.target.start_month.value,
|
||||||
start_date: event.target.start_date.value,
|
start_date: event.target.start_date.value,
|
||||||
end_date: event.target.end_date.value,
|
end_date: event.target.end_date.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -258,8 +258,8 @@ export default function addUserForm() {
|
||||||
{individualValue &&
|
{individualValue &&
|
||||||
<div>
|
<div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="annual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0">-NA-</option>
|
<option value="0">-NA-</option>
|
||||||
<option value="Jan">Jan</option>
|
<option value="Jan">Jan</option>
|
||||||
<option value="Feb">Feb</option>
|
<option value="Feb">Feb</option>
|
||||||
|
|
|
@ -58,7 +58,7 @@ export default function addSchoolForm() {
|
||||||
country: event.target.country.value,
|
country: event.target.country.value,
|
||||||
state: event.target.state.value,
|
state: event.target.state.value,
|
||||||
cities: event.target.cities.value,
|
cities: event.target.cities.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -150,8 +150,8 @@ export default function addSchoolForm() {
|
||||||
<PhoneInput className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' name="phone" placeholder="Enter phone number" value={phoneValue} onChange={setphoneValue}/>
|
<PhoneInput className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' name="phone" placeholder="Enter phone number" value={phoneValue} onChange={setphoneValue}/>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="annual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0" >-NA-</option>
|
<option value="0" >-NA-</option>
|
||||||
<option value="January">January</option>
|
<option value="January">January</option>
|
||||||
<option value="February">February</option>
|
<option value="February">February</option>
|
||||||
|
|
|
@ -5,11 +5,11 @@ import { Inter } from 'next/font/google'
|
||||||
const inter = Inter({ subsets: ['latin'] })
|
const inter = Inter({ subsets: ['latin'] })
|
||||||
import NavBar from '../../components/NavBar'
|
import NavBar from '../../components/NavBar'
|
||||||
export default function Modal() {
|
export default function Modal() {
|
||||||
const [school, setUser] = useState([]);
|
const [school, setSchool] = useState([]);
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const response = await fetch("https://management.beanstalkedu.com/items/school?filter[status][_eq]=published");
|
const response = await fetch("/api/listSchlools");
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
return setUser(data.data);
|
return setSchool(data);
|
||||||
}
|
}
|
||||||
console.log(school)
|
console.log(school)
|
||||||
|
|
||||||
|
@ -33,14 +33,7 @@ const fetchData = async () => {
|
||||||
<svg width="20px" height="20px" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7.5 4.5L11.5 6.5V14.5H3.5V6.5L7.5 4.5ZM7.5 4.5V0M0 14.5H15M1.5 14.5V8.5H3.5M13.5 14.5V8.5H11.5M6.5 14.5V11.5H8.5V14.5M7.5 0.5H10.5V2.5H7.5M7.5 9.5C6.94772 9.5 6.5 9.05228 6.5 8.5C6.5 7.94772 6.94772 7.5 7.5 7.5C8.05228 7.5 8.5 7.94772 8.5 8.5C8.5 9.05228 8.05228 9.5 7.5 9.5Z" stroke="#ffffff"></path> </g></svg>
|
<svg width="20px" height="20px" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7.5 4.5L11.5 6.5V14.5H3.5V6.5L7.5 4.5ZM7.5 4.5V0M0 14.5H15M1.5 14.5V8.5H3.5M13.5 14.5V8.5H11.5M6.5 14.5V11.5H8.5V14.5M7.5 0.5H10.5V2.5H7.5M7.5 9.5C6.94772 9.5 6.5 9.05228 6.5 8.5C6.5 7.94772 6.94772 7.5 7.5 7.5C8.05228 7.5 8.5 7.94772 8.5 8.5C8.5 9.05228 8.05228 9.5 7.5 9.5Z" stroke="#ffffff"></path> </g></svg>
|
||||||
Add School
|
Add School
|
||||||
</a> */}
|
</a> */}
|
||||||
<a href="/add-school-form" className="inline-flex place-items-center justify-center p-2 bg-[#FE4501] text-white font-bold rounded-full whitespace-nowrap">
|
|
||||||
<svg width="20px" height="20px" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7.5 4.5L11.5 6.5V14.5H3.5V6.5L7.5 4.5ZM7.5 4.5V0M0 14.5H15M1.5 14.5V8.5H3.5M13.5 14.5V8.5H11.5M6.5 14.5V11.5H8.5V14.5M7.5 0.5H10.5V2.5H7.5M7.5 9.5C6.94772 9.5 6.5 9.05228 6.5 8.5C6.5 7.94772 6.94772 7.5 7.5 7.5C8.05228 7.5 8.5 7.94772 8.5 8.5C8.5 9.05228 8.05228 9.5 7.5 9.5Z" stroke="#ffffff"></path> </g></svg>
|
|
||||||
List Users Under This School
|
|
||||||
</a>
|
|
||||||
<div className="inline-flex place-items-center justify-center p-2 bg-[#FE4501] text-white font-bold rounded-full whitespace-nowrap">
|
|
||||||
<span className="text-small">CSV Upload</span>
|
|
||||||
<input type="file" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className='flex xl:justify-center overflow-x-scroll pb-4 w-full'>
|
<div className='flex xl:justify-center overflow-x-scroll pb-4 w-full'>
|
||||||
|
@ -48,14 +41,10 @@ const fetchData = async () => {
|
||||||
<thead className=''>
|
<thead className=''>
|
||||||
<tr className='bg-[#FFF6F2] text-[#1D1D1D] text-xl whitespace-nowrap'>
|
<tr className='bg-[#FFF6F2] text-[#1D1D1D] text-xl whitespace-nowrap'>
|
||||||
<th className=" p-2">ID</th>
|
<th className=" p-2">ID</th>
|
||||||
<th className=" p-2">School Name</th>
|
<th className=" p-2"> Name</th>
|
||||||
<th className=" p-2">Country</th>
|
<th className=" p-2">City</th>
|
||||||
<th className=" p-2">Annual</th>
|
|
||||||
<th className=" p-2"><abbr title="Subscription End Date" className="no-underline">S.E.D</abbr></th>
|
|
||||||
<th className=" p-2"><abbr title="Early Start Program" className="no-underline">E.S.P</abbr> </th>
|
|
||||||
<th className=" p-2">Toddlers</th>
|
|
||||||
<th className=" p-2">Interakto</th>
|
|
||||||
<th className=" p-2">Status</th>
|
<th className=" p-2">Status</th>
|
||||||
|
<th className=" p-2">Expiry</th>
|
||||||
<th className=" p-2 inline-flex"> <img src="/img/3.svg" alt="" />Edit</th>
|
<th className=" p-2 inline-flex"> <img src="/img/3.svg" alt="" />Edit</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -63,16 +52,14 @@ const fetchData = async () => {
|
||||||
{school.map(data=>
|
{school.map(data=>
|
||||||
<tr className="border-b-2 whitespace-normal">
|
<tr className="border-b-2 whitespace-normal">
|
||||||
<td className=" p-2">{data.id}</td>
|
<td className=" p-2">{data.id}</td>
|
||||||
<td className=" p-2">{data.name}</td>
|
<td className=" p-2">{data.sname}</td>
|
||||||
<td className="p-2">{data.country}</td>
|
<td className="p-2">{data.city}</td>
|
||||||
<td className="p-2">{data.anual}</td>
|
|
||||||
<td className="p-2">{data.agreement_expiry_date}</td>
|
|
||||||
<td className="p-2">{data.early_start_programme}</td>
|
|
||||||
<td className="p-2">{data.toddlers}</td>
|
|
||||||
<td className="p-2">{data.interakto}</td>
|
|
||||||
<td className="p-2">{data.status}</td>
|
<td className="p-2">{data.status}</td>
|
||||||
<td className="p-2"><a href={'/edit-school?school='+data.id} className="flex justify-center place-items-center">
|
<td className="p-2">{data.usage_expiry}</td>
|
||||||
<svg width="35px" height="35px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#166435"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path opacity="0.15" d="M8 16H12L18 10L14 6L8 12V16Z" fill="#166435"></path> <path d="M14 6L8 12V16H12L18 10M14 6L17 3L21 7L18 10M14 6L18 10M10 4L4 4L4 20L20 20V14" stroke="#166435" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg></a> </td>
|
<td className="p-2">
|
||||||
|
<a href={'/edit-school?school='+data.id} className="flex justify-center place-items-center">
|
||||||
|
<svg width="35px" height="35px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#166435"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path opacity="0.15" d="M8 16H12L18 10L14 6L8 12V16Z" fill="#166435"></path> <path d="M14 6L8 12V16H12L18 10M14 6L17 3L21 7L18 10M14 6L18 10M10 4L4 4L4 20L20 20V14" stroke="#166435" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg></a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -58,7 +58,7 @@ export default function addSchoolForm() {
|
||||||
country: event.target.country.value,
|
country: event.target.country.value,
|
||||||
state: event.target.state.value,
|
state: event.target.state.value,
|
||||||
cities: event.target.cities.value,
|
cities: event.target.cities.value,
|
||||||
anual: event.target.anual.value,
|
annual: event.target.annual.value,
|
||||||
toddlers: event.target.toddlers.value,
|
toddlers: event.target.toddlers.value,
|
||||||
early_start_programme: event.target.early_start_programme.value,
|
early_start_programme: event.target.early_start_programme.value,
|
||||||
interakto: event.target.interakto.value,
|
interakto: event.target.interakto.value,
|
||||||
|
@ -150,8 +150,8 @@ export default function addSchoolForm() {
|
||||||
<PhoneInput className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' name="phone" placeholder="Enter phone number" value={phoneValue} onChange={setphoneValue}/>
|
<PhoneInput className=' border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]' name="phone" placeholder="Enter phone number" value={phoneValue} onChange={setphoneValue}/>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col w-full pt-4'>
|
<div className='flex flex-col w-full pt-4'>
|
||||||
<label htmlFor="anual" className='text-xl font-bold'>Anual</label>
|
<label htmlFor="annual" className='text-xl font-bold'>annual</label>
|
||||||
<select name="anual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
<select name="annual" className=' bg-white border-2 border-[#FE4501] p-2 rounded-md focus:outline-none focus:border-2 focus:border-[#F2B705]'>
|
||||||
<option value="0" >-NA-</option>
|
<option value="0" >-NA-</option>
|
||||||
<option value="January">January</option>
|
<option value="January">January</option>
|
||||||
<option value="February">February</option>
|
<option value="February">February</option>
|
||||||
|
|
Loading…
Reference in New Issue