Congratulations, you have successfully completed HESK database setup!

Success! HESK Successfully installed
Next Steps:

  1. Don't forget to run the NuHesk Installation!
  2. Remember your login details:
    Username: 
    Password: 
    
Attachments hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."attachments` ( `att_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `ticket_id` varchar(13) NOT NULL DEFAULT '', `saved_name` varchar(255) NOT NULL DEFAULT '', `real_name` varchar(255) NOT NULL DEFAULT '', `size` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`att_id`), KEY `ticket_id` (`ticket_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Categories hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(60) NOT NULL DEFAULT '', `cat_order` smallint(5) unsigned NOT NULL DEFAULT '0', `autoassign` enum('0','1') NOT NULL DEFAULT '1', `type` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `type` (`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // ---> Insert default category hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` (`id`, `name`, `cat_order`, `autoassign`, `type`) VALUES (1, 'General', 10, '1', '0')"); // -> KB Articles hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `catid` smallint(5) unsigned NOT NULL, `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `author` smallint(5) unsigned NOT NULL, `subject` varchar(255) NOT NULL, `content` mediumtext NOT NULL, `keywords` mediumtext NOT NULL, `rating` float NOT NULL DEFAULT '0', `votes` mediumint(8) unsigned NOT NULL DEFAULT '0', `views` mediumint(8) unsigned NOT NULL DEFAULT '0', `type` enum('0','1','2') NOT NULL DEFAULT '0', `html` enum('0','1') NOT NULL DEFAULT '0', `sticky` enum('0','1') NOT NULL DEFAULT '0', `art_order` smallint(5) unsigned NOT NULL DEFAULT '0', `history` mediumtext NOT NULL, `attachments` mediumtext NOT NULL, PRIMARY KEY (`id`), KEY `catid` (`catid`), KEY `type` (`type`), KEY `sticky` (`sticky`), FULLTEXT KEY `subject` (`subject`,`content`,`keywords`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> KB Attachments hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_attachments` ( `att_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `saved_name` varchar(255) NOT NULL DEFAULT '', `real_name` varchar(255) NOT NULL DEFAULT '', `size` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`att_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> KB Categories hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `parent` smallint(5) unsigned NOT NULL, `articles` smallint(5) unsigned NOT NULL DEFAULT '0', `articles_private` smallint(5) unsigned NOT NULL DEFAULT '0', `articles_draft` smallint(5) unsigned NOT NULL DEFAULT '0', `cat_order` smallint(5) unsigned NOT NULL, `type` enum('0','1') NOT NULL, PRIMARY KEY (`id`), KEY `type` (`type`), KEY `parent` (`parent`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // ---> Insert default KB category hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` (`id`, `name`, `parent`, `articles`, `cat_order`, `type`) VALUES (1, 'Knowledgebase', 0, 0, 10, '0')"); // -> Login attempts hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."logins` ( `ip` varchar(46) NOT NULL, `number` tinyint(3) unsigned NOT NULL DEFAULT '1', `last_attempt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, UNIQUE KEY `ip` (`ip`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Private messages hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."mail` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `from` smallint(5) unsigned NOT NULL, `to` smallint(5) unsigned NOT NULL, `subject` varchar(255) NOT NULL, `message` mediumtext NOT NULL, `dt` datetime NOT NULL, `read` enum('0','1') NOT NULL DEFAULT '0', `deletedby` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `to` (`to`,`read`,`deletedby`), KEY `from` (`from`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // ---> Insert rate this script email hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."mail` (`id`, `from`, `to`, `subject`, `message`, `dt`, `read`, `deletedby`) VALUES (1, 9999, 1, 'Rate this script', '
\r\n\r\n

Enjoy using HESK? Please let others know!

\r\n\r\n

You are invited to rate HESK or even write a short review here:
 
\"\" Rate this script @ Hot Scripts
 
\"\" Rate this script @ The PHP Resource Index

\r\n\r\n

Thank you,
 
Klemen,
\r\nwww.hesk.com\r\n\r\n

 

', NOW(), '0', 9999)"); // ---> Insert welcome email hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."mail` (`id`, `from`, `to`, `subject`, `message`, `dt`, `read`, `deletedby`) VALUES (2, 9999, 1, 'Welcome to HESK!', '
\r\n\r\n

Congratulations for installing HESK, a lightweight and easy-to-use ticket support system!

\r\n\r\n

I am sure you are eager to use your HESK™ helpdesk to improve your customer support and reduce your workload, so check the rest of this message for some quick "Getting Started" tips.

\r\n\r\n

Once you have learned the power of HESK™, please consider supporting its future enhancement by purchasing an inexpensive license. Having a site license will remove the "Powered by Help Desk Software HESK" links from the bottom of your screens to make it look even more professional.

\r\n\r\n

Enjoy using HESK™ - and I value receiving your constructive feedback and feature suggestions.

\r\n\r\n

Klemen Stirn,
\r\nHESK owner and author
\r\nwww.hesk.com\r\n\r\n

 

\r\n\r\n

*** Quick "Getting Started" Tips ***

\r\n\r\n\r\n\r\n
', NOW(), '0', 9999)"); // -> Notes hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."notes` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `ticket` mediumint(8) unsigned NOT NULL, `who` smallint(5) unsigned NOT NULL, `dt` datetime NOT NULL, `message` mediumtext NOT NULL, PRIMARY KEY (`id`), KEY `ticketid` (`ticket`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Online hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."online` ( `user_id` smallint(5) unsigned NOT NULL, `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `tmp` int(11) unsigned NOT NULL DEFAULT '0', UNIQUE KEY `user_id` (`user_id`), KEY `dt` (`dt`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Pipe loops hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."pipe_loops` ( `email` varchar(255) NOT NULL, `hits` smallint(1) unsigned NOT NULL DEFAULT '0', `message_hash` char(32) NOT NULL, `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, KEY `email` (`email`,`hits`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Replies hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `replyto` mediumint(8) unsigned NOT NULL DEFAULT '0', `name` varchar(50) NOT NULL DEFAULT '', `message` mediumtext NOT NULL, `dt` datetime DEFAULT NULL, `attachments` mediumtext, `staffid` smallint(5) unsigned NOT NULL DEFAULT '0', `rating` enum('0','1','5') NOT NULL DEFAULT '0', `read` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `replyto` (`replyto`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Canned Responses hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."std_replies` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '', `message` mediumtext NOT NULL, `reply_order` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Tickets hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `trackid` varchar(13) NOT NULL, `name` varchar(50) NOT NULL DEFAULT '', `email` varchar(255) NOT NULL DEFAULT '', `category` smallint(5) unsigned NOT NULL DEFAULT '1', `priority` enum('0','1','2','3') NOT NULL DEFAULT '3', `subject` varchar(70) NOT NULL DEFAULT '', `message` mediumtext NOT NULL, `dt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `lastchange` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `ip` varchar(46) NOT NULL DEFAULT '', `language` varchar(50) DEFAULT NULL, `status` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0', `owner` smallint(5) unsigned NOT NULL DEFAULT '0', `time_worked` time NOT NULL DEFAULT '00:00:00', `lastreplier` enum('0','1') NOT NULL DEFAULT '0', `replierid` smallint(5) unsigned DEFAULT NULL, `archive` enum('0','1') NOT NULL DEFAULT '0', `locked` enum('0','1') NOT NULL DEFAULT '0', `attachments` mediumtext NOT NULL, `merged` mediumtext NOT NULL, `history` mediumtext NOT NULL, `custom1` mediumtext NOT NULL, `custom2` mediumtext NOT NULL, `custom3` mediumtext NOT NULL, `custom4` mediumtext NOT NULL, `custom5` mediumtext NOT NULL, `custom6` mediumtext NOT NULL, `custom7` mediumtext NOT NULL, `custom8` mediumtext NOT NULL, `custom9` mediumtext NOT NULL, `custom10` mediumtext NOT NULL, `custom11` mediumtext NOT NULL, `custom12` mediumtext NOT NULL, `custom13` mediumtext NOT NULL, `custom14` mediumtext NOT NULL, `custom15` mediumtext NOT NULL, `custom16` mediumtext NOT NULL, `custom17` mediumtext NOT NULL, `custom18` mediumtext NOT NULL, `custom19` mediumtext NOT NULL, `custom20` mediumtext NOT NULL, PRIMARY KEY (`id`), KEY `trackid` (`trackid`), KEY `archive` (`archive`), KEY `categories` (`category`), KEY `statuses` (`status`), KEY `owner` (`owner`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); // -> Users hesk_dbQuery(" CREATE TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` ( `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `user` varchar(20) NOT NULL DEFAULT '', `pass` char(40) NOT NULL, `isadmin` enum('0','1') NOT NULL DEFAULT '0', `name` varchar(50) NOT NULL DEFAULT '', `email` varchar(255) NOT NULL DEFAULT '', `signature` varchar(255) NOT NULL DEFAULT '', `language` varchar(50) DEFAULT NULL, `categories` varchar(255) NOT NULL DEFAULT '', `afterreply` enum('0','1','2') NOT NULL DEFAULT '0', `autostart` enum('0','1') NOT NULL DEFAULT '1', `notify_new_unassigned` enum('0','1') NOT NULL DEFAULT '1', `notify_new_my` enum('0','1') NOT NULL DEFAULT '1', `notify_reply_unassigned` enum('0','1') NOT NULL DEFAULT '1', `notify_reply_my` enum('0','1') NOT NULL DEFAULT '1', `notify_assigned` enum('0','1') NOT NULL DEFAULT '1', `notify_pm` enum('0','1') NOT NULL DEFAULT '1', `notify_note` enum('0','1') NOT NULL DEFAULT '1', `default_list` varchar(255) NOT NULL DEFAULT '', `autoassign` enum('0','1') NOT NULL DEFAULT '1', `heskprivileges` mediumtext NOT NULL, `ratingneg` mediumint(8) unsigned NOT NULL DEFAULT '0', `ratingpos` mediumint(8) unsigned NOT NULL DEFAULT '0', `rating` float NOT NULL DEFAULT '0', `replies` mediumint(8) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `autoassign` (`autoassign`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci "); hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."users` (`id`, `user`, `pass`, `isadmin`, `name`, `email`, `signature`, `heskprivileges`) VALUES (1, '".hesk_dbEscape($_SESSION['admin_user'])."', '".hesk_dbEscape($_SESSION['admin_hash'])."', '1', 'Your name', 'you@me.com', 'Sincerely,\r\n\r\nYour name\r\nYour website\r\nhttp://www.yourwebsite.com', '')"); return true; } // End hesk_iTables() function hesk_iSaveSettings() { global $hesk_settings, $hesklang; $spam_question = hesk_generate_SPAM_question(); $hesk_settings['secimg_use'] = empty($_SESSION['set_captcha']) ? 0 : 1; $hesk_settings['use_spamq'] = empty($_SESSION['use_spamq']) ? 0 : 1; $hesk_settings['question_ask'] = $spam_question[0]; $hesk_settings['question_ans'] = $spam_question[1]; $hesk_settings['set_attachments'] = empty($_SESSION['set_attachments']) ? 0 : 1; $hesk_settings['hesk_version'] = HESK_NEW_VERSION; if (isset($_SERVER['HTTP_HOST'])) { $hesk_settings['site_url']='http://' . $_SERVER['HTTP_HOST']; if (isset($_SERVER['REQUEST_URI'])) { $hesk_settings['hesk_url']='http://' . $_SERVER['HTTP_HOST'] . str_replace('/install/install.php','',$_SERVER['REQUEST_URI']); } } /* Encode and escape characters */ $set = $hesk_settings; foreach ($hesk_settings as $k=> $v) { if (is_array($v)) { continue; } $set[$k] = addslashes($v); } $set['debug_mode'] = 0; $set['email_providers'] = count($set['email_providers']) ? "'" . implode("','", $set['email_providers']) . "'" : ''; // Check if PHP version is 5.2.3+ and MySQL is 5.0.7+ $res = hesk_dbQuery('SELECT VERSION() AS version'); $set['db_vrsn'] = (version_compare(PHP_VERSION, '5.2.3') >= 0 && version_compare( hesk_dbResult($res) , '5.0.7') >= 0) ? 1 : 0; hesk_iSaveSettingsFile($set); return true; } // End hesk_iSaveSettings() ?>