Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>GFA</title>
- <link href='https://fonts.googleapis.com/css?family=Lato:100,300' rel='stylesheet' type='text/css'>
- <link href="css/bootstrap.min.css" rel="stylesheet">
- <link href="css/styles.css" rel="stylesheet">
- </head>
- <body>
- <?php
- $servername = "localhost";
- $username = "id2115970_admin";
- $password = "aaaaa";
- $dbname = "id2115970_users";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "INSERT INTO test (a, b, c,d)
- VALUES (7,8, 7,6)";
- if (mysqli_query($conn, $sql)) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . mysqli_error($conn);
- }
- $sql = "SELECT a, b, c,d";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo "d " . $row["a"]. " - Name: " . $row["b"]. " " . $row["c"]. "<br>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
- <script>
- window.fbAsyncInit = function() {
- FB.init({
- appId : '1688575671170019',
- cookie : true,
- xfbml : true,
- version : 'v2.8'
- });
- FB.AppEvents.logPageView();
- };
- (function(d, s, id){
- var js, fjs = d.getElementsByTagName(s)[0];
- if (d.getElementById(id)) {return;}
- js = d.createElement(s); js.id = id;
- js.src = "//connect.facebook.net/en_US/sdk.js";
- fjs.parentNode.insertBefore(js, fjs);
- }(document, 'script', 'facebook-jssdk'));
- </script>
- <?php
- // Include FB config file && User class
- require_once 'fbConfig.php';
- require_once 'user.php';
- if(isset($accessToken)){
- if(isset($_SESSION['facebook_access_token'])){
- $fb->setDefaultAccessToken($_SESSION['facebook_access_token']);
- }else{
- // Put short-lived access token in session
- $_SESSION['facebook_access_token'] = (string) $accessToken;
- // OAuth 2.0 client handler helps to manage access tokens
- $oAuth2Client = $fb->getOAuth2Client();
- // Exchanges a short-lived access token for a long-lived one
- $longLivedAccessToken = $oAuth2Client->getLongLivedAccessToken($_SESSION['facebook_access_token']);
- $_SESSION['facebook_access_token'] = (string) $longLivedAccessToken;
- // Set default access token to be used in script
- $fb->setDefaultAccessToken($_SESSION['facebook_access_token']);
- }
- // Redirect the user back to the same page if url has "code" parameter in query string
- if(isset($_GET['code'])){
- header('Location: ./');
- }
- // Getting user facebook profile info
- try {
- $profileRequest = $fb->get('/me?fields=name,first_name,last_name,email,link,gender,locale,picture');
- $fbUserProfile = $profileRequest->getGraphNode()->asArray();
- } catch(FacebookResponseException $e) {
- echo 'Graph returned an error: ' . $e->getMessage();
- session_destroy();
- // Redirect user back to app login page
- header("Location: ./");
- exit;
- } catch(FacebookSDKException $e) {
- echo 'Facebook SDK returned an error: ' . $e->getMessage();
- exit;
- }
- // Initialize User class
- $user = new User();
- // Insert or update user data to the database
- $fbUserData = array(
- 'oauth_provider'=> 'facebook',
- 'oauth_uid' => $fbUserProfile['id'],
- 'first_name' => $fbUserProfile['first_name'],
- 'last_name' => $fbUserProfile['last_name'],
- 'email' => $fbUserProfile['email'],
- 'gender' => $fbUserProfile['gender'],
- 'locale' => $fbUserProfile['locale'],
- 'picture' => $fbUserProfile['picture']['url'],
- 'link' => $fbUserProfile['link']
- );
- $userData = $user->checkUser($fbUserData);
- // Put user data into session
- $_SESSION['userData'] = $userData;
- // Get logout url
- $logoutURL = $helper->getLogoutUrl($accessToken, $redirectURL.'logout.php');
- // Render facebook profile data
- if(!empty($userData)){
- $output = '<h1>Facebook Profile Details </h1>';
- $output .= '<img src="'.$userData['picture'].'">';
- $output .= '<br/>Facebook ID : ' . $userData['oauth_uid'];
- $output .= '<br/>Name : ' . $userData['first_name'].' '.$userData['last_name'];
- $output .= '<br/>Email : ' . $userData['email'];
- $output .= '<br/>Gender : ' . $userData['gender'];
- $output .= '<br/>Locale : ' . $userData['locale'];
- $output .= '<br/>Logged in with : Facebook';
- $output .= '<br/><a href="'.$userData['link'].'" target="_blank">Click to Visit Facebook Page</a>';
- $output .= '<br/>Logout from <a href="'.$logoutURL.'">Facebook</a>';
- }else{
- $output = '<h3 style="color:red">Some problem occurred, please try again.</h3>';
- }
- }else{
- // Get login url
- $loginURL = $helper->getLoginUrl($redirectURL, $fbPermissions);
- // Render facebook login button
- $output = '<a href="'.htmlspecialchars($loginURL).'"><img src="img/facebook_connect_button.png"></a>';
- }
- ?>
- <div class="fb-login-button" data-width="100" data-max-rows="1" data-size="large" data-button-type="continue_with" data-show-faces="true" data-auto-logout-link="true" data-use-continue-as="true"></div>
- <div id="fb-root"></div>
- <script>(function(d, s, id) {
- var js, fjs = d.getElementsByTagName(s)[0];
- if (d.getElementById(id)) return;
- js = d.createElement(s); js.id = id;
- js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.9";
- fjs.parentNode.insertBefore(js, fjs);
- }(document, 'script', 'facebook-jssdk'));</script>
- <!-- >Header- need to change it into a link to a file</!-->
- <div class="container">
- <header class="row">
- <div class="col-md-6">
- <img src="img/logo.png" class="img-responsive logo" alt="logo">
- <h1 class="text-thin text-left COLo">Georgia Future Academy</h1>
- </div>
- <div class="col-md-6 text-right text-camelcase text-bottom">
- <h4 style="margin-top:50px">
- <a href="index.html">Home Page</a>
- <a href="about.html">About Us</a>
- <a href="projects.html">Projects</a>
- <a href="contact.html">Contacts</a>
- </h4>
- </div>
- </header>
- <section class="row">
- <div class="col-md-12">
- <hr>
- </div>
- </section>
- <!-- >SLIDESHOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</!-->
- <section class="row">
- <div class="slideshow-container">
- <div class="mySlides fade">
- <img src="img/project_7.jpg" style="width:100%">
- </div>
- <div class="mySlides fade">
- <img src="img/project_6.jpg" style="width:100%">
- </div>
- <div class="mySlides fade">
- <img src="img/project_5.jpg" style="width:100%">
- </div>
- <div class="mySlides fade">
- <img src="img/project_4.jpg" style="width:100%">
- </div>
- <a class="prev" onclick="plusSlides(-1)">❮</a>
- <a class="next" onclick="plusSlides(1)">❯</a>
- </div>
- <br>
- <script>
- var slideIndex = 1;
- showSlides(slideIndex);
- function plusSlides(n) {
- showSlides(slideIndex += n);
- }
- function currentSlide(n) {
- showSlides(slideIndex = n);
- }
- function showSlides(n) {
- var i;
- var slides = document.getElementsByClassName("mySlides");
- var dots = document.getElementsByClassName("dot");
- if (n > slides.length) {slideIndex = 1}
- if (n < 1) {slideIndex = slides.length}
- for (i = 0; i < slides.length; i++) {
- slides[i].style.display = "none";
- }
- for (i = 0; i < dots.length; i++) {
- dots[i].className = dots[i].className.replace(" active", "");
- }
- slides[slideIndex-1].style.display = "block";
- dots[slideIndex-1].className += " active";
- }
- </script>
- </section>
- <!-- >Project Table</!-->
- <section class="row">
- <div class="container">
- <header class="row text-center" >
- <div class="col-md-12 text-center text-uppercase">
- <h2 style="margin:10px" class="COLh">Current Projects</h2>
- </div>
- </header>
- <br>
- <br>
- <section class="row text-center">
- <div class="col-md-4 add-border tags">
- <a href="https://www.facebook.com/events/291152967996427/" target="_blank">
- <img src="img/project_7.jpg" class="img-responsive project" alt="project 7">
- <h3 class="text-camelcase "> Debates Competition </h3>
- <p> Project "Debate!" Within the history of debates in Georgia, the first full-fledged season is held, which consists of several qualifying and final tournaments. </p>
- </a>
- </div>
- <div class="col-md-4 add-border tags">
- <a href="https://www.facebook.com/events/1358425390891504/" target="_blank">
- <img src="img/project_6.jpg" class="img-responsive project" alt="project 6">
- <h3 class="text-camelcase"> Body Language Lecture </h3>
- <p> Psychologist Levan Zardalishvili will talk about how the body language affects human communication, how to use it to influence society and others. </p>
- </a>
- </div>
- <div class="col-md-4 add-border tags">
- <a href="https://www.facebook.com/events/1244190505702187/" target="_blank">
- <img src="img/project_5.jpg" class="img-responsive project" alt="project 5">
- <h3 class="text-camelcase"> School of Law </h3>
- <p> The goal of the school is to provide all the important information about the rule of law and enforcement of law that will help people to become a responsible citizens. </p>
- </a>
- </div>
- <br>
- <br>
- <section class="row">
- <div class="col-md-12">
- <hr>
- </div>
- </section>
- <footer class="row">
- <div class="col-md-3 text-left">
- <br>
- <div class="fb-like" data-href="https://www.facebook.com/geofutureacademy/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="true" data-share="true"></div>
- </div>
- <div class="col-md-6 text-center">
- <br>
- <h7 class="text-thin text-center text-bottom" >Copyright © 2017 Georgia Future Academy. All Rights Reserved.</h7>
- </div>
- <div class="col-md-3 text-right" style="padding-right: 0px;padding-left: 0px;">
- <div class="icontext marginR">
- <h7 class="text-thin text-left ">599 72 13 99</h7>
- <img src="img/i_phone.png" class="img-responsive iconify" alt="phone icon">
- </div>
- <div class="icontext marginR">
- <h7 class="text-thin text-left ">geofutureacademy@gmail.com</h7>
- <img src="img/i_email.png" class="img-responsive iconify" alt="email icon">
- </div>
- </div>
- </footer>
- </section>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement