Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: List-data-peserta
- Description: Mengambil data peserta seminar dari tabel
- Version: 1.0
- Author: Rifaqu Emprit
- Author URI: http://www.facebook.com/rifaqu
- License: Copyright (c) 2013 NovemberCeria
- */
- add_action('admin_menu', 'list_data');
- function list_data() {
- add_options_page('List Data Peserta', 'List Data Peseta', 1, 'list-data-peserta', 'ambil_data');
- }
- function ambil_data_scripts(){
- wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'js/jssatu.js');
- wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'js/jsdua.js');
- wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'css/satu.css');
- wp_register_script('ambil_data_script',plugin_dir_url( __FILE__ ).'css/dua.css');
- wp_enqueue_script('ambil_data_script');
- }
- add_action('wp_enqueue_scripts','ambil_data_scripts');
- function ambil_data() {
- if (!current_user_can(1)) {
- wp_die( __('You do not have sufficient permissions to access this page.') );
- }
- echo "<script src='//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.10.8/jquery.tablesorter.min.js'></script>";
- echo "<script>
- $(function() {
- $('table#sortTableExample').tablesorter({ sortList: [[1,0]] });
- });
- </script>";
- echo "<table class='zebra-striped'>
- <tr>
- <th>No.</th>
- <th>Name</th>
- <th>Tanggal Lahir</th>
- <th>Instansi</th>
- <th>Sebagai</th>
- <th>Status</th>
- </tr>";
- $no = 1;
- $query = mysql_query("SELECT * FROM wp_visual_form_builder_entries")or die(mysql_error());
- while ($a=mysql_fetch_array($query)) {
- echo "<tr>";
- echo "<td>".$no."<td>";
- //pemecahan data
- $newdata = unserialize($a['data']);
- foreach ($newdata as $key => $value) {
- //echo $value[$a]."<br>";
- foreach ($value as $kea => $isi) {
- if ($kea == 'value') echo "<td>".$isi."</td>";
- }
- }
- echo "</tr>";
- $no++;
- }
- echo "</table>";
- echo "* Status Pending berarti anda belum mengirimkan bukti transfer";
- }
Advertisement
Add Comment
Please, Sign In to add comment