Şuanki Dizin: /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/ |
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/form.php |
<?php include('78enc22_main7sqww_8d9/lib/functions.php'); $db = new login_function(); $SuccessMsg=""; $contact_no_error = 0 ; $actual_image_name=""; $flag=0; $firstname=""; $middlename=""; $lastname=""; $mobile_no=""; $email_id=""; $address=""; $district=""; $taluka=""; $applicant=""; $college_name=""; $grievance_category=""; $grievance_subj=""; $grievance_details=""; $document=""; $declaration=""; if(isset($_POST['add'])) { $firstname = $_POST['firstname']; $middlename = $_POST['middlename']; $lastname = $_POST['lastname']; $mobile_no = $_POST['mobile_no']; if(strlen($mobile_no)!=10) { $contact_no_error = 1 ; $flag=1; } $email_id = $_POST['email_id']; $address = $_POST['address']; $district = ""; $taluka = ""; $applicant = $_POST['applicant']; $college_name = $_POST['college_name']; $grievance_category = $_POST['grievance_category']; $grievance_subj = $_POST['grievance_subj']; $grievance_details = $_POST['grievance_details']; //$declaration = $_POST['declaration']; $enroll_no = $_POST['enroll_no']; $qualification_id = $_POST['qualification']; $occupation_id = $_POST['occupation']; $designation_id = $_POST['designation']; $department_id = $_POST['department']; if(isset($_POST['declaration'])) { $declaration = 1; } $valid_formats = array("jpg","png","gif","bmp","jpeg","pdf","JPEG","JPG","BMP","PNG","GIF","PDF"); if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { $name = $_FILES['document']['name']; $size = $_FILES['document']['size']; if(strlen($name)) { list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { $documents = array(); function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } $current_random_string = generateRandomString(); $actual_image_name = $current_random_string.".".strtolower($ext); $tmp = $_FILES['document']['tmp_name']; $img_Dir = "78enc22_main7sqww_8d9/attachments/"; if(!file_exists($img_Dir)) { mkdir($img_Dir); } if(move_uploaded_file($tmp,$img_Dir.$actual_image_name)) { } else { $image_error = "failed" ; $flag = 1; } } else { $image_error = "Invalid document format"; $flag = 1; } } } if($flag==0) { if($db->save_grievance_form($firstname,$middlename,$lastname,$mobile_no,$email_id,$address,$district,$taluka,$applicant,$college_name,$grievance_category,$grievance_subj,$grievance_details,$actual_image_name,$declaration,$enroll_no,$qualification_id,$occupation_id,$designation_id,$department_id)) { $SuccessMsg = 1; $firstname=""; $middlename=""; $lastname=""; $mobile_no=""; $email_id=""; $address=""; $district=""; $taluka=""; $applicant=""; $college_name=""; $grievance_category=""; $grievance_subj=""; $grievance_details=""; $document=""; $declaration=""; } else { $SuccessMsg = 2; } } else { $SuccessMsg = 3; } } ?> <html> <head> <title>SVSMD's Grievance Form</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/bootstrap.min.css"> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <style> .form-control { } .heading { padding:20px; } @media only screen and (max-width: 800px) { .form-control { width:100%; margin:auto; padding:8px; } h3 { pading:10px; margin:12px; margin-top:25px; } .heading { padding:8px; } } .form-row { } </style> <script> function validateForm() { var i = document.forms["myForm"]["applicant"].value; var a = document.forms["myForm"]["firstname"].value; var b = document.forms["myForm"]["middlename"].value; var c = document.forms["myForm"]["lastname"].value; var d = document.forms["myForm"]["mobile_no"].value; var e = document.forms["myForm"]["email_id"].value; var f = document.forms["myForm"]["address"].value; var j = document.forms["myForm"]["college_name"].value; var k = document.forms["myForm"]["grievance_category"].value; var l = document.forms["myForm"]["grievance_subj"].value; var m = document.forms["myForm"]["grievance_details"].value; if (i == "" || i=="Select Applicant Type") { alert("Please Select Applicant Type"); return false; } if (a == "") { alert("Enter Your First Name"); return false; } if (b == "") { alert("Enter Your Middle Name"); return false; } if (c == "") { alert("Enter Your Last Name"); return false; } if (d == "") { alert("Enter Your Mobile Number"); return false; } if (e == "") { alert("Enter Email Address"); return false; } if (f == "") { alert("Enter Address") return false; } if (j == "") { alert("Enter Your College Name"); return false; } if (k == "" || k=="select") { alert("Please Select Grievance Category") return false; } if (l == "") { alert("Enter Grievance Subject"); return false; } if (m == "") { alert("Enter Grievance Details"); return false; } } </script> <script type="text/javascript"> function changeFunc() { var selectBox = document.getElementById("applicant_id"); var selectedValue = selectBox.options[selectBox.selectedIndex].value; if (selectedValue=="Student"){ $('#enroll_id').show(); } else { $('#enroll_id').hide(); } if (selectedValue=="Parents"){ $('#qualification_id').show(); $('#occupation_id').show(); } else { $('#qualification_id').hide(); $('#occupation_id').hide(); } if (selectedValue=="Faculty / Staff"){ $('#designation_id').show(); $('#department_id').show(); } else { $('#designation_id').hide(); $('#department_id').hide(); } } </script> <script> function check() { var pass1 = document.getElementById('mobile'); var message = document.getElementById('message'); var goodColor = "#0C6"; var badColor = "#E6DCDC"; if(mobile.value.length!=10){ mobile.style.backgroundColor = badColor; message.style.color = badColor; message.innerHTML = "required 10 digits mobile number" }} </script> </head> <body style="background-color:#C80032;"> <?php include('header.php'); ?> <div class="container heading"> <h3><center><span style="color:white; color: linear-gradient(blue, pink); font-weight:bold; text-shadow:4px 2px black; margin-bottom:0px;font-family: 'Archivo Black', sans-serif;">SVSMD's Grievance Form</span></center></h3> </div> <div class="container"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>" name="myForm" onsubmit="return validateForm()" enctype="multipart/form-data" autocomplete="off"> <?php if($SuccessMsg == 1) { ?> <div class="alert alert-success"> <span class="alert-link">Successfully ! </span> Your Details are Sent </div> <?php } ?> <div class="form-row"> <div class="form-group col-md-4"> <select class="form-control" name="applicant" id="applicant_id" onchange="changeFunc();"> <option value="Select Applicant Type">Select Applicant Type</option> <option value="Student"<?php if($applicant=="Student"){ ?> Selected <?php } ?>>Student</option> <option value="Parents" <?php if($applicant=="Parents"){ ?> Selected <?php } ?>>Parents</option> <option value="Faculty / Staff" <?php if($applicant=="Faculty / Staff"){ ?> Selected <?php } ?> >Faculty / Staff</option> <option value="Other" <?php if($applicant=="Other"){ ?> Selected <?php } ?> >Other</option> </select> </div> <div class="form-group col-md-4" id="enroll_id" style="display:none;"> <input type="text" class="form-control" placeholder="Enter Your Enrollment Number" name="enroll_no" value="<?php //echo $enroll_no; ?>" /> </div> <div class="form-group col-md-4" id="qualification_id" style="display:none;"> <input type="text" class="form-control" placeholder="Enter Parent Qualification" name="qualification" value="<?php //echo $enroll_no; ?>" /> </div> <div class="form-group col-md-4" id="occupation_id" style="display:none;"> <input type="text" class="form-control" placeholder="Enter Parent Occupation" name="occupation" value="<?php //echo $enroll_no; ?>" /> </div> <div class="form-group col-md-4" id="designation_id" style="display:none;"> <input type="text" class="form-control" placeholder="Enter Faculty Designation" name="designation" value="<?php //echo $enroll_no; ?>" /> </div> <div class="form-group col-md-4" id="department_id" style="display:none;"> <input type="text" class="form-control" placeholder="Enter Faculty Department" name="department" value="<?php //echo $enroll_no; ?>" /> </div> </div> <div class="form-row"> <div class="form-group col-md-4"> <input type="text" class="form-control" placeholder="Enter Your First Name" name="firstname" value="<?php echo $firstname; ?>" /> </div> <div class="form-group col-md-4"> <input type="text" class="form-control" placeholder="Enter Your Middle Name" name="middlename" value="<?php echo $middlename; ?>" /> </div> <div class="form-group col-md-4"> <input type="text" class="form-control" placeholder="Enter Your Last Name" name="lastname" value="<?php echo $lastname; ?>" /> </div> <div class="form-group col-md-4"> <input type="number" class="form-control" id="mobile" onkeyup="check(); return false;" placeholder="Enter Your Mobile Number" name="mobile_no" value="<?php echo $mobile_no; ?>" /><span id="message"></span> <?php if($contact_no_error == 1) { ?> <div> <span style="color:white;">Please Enter 10 Digit Mobile number</span> </div> <?php } ?> </div> <div class="form-group col-md-4"> <input type="email" class="form-control" placeholder="Enter Email Address" name="email_id" value="<?php echo $email_id; ?>" /> </div> <div class="form-group col-md-12"> <textarea type="text" class="form-control" placeholder="Enter Address" name="address" /><?php echo $address; ?></textarea> </div> <div class="form-group col-md-4"> <input type="text" class="form-control" placeholder="Enter College / Organisation Name where you belong" name="college_name" value="<?php echo $college_name; ?>" /> </div> <div class="form-group col-md-4"> <select class="form-control" name="grievance_category"> <option value="select" >Select Grievance Category</option> <option value="Academic" <?php if($grievance_category=="Academic"){ ?> Selected <?php } ?>>Academic</option> <option value="Anti Ragging" <?php if($grievance_category=="Anti Ragging"){ ?> Selected <?php } ?>>Anti Ragging</option> <option value="Anti Sexual Harassment" <?php if($grievance_category=="Anti Sexual Harassment"){ ?> Selected <?php } ?>>Anti Sexual Harassment</option> <option value="Any Other" <?php if($grievance_category=="Any Other"){ ?> Selected <?php } ?>>Any Other</option> </select> </div> <div class="form-group col-md-4"> <input type="text" class="form-control" placeholder="Enter Grievance Subject" name="grievance_subj" value="<?php echo $grievance_subj; ?>" /> </div> <div class="form-group col-md-6"> <textarea type="text" class="form-control" height="100" placeholder="Enter Grievance Details" name="grievance_details" /><?php echo $grievance_details; ?></textarea> </div> <div class="form-group col-md-6"> <label style="color:white;">Upload Supporting Document if any:</label> <input type="file" class="form-control" placeholder="" name="document" /> </div> <div class="form-group col-md-12" style="color:white;"> <b>Declaration:</b> <input type="checkbox" name="declaration" id="declaration" value="1"> I hereby state that the facts mentioned above are true to best of my knowledge and belief </div> <div class="form-group col-md-12"> <center><button type="submit" name="add" id="sumbit" onClick="return validate()" class="btn btn-success">Submit</button></center> </div> <input type="hidden" name="flg" value="1"> </div> </form> </div> <?php include('footer.php'); ?> </body> </html>
Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4