CREATE TABLE IF NOT EXISTS `def_Channel` (
`Channel` char(255) NOT NULL DEFAULT '',
`Package` char(255) NOT NULL DEFAULT '',
`Style` text DEFAULT NULL,
`Report1` char(255) DEFAULT '',
`Report2` char(255) DEFAULT '',
`Report3` char(255) DEFAULT '',
`Documentpdf` char(255) DEFAULT '',
`Width` int DEFAULT 700,
`Internal` char(1) DEFAULT 'Y',
`MailingListName` char(255) DEFAULT NULL,
`ExampleChannel` char(255) DEFAULT '',
`Type` char(255) DEFAULT NULL,
`Email` char(255) DEFAULT '',
`ReportNotes` mediumtext DEFAULT NULL,
`MailingList` char(1) DEFAULT 'N',
`Description` text DEFAULT NULL,
`AttachmentFile` char(255) DEFAULT '',
`TopBannerImage` mediumtext DEFAULT NULL,
`Company` char(255) DEFAULT '',
`BaseDir` char(255) DEFAULT '',
`Prefix` char(255) DEFAULT NULL,
`Background` char(10) DEFAULT '#FFFFFF',
`ShowSubscribe` char(1) DEFAULT 'N',
`MailConnection` char(255) DEFAULT '',
`Reportpdf` char(255) DEFAULT '',
`Footer` mediumtext DEFAULT NULL,
`WebUrl` char(255) DEFAULT '',
`LineStyle1` text DEFAULT NULL,
`LineStyle2` text DEFAULT NULL,
`LineHeader` text DEFAULT NULL,
`infrastructure` char(1) DEFAULT NULL,
`NextWeekDay` char(1) DEFAULT 'Y',
`ShowBottomBanner` char(1) DEFAULT 'Y',
`ShowTopBanner` char(1) DEFAULT 'Y',
`Notes` longtext DEFAULT NULL,
`FormFields` char(255) DEFAULT NULL,
`Attachmentreporttype` char(255) DEFAULT 'xls',
`ActionActive` char(1) DEFAULT 'Y',
`Virtual` char(1) DEFAULT '',
`Attachmentreport` char(255) DEFAULT '',
`WebStagingUrl` char(255) DEFAULT '',
`AttachmentFolder` char(255) DEFAULT '',
`AttachmentFileType` char(255) DEFAULT '',
`Attachmentdocument` char(255) DEFAULT '',
`Attachmentfilename` char(255) DEFAULT '',
`Attachmenttemplate` char(255) DEFAULT '',
`PublishDate` datetime DEFAULT NULL,
`FileFormat` char(255) DEFAULT '',
`Header` mediumtext DEFAULT NULL,
`MailPdf` char(1) DEFAULT '',
`Compress` char(50) DEFAULT NULL,
`EmailToColumn` char(255) DEFAULT '',
`SqlGetParams` mediumtext DEFAULT NULL,
`Result1Col` char(255) DEFAULT '',
`Result2Col` char(255) DEFAULT '',
`Result3Col` char(255) DEFAULT '',
`Result4Col` char(255) DEFAULT '',
`Result5Col` char(255) DEFAULT '',
`Result6Col` char(255) DEFAULT '',
`Result7Col` char(255) DEFAULT '',
`Result8Col` char(255) DEFAULT '',
`Result9Col` char(255) DEFAULT '',
`Module` varchar(255) DEFAULT NULL,
PRIMARY KEY (`Channel`,`Package`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE={collation};
CREATE TABLE `def_email` (
`EmailCode` char(255) NOT NULL DEFAULT '',
`ActionPortfolio` char(255) NOT NULL DEFAULT 'Adhoc',
`Package` VARCHAR(255) NOT NULL DEFAULT '',
`Module` VARCHAR(255) DEFAULT NULL,
`Style` text DEFAULT NULL,
`Report1` char(255) DEFAULT '',
`campaign_id` int(11) DEFAULT NULL,
`Report3` char(255) DEFAULT '',
`Report2` char(255) DEFAULT '',
`Width` int(11) DEFAULT 700,
`Internal` char(1) DEFAULT 'Y',
`Type` char(255) DEFAULT NULL,
`Email` char(255) DEFAULT '',
`ReportNotes` mediumtext DEFAULT NULL,
`CardIcon` char(50) DEFAULT 'fa-envelope-o',
`MailingList` char(1) DEFAULT 'N',
`Description` text DEFAULT NULL,
`AttachmentFolder` char(255) DEFAULT '',
`Company` char(255) DEFAULT 'INCLINE',
`BaseDir` char(255) DEFAULT '',
`CategorySummary3` char(255) DEFAULT NULL,
`Background` char(10) DEFAULT '#FFFFFF',
`ShowSubscribe` char(1) DEFAULT 'N',
`LineHeader` text DEFAULT NULL,
`Strategy_id` char(25) DEFAULT NULL,
`WebUrl` char(255) DEFAULT '',
`LineStyle1` text DEFAULT NULL,
`ShowPrices` char(1) DEFAULT 'N',
`infrastructure` char(1) DEFAULT NULL,
`Footer` mediumtext DEFAULT NULL,
`NextWeekDay` char(1) DEFAULT 'Y',
`ShowBottomBanner` char(1) DEFAULT 'Y',
`Notes` longtext DEFAULT NULL,
`FormFields` char(255) DEFAULT NULL,
`LineStyle2` text DEFAULT NULL,
`Attachmentreport` char(255) DEFAULT '',
`MailConnection` char(255) DEFAULT '',
`WebStagingUrl` char(255) DEFAULT '',
`AttachmentFile` char(255) DEFAULT '',
`PublishDate` datetime DEFAULT NULL,
`Prefix` char(255) DEFAULT NULL,
`CardColor` char(50) DEFAULT 'btn-success',
`ShowTopBanner` char(1) DEFAULT 'Y',
PRIMARY KEY (
`EmailCode`, `ActionPortfolio`, `Package`
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
COLLATE={collation};
CREATE TABLE IF NOT EXISTS `stage_channel` (
`Guid` char(255) NOT NULL DEFAULT '',
`Channel` char(255) NOT NULL,
`Package` varchar(255) DEFAULT NULL,
`TemplateCode` varchar(64) DEFAULT NULL,
`Status` char(50) DEFAULT NULL,
`StatusError` char(255) DEFAULT NULL,
`Email` char(255) DEFAULT '',
`Address` char(255) DEFAULT '',
`Uuid` char(255) DEFAULT '',
`ChannelDescription` char(255) DEFAULT NULL,
`ChannelNotes` text DEFAULT NULL,
`ChannelReportNotes` mediumtext DEFAULT NULL,
`Channelreplyto` char(50) DEFAULT NULL,
`Channelreport1` char(50) DEFAULT NULL,
`Channelreport2` char(50) DEFAULT NULL,
`Channelreport3` char(50) DEFAULT NULL,
`TopBannerImage` char(255) DEFAULT NULL,
`MailingListName` char(255) DEFAULT NULL,
`DocReference` char(50) DEFAULT NULL,
`DocName` char(50) DEFAULT NULL,
`Param1` text DEFAULT NULL,
`Param2` text DEFAULT NULL,
`Param3` text DEFAULT NULL,
`Param4` text DEFAULT NULL,
`Param5` text DEFAULT NULL,
`Param6` text DEFAULT NULL,
`Param7` text DEFAULT NULL,
`Param8` text DEFAULT NULL,
`Param9` text DEFAULT NULL,
`LogMessage` text DEFAULT NULL,
`LogMessageText` text DEFAULT NULL,
`LogTitle` text DEFAULT NULL,
`LogSmtpUser` char(255) DEFAULT NULL,
`LogSmtpSender` char(255) DEFAULT NULL,
`LogSmtpServer` char(255) DEFAULT NULL,
`Thread` int(11) DEFAULT 0,
`WorkerPid` int(11) NOT NULL DEFAULT 0,
`DispatcherName` char(255) DEFAULT NULL,
`DispatcherPid` int(11) DEFAULT 0,
`Instance` char(255) DEFAULT NULL,
`Nodename` char(255) DEFAULT NULL,
`CPULoad` int(11) DEFAULT 0,
`MemoryLoad` int(11) DEFAULT 0,
`DiskLoad` int(11) DEFAULT 0,
`TimeScheduled` datetime DEFAULT NULL,
`TimeAdded` timestamp NULL DEFAULT current_timestamp(),
`TimeRun` datetime DEFAULT NULL,
`TimeThreaded` datetime DEFAULT NULL,
`TimeStarted` datetime DEFAULT NULL,
`TimeCompleted` datetime DEFAULT NULL,
PRIMARY KEY (`Guid`, `Channel`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE={collation};
SELECT *, '' AS Notesreplaced FROM `{def_channel}`
WHERE
Package IN ('{package}', '{archetype}', 'CORE', 'SYSTEM')
AND Channel = '{channel}';
Insert into {def_channel} (Channel,Package) values ('{channel}','{package}')
select Company,User,Surname,Email from def_ChannelMail where Uuid like '{guid}'
SELECT Password from sys_User, def_Channelmail
WHERE
sys_User.User = def_Channelmail.User and sys_User.User like '{user}'
SELECT
D.Style, D.LineStyle1, D.LineStyle2, D.LineHeader, D.Width, D.Background
FROM
`def_channel` D
WHERE
Channel LIKE '{channel}' AND Package LIKE '{package}'
select Firstname from def_ChannelMail where Uuid like '{guid}'
SELECT DocName, ZipOnEmail FROM def_document WHERE docname LIKE '{doc_name}'
where Package in ('{package}','{archetype}','CORE','SYSTEM')
SELECT CONTEXT,CONTEXT2 FROM data_documentfile WHERE
Docname = '{doc_name}' ORDER BY CreateTime DESC LIMIT 1
Insert ignore INTO `def_report` ( `ReportCode`, `Title`, `Company`, `Query`, `Level`, `Type`, `Template`, `Package`, `Package` )
VALUES ('sys_channelpdf','Channel PDF', 'TECHNOCORE', 'SELECT LogMessage AS ` ` FROM stage_channel
WHERE Guid = "{guid}"',1,'layout','direct', '{package}', '{package}');
Update stage_channel set
LogMessage = '{final_message}',
LogTitle = '{final_description}'
where Guid = '{guid}'
SELECT User from def_ChannelMail
WHERE
Uuid like '{guid}'
AND Package in ('{package}',
'{archetype}','CORE','SYSTEM')
SELECT D.MailConnection
FROM
{def_table} AS D
WHERE
D.Channel = '{channel}'
AND Package IN ('{package}', '{archetype}', 'CORE', 'SYSTEM');
SELECT User from def_ChannelMail
WHERE
Uuid like '{guid}'
AND Package in ('{package}',
'{archetype}','CORE','SYSTEM')
SELECT D.MailConnection
FROM
{def_table} AS D
WHERE
D.Channel = '{channel}'
AND Package IN ('{package}', '{archetype}', 'CORE', 'SYSTEM');
title