Skip to content

Commit

Permalink
portfolio needs to be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
bindumareedu committed Apr 22, 2019
2 parents ecf917d + ae11e7d commit f534cca
Show file tree
Hide file tree
Showing 14 changed files with 764 additions and 309 deletions.
6 changes: 6 additions & 0 deletions backend/connect.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
<<<<<<< HEAD
$connection = pg_connect("host=ec2-54-227-245-146.compute-1.amazonaws.com
dbname=d2kuab01c8dti4 port=5432 user=uxaxldrtjmmrxj password=05baad5cb66858815c641ff304a9bb2b115a1d0fad29703e038b61c916826795")
or die('Could not connect: ' . pg_last_error());
Expand All @@ -8,4 +9,9 @@
// $select_db = mysqli_select_db($connection, 'test');
// if (!$select_db){
// die("Database Selection Failed" . mysqli_error($connection));
=======
$connection = pg_connect("host=ec2-54-227-245-146.compute-1.amazonaws.com
dbname=d2kuab01c8dti4 port=5432 user=uxaxldrtjmmrxj password=05baad5cb66858815c641ff304a9bb2b115a1d0fad29703e038b61c916826795")
or die('Could not connect: ' . pg_last_error());
>>>>>>> ae11e7d170e6662d61464e41d48b7411a59eaac4
?>
2 changes: 1 addition & 1 deletion backend/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
}
// header('Content-type: application/json');
// echo json_encode($response_array);
// pg_close($connection);
pg_close($connection);
}
?>
Empty file removed backend/dashboard.php
Empty file.
3 changes: 2 additions & 1 deletion backend/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
if (isset($_SESSION['username'])){
// I'm re-directing it to index page for now.
// But needs to be pointed to DASHBOARD.
header('Location: ../dashboard.php');
header('Location: ../pages-profile.php');
}
else{
echo "something went wrong, please try again!";
}
}
pg_close($connection);
//3.1.4 if the user is logged in Greets the user with message

?>
1 change: 1 addition & 0 deletions backend/process.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
$name_error = "Sorry, An account exists with this email ID";
}
}
pg_close($connection);
?>
86 changes: 86 additions & 0 deletions backend/profile-update.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

session_start();
require('connect.php');

if (isset($_GET['username']) and isset($_GET['fname']) and isset($_GET['lname']) and isset($_GET['email'])){
$photographer = $_GET['username'];
$fname = $_GET['fname'];
$lname = $_GET['lname'];
$email = $_GET['email'];
// $msg_subject = $_GET['Subject'];

if(isset($_GET['facebook'])){
$facebook = $_GET['facebook'];
}

if(isset($_GET['twitter'])){
$twitter = $_GET['twitter'];
}

if(isset($_GET['instagram'])){
$instagram = $_GET['instagram'];
}

if(isset($_GET['pinterest'])){
$pinterest = $_GET['pinterest'];
}

if(isset($_GET['phone'])){
$phone = $_GET['phone'];
}

if(isset($_GET['title'])){
$title = $_GET['title'];
}

if(isset($_GET['about'])){
$about = $_GET['about'];
}

if(isset($_GET['address'])){
$address = $_GET['address'];
}

if(isset($_GET['projects'])){
$projects = $_GET['projects'];
}

if(isset($_GET['clients'])){
$clients = $_GET['clients'];
}

if(isset($_GET['skills'])){
$skills = json_decode(stripslashes($_GET['skills']));
}

if(isset($_GET['percs'])){
$percs = json_decode(stripslashes($_GET['percs']));
}

// echo $username;

$query = "UPDATE public.users_info SET profile_email='$email',fname = '$fname',lname = '$lname',facebook_url = '$facebook',twitter_url = '$twitter',pinterest_url = '$pinterest',instagram_url = '$instagram',pnum = '$phone',designation = '$title',about = '$about',address = '$address',projects = '$projects',clients = '$clients' WHERE email = '$photographer'";
$result = pg_query($connection, $query) or die('Query failed: ' . pg_last_error());
if($result){
echo 'success';
}
else {
echo 'error';
}

for($i=0; $i < count($skills); $i++){
$query2 = "INSERT INTO public.skills(photographer_id,skill_name,strength) VALUES ('$photographer','$skills[$i]','$percs[$i]')";
$result2 = pg_query($connection, $query2) or die('Query failed: ' . pg_last_error());
if($result2){
echo 'success';
}
else {
echo 'error';
}
}

pg_close($connection);
// echo 'success';
}
?>
2 changes: 1 addition & 1 deletion backend/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
// header('Location: http://ella.ils.indiana.edu/~smareedu/login/home.php');
// exit;
// }

pg_close($connection);
?>
54 changes: 6 additions & 48 deletions dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="main-menu h-100">
<nav class="navbar h-100 navbar-expand-lg">
<!-- Logo Area -->
<a class="navbar-brand" href="index.html"><img src="img/core-img/logo.png" width="240px" height="100px" alt="Logo" style="margin-left: -25%;"></a>
<a class="navbar-brand" href="#"><img src="img/core-img/logo.png" width="240px" height="100px" alt="Logo" style="margin-left: -25%;"></a>

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#studioMenu" aria-controls="studioMenu" aria-expanded="false" aria-label="Toggle navigation"><i class="fa fa-bars"></i> Menu</button>

