Shell File Manager
<?php
session_start();
include_once('../include/config.php');
$log_status=$_GET['log_status'];
if ($log_status == ''){
header("Location: ../Login/login-user.php");
}
if ($log_status == $_SESSION['log_status']){
$result = mysqli_query($connection,"SELECT * FROM usertable where log_status='$log_status'");
$row= mysqli_fetch_array($result);
$user_id=$row['id'];
if (isset($_POST['rma'])) {
$successrma = "";
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$c_name =$_POST['c_name'];
$c_person = $_POST['c_person'];
$email=$_POST["email"];
$tele=$_POST["tele"];
$Fax=$_POST["Fax"];
$Address=$_POST["Address"];
$pos_code=$_POST["pos_code"];
$city=$_POST["city"];
$country=$_POST["country"];
$invoice_date=$_POST["invoice_date"];
$invoice_num=$_POST["invoice_num"];
$distributor_name=$_POST["distributor_name"];
$inser_rma = "INSERT INTO services_rma (user_id,c_name, c_person, email,tele,Fax,Address,pos_code,city,country,invoice_date,invoice_num,distributor_name)
VALUES ('$user_id' , '$c_name', '$c_person', '$email','$tele','$Fax','$Address','$pos_code','$city','$country','$invoice_date','$invoice_num','$distributor_name')";
if ($connection->query($inser_rma) === TRUE) {
$successrma="New RMA Request created successfully";
$field_values_array = $_POST['model_number'];
$field_values_array = $_POST['serial_number'];
$field_values_array = $_POST['problem'];
foreach($field_values_array as $key => $value){
$rma_id = $connection->insert_id; // function will now return the ID instead of tru
$inser_rma_products = " INSERT INTO services_rma_products (rma_id, model_number, serial_number,problem ) VALUES('$rma_id' ,'" . $_POST['model_number'][$key] . "' ,'" . $_POST['serial_number'][$key] . "','" . $_POST['problem'][$key] . "' )";
$resultpayment = mysqli_query($connection, $inser_rma_products);
print_r($inser_rma_products);
}
} else {
echo "Error: " . $inser_rma . "<br>" . $connection->error;
}
header("Location: services.php?log_status=$log_status");
}
}
Shell File Manager Version 1.1, Coded By Shell
Email: [email protected]