<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Version_114 extends CI_Migration{

	public function up() {
		/**
		 * Start tblemailtemplates
		 */

		 $inserts = array(
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-already-send', 'english', 'Proforma Already Sent to Customer', 'Proforma # {proforma_number} ', '<span style=\"font-size: 12pt;\">Hi {contact_firstname} {contact_lastname}</span><br /><br /><span style=\"font-size: 12pt;\">At your request, here is the proforma with number <strong># {proforma_number}</strong></span><br /><br /><span style=\"font-size: 12pt;\">You can view the proforma on the following link: <a href=\"{proforma_link}\">{proforma_number}</a></span><br /><br /><span style=\"font-size: 12pt;\">Please contact us for more information.</span><br /><br /><span style=\"font-size: 12pt;\">Kind Regards,</span><br /><span style=\"font-size: 12pt;\">{email_signature}</span>', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-already-send', 'romanian', 'Proforma Already Sent to Customer [romanian]', 'Proforma # {proforma_number} ', '<span style=\"font-size: 12pt;\">Salut {contact_firstname} {contact_lastname}</span><br /><br /><span style=\"font-size: 12pt;\"> La cererea ta, iata proforma cu numarul <strong># {proforma_number}</strong></span><br /><br /><span style=\"font-size: 12pt;\">Poti vizualiza proforma accesand urmatoarea adresa: <a href=\"{proforma_link}\">{proforma_number}</a></span><br /><br /><span style=\"font-size: 12pt;\">Te rugam sa ne contactezi pentru mai multe informatii.</span><br /><br /><span style=\"font-size: 12pt;\">Kind Regards,</span><br /><span style=\"font-size: 12pt;\">{email_signature}</span>', '{companyname} | CRMConnect', NULL, 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-overdue-notice', 'english', 'Proforma Overdue Notice', 'Proforma Overdue Notice - {proforma_number}', '<span style=\"font-size: 12pt;\">Hi {contact_firstname} {contact_lastname}</span><br /><br /><span style=\"font-size: 12pt;\">This is an overdue notice for proforma <strong># {proforma_number}</strong></span><br /><br /><span style=\"font-size: 12pt;\">This proforma was due: {proforma_duedate}</span><br /><br /><span style=\"font-size: 12pt;\">You can view the proforma on the following link: <a href=\"{proforma_link}\">{proforma_number}</a></span><br /><br /><span style=\"font-size: 12pt;\">Kind Regards,</span><br /><span style=\"font-size: 12pt;\">{email_signature}</span>', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-overdue-notice', 'romanian', 'Proforma Overdue Notice [romanian]', 'Notificare intarziere proforma - {proforma_number}', '<p>Salut {contact_firstname} {contact_lastname}</p>\n<p></p>\n<p>Aceasta este o notificare de intarziere pentru proforma <strong># {proforma_number}</strong></p>\n<p></p>\n<p>Scadenta proformei: {proforma_duedate}</p>\n<p></p>\n<p>Poti vizualiza proforma accesand urmatorul link: <a href=\" {proforma_link}\" rel=\"noopener noreferrer\" target=\"_blank\">{proforma_number}</a></p>\n<p></p>\n<p>Cu stima,</p>\n<p>{email_signature}</p>', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-payment-recorded', 'english', 'Proforma Payment Recorded (Sent to Customer)', 'Proforma Payment Recorded', '<span style=\"font-size: 12pt;\">Hello {contact_firstname}&nbsp;{contact_lastname}<br /><br /></span>Thank you for the payment. Find the payment details below:<br /><br />-------------------------------------------------<br /><br />Amount:&nbsp;<strong>{payment_total}<br /></strong>Date:&nbsp;<strong>{payment_date}</strong><br />Proforma number:&nbsp;<span style=\"font-size: 12pt;\"><strong># {proforma_number}<br /><br /></strong></span>-------------------------------------------------<br /><br />You can always view the proforma for this payment at the following link:&nbsp;<a href=\"{proforma_link}\"><span style=\"font-size: 12pt;\">{proforma_number}</span></a><br /><br />We are looking forward working with you.<br /><br /><span style=\"font-size: 12pt;\">Kind Regards,</span><br /><span style=\"font-size: 12pt;\">{email_signature}</span>', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-payment-recorded', 'romanian', 'Proforma Payment Recorded (Sent to Customer) [romanian]', 'Plata proformei a fost inregistrata', '<p>Salut {contact_firstname}&nbsp;{contact_lastname}</p>\n<p></p>\n<p>Multumim pentru efectuarea platii.</p>\n<p>Mai jos sunt transmise detaliile:</p>\n<p></p>\n<p>-------------------------------------------------</p>\n<p></p>\n<p>Suma:&nbsp;<strong>{payment_total}</strong></p>\n<p>Data:&nbsp;<strong>{payment_date}</strong></p>\n<p>Numarul proformei:&nbsp;<strong># {proforma_number}</strong></p>\n<p></p>\n<p>-------------------------------------------------</p>\n<p>Poti verifica proformele pentru aceasta plata accesand link-ul urmator:&nbsp;<a href=”{proforma_link}\" rel=\"noopener noreferrer\" target=\"_blank\">{proforma_number}</a></p>\n<p></p>\n<p>Te rog sa ne contactezi pentru informatii suplimentare.</p>\n<p></p>\n<p>Cu stima,</p>\n<p>{email_signature}</p>', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-payment-recorded-to-staff', 'english', 'Proforma Payment Recorded (Sent to Staff)', 'New Proforma Payment', '<span style=\"font-size: 12pt;\">Hi</span><br /><br /><span style=\"font-size: 12pt;\">Customer recorded payment for proforma <strong># {proforma_number}</strong></span><br /><br /><span style=\"font-size: 12pt;\">You can view the proforma on the following link: <a href=\"{proforma_link}\">{proforma_number}</a></span><br /><br /><span style=\"font-size: 12pt;\">Kind Regards,</span><br /><span style=\"font-size: 12pt;\">{email_signature}</span>', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-payment-recorded-to-staff', 'romanian', 'Proforma Payment Recorded (Sent to Staff) [romanian]', 'O plata noua a fost inregistrata pentru proforma', '<p>Salut</p>\n<p></p>\n<p>Clientul a inregistrat o noua plata pentru proforma <strong># {proforma_number}</strong></p>\n<p></p>\n<p>Poti vizualiza proforma accesand urmatorul link: <a href=\" {proforma_link}\" rel=\"noopener noreferrer\" target=\"_blank\">{proforma_number}</a></p>\n<p></p>\n<p>Cu stima,</p>\n<p>{email_signature}</p>\n', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-send-to-client', 'english', 'Send Proforma to Customer', 'Proforma with number {proforma_number} created', '<span style=\"font-size: 12pt;\">Dear {contact_firstname} {contact_lastname}</span><br /><br /><span style=\"font-size: 12pt;\">We have prepared the following proforma for you: <strong># {proforma_number}</strong></span><br /><br /><span style=\"font-size: 12pt;\"><strong>Proforma status</strong>: {proforma_status}</span><br /><br /><span style=\"font-size: 12pt;\">You can view the proforma on the following link: <a href=\"{proforma_link}\">{proforma_number}</a></span><br /><br /><span style=\"font-size: 12pt;\">Please contact us for more information.</span><br /><br /><span style=\"font-size: 12pt;\">Kind Regards,</span><br /><span style=\"font-size: 12pt;\">{email_signature}</span>', '{companyname} | CRM', '', 0, 1, 0);
			",
			"
			INSERT INTO `tblemailtemplates` (`type`, `slug`, `language`, `name`, `subject`, `message`, `fromname`, `fromemail`, `plaintext`, `active`, `order`) VALUES('proforma', 'proforma-send-to-client', 'romanian', 'Send Proforma to Customer [romanian]', 'Proforma cu numarul {proforma_number} a fost creata', '<p>Salut {contact_firstname} {contact_lastname}</p>\n<p></p>\n<p>A fost emisa proforma cu numarul: <strong># {proforma_number}</strong></p>\n<p></p>\n<p><strong>Status proforma</strong>: {proforma_status}</p>\n<p></p>\n<p>Poti vizualiza proforma accesand urmatorul link: <a href={proforma_link}\" target=\"_blank\" rel=\"noreferrer noopener”>{proforma_number}</a></p>\n<p></p>\n<p>Te rugam sa ne contactezi pentru mai multe informatii.</p>\n<p></p>\n<p>Cu stima,</p>\n<p>{email_signature}</p>', '{companyname} | CRM', '', 0, 1, 0);
			"
		);

		foreach ($inserts as $index => $insert) {
			$this->db->query($insert);
		};
	}

	public function down()	{
		$this->db->where('type', 'proforma');
		$this->db->delete('tblemailtemplates');
	}
}