Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aditiverma-21 authored Sep 13, 2024
1 parent 2962aef commit 886371f
Show file tree
Hide file tree
Showing 25 changed files with 1,586 additions and 0 deletions.
82 changes: 82 additions & 0 deletions adminprofile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php
$id=$_REQUEST["user_id"];
include'db.php';
$qry="SELECT * FROM user_details WHERE userid='$id'";
$result=mysqli_query($con,$qry);
$row=mysqli_fetch_array($result);


?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin| Site Name</title>
</head>
<body>
<img src="" alt="userimage" width="200" height="200"><br>
<h1>Admin NAME</h1>
<br>
<h1>Personal Info</h1>


<form>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td><h2>Personal Details</h2></td></tr>
<tr>
<td>Name: </td>
<td>
<input type="text" name="txtname" value="'<?php echo $row["user_name"]; ?>' " placeholder="Enter name here" autofocus>
<input type="hidden" name="txthidden" value='<?php echo $row["user_id"]; ?>' >

</td>
</tr>

<tr>
<td>Date of Birth: </td>
<td>
<input type="date" name="dob" value='<?php echo $row["dob"]; ?>' required>
</td>
</tr>

<tr>
<td>Email Id: </td>
<td>
<input type="email" name="txtemail" value='<?php echo $row["email_id"]; ?>'placeholder="mail-id">
</td>
</tr>


<tr>
<td>Contact: </td>
<td>
<input type="tel" name="txttel" value='<?php echo $row["phone"]; ?>'placeholder="Your phone number">
</td>
</tr>

</form>
</table>

<h2>Total Artworks Uploaded in the site:</h2>
<?php

$con=mysqli_connect("localhost","root","","artcopyright");
$qry= "SELECT*from artwork";

$total=(mysqli_query($con,$qry));
echo".'$total'.";
?>

<br>
<a href="logout.php" target="_blank" title="logoutsite">Logout</a>

</body>
</html>



</body>
</html>
173 changes: 173 additions & 0 deletions artgallery1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 15, 2023 at 07:02 AM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.0.28

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `artgallery`
--

-- --------------------------------------------------------

--
-- Table structure for table `artwork`
--

