0% found this document useful (0 votes)
10 views

Code

This document contains a form for adding a new course with fields for course information like sector, level, name, duration, certifying agency, qualifications required, training mode, addresses and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Code

This document contains a form for adding a new course with fields for course information like sector, level, name, duration, certifying agency, qualifications required, training mode, addresses and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

<% include ..

/partials/header %>
<div class="content-header row d-xl-block d-lg-block d-md-none d-sm-none d-
none">
<div class="content-header-left col-md-9 col-12 mb-2">
<div class="row breadcrumbs-top">
<div class="col-12">
<h3 class="content-header-title float-left mb-0">Add
Course</h3>
<div class="breadcrumb-wrapper col-12">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="/admin">Home</a></li>
<li class="breadcrumb-item active">Add Course</li>
</ol>
</div>
</div>
</div>
</div>
</div>
<div class="content-body">
<% include ../partials/flash %>
<section id="personal-info">

<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card">
<div class="card-header border border-top-0 border-left-0
border-right-0">
<h4 class="card-title pb-1">Course Information</h4>
</div>
<div class="card-content">
<div class="card-body">
<div class="row">
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="sectorblock">
<label>Sector</label>
<select class="form-control" name="sector"
id="sector">
<option value="">Select Sector</option>
<option value="Aerospace and Aviation
Sector Skill Council">Aerospace and Aviation Sector Skill Council</option>
<option value="Agriculture Skill Council of
India">Agriculture Skill Council of India</option>
<option value="Apparel Made-Ups &amp; Home
Furnishing Sector Skill Council">Apparel Made-Ups &amp; Home Furnishing Sector
Skill Council</option>
<option value="Automotive Skills
Development Council">Automotive Skills Development Council</option>
<option value="Beauty &amp; Wellness Sector
Skill Council">Beauty &amp; Wellness Sector Skill Council</option>
<option value="BFSI Sector Skill Council Of
India">BFSI Sector Skill Council Of India</option>
<option value="Capital Goods Skill
Council">Capital Goods Skill Council</option>
<option value="Construction Skill
Development Council of India">Construction Skill Development Council of
India</option>
<option value="Domestic Workers Sector
Skill Council">Domestic Workers Sector Skill Council</option>
<option value="Electronics Sector Skills
Council of India">Electronics Sector Skills Council of India</option>
<option value="Food Industry Capacity &
Skill Initiative">Food Industry Capacity & Skill Initiative</option>
<option value="Furniture &amp; Fittings
Skill Council">Furniture &amp; Fittings Skill Council</option>
<option value="Gem & Jewellery Skill
council of India">Gem & Jewellery Skill council of India</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="courseblock">
<label>Course Level</label>
<select class="form-control" name="courseLevel"
id="courseLevel">
<option value="">Select Level</option>
<option
value="Certificate">Certificate</option>
<option value="Diploma">Diploma</option>
<option value="Advance Diploma">Advance
Diploma</option>
<option value="Degree">Degree</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Name</label>
<input class="form-control" type="text"
name="name" id="name">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Duration</label>
<input class="form-control" type="text"
name="duration" id="duration">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Certifying Agency</label>
<input class="form-control" type="text"
name="certifyingAgency" id="certifyingAgency">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Certifying Agency Website</label>
<input class="form-control" type="text"
name="certifyingAgencyWebsite" id="certifyingAgencyWebsite">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="qualificationblock">
<label>Qualification</label>
<select class="form-control"
name="qualification" id="qualification">
<option value="">Select
Qualification</option>
<option value="10th">10th</option>
<option value="Diploma">Diploma</option>
<option value="Advance Diploma">Advance
Diploma</option>
<option value="Degree">Degree</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Age</label>
<input class="form-control" type="text"
name="age" id="age">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Experience</label>
<input class="form-control" type="text"
name="experience" id="experience">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="trainingblock">
<label>Training Mode</label>
<select class="form-control"
name="trainingMode" id="trainingMode">
<option value="">Select Training</option>
<option value="Online">Online</option>
<option value="Offline">Offline</option>
<option value="Blended">Blended</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="onlinetrainingblock">
<label>Online Training Timing</label>
<select class="form-control"
name="onlineTrainingTiming" id="onlineTrainingTiming">
<option value="">Select Training</option>
<option value="Online">Online</option>
<option value="Offline">Offline</option>
<option value="Blended">Blended</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="offlinetrainingblock">
<label>Offline Training Timing</label>
<select class="form-control"
name="offlineTrainingTiming" id="offlineTrainingTiming">
<option value="">Select Training</option>
<option value="Online">Online</option>
<option value="Offline">Offline</option>
<option value="Blended">Blended</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="addressblock">
<label>Address</label>
<select class="form-control" name="address"
id="address">
<option value="">Select Address</option>
<option value="App">App</option>
<option value="Address">Address</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="ojtblock">
<label>OJT</label>
<select class="form-control" name="ojt"
id="ojt">
<option value="">Select OJT</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Registration Charges</label>
<input class="form-control" type="text"
name="registrationCharges" id="registrationCharges">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Course Fee</label>
<input class="form-control" type="text"
name="courseFee" id="courseFee">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Cut Price</label>
<input class="form-control" type="text"
name="cutPrice" id="cutPrice">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Exam Fee</label>
<input class="form-control" type="text"
name="examFee" id="examFee">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Other fee if any</label>
<input class="form-control" type="text"
name="otherFee" id="otherFee">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1" id="emioptionblock">
<label>EMI Option Available</label>
<select class="form-control"
name="emiOptionAvailable" id="emiOptionAvailable">
<option value="">Select EMI Option</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Max EMI Tenure</label>
<input class="form-control" type="text"
name="maxEMITenure" id="maxEMITenure">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Stipend During Training</label>
<input class="form-control" type="text"
name="stipendDuringTraining" id="stipendDuringTraining">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Last date for apply</label>
<input class="form-control" type="text"
name="lastDateForApply" id="lastDateForApply">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Required Documents</label>
<input class="form-control" type="text"
name="requiredDocuments" id="requiredDocuments">
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="personal-info">
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card">
<div class="card-header border border-top-0 border-left-0
border-right-0">
<h4 class="card-title pb-1">Add Docs</h4>
</div>
<div class="card-content">
<div class="card-body">
<div class="row">
<div class="col-xl-4 col-xl-lg-4 col-md-4 col-sm-12
col-12 mb-1">
<label>Add Video</label>
<input class="form-control" type="file"
name="videos" id="videos">
</div>
<div class="col-xl-4 col-xl-lg-4 col-md-4 col-sm-12
col-12 mb-1">
<label>Add Photos</label>
<input class="form-control" type="file"
name="photos" id="photos">
</div>
<div class="col-xl-4 col-xl-lg-4 col-md-4 col-sm-12
col-12 mb-1">
<label>Add Audio</label>
<input class="form-control" type="file"
name="audios" id="audios">
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="personal-info">
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card">
<div class="card-header border border-top-0 border-left-0
border-right-0">
<h4 class="card-title pb-1">Testimonial Videos</h4>
</div>
<div class="card-content">
<div class="card-body">
<div class="row">
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Add Video</label>
<input class="form-control" type="file"
name="videos" id="videos">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Add Video</label>
<input class="form-control" type="file"
name="videos" id="videos">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Add Video</label>
<input class="form-control" type="file"
name="videos" id="videos">
</div>
<div class="col-xl-3 col-xl-lg-3 col-md-2 col-sm-12
col-12 mb-1">
<label>Add Video</label>
<input class="form-control" type="file"
name="videos" id="videos">
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="personal-info">
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card">
<div class="card-header border border-top-0 border-left-0
border-right-0">
<h4 class="card-title pb-1">Extra Features</h4>
</div>
<div class="card-content">
<div class="card-body">
<div class="row">
<div class="col-xl-4 col-xl-lg-4 col-md-4 col-sm-12
col-12 mb-1">
<label>Course Feature</label>
<textarea class="form-control"
placeholder="Bulletes points" name="courseFeatures" id="courseFeatures"></textarea>
</div>
<div class="col-xl-4 col-xl-lg-4 col-md-4 col-sm-12
col-12 mb-1">
<label>Important Terms</label>
<textarea class="form-control"
placeholder="Bulletes points" name="importantTerms" id="importantTerms"></textarea>
</div>
<div class="col-xl-4 col-xl-lg-4 col-md-4 col-sm-12
col-12 mb-1">
<label>F&amp;Q</label>
<textarea class="form-control"
placeholder="Bulletes points" name="faq" id="faq"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-12 mt-2 text-right">
<button onclick="reset()" class="btn btn-danger waves-effect waves-
light">Reset</button>
<button id="sub-btn" type="button" class="btn btn-success px-lg-2
ml-1 waves-effect waves-light">
Save
</button>
</div>

