Commit 351fd025 by Cici

upload

parent 74a5442a
<?php
$id = $_GET['id'];
?>
<form id="contact-us" method="post" action="upload_bukti_process.php?id=<?= $id ?>" enctype="multipart/form-data">
<!-- Left Inputs -->
<input type="file" name="uploaded_file" id="username" required="required" class="form" placeholder="Username" />
<br><br>
<button type="submit" id="submit" name="submit" class="text-center form-btn form-btn">Upload</button>
</form>
\ No newline at end of file
<?php
session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';
if (!empty($_FILES['uploaded_file'])) {
$path = "pembayaran/";
$path = $path . basename($_FILES['uploaded_file']['name']);
if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {
echo "The file " . basename($_FILES['uploaded_file']['name']) .
" has been uploaded";
} else {
echo "There was an error uploading the file, please try again!";
}
}
$gambar = basename($_FILES['uploaded_file']['name']);
$status = "Waiting For Confirmation";
$id = $_GET['id'];
//die($gambar);
$sql = "UPDATE pembayaran SET status='$status',gambar='$gambar' WHERE id=$id";
if ($database->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $database->error;
}
redirect('index.php#pembayaran');
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment