diff --git a/action.php b/action.php new file mode 100644 index 0000000..650110d --- /dev/null +++ b/action.php @@ -0,0 +1,126 @@ +num_rows > 0) + { + mysqli_query($conn, "UPDATE users SET name = '" . $name . "', phone = '" . $phone . "', status = '" . $status . "', created_at = NOW() WHERE email = '" . $email . "'"); + } + else + { + mysqli_query($conn, "INSERT INTO users (name, email, phone, created_at, updated_at, status) VALUES ('" . $name . "', '" . $email . "', '" . $phone . "', NOW(), NOW(), '" . $status . "')"); + + } + } + + // Close opened CSV file + fclose($csvFile); + + header("Location: index.php"); + + } + else + { + echo "Please select valid file"; + } + } + +} +elseif ($action=='remove') +{ + $sql="DELETE from importation where id=".$id; + + mysqli_query($conn, $sql); + + header("Location: index.php"); +} + +?> \ No newline at end of file diff --git a/db.php b/db.php new file mode 100644 index 0000000..a4ac4c7 --- /dev/null +++ b/db.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/index.php b/index.php index 6c32a7d..d0a71fe 100644 --- a/index.php +++ b/index.php @@ -64,6 +64,11 @@ Exports AidImpact +