</section>
</div>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
console.log(document.getElementById('sub-btn'),'btn')
document.getElementById('sub-btn').addEventListener('click',
(event)=>{
event.preventDefault();
if (!validations()) {
event.preventDefault();
return false
}
let body={
sector:document.getElementById("sector").value,
certifyingAgency:$('#certifyingAgency').val(),
experience:$('#experience').val(),
trainingMode:$('#trainingMode').val(),
courseLevel: document.getElementById("courseLevel").value,
name :document.getElementById("name").value,
duration : document.getElementById("duration").value,
qualification :
document.getElementById("qualification").value,
onlineTrainingTiming :
document.getElementById("onlineTrainingTiming").value,
offlineTrainingTiming :
document.getElementById("offlineTrainingTiming").value,
address :document.getElementById("address").value,
ojt: document.getElementById("ojt").value,
certifyingAgencyWebsite:$('#certifyingAgencyWebsite').val(),
age:$('#age').val(),
registrationCharges:$('#registrationCharges').val(),
courseFee:$('#courseFee').val(),
cutPrice:$('#cutPrice').val(),
examFee:$('#examFee').val(),
otherFee:$('#otherFee').val(),
emiOptionAvailable:$('#emiOptionAvailable').val(),
maxEMITenure:$('#maxEMITenure').val(),
stipendDuringTraining:$('#stipendDuringTraining').val(),
lastDateForApply:$('#lastDateForApply').val(),
requiredDocuments:$('#requiredDocuments').val(),
courseFeatures:$('#courseFeatures').val(),
importantTerms:$('#importantTerms').val(),
faq:$('#faq').val()
}
axios.post("/admin/courses/add", body).then((res) => {
if(res&&res.status){
window.location.href="/admin/courses"
}
})
})

