Guest User

Untitled

a guest
Nov 30th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. <div ng-controller="MenuController">
  2. <figure class="menu_jumbotron">
  3. <ul class="breadcrumb">
  4. <li><a href="home">Home</a></li>
  5. <li>Menu</li>
  6. </ul>
  7. </figure>
  8. <div class="menu">
  9. <h1><i>{{title}}</i></h1>
  10. <div class="menu_button">
  11. <figure>
  12. <div>
  13. <span>Breakfast</span>
  14. <span>100% Organic</span>
  15. </div>
  16. </figure>
  17. <figure>
  18. <div>
  19. <span>Lunch</span>
  20. <span>100% Organic</span>
  21. </div>
  22. </figure>
  23. <figure>
  24. <div>
  25. <span>Dinner</span>
  26. <span>100% Organic</span>
  27. </div>
  28. </figure>
  29. <figure>
  30. <div>
  31. <span>Beverages</span>
  32. <span>100% Organic</span>
  33. </div>
  34. </figure>
  35. <figure>
  36. <div>
  37. <span>Desserts</span>
  38. <span>100% Organic</span>
  39. </div>
  40. </figure>
  41. </div>
  42. <div>
  43. <table style="background-color:white; margin-left:500px">
  44. <thead>
  45. <th style="border:1px solid red">Name</th>
  46. <th style="border:1px solid red">Price</th>
  47. <th style="border:1px solid red">Meal Type</th>
  48. </thead>
  49. <tbody>
  50. <tr ng-repeat="item in all_items" >
  51. <td>{{ item.Name }}</td>
  52. <td>{{ item.Price }}</td>
  53. <td>{{ item.MealType }}</td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. </div>
  58. </div>
  59. </div>
  60.  
  61. <?php
  62. $host = "localhost";
  63. $user = "root";
  64. $password = "kkkratika";
  65. $db = "meoan_organics";
  66.  
  67. $con = new mysqli($host,$user,$password,$db);
  68.  
  69. if(!$con)
  70. {
  71. die('Unsuccessful Connection');
  72. }
  73.  
  74. $sql = "SELECT * FROM `meoan_all_food_items`";
  75.  
  76. $q = $con->query($sql);
  77.  
  78. $data = array();
  79.  
  80. if($q->num_rows >0)
  81. {
  82. while($row = $q->fetch_object())
  83. {
  84. $data[] = $row;
  85. }
  86. }
  87. else
  88. {
  89. $data[] = null;
  90. }
  91.  
  92. $con->close();
  93. echo json_encode($data);
  94. ?>
  95.  
  96. /// <reference path="route.js" />
  97.  
  98. app.controller("MenuController",['$scope', '$http', '$log', function ($scope,$http,$log) {
  99. $scope.title = "Our Menu";
  100.  
  101. $http.get('database/popdata.php')
  102. .then(function(data){
  103. $scope.all_items = data;
  104. }),function(err){
  105. $log.error(err);
  106. }
  107. }]);
Add Comment
Please, Sign In to add comment