Skip to content

Instantly share code, notes, and snippets.

@zjbennett

zjbennett/functions.php

Last active Aug 7, 2018
Embed
What would you like to do?
G-Form Submission that take the booking form and places the submission into a table.
<?php
add_action( 'gform_after_submission_1', 'input_fields', 10, 2 );
function input_fields( $entry, $form ) {
global $wpdb;
$result = $wpdb->insert('wp_booking', array(
'booking_profname' => rgar( $entry, '4' ),
'booking_language' => rgar( $entry, '18' ),
'booking_gender' => rgar( $entry, '5' ),
'booking_date' => rgar( $entry, '7' ),
'booking_time' => rgar( $entry, '8' ),
'booking_duration' => rgar( $entry, '10' ),
'booking_interviewname' => rgar( $entry, '11' ),
'booking_id' => rgar ( $entry, '19'),
'user_id' => rgar( $entry, '23'),
'booking_type' => rgar ($entry, '24' ),
'booking_contnum' => rgar ($entry, '26'),
'booking_nature' => rgar ($entry, '30'),
));
GFCommon::log_debug( __METHOD__ . '(): result => ' . var_export( $result, true ) );
if ( $result === false ) {
GFCommon::log_debug( __METHOD__ . '(): error => ' . $wpdb->last_error );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.