CREATE TABLE `artwork` (
`a_id` int(20) NOT NULL,
`user_id` varchar(20) NOT NULL,
`registration_no` varchar(20) NOT NULL,
`title` varchar(40) NOT NULL,
`description` text NOT NULL,
`medium` text NOT NULL,
`image` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `category`
--

CREATE TABLE `category` (
`Painting` varchar(10) NOT NULL,
`Sketches` varchar(10) NOT NULL,
`Photographs` varchar(20) NOT NULL,
`Best _out _of _waste` varchar(20) NOT NULL,
`Statue` varchar(12) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `copyright`
--

CREATE TABLE `copyright` (
`cr_id` int(11) NOT NULL,
`user_id` int(20) NOT NULL,
`registration_no` varchar(20) DEFAULT NULL,
`title` varchar(40) NOT NULL,
`category` varchar(10) NOT NULL,
`description` text NOT NULL,
`medium` varchar(20) NOT NULL,
`published` varchar(10) NOT NULL,
`area` varchar(20) NOT NULL,
`year` year(4) NOT NULL,
`authority` varchar(20) NOT NULL,
`design_act` varchar(5) NOT NULL,
`copyright_act` varchar(5) NOT NULL,
`work_photo` varchar(100) DEFAULT NULL,
`awards` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `copyright`
--

INSERT INTO `copyright` (`cr_id`, `user_id`, `registration_no`, `title`, `category`, `description`, `medium`, `published`, `area`, `year`, `authority`, `design_act`, `copyright_act`, `work_photo`, `awards`) VALUES
(0, 2, NULL, 'Clouds', 'Photograph', 'gdrg', 'ggedx', '', '', '0000', '', 'No', 'Yes', NULL, 'gfx'),
(0, 3, NULL, 'Tree', 'Statue', 'Artwork', 'Oil', 'Yes', 'ncbdnm', '2023', 'bdbfme', 'Yes', 'No', NULL, 'jdbfje');

-- --------------------------------------------------------

--
-- Table structure for table `login`
--

CREATE TABLE `login` (
`uid` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_details`
--

CREATE TABLE `user_details` (
`user_id` int(12) NOT NULL,
`user_name` varchar(20) NOT NULL,
`password` varchar(10) NOT NULL,
`name` varchar(100) NOT NULL,
`email_id` varchar(40) NOT NULL,
`phone` bigint(20) NOT NULL,
`gender` varchar(10) NOT NULL,
`nationality` text NOT NULL,
`address` text NOT NULL,
`aadhar_no` bigint(12) NOT NULL,
`passport_no` varchar(20) NOT NULL,
`pan_no` varchar(20) NOT NULL,
`photo` varchar(2000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `artwork`
--
ALTER TABLE `artwork`
ADD PRIMARY KEY (`a_id`);

--
-- Indexes for table `copyright`
--
ALTER TABLE `copyright`
ADD PRIMARY KEY (`user_id`);

--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`uid`);

--
-- Indexes for table `user_details`
--
ALTER TABLE `user_details`
ADD PRIMARY KEY (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `artwork`
--
ALTER TABLE `artwork`
MODIFY `a_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `login`
--
ALTER TABLE `login`
MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user_details`
--
ALTER TABLE `user_details`
MODIFY `user_id` int(12) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
123 changes: 123 additions & 0 deletions artwork.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?php session_start();
include'db.php';

$id=$_SESSION["user_id"];

$qry="SELECT * FROM user_details WHERE user_id='$id'";
$result=mysqli_query($con,$qry);
$row=mysqli_fetch_array($result);

$qry2="SELECT * FROM `category`";
$all_categories = mysqli_query($con,$qry2);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register Artwork</title>
</head>
<body>
<center><h1>Upload your Artwork!!</h1></center>


<form name="artworkregister" action="artwork.php" method="post" enctype="multipart/form-data">

<table border="0" cellspacing="1" cellpadding="5" align="center" >
<tr>
<td>User Id: </td>
<td>
<input type="text" name="uid" value='<?php echo $row["user_id"]; ?>' autocomplete="off" required disabled>
<input type="hidden" name="txthidden" value='<?php echo $row["user_id"]; ?>' >

</td>
</tr>
<tr>
<td>Title: </td>
<td>
<input type="text" name="title" value="" placeholder="Title" required>
</td>
</tr>
<tr>
<td>Description: </td>
<td>
<input type="text" name="desc" value="" placeholder="Description of Artwork" required >
</td>
</tr>
<tr>
<td>Medium: </td>
<td>
<input type="text" name="medium" value="" placeholder="Medium" required>

</td>
</tr>
<tr>
<td>Category: </td>
<td>
<select name="category">
<?php
while ($category = mysqli_fetch_array(
$all_categories,MYSQLI_ASSOC)):;
?>
<option value="<?php echo $category["category_name"];?>">
<?php echo $category["category_name"];?>
</option>
<?php
endwhile;
?>
</select>

</td>
</tr>

<tr>
<td>Upload Image of your Artwork</td>
<td>
<input type="file" name="img" accept="image/jpeg" >
</td>
</tr>
<br>

<tr>
<td colspan="2" align="center">
<input type="submit" name="btnsave" value="Save and Proceed">
<input type="reset" name="clear" value="Clear">
</td>
</tr>


</table>
</form>

<?php

if(isset($_REQUEST["btnsave"]))
{
$user_id=$_REQUEST["uid"];
$title=$_REQUEST["title"];
$description=$_REQUEST["desc"];
$medium=$_REQUEST["medium"];
$category=$_REQUEST["category"];
$upload=$_REQUEST["img"];


include 'db.php';
$qry= "INSERT INTO `artwork`(`user_id`, `title`, `description`, `medium`,`category`, `image`) VALUES ('$user_id','$title','$description','$medium','$category','$upload')";

if(mysqli_query($con,$qry))
{
echo"<center><h2>Artwork Uploaded Successfully!!!</h2></center>";
}
else
{
echo"<center><h2>Artwork not uploaded ,Error Occured!!!</h2></center>";
}


}


?>

</body>
</html>
Loading

0 comments on commit 886371f

Please sign in to comment.