Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function users(){
- global $wpdb;
- extract($_POST);
- // data
- $data = array();
- // coupon
- $data['coupon'] = $wpdb->get_row($wpdb->prepare("SELECT * FROM `".TBL_MGM_COUPON."` WHERE id=%d", $id ));
- // users
- // $data['users'] = array();
- // $data['users'] = mgm_get_all_userids(array('ID'), 'get_results');
- $meta_query = array( array('key'=>'_mgm_user_register_coupon','value'=>$id,'compare'=>'=','type'=>'UNSIGNED'),
- array('key'=>'_mgm_user_upgrade_coupon','value'=>$id,'compare'=>'=','type'=>'UNSIGNED'), array('key'=>'_mgm_user_extend_coupon','value'=>$id,'compare'=>'=','type'=>'UNSIGNED')
- );
- //error_log("starting pull");
- // fixes
- $usrs = array();
- $us = array();
- foreach($meta_query as $key) {
- $usrs = array_merge($usrs, mgm_get_users_with_meta( array($key), null, null, 'OR'));
- //$mg = mgm_get_users_with_meta( array($key), null, null, null);
- //$us = array_merge($us, $mg);
- }
- //error_log(print_r($us,true));
- $data['users'] = $usrs;
- //$data['users'] = mgm_get_users_with_meta( $meta_query, null, null, 'OR' );
- //error_log(print_r($data,true));
- //error_log("finish pull");
- // load template view
- $this->load->template('coupons/users', array('data'=>$data));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement