field_table_name = $wpdb->prefix . 'visual_form_builder_fields'; $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms'; $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries'; add_action( 'admin_init', array( &$this, 'entries_detail' ) ); } public function entries_detail(){ global $wpdb; $entry_id = absint( $_REQUEST['entry'] ); $query = "SELECT forms.form_title, entries.* FROM $this->form_table_name AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id WHERE entries.entries_id = $entry_id;"; $entries = $wpdb->get_results( $query ); echo '

' . sprintf( '« Back to Entries', $_REQUEST['page'], $_REQUEST['view'] ) . '

'; /* Get the date/time format that is saved in the options table */ $date_format = get_option('date_format'); $time_format = get_option('time_format'); /* Loop trough the entries and setup the data to be displayed for each row */ foreach ( $entries as $entry ) { $data = unserialize( $entry->data ); ?>

form_title ); ?> : # entries_id; ?>

: form_title ); ?>
: date_submitted ) ); ?>
: ip_address; ?>
: subject ); ?>
: sender_name ); ?>
: $1', implode( ',', unserialize( stripslashes( $entry->emails_to ) ) ) ); ?>
Delete', $_REQUEST['page'], $_REQUEST['view'], 'delete', $entry_id ); ?>
$v ) { if ( !is_array( $v ) ) { if ( $count == 0 ) { echo '

' . $entry->form_title . ' : ' . __( 'Entry' , 'visual-form-builder') .' #' . $entry->entries_id . '

'; } echo '

' . ucwords( $k ) . '

'; echo $v; //echo '
'; $count++; } else { /* Cast each array as an object */ $obj = (object) $v; /* Close each section */ if ( $open_section == true ) { /* If this field's parent does NOT equal our section ID */ if ( $sec_id && $sec_id !== $obj->parent_id ) { echo '
'; $open_section = false; } } if ( $obj->type == 'fieldset' ) { /* Close each fieldset */ if ( $open_fieldset == true ) echo '
'; echo '

' . $obj->name . '

'; $open_fieldset = true; } elseif ( $obj->type == 'section' ) { /* Close each fieldset */ if ( $open_section == true ) echo '
'; echo '

' . $obj->name . '

'; /* Save section ID for future comparison */ $sec_id = $obj->id; $open_section = true; } switch ( $obj->type ) { case 'fieldset' : case 'section' : case 'submit' : break; default : echo '

' . $obj->name . '

' . $obj->value . '
'; break; } } } if ( $count > 0 ) echo '
'; echo ''; } echo '
'; } } ?>