function validations() {
$('#sectorblock .error').removeClass('error')
$('#courseblock .error').removeClass('error')
$('#qualificationblock .error').removeClass('error')
$('#trainingblock .error').removeClass('error')
$('#offlinetrainingblock .error').removeClass('error')
$('#onlinetrainingblock .error').removeClass('error')
$('#ojtblock .error').removeClass('error')
$('#addressblock .error').removeClass('error')

var sector = document.getElementById("sector").value;


let certifyingAgency=$('#certifyingAgency').val();
let experience=$('#experience').val();
let trainingMode=$('#trainingMode').val();
var courseLevel = document.getElementById("courseLevel").value;
var name = document.getElementById("name").value;
var duration = document.getElementById("duration").value;
var qualification =
document.getElementById("qualification").value;
var onlineTrainingTiming =
document.getElementById("onlineTrainingTiming").value;
var offlineTrainingTiming =
document.getElementById("offlineTrainingTiming").value;
var address = document.getElementById("address").value;
var ojt = document.getElementById("ojt").value;
let certifyingAgencyWebsite=$
('#certifyingAgencyWebsite').val();
let age=$('#age').val();
let registrationCharges=$('#registrationCharges').val()
let courseFee=$('#courseFee').val();
let cutPrice=$('#cutPrice').val();
const examFee=$('#examFee').val();
let otherFee=$('#otherFee').val();
let emiOptionAvailable=$('#emiOptionAvailable').val();
let maxEMITenure=$('#maxEMITenure').val();
let stipendDuringTraining=$('#stipendDuringTraining').val();
let lastDateForApply=$('#lastDateForApply').val();
let requiredDocuments=$('#requiredDocuments').val();
let courseFeatures=$('#courseFeatures').val();
let importantTerms=$('#importantTerms').val();
let faq=$('#faq').val();
let firstError = ''
let flag = true
if (sector.trim() === '') {
$('#sectorblock').addClass('error')
firstError = firstError ? firstError : $('#sector')
flag = false
} if (courseLevel.trim() === "") {
$('#courseblock').addClass('error')
firstError = firstError ? firstError : $('#courseLevel')
flag = false;
} if (qualification.trim() === '') {
$('#qualificationblock').addClass('error')
firstError = firstError ? firstError : $('#qualification')
flag = false
}
if (onlineTrainingTiming.trim() === '') {
$('#onlineTrainingTiming').addClass('error')
firstError = firstError ? firstError : $('#onlineTrainingTiming')
flag = false
}
if (offlineTrainingTiming.trim() === '') {
$('#offlinetrainingblock').addClass('error')
firstError = firstError ? firstError : $('#jd-qua')
flag = false
}
if (ojt.trim()==="") {
$('#ojtblock').addClass('error')
firstError = firstError ? firstError : $('#ojt')
flag = false
}
if (address.trim() === '') {
$('#addressblock').addClass('error')
firstError = firstError ? firstError : $('#address')
flag = false
}
if (firstError) {
firstError.focus();
}
return true;
}
// $('#sub-btn').click((e) => {
// e.preventDefault();
// if (!validations()) {
// e.preventDefault();
// return false
// }

</script>
<% include ../partials/footer %>
</div>

You might also like