get_row("select * from ".EVENTS_MULTI_EVENT_REGISTRATION_ID_GROUP_TABLE." where registration_id = '$registration_id' "); if ( $check !== NULL ) { $registration_id = $check->primary_registration_id; $registration_ids = $wpdb->get_results("select * from ".EVENTS_MULTI_EVENT_REGISTRATION_ID_GROUP_TABLE." where primary_registration_id = '$registration_id' ", ARRAY_A); $multi_reg = true; } switch ( $_REQUEST[ 'form_action' ] ) { //Add payment info case 'payment': if ( isset($_REQUEST[ 'attendee_action' ]) && $_REQUEST[ 'attendee_action' ] == 'post_payment' ){ //Added by Imon $primary_row = $wpdb->get_row("select id from ".EVENTS_ATTENDEE_TABLE." where registration_id = '$registration_id' order by id limit 0,1 "); $primary_attendee_id = $primary_row->id; // GET the primary attendee id because amount paid info is kept with the primary attendee $payment_status = isset($_REQUEST[ 'payment_status' ]) ? $_REQUEST[ 'payment_status' ]:''; $txn_type = isset($_REQUEST[ 'txn_type' ]) ? $_REQUEST[ 'txn_type' ]:''; $txn_id = isset($_REQUEST[ 'txn_id' ]) ? $_REQUEST[ 'txn_id' ]:''; //$quantity = isset($_REQUEST[ 'quantity' ]) ? $_REQUEST[ 'quantity' ]:''; $amount_pd = isset($_REQUEST[ 'amount_pd' ]) ? $_REQUEST[ 'amount_pd' ]:''; $payment_date = isset($_REQUEST[ 'payment_date' ]) ? $_REQUEST[ 'payment_date' ]:''; $coupon_code = isset($_REQUEST[ 'coupon_code' ]) ? $_REQUEST[ 'coupon_code' ]:''; //Added/updated by Imon //Update payment status information for primary attendee $sql = "UPDATE " . EVENTS_ATTENDEE_TABLE . " SET payment_status = '$payment_status', txn_type = '$txn_type', txn_id = '$txn_id', amount_pd = '$amount_pd', payment_date ='$payment_date', coupon_code ='$coupon_code' WHERE registration_id ='" . $registration_id . "' and id = $primary_attendee_id "; $wpdb->query( $sql ); if ( count($registration_ids) > 0 ) { foreach($registration_ids as $reg_id) { // Update payment status information for all attendees $sql = "UPDATE " . EVENTS_ATTENDEE_TABLE . " SET payment_status = '$payment_status', txn_type = '$txn_type', txn_id = '$txn_id', payment_date ='$payment_date', coupon_code ='$coupon_code' WHERE registration_id ='" . $reg_id['registration_id']. "' "; $wpdb->query( $sql ); } } else { // Update payment status information for all attendees $sql = "UPDATE " . EVENTS_ATTENDEE_TABLE . " SET payment_status = '$payment_status', txn_type = '$txn_type', txn_id = '$txn_id', payment_date ='$payment_date', coupon_code ='$coupon_code' WHERE registration_id ='" . $registration_id . "' "; $wpdb->query( $sql ); } //Send Payment Recieved Email if ( $_REQUEST[ 'send_payment_rec' ] == "send_message" ) { /* * @todo Do we send an email to each attendee in a group or just the main? */ //event_espresso_send_payment_notification( $id ); //Added by Imon if ( count($registration_ids) > 0 ) { $reg_attendees = array(); foreach($registration_ids as $reg_id) { $SQL = 'SELECT * FROM ' . EVENTS_ATTENDEE_TABLE . ' WHERE registration_id =%s'; $more_reg_attendees = $wpdb->get_results( $wpdb->prepare( $SQL, $reg_id['registration_id'] ), 'OBJECT_K' ); foreach ( $more_reg_attendees as $another_reg_attendee ) { $reg_attendees[ $another_reg_attendee->email ] = $another_reg_attendee; } } foreach ( $reg_attendees as $reg_attendee ){ event_espresso_send_payment_notification( array( 'registration_id'=>$reg_attendee->registration_id )); } } else { event_espresso_send_payment_notification(array('registration_id'=>$registration_id)); } } } break; //Send Invoice case 'send_invoice': //Added by Imon if ( $org_options["use_attendee_pre_approval"] == "Y" ) { $pre_approve = $_REQUEST['pre_approve']; if ( count($registration_ids) > 0 ) { foreach($registration_ids as $reg_id) { $sql = "UPDATE " . EVENTS_ATTENDEE_TABLE . " SET pre_approve = '$pre_approve' WHERE registration_id ='" . $reg_id['registration_id'] . "'"; $wpdb->query( $sql ); } } else { $sql = "UPDATE " . EVENTS_ATTENDEE_TABLE . " SET pre_approve = '$pre_approve' WHERE registration_id ='" . $registration_id . "'"; $wpdb->query( $sql ); } } else { $pre_approve = 0; } if ( $pre_approve == "0" ) { if ( count($registration_ids) > 0 ) { $reg_attendees = array(); foreach($registration_ids as $reg_id) { $SQL = 'SELECT * FROM ' . EVENTS_ATTENDEE_TABLE . ' WHERE registration_id =%s'; $more_reg_attendees = $wpdb->get_results( $wpdb->prepare( $SQL, $reg_id['registration_id'] ), 'OBJECT_K' ); foreach ( $more_reg_attendees as $another_reg_attendee ) { $reg_attendees[ $another_reg_attendee->email ] = $another_reg_attendee; } } foreach ( $reg_attendees as $reg_attendee ){ event_espresso_send_invoice( $reg_attendee->registration_id, $_REQUEST[ 'invoice_subject' ], $_REQUEST[ 'invoice_message' ] ); } } else { event_espresso_send_invoice( $registration_id , $_REQUEST[ 'invoice_subject' ], $_REQUEST[ 'invoice_message' ] ); } echo '

'.__('Invoice Sent', 'event_espresso').'

'; } break; } //Show the forms. // $id = $registration_id ; $attendees = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . EVENTS_ATTENDEE_TABLE . " WHERE registration_id ='%s' ORDER BY ID LIMIT 1" ,$registration_id)); foreach ( $attendees as $attendee ) { $id = $attendee->id; //$registration_id = $attendee->registration_id;//Removed by Imon $lname = $attendee->lname; $fname = $attendee->fname; $address = $attendee->address; $city = $attendee->city; $state = $attendee->state; $zip = $attendee->zip; $email = $attendee->email; $phone = $attendee->phone; $date = $attendee->date; $payment_status = $attendee->payment_status; $txn_type = $attendee->txn_type; $txn_id = $attendee->txn_id; $amount_pd = $attendee->amount_pd; $quantity = $attendee->quantity; $payment_date = $attendee->payment_date; $event_id = $attendee->event_id; $coupon_code = $attendee->coupon_code; $pre_approve = $attendee->pre_approve; $start_date = $attendee->start_date; $event_time = $attendee->event_time; } $events = $wpdb->get_results( $wpdb->prepare("SELECT * FROM " . EVENTS_DETAIL_TABLE . " WHERE id='%d'",$event_id )); foreach ( $events as $event ) { $event_id = $event->id; $event_name = $event->event_name; $event_desc = $event->event_desc; $event_description = $event->event_desc; $event_identifier = $event->event_identifier; $cost = isset($event->event_cost) ? $event->event_cost:0; $active = $event->is_active; } $event_date = event_date_display($start_date .' '.$event_time, get_option('date_format') . ' g:i a'); $total_paid = espresso_attendee_price(array('registration_id'=>$_REQUEST['registration_id'], 'session_total'=>true)); if ( isset($_REQUEST[ 'status' ]) && $_REQUEST[ 'status' ] == 'saved' ){ ?>

.

| | -

-

0 ){ echo '

'.__('Registration Ids:', 'event_espresso').'

'; echo '
    '; foreach($registration_ids as $reg_id){ //TODO:Display cost per registration id. At the moment it is not possible to display price per registration id because discount is calculated for total amount [IMON] echo '
  • # '.$reg_id['registration_id'].' [ '.__('View/Edit Registration', 'event_espresso').' ]
  • '; } }else{ echo '

    '.__('Registration Id:', 'event_espresso').'

    '; //TODO:Display cost per registration id. At the moment it is not possible to display price per registration id because discount is calculated for total amount [IMON] echo '

    # ' . $registration_id . ' [ '.__('View/Edit Registration', 'event_espresso').' ]

    '; } echo '

'; ?>
  • '','text'=> __('None','event_espresso')), array('id'=>'Completed','text'=> __('Completed','event_espresso')), array('id'=>'Pending','text'=> __('Pending','event_espresso')), array('id'=>'Payment Declined','text'=> __('Payment Declined','event_espresso')), array('id'=>'Incomplete','text'=> __('Incomplete','event_espresso'))); echo select_input('payment_status', $values, $payment_status); ?>
  • '', 'text' => __('N/A', 'event_espresso')), array('id' => 'web_accept', 'text' => espresso_payment_type('web_accept')), array('id' => 'CC', 'text' => __('Credit Card', 'event_espresso')), array('id' => 'INV', 'text' => espresso_payment_type('INV')), array('id' => 'OFFLINE', 'text' => espresso_payment_type('OFFLINE')), ); echo select_input('txn_type', $txn_values, $txn_type); ?>
  • '.__('Edit Payment', 'event_espresso').' ] ';?>
  • ? '; ?>
  • :
  • Our records show that we have not received your payment of [cost] for [event_link].

    Please visit [payment_url] to view your payment options.

    [invoice_link]

    Sincerely,
    ' . $Organization = $org_options[ 'organization' ] . '

    ', 'event_espresso' ); if (function_exists('wp_editor')){ $args = array("textarea_rows" => 5, "textarea_name" => "invoice_message", "editor_class" => "my_editor_custom"); wp_editor(espresso_admin_format_content($email_content), "invoice_message", $args); }else{ echo ''; espresso_tiny_mce(); } ?>
     

    |

  • : '0','text'=> __('Yes','event_espresso')), array('id'=>'1','text'=> __('No','event_espresso'))); echo select_input("pre_approve",$pre_approval_values,$pre_approve); ?>

<<