Last active
August 7, 2018 13:43
-
-
Save zjbennett/cef32bdd54500e8183260da3c4b0991d to your computer and use it in GitHub Desktop.
G-Form Submission that take the booking form and places the submission into a table.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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