
START TRANSACTION;


UPDATE `options` SET `value`='1|2|3::1', `is_visible`='0' WHERE `key`='o_bf_include_name';



ALTER TABLE `plugin_auth_users` ADD COLUMN `fname` varchar(255) DEFAULT NULL AFTER `name`;
ALTER TABLE `plugin_auth_users` ADD COLUMN `lname` varchar(255) DEFAULT NULL AFTER `fname`;

ALTER TABLE `bookings` ADD COLUMN `c_fname` varchar(255) DEFAULT NULL AFTER `c_name`;
ALTER TABLE `bookings` ADD COLUMN `c_lname` varchar(255) DEFAULT NULL AFTER `c_fname`;

ALTER TABLE `cars` ADD COLUMN `insaurance_deductable` varchar(255) DEFAULT NULL;


INSERT INTO `options` (`foreign_id`, `key`, `tab_id`, `value`, `label`, `type`, `order`, `is_visible`, `style`) VALUES
(1, 'o_bf_include_fname', 2, '1|2|3::3', 'No|Yes|Yes (required)', 'enum', 2, 1, NULL),
(1, 'o_bf_include_lname', 2, '1|2|3::3', 'No|Yes|Yes (required)', 'enum', 2, 1, NULL);

			
INSERT INTO `plugin_base_fields` VALUES (NULL, 'lblInsuranceDeductable', 'backend', 'Label / Insurance deductable', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'Insurance deductable', 'script');
				
INSERT INTO `plugin_base_fields` VALUES (NULL, 'opt_o_bf_include_fname', 'backend', 'Options / First Name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'First Name', 'script');
				
INSERT INTO `plugin_base_fields` VALUES (NULL, 'opt_o_bf_include_lname', 'backend', 'Options / Last Name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'Last Name', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'lblFirstName', 'backend', 'Label / First name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'First name', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'lblLastName', 'backend', 'Label / Last name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'Last name', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'front_client_fname', 'frontend', 'Label / First name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'First name', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'front_client_lname', 'frontend', 'Label / Last name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'Last name', 'script');

INSERT INTO `plugin_base_fields` VALUES (NULL, 'client_account_required_ARRAY_fname', 'arrays', 'Label / First name is required', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'First name is required', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'client_account_required_ARRAY_lname', 'arrays', 'Label / Last name is required', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'Last name is required', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'front_4_fname', 'frontend', 'Label / First Name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'First Name', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'front_4_v_fname', 'frontend', 'Label / First Name is required', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'First Name is required', 'script');
	
INSERT INTO `plugin_base_fields` VALUES (NULL, 'booking_fname', 'backend', 'Label / First Name', 'script', '2018-05-31 06:44:09');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', 'First Name', 'script');
	

SET @id := (SELECT `id` FROM `plugin_base_fields` WHERE `key`='opt_o_email_body_text');
UPDATE `plugin_base_multi_lang` SET `content`='<div class="col-xs-6">
<div><small>{Title}</small></div>
<div><small>{FirstName}</small></div>
<div><small>{LastName}</small></div>
<div><small>{Email}</small></div>
<div><small>{Phone}</small></div>
<div><small>{Country}</small></div>
<div><small>{City}</small></div>
<div><small>{State}</small></div>
<div><small>{Zip}</small></div>
<div><small>{Address}</small></div>
<div><small>{Company}</small></div>
<div><small>{Notes}</small></div>
<div><small>{DriverLicense}</small></div>
<div><small>{Birthday}</small></div>
<div><small>{DtFrom}{DtTo}</small></div>
<div><small>{PickupLocation}</small></div>
<div><small>{ReturnLocation}</small></div>
<div><small>{Type}</small></div>
<div><small>{LimitMileage}</small></div>
</div>
<div class="col-xs-6">
<div><small>{RentalDays}</small></div>
<div><small>{Extras}</small></div>
<div><small>{BookingID}</small></div>
<div><small>{UniqueID}</small></div>
<div><small>{Deposit}</small></div>
<div><small>{Total}</small></div>
<div><small>{Tax}</small></div>
<div><small>{Security}</small></div>
<div><small>{Insurance}</small></div>

<div><small>{PricePerDay}</small></div>
<div><small>{TotalDaysPrice}</small></div>
<div><small>{ExtraPrice}</small></div>

<div><small>{PaymentMethod}</small></div>
<div><small>{CarMake}</small></div>
<div><small>{CarModel}</small></div>
<div><small>{Mileage}</small></div>
<div><small>{Description}</small></div>
<div><small>{CancelURL}</small></div>
 </div>
 <div class="col-xs-12">
 <div><small>{InsuranceDeductable}</small></div>
 <div><small>{RegistrationNumber}</small></div>
 <div><small>{CarServicePhoneNumber}</small></div>
<div><small>{CarInsuranceCustomerNumber}</small></div>
 </div>
' WHERE `foreign_id`=@id AND `model`='pjField' AND `field`='title';



SET @id := (SELECT `id` FROM `plugin_base_fields` WHERE `key`='opt_o_email_account_body_text');
UPDATE `plugin_base_multi_lang` SET `content`='<div class="col-xs-12">
<div><small><strong>{Title}</strong> - The client''s title</small></div>
<div><small><strong>{FirstName}</strong> - The client''s first name</small></div>
<div><small><strong>{LastName}</strong> - The client''s last name</small></div>
<div><small><strong>{Email}</strong> - The client''s email</small></div>
<div><small><strong>{Password}</strong> - The client''s password</small></div>
<div><small><strong>{Company}</strong> - The client''s company</small></div>
<div><small><strong>{Phone}</strong> - The client''s phone number</small></div>
<div><small><strong>{Notes}</strong> - Additional notes</small></div>
<div><small><strong>{Country}</strong> - The provided country</small></div>
<div><small><strong>{State}</strong> - The provided state</small></div>
<div><small><strong>{City}</strong> - The provided city</small></div>
<div><small><strong>{Zip}</strong> - The provided zip</small></div>
<div><small><strong>{Address}</strong> - The provided address</small></div>
 </div>
' WHERE `foreign_id`=@id AND `model`='pjField' AND `field`='title';
	
	

COMMIT;