Monkey Albino

Linux altar53.supremepanel53.com 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64
/ home/ bdapparelinfo/ apptech-resource.com.bd/ Wp-Administrator/ modul/

/home/bdapparelinfo/apptech-resource.com.bd/Wp-Administrator/modul/user_query.php

<?php 	
	$form_error = array();
	if(isset($_POST['addpages'])){
		
		
		$des = addslashes($_POST['des']);
		$title = addslashes($_POST['title']); 
		$dob = date('d-m-Y');
		$pagescontent = $_POST['pages_name'];
		$price = $_POST['price'];
		$size = $_POST['size'];
		$model = $_POST['model'];
		$post_position = $_POST['post_position'];
		$resized_file = "";
		
		$User_Img1 = $_FILES['u_img1']['name'];
		$User_Img2 = $_FILES['u_img2']['name'];
		$User_Img3 = $_FILES['u_img3']['name'];
		$User_Img4 = $_FILES['u_img4']['name'];
		//echo $User_Img;
		//exit;
		//upload a file		
			$t=time();
		$User_Img1 = $t.$_FILES['u_img1']['name'];
			$array = explode(".", $_FILES["u_img1"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img1"]["size"] > 20000 && $_FILES["u_img1"]["error"] > 0)					{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img1']['tmp_name'], "../media/" .$t.$_FILES['u_img1']['name']);		
				}		
		$User_Img2 = $t.$_FILES['u_img2']['name'];
			$array = explode(".", $_FILES["u_img2"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img2"]["size"] > 20000 && $_FILES["u_img2"]["error"] > 0)					{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img2']['tmp_name'], "../media/" .$t.$_FILES['u_img2']['name']);		
				}		
		$User_Img3 = $t.$_FILES['u_img3']['name'];
			$array = explode(".", $_FILES["u_img3"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img3"]["size"] > 20000 && $_FILES["u_img3"]["error"] > 0)					{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img3']['tmp_name'], "../media/" .$t.$_FILES['u_img3']['name']);		
				}			
		$User_Img4 = $t.$_FILES['u_img4']['name'];
			$array = explode(".", $_FILES["u_img4"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img4"]["size"] > 20000 && $_FILES["u_img4"]["error"] > 0)					{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img4']['tmp_name'], "../media/" .$t.$_FILES['u_img4']['name']);		
				}		
			//include('img_upload.php');		
		
		///exit;
		 
		$add_user = $function_file->addcontent($pagescontent, $title, $price, $size, $model, $des, $post_position, $User_Img1, $User_Img2, $User_Img3, $User_Img4, $resized_file, $dob); 
	}//	end inserting User
	$ID=$_GET['id'];
		$edit_pages = $function_file->edit_pages_id($ID);
		$raw = mysql_fetch_array($edit_pages);
		$IMG1=$raw['image'];$IMG2=$raw['image_2'];$IMG3=$raw['image_3'];$IMG4=$raw['image_4'];
		$pages_name=$raw['content_pages_name'];
			$sqlcat=mysql_fetch_array(mysql_query("SELECT * FROM `categories` WHERE id='$pages_name'"));
		//$Cat_Id_No=$raw['content_pages_name'];
		
	if(isset($_POST['editpages'])){		
		$ID = $_POST['edit_id'];
		$des = addslashes($_POST['des']);
		$title = addslashes($_POST['title']); 
		$dob = date('d-m-Y  H:i:s');
		$pagescontent = $_POST['pages_name'];	
		$price = $_POST['price'];
		$size = $_POST['size'];
		$model = $_POST['model'];
		$post_position = $_POST['post_position'];
		
			$t=time();	
		if($_FILES['u_img1']['name']){
		$User_Img1 = $t.$_FILES['u_img1']['name'];
		$array = explode(".", $_FILES["u_img1"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img1"]["size"] > 20000 && $_FILES["u_img1"]["error"] > 0)	{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img1']['tmp_name'], "../media/" .$t.$_FILES['u_img1']['name']);		
						unlink("../media/".$_POST['img_old1']);			
				}		
		}else{		
		$User_Img1 = $_POST['img_old1'];
		}
		if($_FILES['u_img2']['name']){
		$User_Img2 = $t.$_FILES['u_img2']['name'];
		$array = explode(".", $_FILES["u_img2"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img2"]["size"] > 20000 && $_FILES["u_img2"]["error"] > 0)	{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img2']['tmp_name'], "../media/" .$t.$_FILES['u_img2']['name']);		
						unlink("../media/".$_POST['img_old2']);			
				}		
		}else{		
		$User_Img2 = $_POST['img_old2'];
		}
		if($_FILES['u_img3']['name']){
		$User_Img3 = $t.$_FILES['u_img3']['name'];
		$array = explode(".", $_FILES["u_img3"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img3"]["size"] > 20000 && $_FILES["u_img3"]["error"] > 0)	{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img3']['tmp_name'], "../media/" .$t.$_FILES['u_img3']['name']);		
						unlink("../media/".$_POST['img_old3']);			
				}		
		}else{		
		$User_Img3 = $_POST['img_old3'];
		}
		if($_FILES['u_img4']['name']){
		$User_Img4 = $t.$_FILES['u_img4']['name'];
		$array = explode(".", $_FILES["u_img4"]["name"]);
			$extension = end( $array);
			$allowedExts = array("jpg", "jpeg", "gif", "png");
				if(!in_array($extension, $allowedExts) && $_FILES["u_img4"]["size"] > 20000 && $_FILES["u_img4"]["error"] > 0)	{
						$upload_error['upload_error']	= 'This file is not allowed to upload';
				}
				else	
				{
						move_uploaded_file($_FILES['u_img4']['tmp_name'], "../media/" .$t.$_FILES['u_img4']['name']);	
						unlink("../media/".$_POST['img_old4']);				
				}		
		}else{		
		$User_Img4 = $_POST['img_old4'];
		}
		/*ennd img 
		
		
		exit();*/
		$ed_page = $function_file->editpages($ID, $des, $title,  $price, $size, $model, $dob, $pagescontent, $post_position, $User_Img1, $User_Img2, $User_Img3, $User_Img4);
	}//	end inserting User
	
	
?>