/** * Output the event transaction list table * * @since 1.3.7 * @global obj $mdjm_event MDJM_Event class object * @global bool $mdjm_event_update True if this event is being updated, false if new. * @param int $event_id The event ID. * @return str */ function mdjm_event_metabox_txn_add_new_row($event_id) { global $mdjm_event, $mdjm_event_update; mdjm_insert_datepicker(array('id' => 'mdjm_txn_display_date', 'altfield' => 'mdjm_txn_date', 'maxdate' => 'today')); ?> <div id="mdjm-event-add-txn-table"> <table id="mdjm_event_add_txn_table" class="widefat mdjm_event_add_txn_table mdjm_form_fields"> <thead> <tr> <th colspan="3"><?php _e('Add Transaction', 'mobile-dj-manager'); ?> <a id="toggle_add_txn_fields" class="mdjm-small mdjm-fake"><?php _e('show form', 'mobile-dj-manager'); ?> </a></th> </tr> </thead> <tbody class="mdjm-hidden"> <tr> <td><label for="mdjm_txn_amount"><?php _e('Amount:', 'mobile-dj-manager'); ?> </label><br /> <?php echo mdjm_currency_symbol() . MDJM()->html->text(array('name' => 'mdjm_txn_amount', 'class' => 'mdjm-input-currency', 'placeholder' => mdjm_sanitize_amount('10'))); ?> </td> <td><label for="mdjm_txn_display_date"><?php _e('Date:', 'mobile-dj-manager'); ?> </label><br /> <?php echo MDJM()->html->text(array('name' => 'mdjm_txn_display_date', 'class' => '')) . MDJM()->html->hidden(array('name' => 'mdjm_txn_date')); ?> </td> <td><label for="mdjm_txn_amount"><?php _e('Direction:', 'mobile-dj-manager'); ?> </label><br /> <?php echo MDJM()->html->select(array('name' => 'mdjm_txn_direction', 'options' => array('In' => __('Incoming', 'mobile-dj-manager'), 'Out' => __('Outgoing', 'mobile-dj-manager')), 'show_option_all' => false, 'show_option_none' => false)); ?> </td> </tr> <tr> <td><span id="mdjm_txn_from_container"><label for="mdjm_txn_from"><?php _e('From:', 'mobile-dj-manager'); ?> </label><br /> <?php echo MDJM()->html->text(array('name' => 'mdjm_txn_from', 'class' => '', 'placeholder' => __('Leave empty if client', 'mobile-dj-manager'))); ?> </span> <span id="mdjm_txn_to_container" class="mdjm-hidden"><label for="mdjm_txn_to"><?php _e('To:', 'mobile-dj-manager'); ?> </label><br /> <?php echo MDJM()->html->text(array('name' => 'mdjm_txn_to', 'class' => '', 'placeholder' => __('Leave empty if client', 'mobile-dj-manager'))); ?> </span></td> <td><label for="mdjm_txn_for"><?php _e('For:', 'mobile-dj-manager'); ?> </label><br /> <?php echo MDJM()->html->txn_type_dropdown(); ?> </td> <td><label for="mdjm_txn_src"><?php _e('Paid via:', 'mobile-dj-manager'); ?> </label><br /> <?php echo MDJM()->html->select(array('name' => 'mdjm_txn_src', 'options' => mdjm_get_txn_source(), 'selected' => mdjm_get_option('default_type', 'Cash'), 'show_option_all' => false, 'show_option_none' => false)); ?> </td> </tr> <?php if (mdjm_get_option('manual_payment_cfm_template')) { ?> <tr id="mdjm-txn-email"> <td colspan="3"><?php echo MDJM()->html->checkbox(array('name' => 'mdjm_manual_txn_email', 'current' => mdjm_get_option('manual_payment_cfm_template') ? true : false, 'class' => 'mdjm-checkbox')); ?> <?php _e('Send manual payment confirmation email?', 'mobile-dj-manager'); ?> </td> </tr> <?php } ?> </tbody> </table> </div> <p id="save-event-txn" class="mdjm-hidden"><a id="save_transaction" class="button button-primary button-small"><?php _e('Add Transaction', 'mobile-dj-manager'); ?> </a></p> <?php }
/** * Retrieve a list of all transaction sources * * @since 1.3 * @param bool * @return arr $txn_sources An array of transaction sources */ function mdjm_list_txn_sources() { $sources = mdjm_get_txn_source(); foreach ($sources as $source) { $txn_sources[$source] = $source; } return $txn_sources; }