-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateArtwork.php
52 lines (33 loc) · 1.12 KB
/
updateArtwork.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
session_start();
if($_SESSION['username']=='' || $_SESSION['roll'] != 'Artist'){
header("Location:index.php");
exit;
}
include 'php/connectdatabase.php';
if (isset($_POST['modify'])){
$aid=$_POST['action'];
$SQLupdateArtwork = "SELECT * FROM ArtWork WHERE AId ='$aid'";
$resultUpdateArtwork = mysqli_query($conn, $SQLupdateArtwork);
$artwork = mysqli_fetch_array($resultUpdateArtwork);
$modTitle = $artwork['Title'];
$modDesc = $artwork['Art_description'];
$disable= $artwork['disabel_comment'];
if(!empty($_POST['Title']))
$modTitle= $_POST['Title'];
if(!empty($_POST['desc']))
$modDesc= $_POST['desc'];
if(!empty($_POST['disableComment'])){
$disable=1;
}
$sql1 ="UPDATE ArtWork SET Title='$modTitle',Art_description ='$modDesc',disabel_comment='$disable' WHERE AId='$aid' ";
if (mysqli_query($conn, $sql1)){
echo '<script language="javascript">';
echo 'alert("ART WORK UPDATED SUCCESFULLY")';
echo '</script>';
}else {
echo "Error: " . $sql1 . "<br>" . mysqli_error($conn);
}
}
header("location:ArtistStudio.php");
?>