D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home2
/
stickain
/
www
/
itosu-ryu.us
/
registerdemo
/
wp-admin
/
Filename :
editreguser.php
back
Copy
<?php /** * Users administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once( './admin.php' ); if ( ! current_user_can( 'list_users' ) ) wp_die( __( 'Cheatin’ uh?' ) ); $wp_list_table = _get_list_table('WP_Users_List_Table'); $pagenum = $wp_list_table->get_pagenum(); $title = __('Users'); $parent_file = 'users.php'; add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) ); // contextual help - choose Help on the top right of admin panel to preview this. $update = ''; switch ( $wp_list_table->current_action() ) { /* Bulk Dropdown menu Role changes */ case 'promote': check_admin_referer('bulk-users'); if ( ! current_user_can( 'promote_users' ) ) wp_die( __( 'You can’t edit that user.' ) ); if ( empty($_REQUEST['users']) ) { wp_redirect($redirect); exit(); } $editable_roles = get_editable_roles(); if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) wp_die(__('You can’t give users that role.')); $userids = $_REQUEST['users']; $update = 'promote'; foreach ( $userids as $id ) { $id = (int) $id; if ( ! current_user_can('promote_user', $id) ) wp_die(__('You can’t edit that user.')); // The new role of the current user must also have promote_users caps if ( $id == $current_user->ID && !$wp_roles->role_objects[$_REQUEST['new_role']]->has_cap('promote_users') ) { $update = 'err_admin_role'; continue; } // If the user doesn't already belong to the blog, bail. if ( is_multisite() && !is_user_member_of_blog( $id ) ) wp_die(__('Cheatin’ uh?')); $user = new WP_User($id); $user->set_role($_REQUEST['new_role']); } wp_redirect(add_query_arg('update', $update, $redirect)); exit(); break; case 'dodelete': if ( is_multisite() ) wp_die( __('User deletion is not allowed from this screen.') ); check_admin_referer('delete-users'); if ( empty($_REQUEST['users']) ) { wp_redirect($redirect); exit(); } if ( ! current_user_can( 'delete_users' ) ) wp_die(__('You can’t delete users.')); $userids = $_REQUEST['users']; $update = 'del'; $delete_count = 0; foreach ( (array) $userids as $id) { $id = (int) $id; if ( ! current_user_can( 'delete_user', $id ) ) wp_die(__( 'You can’t delete that user.' ) ); if ( $id == $current_user->ID ) { $update = 'err_admin_del'; continue; } switch ( $_REQUEST['delete_option'] ) { case 'delete': if ( current_user_can('delete_user', $id) ) wp_delete_user($id); break; case 'reassign': if ( current_user_can('delete_user', $id) ) wp_delete_user($id, $_REQUEST['reassign_user']); break; } ++$delete_count; } $redirect = add_query_arg( array('delete_count' => $delete_count, 'update' => $update), $redirect); wp_redirect($redirect); exit(); break; case 'delete': if ( is_multisite() ) wp_die( __('User deletion is not allowed from this screen.') ); check_admin_referer('bulk-users'); if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) { wp_redirect($redirect); exit(); } if ( ! current_user_can( 'delete_users' ) ) $errors = new WP_Error( 'edit_users', __( 'You can’t delete users.' ) ); if ( empty($_REQUEST['users']) ) $userids = array(intval($_REQUEST['user'])); else $userids = (array) $_REQUEST['users']; include ('admin-header.php'); ?> <form action="" method="post" name="updateusers" id="updateusers"> <?php wp_nonce_field('delete-users') ?> <?php echo $referer; ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php _e('Delete Users'); ?></h2> <p><?php echo _n( 'You have specified this user for deletion:', 'You have specified these users for deletion:', count( $userids ) ); ?></p> <ul> <?php $go_delete = 0; foreach ( $userids as $id ) { $id = (int) $id; $user = new WP_User($id); if ( $id == $current_user->ID ) { echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be deleted.</strong>'), $id, $user->user_login) . "</li>\n"; } else { echo "<li><input type=\"hidden\" name=\"users[]\" value=\"" . esc_attr($id) . "\" />" . sprintf(__('ID #%1s: %2s'), $id, $user->user_login) . "</li>\n"; $go_delete++; } } ?> </ul> <?php if ( $go_delete ) : ?> <fieldset><p><legend><?php echo _n( 'What should be done with posts and links owned by this user?', 'What should be done with posts and links owned by these users?', $go_delete ); ?></legend></p> <ul style="list-style:none;"> <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" checked="checked" /> <?php _e('Delete all posts and links.'); ?></label></li> <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" /> <?php echo '<label for="delete_option1">'.__('Attribute all posts and links to:').'</label>'; wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> </ul></fieldset> <input type="hidden" name="action" value="dodelete" /> <?php submit_button( __('Confirm Deletion'), 'secondary' ); ?> <?php else : ?> <p><?php _e('There are no valid users selected for deletion.'); ?></p> <?php endif; ?> </div> </form> <?php include ('admin-header.php'); ?> <form action="" method="post" name="updateusers" id="updateusers"> <?php wp_nonce_field('remove-users') ?> <?php echo $referer; ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php _e('Remove Users from Site'); ?></h2> <p><?php _e('You have specified these users for removal:'); ?></p> <?php ?> <?php if ( $go_remove ) : ?> <input type="hidden" name="action" value="doremove" /> <?php submit_button( __('Confirm Removal'), 'secondary' ); ?> <?php else : ?> <p><?php _e('There are no valid users selected for removal.'); ?></p> <?php endif; ?> </div> </form> <?php break; default: if ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $wp_list_table->prepare_items(); $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); if ( $pagenum > $total_pages && $total_pages > 0 ) { wp_redirect( add_query_arg( 'paged', $total_pages ) ); exit; } include('./admin-header.php'); /////////////////////////////////////////////////////////////////////////////////////////////////////// $user_id = get_current_user_id(); $current_temp =of_get_option('template_selection', '' ); $event = get_user_meta($user_id,'wpcf-event-name',true); if($current_temp == $event) { if(isset($_GET['export'])) { header("Content-type: text/csv"); header("Cache-Control: no-store, no-cache"); header('Content-Disposition: attachment; filename="tournamentparticipants.csv"'); } /* Template Name: Export */ ?> <?php if(isset($_GET['clear'])) { if(current_user_can('administrator')) { $DELSQL1 = $wpdb->query("DELETE FROM mee_tournament_tbl"); $DELSQL2 = $wpdb->query("DELETE FROM mee_ftournament_tbl"); $res = "Data has been cleared"; } } if(isset($_GET['export'])) { if(current_user_can('editor') || current_user_can('administrator')) { $user_id = get_current_user_id(); $file = fopen("php://output",'w'); $csvfc=array("S.No,Name,Phone,Address,City,State,Zipcode,Email,Age,Gender,Level,DOB,Instructor Name,Dojo Name,Instructor City,Instructor State,Division,Division Numbers,Discount Code,Total,Penalty,Type,Regdate"); $event = get_user_meta($user_id,'wpcf-event-name',true); if(current_user_can('editor')) $result = $wpdb->get_results("Select * from mee_ftournament_tbl where Division LIKE '%$event%'",ARRAY_A); elseif(current_user_can('administrator')) $result = $wpdb->get_results("Select * from mee_ftournament_tbl",ARRAY_A); foreach($result as $reskey) { $sno++; $name = $reskey['Name']; $phone = $reskey['Phone']; $address = $reskey['Address']; $city = $reskey['City']; $state = $reskey['State']; $zip = $reskey['Zipcode']; $email = $reskey['Email']; $age = $reskey['Age']; $gender = $reskey['Gender']; $level = $reskey['Level']; //echo "hii ".$level; $dob = $reskey['Date']; $iname = $reskey['Iname']; $dname = $reskey['Dname']; $icity = $reskey['Icity']; $istate = $reskey['Istate']; if($reskey['Division']!=""); $division = implode(";",unserialize($reskey['Division'])); $divnumber = $reskey['Divnumber']; $disc_code = $reskey['DID']; $total = $reskey['Total']; $penalty = $reskey['Penalty']; $type = $reskey['Type']; $regdate = $reskey['Regdate']; array_push($csvfc,"$sno,$name,$phone,$address,$city,$state,$zip,$email,$age,$gender,$level,$dob,$iname,$dname,$icity,$istate,$division,$divnumber,$disc_code,$total,$penalty,$type,$regdate"); } foreach ($csvfc as $line) { fputcsv($file,split(',',$line)); } fclose($file); } } elseif(current_user_can('editor') || current_user_can('administrator')) { get_header(); ?> <div class="container"> <div id="content"> <?php if($res!="") { ?> <div class="message"><?php echo $res?></div> <?php } ?> <div class="export"><a href="<?php echo home_url()?>/export?export=1">Export</a> <?php if(current_user_can('administrator')) { ?> <a href="#" onclick="cleardatas()">Clear Data</a> <?php } ?> </div> <div class="exporttbl"> <table> <tr> <th>S.No</th> <th>Name</th> <th>Phone</th> <th>Address</th> <th>City</th> <th>State</th> <th>Zipcode</th> <th>Email</th> <th>Age</th> <th>Gender</th> <th>Level</th> <th>DOB</th> <th>Instructor Name</th> <th>Dojo Name</th> <th>Instructor City</th> <th>Instructor State</th> <th>Division</th> <th>Division Numbers</th> <th>Discount Code</th> <th>Total</th> <th>Penalty</th> <th>Type</th> <th>Regdate</th> <th>Action</th> </tr> <?php $user_id = get_current_user_id(); $rec_limit = 10; if( isset($_GET{'page'} ) ) { $page = $_GET{'page'} + 1; $offset = $rec_limit * $page ; } else { $page = 0; $offset = 0; } $left_rec = $rec_count - ($page * $rec_limit); $event = get_user_meta($user_id,'wpcf-event-name',true); /*if(current_user_can('editor')) $result = $wpdb->get_results("Select * from mee_ftournament_tbl where Division LIKE '%$event%' LIMIT $offset, $rec_limit",ARRAY_A); elseif(current_user_can('administrator'))*/ $result = $wpdb->get_results("Select * from mee_ftournament_tbl LIMIT $offset, $rec_limit",ARRAY_A); foreach($result as $reskey) { $sno++; $name = $reskey['Name']; $phone = $reskey['Phone']; $address = $reskey['Address']; $city = $reskey['City']; $state = $reskey['State']; $zip = $reskey['Zipcode']; $email = $reskey['Email']; $age = $reskey['Age']; $gender = $reskey['Gender']; $level = $reskey['Level']; //echo "hii ".$level; $dob = $reskey['Date']; $iname = $reskey['Iname']; $dname = $reskey['Dname']; $icity = $reskey['Icity']; $istate = $reskey['Istate']; if($reskey['Division']!="") $division = implode(";",unserialize($reskey['Division'])); $divnumber = $reskey['Divnumber']; $disc_code = $reskey['DID']; $total = $reskey['Total']; $penalty = $reskey['Penalty']; $type = $reskey['Type']; $regdate = $reskey['Regdate']; ?> <tr> <td><?php echo $sno?></td> <td><?php echo $name?></td> <td><?php echo $phone?></td> <td><?php echo $address?></td> <td><?php echo $city?></td> <td><?php echo $state?></td> <td><?php echo $zip?></td> <td><?php echo $email?></td> <td><?php echo $age?></td> <td><?php echo $gender?></td> <td><?php echo $level?></td> <td><?php echo $dob?></td> <td><?php echo $iname?></td> <td><?php echo $dname?></td> <td><?php echo $icity?></td> <td><?php echo $istate?></td> <td><?php echo $division?></td> <td><?php echo $divnumber?></td> <td><?php echo $disc_code?></td> <td><?php echo $total?></td> <td><?php echo $penalty?></td> <td><?php echo $type?></td> <td><?php echo $regdate?></td> <td><a href="<?php echo home_url()?>/edit/?id=<?php echo $reskey['id']?>">Edit</a></td> </tr> <?php } ?> </table></div> <?php if( $page > 0 ) { $last = $page - 2; echo "<a href=\"$_PHP_SELF?page=$last\">Last 10 Records</a> |"; echo "<a href=\"$_PHP_SELF?page=$page\">Next 10 Records</a>"; } else if( $page == 0 ) { echo "<a href=\"$_PHP_SELF?page=$page\">Next 10 Records</a>"; } else if( $left_rec < $rec_limit ) { $last = $page - 2; echo "<a href=\"$_PHP_SELF?page=$last\">Last 10 Records</a>"; } ?> </div><!-- #content --> </div><!-- #container --> <script type="text/javascript"> function cleardatas() { var r=confirm("Are you sure you want to clear the data?"); if (r==true) { window.location = "<?php echo home_url()?>/export/?clear=1"; } } </script> <?php //get_sidebar(); ?> <?php include('./admin-footer.php'); } else { get_header(); ?> <div class="container"> <div id="content"> <br/><br/> <h2>Sorry! You are not Authourized to see the current Tournament Details</h2> </div> </div> <?php }}} get_footer(); ?>