-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_gigs.php
34 lines (27 loc) · 1.16 KB
/
check_gigs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
require_once "./dbConnection.inc";
require_once "./function.php";
getSessionValues();
if (isset($_POST['addGigs'], $conn)) {
if (!empty($_POST['service'])) {
$service = $_POST['service'];
$description = $_POST['description'];
$price = $_POST['price'];
$banner = $_FILES['imgToUpload'];
if (isset($service, $description, $banner, $price)) {
$sql = "INSERT INTO freelance_gig(gigs_service, gigs_description, gigs_banner, gigs_price, user_id) VALUES ('$service', '$description', '$banner', '$price', (SELECT freelance_id FROM freelance_info WHERE freelance_id = '$userId'))";
$conn->query($sql);
echo $conn->affected_rows;
$lastId = $conn->insert_id;
$banner = add_image_gigs($conn, $_POST["addGigs"], $_FILES["imgToUpload"], "freelance_gig", $lastId);
header("location: mygigs.php");
} else {
header("location: add_gigs.php?input_status=noinput");
}
} else {
echo "<script>alert('No Input'); window.location.href='add_gigs.php'</script>";
}
}
if (isset($_POST['cancelGigs'])) {
header("location: mygigs.php");
}