[insert_php]
session_start();
ob_start();
if (isset($_POST[‘FirstName’]))
$FirstName = $_POST[‘FirstName’];
if (isset($_POST[‘LastName’]))
$LastName = $_POST[‘LastName’];
if (isset($_POST[‘Address1’]))
$Address1 = $_POST[‘Address1’];
if (isset($_POST[‘Address2’]))
$Address2 = $_POST[‘Address2’];
if (isset($_POST[‘City’]))
$City = $_POST[‘City’];
if (isset($_POST[‘State’]))
$State = $_POST[‘State’];
if (isset($_POST[‘ZipCode’]))
$ZipCode = $_POST[‘ZipCode’];
if (isset($_POST[‘EmailID’]))
$EmailID = $_POST[‘EmailID’];
if (isset($_POST[‘PhoneNo’]))
$PhoneNo = $_POST[‘PhoneNo’];
if (isset($_POST[‘YrsExp’]))
$YrsExp = $_POST[‘YrsExp’];
if (isset($_POST[‘AboutYou’]))
$AboutYou = $_POST[‘AboutYou’];
if (isset($_POST[‘WorkshopType’]))
$WorkshopType = $_POST[‘WorkshopType’];
if (isset($_POST[‘RefName’]))
$RefName = $_POST[‘RefName’];
$WorkshopAdvanceTwo = 500;
$WorkshopAdvanceOne = 350;
$WorkshopProfessional = 750;
$WorkshopOneonOne = 1000;
$WorkshopFees = 1000;
$RegistrationFees = 150;
if ($WorkshopType == ‘Advance-1’)
$WorkshopFees = $WorkshopAdvanceOne;
if ($WorkshopType == ‘Advance-2’)
$WorkshopFees = $WorkshopAdvanceTwo;
if ($WorkshopType == ‘Professional’)
$WorkshopFees = $WorkshopProfessional;
if ($WorkshopType == ‘One2One’)
$WorkshopFees = $WorkshopOneonOne;
$DB_HOST = ‘localhost’;
$DB_USER = ‘artnbeat’;
$DB_PASS = ‘Remember1!’;
$DB_NAME = ‘artnbeat’;
global $wpdb;
try {
$newdb = new wpdb($DB_USER, $DB_PASS, $DB_NAME, $DB_HOST);
$newdb->print_error();
$newdb->insert (‘Workshop’, array(
‘WSName’ =>’Dr L Subramaniam Workshop 2018′,
‘FirstName’ => $FirstName,
‘LastName’ => $LastName,
‘Address1’ => $Address1,
‘Address2’ => $Address2,
‘City’ => $City,
‘State’ => $State,
‘ZipCode’ => $ZipCode,
‘EmailID’ => $EmailID,
‘PhoneNo’ => $PhoneNo,
‘AboutYou’ => $AboutYou,
‘WSType’ => $WorkshopType,
‘WSRefName’ => $RefName,
‘WSFees’ => $WorkshopFees + $RegistrationFees
)
);
$newdb->print_error();
} catch (Exception $e) { // Database Error
echo $e->getMessage();
}
[/insert_php]
|
|