File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/caste-based-discrimination-complaint.php
<?php include 'inc/header.php';?>
<?php include 'inc/slider.php';
if(isset($_POST['Submit']) and ($_POST['Submit']=='Submit'))
{
$offset1=19800; //converting 5:30 hours to seconds.
$dateFormat1="Y-m-d H:i:s";
$timeNdate1=gmdate($dateFormat1, time()+$offset1);
if(isset($_REQUEST['name'], $_REQUEST['phone']) and !empty($_REQUEST['name']) and !empty($_REQUEST['phone']))
{
$cdate = $_REQUEST['cdate'];
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$roll = $_REQUEST['roll'];
$course = $_REQUEST['course'];
$category = $_REQUEST['category'];
$official = $_REQUEST['official'];
$message = $_REQUEST['message'];
//$insert = mysqli_query($connection->myconn, "INSERT INTO enquire SET painting='".$painting."', artists='".$artists."', ref ='".$ref."', name='".$name."', email='".$email."', phone='".$phone."', message='".$message."', action='1', created_on='".$timeNdate1."'");
//if($insert === TRUE)
//{
$to = "sbscprincipal@gmail.com";
$subject = "Caste Based Discrimination Complaint Form your website";
$message = "
<html>
<head>
<title>Caste Based Discrimination Complaint Form your website</title>
</head>
<body>
<p>This email received from your wensite.</p>
<table border='1'>
<tr>
<th>Date</th>
<td>".$cdate."</td>
</tr>
<tr>
<th>Name</th>
<td>".$name."</td>
</tr>
<tr>
<th>E-mail ID.</th>
<td>".$email."</td>
</tr>
<tr>
<th>Mobile No.</th>
<td>".$phone."</td>
</tr>
<tr>
<th>Roll No.</th>
<td>".$roll."</td>
</tr>
<tr>
<th>Course/Semester</th>
<td>".$course."</td>
</tr>
<tr>
<th>Category</th>
<td>".$category."</td>
</tr>
<tr>
<th>Name of the erring Official/Faculty Member</th>
<td>".$official."</td>
</tr>
<tr>
<th>Details of the complaint</th>
<td>".$message."</td>
</tr>
</table>
</body>
</html>";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From:'. $email . "\r\n";
//$headers .= 'Cc: myboss@example.com' . "\r\n";
$mail = mail($to,$subject,$message,$headers);
$to = $mail;
$subject = "Caste Based Discrimination Complaint";
$message = "
<html>
<head>
<title>Caste Based Discrimination Complaint for sbsc website</title>
</head>
<body>
<p>This email copy of your complaint mail.</p>
<table border='1'>
<tr>
<th>Date</th>
<td>".$cdate."</td>
</tr>
<tr>
<th>Name</th>
<td>".$name."</td>
</tr>
<tr>
<th>E-mail ID.</th>
<td>".$email."</td>
</tr>
<tr>
<th>Mobile No.</th>
<td>".$phone."</td>
</tr>
<tr>
<th>Roll No.</th>
<td>".$roll."</td>
</tr>
<tr>
<th>Course/Semester</th>
<td>".$course."</td>
</tr>
<tr>
<th>Category</th>
<td>".$category."</td>
</tr>
<tr>
<th>Name of the erring Official/Faculty Member</th>
<td>".$official."</td>
</tr>
<tr>
<th>Details of the complaint</th>
<td>".$message."</td>
</tr>
</table>
</body>
</html>";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <sbscprincipal@gmail.com>' . "\r\n";
$mail1 = mail($to,$subject,$message,$headers);
echo "<script>alert('Thanks Your Complaint Submit Successfully.')</script>";
}else
{
echo "<script>alert('Error Youe Complaint not send.')</script>"; //##### FAILED SQL ERROR
}
//else
//{
// echo "<script>alert('Error Youe Complaint not send.')</script>"; //##### REQUIRED PARAMETER MISSING
//}
}
?>
<div class="container">
<div class="row">
<div class="col-lg-12"> <img src="images/banner_sbsc.jpg" class="img-responsive" alt="">
<h3 class="sub_heading">Caste Based Discrimination Complaint</h3>
</div>
</div>
</div>
<div class="container">
<div class="row " >
<div class="col-lg-12 ">
<!--<h4 class="inner_heading">CASTE BASED DISCRIMINATION COMPLAINT</h4>-->
<!-- <div class="pull-right m_2" ><a href="http://sbsc.in/calender.pdf"><img src="images/calendar.png" class="img-responsive" alt=""></a></div>-->
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h4>Complaint Here</h4>
</div>
<div class="panel-body">
<span class="eerror" style="color:red; display:none; text-align: center;"></span>
<form action="" method="post" name="complaint_form" enctype="multipart/form-data">
<div class="form-group col-md-6">
<label>Date</label>
<input type="date" class="form-control" name="cdate" />
</div>
<div class="form-group col-md-6">
<label for="Name">Name</label>
<input type="text" class="form-control" placeholder="Name" name="name" onKeyPress="return withoutspecialnumeric(event)" maxlength="35" />
</div>
<div class="form-group col-md-6">
<label for="Email">E-mail ID</label>
<input type="text" class="form-control" placeholder="Email" name="email" maxlength="150" />
</div>
<div class="form-group col-md-6">
<label for="Phone">Mobile No.</label>
<input type="text" class="form-control" placeholder="Mobile No." name="phone" onKeyPress="return IsNumeric(event)" maxlength="10" />
</div>
<div class="form-group col-md-6">
<label for="Phone">Roll No.</label>
<input type="text" class="form-control" placeholder="Roll No." name="roll" onKeyPress="return IsNumeric(event)" maxlength="10" />
</div>
<div class="form-group col-md-6">
<label for="Name">Course/Semester</label>
<input type="text" class="form-control" placeholder="Course/Semester" name="course" />
</div>
<div class="form-group col-md-6">
<label for="Name">Category</label>
<select name="category" class="form-control">
<option value="">-Select--</option>
<option value="SC">SC</option>
<option value="ST">ST</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="Name">Name of the erring Official/Faculty Member</label>
<input type="text" class="form-control" placeholder="Name of the erring Official/Faculty Member" name="official" />
</div>
<div class="form-group col-md-12">
<label for="Message"> Details of the complaint</label>
<textarea class="form-control" placeholder=" Details of the complaint" name="message" rows="5"></textarea>
</div>
<div class="form-group col-md-12">
<button type="submit" class="btn btn-danger" name="Submit" value="Submit" onclick="return Validate_complaint();">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php include 'inc/footer.php';?>
<script>
function IsNumeric(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
function withoutspecialnumeric(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if((64 < charCode && charCode < 91) || (96 <charCode && charCode< 123) || (charCode==32) || charCode == 8 || charCode == 46)
{
return true;
}else
{
return false;
}
}
function Validate_complaint()
{
//alert("okkkkkkk");
if(document.complaint_form.cdate.value.trim() == '')
{
$(".eerror").html('Please select date.');
document.complaint_form.cdate.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.name.value.trim() == '')
{
$(".eerror").html('Please enter your name.');
document.complaint_form.name.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.name.value.length < 3)
{
$(".eerror").html('Please enter your correct name.');
document.complaint_form.name.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.email.value.trim() == '')
{
$(".eerror").html('Please enter email.');
document.complaint_form.email.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.email.value.trim()!= '')
{
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.complaint_form.email.value)))
{
$(".eerror").html('Invalid email id! please enter the correct email id.');
document.complaint_form.email.focus();
$(".eerror").css("display", "block");
return false;
}
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.phone.value.trim() == '')
{
$(".eerror").html('Please enter mobile number.');
document.complaint_form.phone.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.phone.value.length < 10)
{
$(".eerror").html('Please enter your correct mobile number.');
document.complaint_form.phone.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.roll.value.trim() == '')
{
$(".eerror").html('Please enter roll number.');
document.complaint_form.roll.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.course.value.trim() == '')
{
$(".eerror").html('Please enter Course/Semester.');
document.complaint_form.course.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.category.value.trim() == '')
{
$(".eerror").html('Please select your category.');
document.complaint_form.category.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.official.value.trim() == '')
{
$(".eerror").html('Please enter Name of the erring Official/Faculty Member.');
document.complaint_form.official.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
if(document.complaint_form.message.value.trim() == '')
{
$(".eerror").html('Please enter your Details of the complaint.');
document.complaint_form.message.focus();
$(".eerror").css("display", "block");
return false;
}else{
$(".eerror").css("display", "none");
}
return true;
}
</script>