Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.79 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>GFA</title>
  7. <link href='https://fonts.googleapis.com/css?family=Lato:100,300' rel='stylesheet' type='text/css'>
  8. <link href="css/bootstrap.min.css" rel="stylesheet">
  9. <link href="css/styles.css" rel="stylesheet">
  10.  
  11.  
  12. </head>
  13. <body>
  14.  
  15. <?php
  16. $servername = "localhost";
  17. $username = "id2115970_admin";
  18. $password = "aaaaa";
  19. $dbname = "id2115970_users";
  20.  
  21. // Create connection
  22. $conn = mysqli_connect($servername, $username, $password, $dbname);
  23. // Check connection
  24. if (!$conn) {
  25. die("Connection failed: " . mysqli_connect_error());
  26. }
  27.  
  28. $sql = "INSERT INTO test (a, b, c,d)
  29. VALUES (7,8, 7,6)";
  30.  
  31. if (mysqli_query($conn, $sql)) {
  32. echo "New record created successfully";
  33. } else {
  34. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  35. }
  36. $sql = "SELECT a, b, c,d";
  37. $result = $conn->query($sql);
  38.  
  39. if ($result->num_rows > 0) {
  40. // output data of each row
  41. while($row = $result->fetch_assoc()) {
  42. echo "d " . $row["a"]. " - Name: " . $row["b"]. " " . $row["c"]. "<br>";
  43. }
  44. } else {
  45. echo "0 results";
  46. }
  47. $conn->close();
  48. ?>
  49.  
  50.  
  51. <script>
  52. window.fbAsyncInit = function() {
  53. FB.init({
  54. appId : '1688575671170019',
  55. cookie : true,
  56. xfbml : true,
  57. version : 'v2.8'
  58. });
  59. FB.AppEvents.logPageView();
  60. };
  61.  
  62. (function(d, s, id){
  63. var js, fjs = d.getElementsByTagName(s)[0];
  64. if (d.getElementById(id)) {return;}
  65. js = d.createElement(s); js.id = id;
  66. js.src = "//connect.facebook.net/en_US/sdk.js";
  67. fjs.parentNode.insertBefore(js, fjs);
  68. }(document, 'script', 'facebook-jssdk'));
  69. </script>
  70.  
  71.  
  72. <?php
  73. // Include FB config file && User class
  74. require_once 'fbConfig.php';
  75. require_once 'user.php';
  76.  
  77. if(isset($accessToken)){
  78. if(isset($_SESSION['facebook_access_token'])){
  79. $fb->setDefaultAccessToken($_SESSION['facebook_access_token']);
  80. }else{
  81. // Put short-lived access token in session
  82. $_SESSION['facebook_access_token'] = (string) $accessToken;
  83.  
  84. // OAuth 2.0 client handler helps to manage access tokens
  85. $oAuth2Client = $fb->getOAuth2Client();
  86.  
  87. // Exchanges a short-lived access token for a long-lived one
  88. $longLivedAccessToken = $oAuth2Client->getLongLivedAccessToken($_SESSION['facebook_access_token']);
  89. $_SESSION['facebook_access_token'] = (string) $longLivedAccessToken;
  90.  
  91. // Set default access token to be used in script
  92. $fb->setDefaultAccessToken($_SESSION['facebook_access_token']);
  93. }
  94.  
  95. // Redirect the user back to the same page if url has "code" parameter in query string
  96. if(isset($_GET['code'])){
  97. header('Location: ./');
  98. }
  99.  
  100. // Getting user facebook profile info
  101. try {
  102. $profileRequest = $fb->get('/me?fields=name,first_name,last_name,email,link,gender,locale,picture');
  103. $fbUserProfile = $profileRequest->getGraphNode()->asArray();
  104. } catch(FacebookResponseException $e) {
  105. echo 'Graph returned an error: ' . $e->getMessage();
  106. session_destroy();
  107. // Redirect user back to app login page
  108. header("Location: ./");
  109. exit;
  110. } catch(FacebookSDKException $e) {
  111. echo 'Facebook SDK returned an error: ' . $e->getMessage();
  112. exit;
  113. }
  114.  
  115. // Initialize User class
  116. $user = new User();
  117.  
  118. // Insert or update user data to the database
  119. $fbUserData = array(
  120. 'oauth_provider'=> 'facebook',
  121. 'oauth_uid' => $fbUserProfile['id'],
  122. 'first_name' => $fbUserProfile['first_name'],
  123. 'last_name' => $fbUserProfile['last_name'],
  124. 'email' => $fbUserProfile['email'],
  125. 'gender' => $fbUserProfile['gender'],
  126. 'locale' => $fbUserProfile['locale'],
  127. 'picture' => $fbUserProfile['picture']['url'],
  128. 'link' => $fbUserProfile['link']
  129. );
  130. $userData = $user->checkUser($fbUserData);
  131.  
  132. // Put user data into session
  133. $_SESSION['userData'] = $userData;
  134.  
  135. // Get logout url
  136. $logoutURL = $helper->getLogoutUrl($accessToken, $redirectURL.'logout.php');
  137.  
  138. // Render facebook profile data
  139. if(!empty($userData)){
  140. $output = '<h1>Facebook Profile Details </h1>';
  141. $output .= '<img src="'.$userData['picture'].'">';
  142. $output .= '<br/>Facebook ID : ' . $userData['oauth_uid'];
  143. $output .= '<br/>Name : ' . $userData['first_name'].' '.$userData['last_name'];
  144. $output .= '<br/>Email : ' . $userData['email'];
  145. $output .= '<br/>Gender : ' . $userData['gender'];
  146. $output .= '<br/>Locale : ' . $userData['locale'];
  147. $output .= '<br/>Logged in with : Facebook';
  148. $output .= '<br/><a href="'.$userData['link'].'" target="_blank">Click to Visit Facebook Page</a>';
  149. $output .= '<br/>Logout from <a href="'.$logoutURL.'">Facebook</a>';
  150. }else{
  151. $output = '<h3 style="color:red">Some problem occurred, please try again.</h3>';
  152. }
  153.  
  154. }else{
  155. // Get login url
  156. $loginURL = $helper->getLoginUrl($redirectURL, $fbPermissions);
  157.  
  158. // Render facebook login button
  159. $output = '<a href="'.htmlspecialchars($loginURL).'"><img src="img/facebook_connect_button.png"></a>';
  160. }
  161. ?>
  162.  
  163.  
  164. <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>
  165.  
  166.  
  167.  
  168. <div id="fb-root"></div>
  169. <script>(function(d, s, id) {
  170. var js, fjs = d.getElementsByTagName(s)[0];
  171. if (d.getElementById(id)) return;
  172. js = d.createElement(s); js.id = id;
  173. js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.9";
  174. fjs.parentNode.insertBefore(js, fjs);
  175. }(document, 'script', 'facebook-jssdk'));</script>
  176.  
  177.  
  178.  
  179. <!-- >Header- need to change it into a link to a file</!-->
  180. <div class="container">
  181. <header class="row">
  182. <div class="col-md-6">
  183. <img src="img/logo.png" class="img-responsive logo" alt="logo">
  184. <h1 class="text-thin text-left COLo">Georgia Future Academy</h1>
  185. </div>
  186. <div class="col-md-6 text-right text-camelcase text-bottom">
  187.  
  188. <h4 style="margin-top:50px">
  189. <a href="index.html">Home Page</a>
  190. <a href="about.html">About Us</a>
  191. <a href="projects.html">Projects</a>
  192. <a href="contact.html">Contacts</a>
  193. </h4>
  194. </div>
  195. </header>
  196. <section class="row">
  197. <div class="col-md-12">
  198. <hr>
  199. </div>
  200. </section>
  201. <!-- >SLIDESHOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</!-->
  202. <section class="row">
  203. <div class="slideshow-container">
  204. <div class="mySlides fade">
  205.  
  206. <img src="img/project_7.jpg" style="width:100%">
  207. </div>
  208.  
  209. <div class="mySlides fade">
  210. <img src="img/project_6.jpg" style="width:100%">
  211. </div>
  212.  
  213. <div class="mySlides fade">
  214.  
  215. <img src="img/project_5.jpg" style="width:100%">
  216. </div>
  217. <div class="mySlides fade">
  218.  
  219. <img src="img/project_4.jpg" style="width:100%">
  220. </div>
  221. <a class="prev" onclick="plusSlides(-1)">&#10094;</a>
  222. <a class="next" onclick="plusSlides(1)">&#10095;</a>
  223.  
  224.  
  225. </div>
  226. <br>
  227. <script>
  228. var slideIndex = 1;
  229. showSlides(slideIndex);
  230.  
  231. function plusSlides(n) {
  232. showSlides(slideIndex += n);
  233. }
  234.  
  235. function currentSlide(n) {
  236. showSlides(slideIndex = n);
  237. }
  238.  
  239. function showSlides(n) {
  240. var i;
  241. var slides = document.getElementsByClassName("mySlides");
  242. var dots = document.getElementsByClassName("dot");
  243. if (n > slides.length) {slideIndex = 1}
  244. if (n < 1) {slideIndex = slides.length}
  245. for (i = 0; i < slides.length; i++) {
  246. slides[i].style.display = "none";
  247. }
  248. for (i = 0; i < dots.length; i++) {
  249. dots[i].className = dots[i].className.replace(" active", "");
  250. }
  251. slides[slideIndex-1].style.display = "block";
  252. dots[slideIndex-1].className += " active";
  253. }
  254. </script>
  255. </section>
  256. <!-- >Project Table</!-->
  257. <section class="row">
  258. <div class="container">
  259. <header class="row text-center" >
  260. <div class="col-md-12 text-center text-uppercase">
  261. <h2 style="margin:10px" class="COLh">Current Projects</h2>
  262. </div>
  263. </header>
  264. <br>
  265. <br>
  266.  
  267. <section class="row text-center">
  268. <div class="col-md-4 add-border tags">
  269. <a href="https://www.facebook.com/events/291152967996427/" target="_blank">
  270. <img src="img/project_7.jpg" class="img-responsive project" alt="project 7">
  271. <h3 class="text-camelcase "> Debates Competition </h3>
  272. <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>
  273. </a>
  274. </div>
  275. <div class="col-md-4 add-border tags">
  276. <a href="https://www.facebook.com/events/1358425390891504/" target="_blank">
  277. <img src="img/project_6.jpg" class="img-responsive project" alt="project 6">
  278. <h3 class="text-camelcase"> Body Language Lecture </h3>
  279. <p> Psychologist Levan Zardalishvili will talk about how the body language affects human communication, how to use it to influence society and others. </p>
  280. </a>
  281. </div>
  282. <div class="col-md-4 add-border tags">
  283. <a href="https://www.facebook.com/events/1244190505702187/" target="_blank">
  284. <img src="img/project_5.jpg" class="img-responsive project" alt="project 5">
  285. <h3 class="text-camelcase"> School of Law </h3>
  286. <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>
  287. </a>
  288. </div>
  289. <br>
  290. <br>
  291. <section class="row">
  292. <div class="col-md-12">
  293. <hr>
  294. </div>
  295. </section>
  296.  
  297.  
  298. <footer class="row">
  299. <div class="col-md-3 text-left">
  300. <br>
  301. <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>
  302. </div>
  303. <div class="col-md-6 text-center">
  304. <br>
  305. <h7 class="text-thin text-center text-bottom" >Copyright © 2017 Georgia Future Academy. All Rights Reserved.</h7>
  306. </div>
  307. <div class="col-md-3 text-right" style="padding-right: 0px;padding-left: 0px;">
  308. <div class="icontext marginR">
  309.  
  310. <h7 class="text-thin text-left ">599 72 13 99</h7>
  311. <img src="img/i_phone.png" class="img-responsive iconify" alt="phone icon">
  312. </div>
  313. <div class="icontext marginR">
  314.  
  315. <h7 class="text-thin text-left ">geofutureacademy@gmail.com</h7>
  316. <img src="img/i_email.png" class="img-responsive iconify" alt="email icon">
  317. </div>
  318. </div>
  319.  
  320. </footer>
  321. </section>
  322. </div>
  323.  
  324.  
  325.  
  326.  
  327. </body>
  328. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement