Created
January 18, 2016 03:13
-
-
Save miyurusankalpa/820a3a488a9b0c5b8699 to your computer and use it in GitHub Desktop.
Acorn Aid PHP7 Compatible installer http://www.hotscripts.com/listing/easy-ticket-143667/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
<title>Acorn Aid Installation</title> | |
<style> | |
html,body { | |
margin: 10px; | |
font-family:Arial, Helvetica, sans-serif; | |
color:#666666; | |
background-color:#F9F9F9; | |
} | |
a { | |
color:#0066CC; | |
text-decoration:none; | |
} | |
a:hover { | |
text-decoration:underline; | |
} | |
#title { | |
margin:0 auto; | |
font-size: x-large; | |
font-weight: bold; | |
width: 650px; | |
} | |
.desc { | |
color:#090; | |
} | |
#outer { | |
margin: 0 auto; | |
background-color:#FFFFFF; | |
width: 650px; | |
border: 1px #DDD solid; | |
-webkit-box-shadow: 2px 2px 2px 2px #EEE; | |
box-shadow: 2px 2px 2px 2px #EEE; | |
-moz-border-radius:3px; | |
-webkit-border-radius:3px; | |
border-radius:3px; | |
padding:20px; | |
} | |
#outer table { | |
border: 1px solid #EEE; | |
border-collapse:collapse; | |
} | |
#outer td { | |
padding: 10px; | |
border-bottom: 1px solid #EEE; | |
border-right: 1px solid #EEE; | |
} | |
#outer #header { | |
background-color:#0066CC; | |
font-size: medium; | |
color:#FFFFFF; | |
} | |
#outer #footer { | |
background-color:#EEE; | |
} | |
.success { | |
color:#009900; | |
} | |
.warning { | |
color:#FF9900; | |
} | |
.error { | |
color:#CC3300; | |
} | |
.large { | |
font-size:large; | |
} | |
hr { | |
border: 0; | |
height: 0; | |
border-top: 1px solid #DDD; | |
} | |
input[type='text'] { | |
border: 1px solid #CCC; | |
padding: 10px; | |
width: 90%; | |
border-radius:5px; | |
-webkit-border-radius:5px; | |
-moz-border-radius:5px; | |
} | |
input[type='submit'], input[type='button'] { | |
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff; | |
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; | |
box-shadow:inset 0px 1px 0px 0px #ffffff; | |
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #f6f6f6)); | |
background:-moz-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); | |
background:-webkit-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); | |
background:-o-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); | |
background:-ms-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); | |
background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%); | |
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0); | |
background-color:#ffffff; | |
-moz-border-radius:6px; | |
-webkit-border-radius:6px; | |
border-radius:6px; | |
border:1px solid #dcdcdc; | |
display:inline-block; | |
font-weight:bold; | |
color:#666666; | |
padding:10px; | |
text-decoration:none; | |
text-shadow:0px 1px 0px #ffffff; | |
} | |
input[type='submit']:hover, input[type='button']:hover { | |
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(1, #ffffff)); | |
background:-moz-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); | |
background:-webkit-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); | |
background:-o-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); | |
background:-ms-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); | |
background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%); | |
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0); | |
background-color:#f6f6f6; | |
} | |
input[type='submit']:active, input[type='button']:active { | |
position:relative; | |
top:1px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="title">Acorn Aid Setup</div> | |
<br> | |
<div id="outer"> | |
<?php | |
if (isset($_POST["Install"])) { | |
$i_et_u = $_POST["i_aa_u"]; | |
$i_et_p = $_POST["i_aa_p"]; | |
$i_et_fn = $_POST["i_aa_fn"]; | |
$i_et_ln = $_POST["i_aa_ln"]; | |
$i_et_ea = $_POST["i_aa_ea"]; | |
$i_et_p_sha = hash('sha256', $i_et_p); | |
$i_db = $_POST["i_db"]; | |
$i_host = $_POST["i_host"]; | |
$i_u = $_POST["i_username"]; | |
$i_p = $_POST["i_pw"]; | |
$i_ticket = "ticket"; | |
$i_ticket_update = "ticket_updates"; | |
$i_categories = "groups"; | |
$i_priorities = "priorities"; | |
$i_settings = "settings"; | |
$i_users = "users"; | |
$i_users_skill = "users_skill"; | |
$i_calendar = "calendar"; | |
$i_canned_replies = "canned_messages"; | |
$i_custom_fields = "custom_fields"; | |
$i_kb = "kb"; | |
$i_kb_groups = "kb_groups"; | |
$i_imail = "imail"; | |
// file and location to write to | |
$settingsfile = "settings.php"; | |
// file content for settings.php | |
$file_content = "<?php \n". | |
"\$mysql_host = \"".$i_host."\";\n". | |
"\$mysql_user = \"".$i_u."\";\n". | |
"\$mysql_pass = \"".$i_p."\";\n". | |
"\$mysql_db = \"".$i_db."\";\n". | |
"\$mysql_ticket = \"".$i_ticket."\";\n". | |
"\$mysql_ticket_updates = \"".$i_ticket_update."\";\n". | |
"\$mysql_categories = \"".$i_categories."\";\n". | |
"\$mysql_priorities = \"".$i_priorities."\";\n". | |
"\$mysql_settings = \"".$i_settings."\";\n". | |
"\$mysql_users = \"".$i_users."\";\n". | |
"\$mysql_users_skill = \"".$i_users_skill."\";\n". | |
"\$mysql_canned_msg = \"".$i_canned_replies."\";\n". | |
"\$mysql_custom_fields = \"".$i_custom_fields."\";\n". | |
"\$mysql_kb = \"".$i_kb."\";\n". | |
"\$mysql_kb_groups = \"".$i_kb_groups."\";\n". | |
"\$mysql_imail = \"".$i_imail."\";\n"; | |
"?>"; | |
echo "<p class=\"large\"><b>Creating Acorn Aid...</b></p><hr>"; | |
//Connect to MySQL | |
$link = mysqli_connect($i_host, $i_u, $i_p); | |
if (!$link) { | |
die('Could not connect: ' . mysqli_error()); | |
} | |
// Make my_db the current database | |
$db_selected = mysqli_select_db($link, $i_db); | |
if (!$db_selected) { | |
// If we couldn't, then it either doesn't exist, or we can't see it. | |
$sql = 'CREATE DATABASE '.$i_db; | |
if (mysqli_query($link, $sql)) { | |
echo "<p class=\"success\">Database <b>".$i_db."</b> created successfully</p>"; | |
$dbcreated = TRUE; | |
} else { | |
echo "<p class=\"error\">Error creating database: " . mysqli_error() . "</p>"; | |
$mysql_create_error = TRUE; | |
} | |
} else { | |
echo "<p class=\"warning\">Database <b>".$i_db."</b> already exists". mysqli_error() . "</p>"; | |
$dbcreated = TRUE; | |
} | |
// If table created or already exists then create each table | |
if ($dbcreated) { | |
// create db connection | |
$db_selected = mysqli_select_db($i_db, $link); | |
// add each table to array and loop through to create | |
$tables = array($i_ticket, $i_ticket_update, $i_categories, $i_priorities, $i_settings, $i_users, $i_users_skill, $i_calendar, $i_canned_replies ,$i_custom_fields, $i_kb, $i_kb_groups, $i_imail); | |
foreach ($tables as $table) { | |
// select table to see if table exists | |
$ticket_table = mysqli_query($link, "SELECT * FROM $table"); | |
// if select statement fails then create new table | |
if (!$ticket_table) { | |
switch ($table) { | |
case "ticket": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `ticket` ( | |
`ID` int(7) unsigned zerofill NOT NULL AUTO_INCREMENT, | |
`User` varchar(100) COLLATE utf8_unicode_ci NOT NULL, | |
`User_Email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Cat_ID` int(11) NOT NULL, | |
`Level_ID` int(11) NOT NULL, | |
`Type` varchar(20) COLLATE utf8_unicode_ci NOT NULL, | |
`Subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Message` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
`Files` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
`IP_Address` varchar(50) COLLATE utf8_unicode_ci NOT NULL, | |
`Page_Referer` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Browser` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Status` varchar(20) COLLATE utf8_unicode_ci NOT NULL, | |
`Owner` int(11) DEFAULT NULL, | |
`Collision` int(11) NOT NULL, | |
`Collision_Time` datetime NOT NULL, | |
`Feedback` int(11) DEFAULT NULL, | |
`Date_Replied` datetime DEFAULT NULL, | |
`Date_Added` datetime NOT NULL, | |
`Date_Updated` datetime NOT NULL, | |
`Date_Closed` datetime DEFAULT NULL, | |
PRIMARY KEY (`ID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "ticket_updates": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `ticket_updates` ( | |
`ID` int(11) NOT NULL AUTO_INCREMENT, | |
`Ticket_ID` int(7) unsigned zerofill NOT NULL, | |
`Update_By` varchar(100) COLLATE utf8_unicode_ci NOT NULL, | |
`Updated_At` datetime NOT NULL, | |
`Update_Type` varchar(20) COLLATE utf8_unicode_ci NOT NULL, | |
`Update_Time` int(11) NOT NULL, | |
`Forward_To` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Notes` text COLLATE utf8_unicode_ci NOT NULL, | |
`Update_Files` text COLLATE utf8_unicode_ci NOT NULL, | |
`Update_Emailed` int(11) NOT NULL, | |
PRIMARY KEY (`ID`), | |
KEY `FK_TID` (`Ticket_ID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "groups": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `groups` ( | |
`Cat_ID` int(11) NOT NULL AUTO_INCREMENT, | |
`Parent_ID` int(11) DEFAULT NULL, | |
`Category` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Def` int(11) DEFAULT NULL, | |
PRIMARY KEY (`Cat_ID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "priorities": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `priorities` ( | |
`Level_ID` int(11) NOT NULL AUTO_INCREMENT, | |
`Level` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`OrderID` int(11) NOT NULL, | |
`Def` int(11) NOT NULL, | |
PRIMARY KEY (`Level_ID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "settings": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `settings` ( | |
`ID` int(11) NOT NULL, | |
`Company_Name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Langauge` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Timezone` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Date_Format` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Redirect_Page` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Ticket_Assignment` int(11) DEFAULT NULL, | |
`Ticket_Dir` varchar(4) COLLATE utf8_unicode_ci NOT NULL, | |
`Ticket_Reply_Position` varchar(3) COLLATE utf8_unicode_ci NOT NULL, | |
`Ticket_Priority` int(1) NOT NULL, | |
`Ticket_Antispam` int(1) NOT NULL, | |
`Ticket_Reopen` int(1) NOT NULL, | |
`Ticket_Feedback` int(1) NOT NULL, | |
`Ticket_Time` int(1) NOT NULL, | |
`LiveChat_Enable` int(1) NOT NULL, | |
`LiveChat_Idle_Time` int(11) NOT NULL, | |
`KB_Enable` int(1) NOT NULL, | |
`KB_Author_Allow` int(1) NOT NULL, | |
`KB_Count` int(1) NOT NULL, | |
`KB_Rating` int(1) NOT NULL, | |
`KB_Showx` int(1) NOT NULL, | |
`File_Enabled` int(1) NOT NULL, | |
`File_Limit` int(11) NOT NULL, | |
`File_Path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`File_Size` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`File_Type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Imail_Manual` int(1) NOT NULL, | |
`Email_Enabled` int(1) NOT NULL, | |
`Email_Method` varchar(10) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_SMTP_Host` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_SMTP_Auth` int(1) NOT NULL, | |
`Email_SMTP_User` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_SMTP_Pass` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_SMTP_Encr` varchar(3) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_SMTP_Port` int(5) NOT NULL, | |
`Email_Display` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Addr` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Re_Addr` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_New_Subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_New_Body` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Update_Subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Update_Body` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Paused_Subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Paused_Body` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Closed_Subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Closed_Body` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Forward_Subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Email_Forward_Body` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY (`ID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "users": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `users` ( | |
`UID` int(11) NOT NULL AUTO_INCREMENT, | |
`User_ID` varchar(100) COLLATE utf8_unicode_ci NOT NULL, | |
`Pwd` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
`Fname` varchar(100) COLLATE utf8_unicode_ci NOT NULL, | |
`Lname` varchar(100) COLLATE utf8_unicode_ci NOT NULL, | |
`Email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Signature` text COLLATE utf8_unicode_ci NOT NULL, | |
`Role` varchar(20) COLLATE utf8_unicode_ci NOT NULL, | |
`Notify_TN` int(11) NOT NULL, | |
`Notify_TU` int(11) NOT NULL, | |
`Notify_PM` int(11) NOT NULL, | |
`Session_ID` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Last_Logon` datetime NOT NULL, | |
`Chat_Status` int(1) NOT NULL, | |
`Chat_Time` datetime NOT NULL, | |
PRIMARY KEY (`UID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "users_skill": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `users_skill` ( | |
`UCID` int(11) NOT NULL AUTO_INCREMENT, | |
`UID` int(11) NOT NULL, | |
`CID` int(11) NOT NULL, | |
PRIMARY KEY (`UCID`), | |
UNIQUE KEY `UID` (`UID`,`CID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "canned_messages": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `canned_messages` ( | |
`CANID` int(11) NOT NULL AUTO_INCREMENT, | |
`Can_Title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Can_Message` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY (`CANID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "custom_fields": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `custom_fields` ( | |
`FID` int(11) NOT NULL AUTO_INCREMENT, | |
`Field_Name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Field_Type` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`Field_Required` int(11) NOT NULL, | |
`Field_MaxLen` int(11) NOT NULL, | |
`Field_Options` mediumtext COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY (`FID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "calendar": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `calendar` ( | |
`datefield` date DEFAULT NULL | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "kb": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `kb` ( | |
`KBID` tinyint(11) NOT NULL AUTO_INCREMENT, | |
`KB_Date_Added` datetime NOT NULL, | |
`KB_Title` varchar(255) NOT NULL, | |
`KB_Author` int(11) NOT NULL, | |
`KB_Group` int(11) NOT NULL, | |
`KB_Article` text NOT NULL, | |
`KB_Count` int(11) NOT NULL, | |
`KB_Count_IP` varchar(50) NOT NULL, | |
`KB_Like` int(11) NOT NULL, | |
`KB_Dislike` int(11) NOT NULL, | |
`KB_Rating_IP` varchar(50) NOT NULL, | |
PRIMARY KEY (`KBID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "kb_groups": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `kb_groups` ( | |
`KBGROUPID` int(11) NOT NULL AUTO_INCREMENT, | |
`KB_Group` varchar(255) NOT NULL, | |
PRIMARY KEY (`KBGROUPID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
case "imail": | |
$table_create = mysqli_query($link, "CREATE TABLE IF NOT EXISTS `imail` ( | |
`IMAILID` int(11) NOT NULL AUTO_INCREMENT, | |
`Email_Addr` varchar(255) NOT NULL, | |
`Email_Host` varchar(255) NOT NULL, | |
`Port_No` varchar(4) NOT NULL, | |
`Protocol` varchar(50) NOT NULL, | |
`Email_SSL` int(1) NOT NULL, | |
`Val_Cert` varchar(50) NOT NULL, | |
`Email_TLS` int(1) NOT NULL, | |
`Email_Folder` varchar(255) NOT NULL, | |
`Email_User` varchar(255) NOT NULL, | |
`Email_Pass` varchar(255) NOT NULL, | |
`Email_Group` int(11) NOT NULL, | |
`Priority` int(11) NOT NULL, | |
`Disabled` tinyint(1) NOT NULL, | |
PRIMARY KEY (`IMAILID`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"); | |
break; | |
} | |
// If table created successfully | |
if ($table_create) { | |
echo "<p class=\"success\">Table <b>".$table."</b> created successfully</p>"; | |
// else there's an error in the sql query | |
} else { | |
echo "<p class=\"error\">Error creating table: <b>".$table."</b></p>"; | |
$mysql_create_error = TRUE; | |
} | |
// else table exists within array | |
} else { | |
echo "<p class=\"warning\">Table <b>".$table."</b> already exists</p>"; | |
} | |
} // end foreach loop | |
} // end if db created | |
$import_default_user = mysqli_query($link, "INSERT INTO `users` (`UID`, `User_ID`, `Pwd`, `Fname`, `Lname`, `Email`, `Role`, `Notify_TN`, `Notify_TU`, `Notify_PM`, `Last_Logon`, `Chat_Status`, `Chat_Time`) | |
VALUES (1, '$i_et_u', '$i_et_p_sha', '$i_et_fn', '$i_et_ln', '$i_et_ea', 'Admin', 1, 1, 1, '2014-07-22 17:56:14', 0, '2014-07-22 17:56:14')"); | |
$import_default_user_skills = mysqli_query($link, "INSERT INTO `users_skill` (`UCID`, `UID`, `CID`) VALUES (1, 1, 1)"); | |
$import_default_group = mysqli_query($link, "INSERT INTO `groups` (`Cat_ID`, `Parent_ID`, `Category`, `Def`) VALUES (1, NULL, 'Default', 1)"); | |
$import_default_priorities = mysqli_query($link, "INSERT INTO `priorities` (`Level_ID`, `Level`, `OrderID`, `Def`) VALUES (1, 'Normal', 1, 1)"); | |
// insert dates into calendar | |
$start = '2014-01-01'; | |
$end = '2020-01-01'; | |
$datediff = strtotime($end) - strtotime($start); | |
$datediff = floor($datediff/(60*60*24)); | |
for($i = 0; $i < $datediff; $i++){ | |
$day = date("Y-m-d", strtotime($start . ' + ' . $i . 'day')); | |
$import_days = mysqli_query($link, "INSERT INTO `calendar` (`datefield`) VALUES ('$day')"); | |
} | |
// import default settings | |
$import_default_settings = mysqli_query($link, "INSERT INTO `settings` (`ID`, `Company_Name`, `Langauge`, `Timezone`, `Date_Format`, `Redirect_Page`, `Ticket_Assignment`, `Ticket_Dir`, `Ticket_Reply_Position`, `Ticket_Priority`, `Ticket_Antispam`, `Ticket_Reopen`, `Ticket_Feedback`, `Ticket_Time`, `LiveChat_Enable`, `LiveChat_Idle_Time`, `KB_Enable`, `KB_Count`, `KB_Rating`, `KB_Author_Allow`, `KB_Showx`, `File_Enabled`, `File_Limit`, `File_Path`, `File_Size`, `File_Type`, `Imail_Manual`, `Email_Enabled`, `Email_Method`, `Email_Display`, `Email_Addr`, `Email_Re_Addr`, `Email_New_Subject`, `Email_New_Body`, `Email_Update_Subject`, `Email_Update_Body`, `Email_Paused_Subject`, `Email_Paused_Body`, `Email_Closed_Subject`, `Email_Closed_Body`, `Email_Forward_Subject`, `Email_Forward_Body`) VALUES | |
(0, 'Company Name', 'english', 'Europe/London', '%D %b %y %H:%i:%s', 'page.php?page=page.tickets', NULL, 'ASC', 'BOT', 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 5, 1, 3, '../file_uploads/', '1048576', 'txt, rtf, doc, docx, pdf, csv, xls, xlsx, jpg, jpeg, png, bmp, gif, mp3, wav, wma', 0, 1, 'PHPMAIL', 'Company Name Support', 'support@yourdomain.com', 'support@yourdomain.com', 'New Service Request - [TICKET_NO] ([TICKET_SUBJECT])', '<p>Dear<strong> [TICKET_USER],</strong></p>\r\n<p>Thank you for contacting us.</p>\r\n<p>This is confirmation of your request taken at [TICKET_DATE_UPDATED].</p>\r\n<p>The description of the request is:</p>\r\n<p>---</p>\r\n<p>[TICKET_ENQUIRY]</p>\r\n<p>---</p>\r\n<p>You can track and update your service request using your ticket number and email address at http://www.yourdomain.com/user/</p>', 'Update regarding Service Request - [TICKET_NO]', '<p>Dear [TICKET_USER],</p>\r\n<p>Your call [TICKET_NO] has been updated.</p>\r\n<p>The update is shown below.</p>\r\n<p>---</p>\r\n<p>[TICKET_UPDATE]</p>\r\n<p>---</p>\r\n<p>Service Request Information:</p>\r\n<p>---</p>\r\n<p>Reference Number: [TICKET_NO]</p>\r\n<p>Reported by: [TICKET_USER]</p>\r\n<p>Reporting Date: [TICKET_DATE_ADDED]</p>\r\n<p>---</p>\r\n<p>You can track and update your service request using your ticket number and email address at http://www.yourdomain.com/user/</p>', 'Paused regarding Service Request - [TICKET_NO]', '<p>Dear [TICKET_USER],</p>\r\n<p>Your call <strong>[TICKET_NO]</strong> with the us has been been paused.</p>\r\n<p>The update is shown below.</p>\r\n<p>---</p>\r\n<p>[TICKET_UPDATE]</p>\r\n<p>---</p>\r\n<p>The original Service Request Description is.</p>\r\n<p>---</p>\r\n<p>[TICKET_ENQUIRY]</p>\r\n<p>---</p>\r\n<p>Service Request Information:</p>\r\n<p>---</p>\r\n<p>Reference Number: [TICKET_NO]</p>\r\n<p>Reported by: [TICKET_USER]</p>\r\n<p>Reporting Date: [TICKET_DATE_ADDED]</p>\r\n<p>---</p>\r\n<p>You can track and update your service request using your ticket number and email address at http://www.yourdomain.com/user/</p>', 'Closed regarding Service Request - [TICKET_NO]', '<p>Dear [TICKET_USER],</p>\r\n<p>Your call [TICKET_NO] with the us has been closed.</p>\r\n<p>The final update is shown below.</p>\r\n<p>---</p>\r\n<p>[TICKET_UPDATE]</p>\r\n<p>---</p>\r\n<p>The original Service Request Description is.</p>\r\n<p>--- [TICKET_ENQUIRY] ---</p>\r\n<p>Service Request Information:</p>\r\n<p>---</p>\r\n<p>Reference Number: [TICKET_NO]</p>\r\n<p>Reported by: [TICKET_USER]</p>\r\n<p>Reporting Date: [TICKET_DATE_ADDED]</p>\r\n<p>---</p>\r\n<p>You can track and update your service request using your ticket number and email address at http://www.yourdomain.com/user/</p>', 'FW: FYI - [TICKET_NO]', '<p>Please can you assist with request below?</p><p>Thanks</p><p>[TICKET_UPDATE]</p>');"); | |
$import_default_tickets = mysqli_query($link, "INSERT INTO `ticket` (`ID`, `User`, `User_Email`, `Cat_ID`, `Level_ID`, `Type`, `Subject`, `Message`, `Files`, `Status`, `Owner`, `Feedback`, `Date_Replied`, `Date_Added`, `Date_Updated`, `Date_Closed`) VALUES | |
(0000001, 'Acorn Aid', 'general@acornaid.com', 1, 1, 'Web', 'Please Rate Acorn Aid', 'Please rate or leave a review for Acorn Aid<p><a href=\'http://www.hotscripts.com/listing/easy-ticket-143667/\' target=\'_blank\'>http://www.hotscripts.com/listing/easy-ticket-143667/</a></p><p>Regards</p><p><a href=\'http://www.acornaid.com/\' target=\'_blank\'>Acorn Aid</a></p>', '', 'Open', NULL, NULL, NULL, NOW(), NOW(), NULL), | |
(0000002, 'Acorn Aid', 'general@acornaid.com', 1, 1, 'Web', 'Welcome to Acorn Aid', 'Congratulations on completing the installation of Acorn Aid, The free, simple, modern day help desk solution.<p>Begin using Acorn Aid by going to Settings and configure each option to your desired requirements.</p><p>Support can be contacted from <a href=\'http://www.acornaid.com/\' target=\'_blank\'>Acorn Aid</a></p><p>Regards</p><p>Acorn Aid</p>', '', 'Open', NULL, NULL, NULL, NOW(), NOW(), NULL)"); | |
mysqli_close($link); | |
// if an mysql table error don't create settings file | |
if (!@$mysql_create_error) { | |
// write settings file | |
$filehandle = fopen($settingsfile, 'w+') or die ("Error writing settings file"); | |
fwrite($filehandle, $file_content); | |
fclose($filehandle); | |
echo "<p class=\"success\">Settings file <b>".$settingsfile."</b> written successfully</p><hr>". | |
"<p class=\"success large\"><b>Installation Complete</b></p>". | |
"<p><a class=\"large\" href=\"http://acornaid.com/support/user/p.kba.php?kbid=11\" target=\"_blank\">Read the getting started guide</a></p>". | |
"<p><a class=\"large\" href=\"../admin/\">Log into Acorn Aid</a></p>". | |
"<p><i>! Remember to delete the installation file from your server once you are satisified all configuration is correct</i></p>"; | |
die(); | |
} else { | |
echo "<hr><p class=\"error large\"><b>Settings file not create due to MYSQL setup not being completed</b></p>"; | |
} | |
} | |
?> | |
<?php | |
function cache_values ($field) { | |
if (isset($field)) { | |
echo $field; | |
} | |
} | |
?> | |
<form name="form1" method="post" action=""> | |
<span class="desc">Enter your preferred username and password for the admin portal of Acorn Aid</span> | |
<p>Acorn Aid Username</p> | |
<input type="text" name="i_aa_u" value="<?php if (isset($i_et_u)) { echo $i_et_u; } else { echo "admin"; } ?>"> | |
<p>Acorn Aid Password</p> | |
<input type="text" name="i_aa_p" value="<?php if (isset($i_et_p)) { echo $i_et_p; } else { echo "password"; } ?>"> | |
<p>First name</p> | |
<input type="text" name="i_aa_fn" value="<?php if (isset($i_et_p)) { echo $i_et_p; } else { echo "Administrator"; } ?>"> | |
<p>Last name</p> | |
<input type="text" name="i_aa_ln" value="<?php if (isset($i_et_p)) { echo $i_et_p; } else { echo "Number1"; } ?>"> | |
<p>Email address</p> | |
<input type="text" name="i_aa_ea" value="<?php if (isset($i_et_p)) { echo $i_et_p; } else { echo "admin@yourdomain.com"; } ?>"> | |
<p class="desc">Enter your hosts mysql settings for the database and tables to be automatically created</p> | |
<p>Database Name</p> | |
<input type="text" name="i_db" value="<?php cache_values(@$i_db); ?>"> | |
<p>MySQL Host</p> | |
<input type="text" name="i_host" value="<?php cache_values(@$i_host); ?>"> | |
<p>MySQL Username</p> | |
<input type="text" name="i_username" value="<?php cache_values(@$i_u); ?>"> | |
<p>MySQL Password</p> | |
<input type="text" name="i_pw" value="<?php cache_values(@$i_p); ?>"> | |
<p><input name="Install" type="submit" id="Install" value="Install"></p> | |
</form> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment