emprit

wp_plugin

Nov 5th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: List-data-peserta
  4. Description: Mengambil data peserta seminar dari tabel
  5. Version: 1.0
  6. Author: Rifaqu Emprit
  7. Author URI: http://www.facebook.com/rifaqu
  8. License: Copyright (c) 2013 NovemberCeria
  9. */
  10.  
  11. add_action('admin_menu', 'list_data');
  12.     function list_data() {
  13.     add_options_page('List Data Peserta', 'List Data Peseta', 1, 'list-data-peserta', 'ambil_data');
  14. }
  15.  
  16. function ambil_data_scripts(){
  17.     wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'js/jssatu.js');
  18.     wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'js/jsdua.js');
  19.     wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'css/satu.css');
  20.     wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'css/dua.css');
  21.     wp_enqueue_script('ambil_data_script');
  22. }
  23. add_action('wp_enqueue_scripts','ambil_data_scripts');
  24. function ambil_data() {
  25.     if (!current_user_can(1))  {
  26.         wp_die( __('You do not have sufficient permissions to access this page.') );
  27.     }
  28.  
  29.    
  30.  
  31.     echo "<script src='//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.10.8/jquery.tablesorter.min.js'></script>";
  32.     echo "<script>
  33.             $(function() {
  34.                 $('table#sortTableExample').tablesorter({ sortList: [[1,0]] });
  35.             });
  36.           </script>";
  37.    
  38.     echo "<table class='zebra-striped'>
  39.             <tr>
  40.             <th>No.</th>
  41.             <th>Name</th>
  42.             <th>Tanggal Lahir</th>
  43.             <th>Instansi</th>
  44.             <th>Sebagai</th>
  45.             <th>Status</th>
  46.             </tr>";
  47.  
  48.     $no = 1;
  49.     $query = mysql_query("SELECT * FROM wp_visual_form_builder_entries")or die(mysql_error());
  50.     while ($a=mysql_fetch_array($query)) {
  51.         echo "<tr>";
  52.         echo "<td>".$no."<td>";
  53.  
  54.         //pemecahan data
  55.         $newdata = unserialize($a['data']);
  56.         foreach ($newdata as $key => $value) {
  57.             //echo $value[$a]."<br>";
  58.            
  59.             foreach ($value as $kea => $isi) {
  60.                 if ($kea == 'value') echo "<td>".$isi."</td>";
  61.             }
  62.            
  63.         }
  64.         echo "</tr>";
  65.     $no++;
  66.     }
  67.  
  68.     echo "</table>";
  69.     echo "* Status Pending berarti anda belum mengirimkan bukti transfer";
  70. }
Advertisement
Add Comment
Please, Sign In to add comment