Expand Down Expand Up @@ -94,9 +94,9 @@
<!-- Sidebar navigation-->
<nav class="sidebar-nav">
<ul id="sidebarnav">
<li> <a class="waves-effect waves-dark" href="dashboard.html" aria-expanded="false"><i class="mdi mdi-gauge"></i><span class="hide-menu">Dashboard</span></a></li>
<li> <a class="waves-effect waves-dark" href="pages-profile.html" aria-expanded="false"><i class="mdi mdi-account-check"></i><span class="hide-menu">Profile</span></a></li>
<li> <a class="waves-effect waves-dark" href="table-basic.html" aria-expanded="false"><i class="mdi mdi-image"></i><span class="hide-menu">Photos</span></a></li>
<li> <a class="waves-effect waves-dark" href="pages-profile.php" aria-expanded="false"><i class="mdi mdi-account-check"></i><span class="hide-menu">Profile</span></a></li>
<li> <a class="waves-effect waves-dark" href="dashboard.php" aria-expanded="false"><i class="mdi mdi-gauge"></i><span class="hide-menu">Dashboard</span></a></li>
<li> <a class="waves-effect waves-dark" href="photos.php" aria-expanded="false"><i class="mdi mdi-image"></i><span class="hide-menu">Photos</span></a></li>
</ul>
</nav>
<!-- End Sidebar navigation -->
Expand Down Expand Up @@ -167,25 +167,12 @@
echo '</script>';
}
}
pg_close($connection);
?>
<!-- ============================================================== -->
<!-- End Page Content -->
<!-- ============================================================== -->
</div>
<!-- ============================================================== -->
<!-- End Container fluid -->
<!-- ============================================================== -->
</div>
<!-- ============================================================== -->
<!-- End Page wrapper -->
<!-- ============================================================== -->
</div>
<!-- ============================================================== -->
<!-- End Wrapper -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- All Jquery -->
<!-- ============================================================== -->

<script src="js/jquery/jquery.min.js"></script>
<!-- Bootstrap popper Core JavaScript -->
<script src="js/popper.min.js"></script>
Expand Down Expand Up @@ -218,35 +205,6 @@
$('.close-icon').on('click',function() {
$(this).closest('.card').fadeOut();
});

// $(document).ready(function () {

// var url = 'backend/dashboard.php';
// $.ajax({
// type:'GET',
// // dataType:'json',
// data: {
// user_profile_id: sessionStorage.getItem("user")
// },
// url: api_url,
// success: function(garages) {
// console.log(garages);
// var index = 1;
// garages.forEach(element => {
// var div_col = document.createElement("div");
// div_col.className = "col-sm-6 col-lg-3";
// div_col.innerHTML = "<div class='overview-item overview-item--c4'><div class='overview__inner'><div class='overview-box clearfix'><div class='text'><h2>Parking Garage "+index+"</h2><span>"+element.numSpots+" spots</span></div></div></div></div>";
// console.log(element);
// tile.appendChild(div_col);
// index++;
// })
// },
// error: function (textStatus, errorThrown) {
// console.log(textStatus);
// console.log(errorThrown);
// }
// });
// });
</script>
</body>
</html>
40 changes: 36 additions & 4 deletions gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<link href="css/responsive.css" rel="stylesheet">
<style>
body, h1,h2,h3,h4,h5,h6 {font-family: "Montserrat", sans-serif}
.w3-row-padding img {margin-bottom: 12px}
.w3-row-padding img {margin-bottom: 12px; float:left;}
.bgimg {
background-position: center;
background-repeat: no-repeat;
Expand Down Expand Up @@ -58,8 +58,39 @@
</div>
<div class="main" style="margin-left:270px; ">
<div class="w3-row-padding" >
<div class="w3-half " style="">
<img src="./W3.CSS Template_files/wedding.jpg" style="width:100%">
<div class="w3-half container-fluid">
<?php
session_start();
if(isset($_SESSION['username'])){

$username = $_SESSION['username'];
require('backend/connect.php');

$query="SELECT name FROM public.imagestore WHERE photographer_id='$username'";
$result = pg_query($connection, $query) or die('Query failed: ' . pg_last_error());
if(pg_num_rows($result) > 0){
$i=0;
$arr=pg_fetch_all($result);
while($i < pg_num_rows($result))
{
$img_file="upload/".$arr[$i]['name'];
echo '<img src="'.$img_file.'">';
// if($i == (pg_num_rows($result)/2) ){
// echo '</div';
// echo '<div class="w3-half">';
// }
$i=$i+1;
}
}
else {
echo '<script language="javascript">';
echo "alert('No images!')";
echo '</script>';
}
}
pg_close($connection);
?>
<!-- <img src="./W3.CSS Template_files/wedding.jpg" style="width:100%">
<img src="./W3.CSS Template_files/rocks.jpg" style="width:100%">
<img src="./W3.CSS Template_files/sailboat.jpg" style="width:100%">
</div>
Expand All @@ -69,8 +100,9 @@
<img src="./W3.CSS Template_files/chef.jpg" style="width:100%">
<img src="./W3.CSS Template_files/wedding.jpg" style="width:100%">
<img src="./W3.CSS Template_files/p6.jpg" style="width:100%">
</div>
</div> -->
<!-- End photo grid -->
</div>
</div>
<!-- Hidden Sidebar (reveals when clicked on menu icon)-->
<nav class="w3-sidebar w3-black w3-animate-right w3-xxlarge" style="display:none;padding-top:150px;right:0;z-index:2" id="mySidebar">
Expand Down
Loading

0 comments on commit f534cca

Please sign in to comment.