<!DOCTYPE html>
<html lang="en">

<?php
session_start();
include "menuadmin.php";
include 'config.php';


if (isset($_POST['update'])) 
{
	$kodecetak=addslashes($_POST['ikodecetak']);
    $xfoto = "logo.png";
	$filesqr    ='assets/img/logo.png';
	unlink($filesqr);
	//$uploaddir = 'assets/img/';
    //$uploadfile = $uploaddir . basename($_FILES['ffoto']['name']);
	//move_uploaded_file($_FILES['ffoto']['tmp_name'], $uploadfile);
	move_uploaded_file($_FILES['ffoto']['tmp_name'], 'assets/img/'.$xfoto);
			
	
	
	

		// Update the database table
		$result = mysqli_query($mysqli, "UPDATE `print` SET `logo`='$xfoto' WHERE `Idcetak`='$kodecetak'");
		
		// Display success message
		echo "<p><font color='green'>Data updated successfully!</p>";
		echo "<br>  ";
		header("location:setinglogo.php?ed=1");
		
}

