
START TRANSACTION;

INSERT INTO `plugin_base_fields` VALUES (NULL, 'opt_o_cancel_pending_reservations', 'backend', 'Options / Cancel pending reservations', 'script', '2015-11-17 07:11:13');
  SET @id := (SELECT LAST_INSERT_ID());
  INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Pending reservations will be automatically cancelled after', 'script');


  ALTER TABLE `clients` ADD `timezone` VARCHAR(255) NULL AFTER `active`;

  INSERT INTO `plugin_base_fields` VALUES (NULL, 'employee_timezone', 'backend', 'Label / Employee timezone', 'script', '2017-03-09 05:27:35');
  SET @id := (SELECT LAST_INSERT_ID());
  INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Timezone', 'script');

  INSERT INTO `plugin_base_fields` VALUES (NULL, 'lblClientTimezone', 'backend', 'Label / Client timezone', 'script', '2017-03-09 05:27:35');
  SET @id := (SELECT LAST_INSERT_ID());
  INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Timezone', 'script');

  INSERT INTO `plugin_base_fields` VALUES (NULL, 'front_timezone', 'frontend', 'Label / Timezone', 'script', '2017-03-09 05:27:35');
  SET @id := (SELECT LAST_INSERT_ID());
  INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Timezone', 'script');

  INSERT INTO `plugin_base_fields` VALUES (NULL, 'lblLogout', 'frontend', 'Label / Logout', 'script', '2017-03-09 05:27:35');
  SET @id := (SELECT LAST_INSERT_ID());
  INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Logout', 'script');


  SET @id := (SELECT `id` FROM `plugin_base_fields` WHERE `key` = "error_bodies_ARRAY_AO25");
  UPDATE `plugin_base_multi_lang` SET `content` = 'Email notifications will be sent to people who make a booking after the booking form is completed or/and payment is made. If you leave subject field blank no email will be sent. You can use tokens in the email messages to personalize them.<br /><br /><table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="50%" valign="top"><p>{Name} - customer name;<br />{Phone} - customer phone number; <br />{Email} - customer e-mail address; <br />{Notes} - additional notes; <br />{Address1} - address 1; <br />{Address2} - address 2; <br />{City} - city; <br />{State} - state; <br />{Zip} - zip code; <br />{Country} - country; <br />{Username} - Username; <br />{Password} - Password; <br />{Link} - Link; <br /></p></td><td width="50%" valign="top">{BookingID} - Booking ID; <br />{Services} - Selected services<br />{CCType} - CC type; <br />{CCNum} - CC number; <br />{CCExpMonth} - CC exp.month; <br />{CCExpYear} - CC exp.year; <br />{CCSec} - CC sec. code; <br />{PaymentMethod} - selected payment method; <br />{Price} - price for selected services; <br />{Deposit} - Deposit amount; <br />{Tax} - Tax amount; <br />{Total} - Total amount; <br />{CancelURL} - Link for booking cancellation;<br/>{Extras} - Extras; </td></tr></tbody></table>' WHERE `foreign_id` = @id AND `model` = "pjField" AND `field` = "title";

  INSERT INTO `options` (`foreign_id`, `key`, `tab_id`, `value`, `label`, `type`, `order`, `is_visible`, `style`) VALUES
    (1, 'o_install_url', 1, NULL, NULL, 'string', 21, 1, NULL);

  INSERT INTO `plugin_base_fields` VALUES (NULL, 'opt_o_install_url', 'backend', 'Options / Main Installation URL', 'script', NULL);
  SET @id := (SELECT LAST_INSERT_ID());
  INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Main Installation URL', 'script');

  INSERT INTO `plugin_base_fields` VALUES (NULL, 'lblForgotPasswordError', 'frontend', 'Label / Forgot password error', 'script', '2015-11-17 07:11:13');
  SET @id := (SELECT LAST_INSERT_ID());
  INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Email doesn''t exist.', 'script');

  ALTER TABLE `bookings` ADD `client_id` INT UNSIGNED NULL AFTER `payment_method`;

COMMIT;