<?php
//session_start();
ob_start();
include "../../../../model/viewuser.php";
include "../../../../controller/upload.php";
include "../../../../konfig/dbconnect.php";
$aksi = $_GET[aksi];
if($aksi=='edit'){
    $user = new viewuser();
    $upload = new upload();
    
    $lokasi_file    = $_FILES['gambar']['tmp_name'];
    $tipe_file      = $_FILES['gambar']['type'];
    $nama_file      = $_FILES['gambar']['name'];
    $acak           = rand(1,99);
    $nama_unik      = $acak.$nama_file;

    $upload->profile($nama_unik);
    
    $user->id = $_POST[id];
    $user->editlogo($nama_unik);
    
    header('location:../../../../index.php?module=home');
}
?>
