SHARE
TWEET

Untitled

a guest Jan 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php  
  2.     $pdo_statement = $pdo_conn->prepare("SELECT * FROM posts ORDER BY id DESC");
  3.     $pdo_statement->execute();
  4.     $result = $pdo_statement->fetchAll();  
  5. ?>
  6. <div style="text-align:right;margin:20px 0px;"><a href="add.php" class="button_link"><img src="crud-icon/add.png" title="Add New Record" style="vertical-align:bottom;" /> Create</a></div>
  7. <table class="tbl-qa">
  8.   <thead>
  9.     <tr>
  10.       <th class="table-header" width="20%">Title</th>
  11.       <th class="table-header" width="40%">Description</th>
  12.       <th class="table-header" width="20%">Date</th>
  13.       <th class="table-header" width="5%">Actions</th>
  14.     </tr>
  15.   </thead>
  16.   <tbody id="table-body">
  17.     <?php
  18.     if(!empty($result)) {
  19.         foreach($result as $row) {
  20.  
  21.     ?>
  22.       <tr class="table-row">
  23.         <td><?php echo $row["post_title"]; ?></td>
  24.         <td><?php echo $row["description"]; ?></td>
  25.         <td><?php echo $row["post_at"]; ?></td>
  26.         <td><a class="ajax-action-links" href='edit.php?id=<?php echo $row['id']; ?>'><img src="crud-icon/edit.png" title="Edit" /></a> <a class="ajax-action-links" href='delete.php?id=<?php echo $row['id']; ?>'><img src="crud-icon/delete.png" title="Delete" /></a></td>
  27.       </tr>
  28.  
  29.     <?php
  30.         }
  31.     }
  32. ?>
  33.    
  34. <html>
  35.   <head>
  36.     <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  37.     <script type="text/javascript">
  38.       google.charts.load('current', {'packages':['corechart']});
  39.       google.charts.setOnLoadCallback(drawChart);
  40.  
  41.       function drawChart() {
  42.  
  43.         var data = google.visualization.arrayToDataTable([
  44.           ['Task', 'Hours per Day'],
  45.           ['Work',     11],
  46.           ['Eat',      2],
  47.           ['Commute',  2],
  48.           ['Watch TV', 2],
  49.           ['Sleep',    7]
  50.         ]);
  51.  
  52.         var options = {
  53.           title: 'My Daily Activities'
  54.         };
  55.  
  56.         var chart = new google.visualization.PieChart(document.getElementById('piechart'));
  57.  
  58.         chart.draw(data, options);
  59.       }
  60.     </script>
  61.   </head>
  62.   <body>
  63.     <div id="piechart" style="width: 900px; height: 500px;"></div>
  64.   </body>
  65. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top