mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Client File upload module created
This commit is contained in:
22
post.php
22
post.php
@@ -100,6 +100,8 @@ if(isset($_POST['add_client'])){
|
||||
mysqli_query($mysqli,"INSERT INTO client_domains SET client_domain_name = '$website', client_id = $client_id");
|
||||
}
|
||||
|
||||
mkdir("uploads/client_files/$client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Client added";
|
||||
|
||||
header("Location: clients.php");
|
||||
@@ -1600,6 +1602,26 @@ if(isset($_GET['delete_client_login'])){
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_file'])){
|
||||
$client_id = intval($_POST['client_id']);
|
||||
$file_type = strip_tags(mysqli_real_escape_string($mysqli,$_POST['file_type']));
|
||||
$new_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['new_name']));
|
||||
|
||||
if($_FILES['file']['tmp_name']!='') {
|
||||
$path = "uploads/client_files/$client_id/";
|
||||
$path = $path . basename( $_FILES['file']['name']);
|
||||
$file_name = basename($path);
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO files SET file_type = '$file_type', file_name = '$path', client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "File uploaded";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_note'])){
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
||||
Reference in New Issue
Block a user