Example #1
0
    $date_input = '';
}
/* Any errors? */
if (strlen($hesk_error_buffer)) {
    hesk_process_messages($hesk_error_buffer, 'NOREDIRECT');
}
/* This will handle error, success and notice messages */
$handle = hesk_handle_messages();
# echo "$sql<br/>";
// That's all the SQL we need for count
$sql_count .= $sql;
$sql = $sql_final . $sql;
/* Prepare variables used in search and forms */
require_once HESK_PATH . 'inc/prepare_ticket_search.inc.php';
/* If there has been an error message skip searching for tickets */
if ($handle !== FALSE) {
    $href = 'find_tickets.php';
    require_once HESK_PATH . 'inc/ticket_list.inc.php';
}
?>

<br/><br/>

<?php 
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
/* Show the search form */
require_once HESK_PATH . 'inc/show_search_form.inc.php';
/* Print footer */
require_once HESK_PATH . 'inc/footer.inc.php';
exit;
Example #2
0
function print_login()
{
    global $hesk_settings, $hesklang;
    // Tell header to load reCaptcha API if needed
    if ($hesk_settings['recaptcha_use'] == 2) {
        define('RECAPTCHA', 1);
    }
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['admin_login'];
    require_once HESK_PATH . 'inc/header.inc.php';
    if (hesk_isREQUEST('notice')) {
        hesk_process_messages($hesklang['session_expired'], 'NOREDIRECT');
    }
    if (!isset($_SESSION['a_iserror'])) {
        $_SESSION['a_iserror'] = array();
    }
    ?>
    <div class="loginError"><?php 
    /* This will handle error, success and notice messages */
    hesk_handle_messages();
    ?>
</div>
    <div>
    <div class="panel panel-default form-signin">
        <div class="panel-heading">
            <h4><span <?php 
    echo $iconDisplay;
    ?>
><span class="mega-octicon octicon-sign-in"></span>&nbsp;</span><?php 
    echo $hesklang['admin_login'];
    ?>
</a></h4>
        </div>
        <div class="panel-body">
            <form class="form-signin form-horizontal" role="form" action="index.php" method="post" name="form1">
                <?php 
    if (in_array('pass', $_SESSION['a_iserror'])) {
        echo '<div class="form-group has-error">';
    } else {
        echo '<div class="form-group">';
    }
    ?>
                <label for="user" class="col-sm-4 control-label"><?php 
    echo $hesklang['username'];
    ?>
:</label>
                <div class="col-sm-8">
                    <?php 
    if (defined('HESK_USER')) {
        $savedUser = HESK_USER;
    } else {
        $savedUser = hesk_htmlspecialchars(hesk_COOKIE('hesk_username'));
    }
    $is_1 = '';
    $is_2 = '';
    $is_3 = '';
    $remember_user = hesk_POST('remember_user');
    if ($hesk_settings['autologin'] && (isset($_COOKIE['hesk_p']) || $remember_user == 'AUTOLOGIN')) {
        $is_1 = 'checked="checked"';
    } elseif (isset($_COOKIE['hesk_username']) || $remember_user == 'JUSTUSER') {
        $is_2 = 'checked="checked"';
    } else {
        $is_3 = 'checked="checked"';
    }
    if ($hesk_settings['list_users']) {
        echo '<select class="form-control" name="user">';
        $res = hesk_dbQuery('SELECT `user` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'users` ORDER BY `user` ASC');
        while ($row = hesk_dbFetchAssoc($res)) {
            $sel = strtolower($savedUser) == strtolower($row['user']) ? 'selected="selected"' : '';
            echo '<option value="' . $row['user'] . '" ' . $sel . '>' . $row['user'] . '</option>';
        }
        echo '</select>';
    } else {
        echo '<input class="form-control" type="text" name="user" size="35" placeholder="' . htmlspecialchars($hesklang['username']) . '" value="' . $savedUser . '" />';
    }
    ?>
                </div>
            </div>
            <?php 
    if (in_array('pass', $_SESSION['a_iserror'])) {
        echo '<div class="form-group has-error">';
    } else {
        echo '<div class="form-group">';
    }
    ?>
            <label for="pass" class="col-sm-4 control-label"><?php 
    echo $hesklang['pass'];
    ?>
:</label>
            <div class="col-sm-8">
                <input type="password" class="form-control" id="pass" name="pass" size="35" placeholder="<?php 
    echo htmlspecialchars($hesklang['pass']);
    ?>
"  />
            </div>
        </div>
            <?php 
    if ($hesk_settings['secimg_use'] == 2) {
        // SPAM prevention verified for this session
        if (isset($_SESSION['img_a_verified'])) {
            echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy'];
        } elseif ($hesk_settings['recaptcha_use'] == 1) {
            ?>
                    <script type="text/javascript">
                        var RecaptchaOptions = {
                            theme : '<?php 
            echo isset($_SESSION['a_iserror']) && in_array('mysecnum', $_SESSION['a_iserror']) ? 'red' : 'white';
            ?>
',
                            custom_translations : {
                                visual_challenge : "<?php 
            echo hesk_slashJS($hesklang['visual_challenge']);
            ?>
",
                                audio_challenge : "<?php 
            echo hesk_slashJS($hesklang['audio_challenge']);
            ?>
",
                                refresh_btn : "<?php 
            echo hesk_slashJS($hesklang['refresh_btn']);
            ?>
",
                                instructions_visual : "<?php 
            echo hesk_slashJS($hesklang['instructions_visual']);
            ?>
",
                                instructions_context : "<?php 
            echo hesk_slashJS($hesklang['instructions_context']);
            ?>
",
                                instructions_audio : "<?php 
            echo hesk_slashJS($hesklang['instructions_audio']);
            ?>
",
                                help_btn : "<?php 
            echo hesk_slashJS($hesklang['help_btn']);
            ?>
",
                                play_again : "<?php 
            echo hesk_slashJS($hesklang['play_again']);
            ?>
",
                                cant_hear_this : "<?php 
            echo hesk_slashJS($hesklang['cant_hear_this']);
            ?>
",
                                incorrect_try_again : "<?php 
            echo hesk_slashJS($hesklang['incorrect_try_again']);
            ?>
",
                                image_alt_text : "<?php 
            echo hesk_slashJS($hesklang['image_alt_text']);
            ?>
"
                            }
                        };
                    </script>
                    <?php 
            require_once HESK_PATH . 'inc/recaptcha/recaptchalib.php';
            echo '<div class="form-group"><div class="col-md-8 col-md-offset-4">';
            echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true);
            echo '</div></div>';
        } elseif ($hesk_settings['recaptcha_use'] == 2) {
            ?>
                    <div class="form-group">
                        <div class="col-md-8 col-md-offset-4">
                            <div class="g-recaptcha" data-sitekey="<?php 
            echo $hesk_settings['recaptcha_public_key'];
            ?>
"></div>
                        </div>
                    </div>
                <?php 
        } else {
            echo '<div class="form-group"><div class="col-md-8 col-md-offset-4">';
            $cls = in_array('mysecnum', $_SESSION['a_iserror']) ? ' class="isError" ' : '';
            echo $hesklang['sec_enter'] . '<br />&nbsp;<br /><img src="' . HESK_PATH . 'print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'' . HESK_PATH . 'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="' . HESK_PATH . 'img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br />&nbsp;<br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />';
            echo '</div></div>';
        }
    }
    // End if $hesk_settings['secimg_use'] == 2
    if ($hesk_settings['autologin']) {
        ?>
                <div class="form-group">
                    <div class="col-md-offset-4 col-md-8">
                        <div class="radio">
                            <label><input type="radio" name="remember_user" value="AUTOLOGIN" <?php 
        echo $is_1;
        ?>
 /> <?php 
        echo $hesklang['autologin'];
        ?>
</label>
                        </div>
                        <div class="radio">
                            <label><input type="radio" name="remember_user" value="JUSTUSER" <?php 
        echo $is_2;
        ?>
 /> <?php 
        echo $hesklang['just_user'];
        ?>
</label>
                        </div>
                        <div class="radio">
                            <label><input type="radio" name="remember_user" value="NOTHANKS" <?php 
        echo $is_3;
        ?>
 /> <?php 
        echo $hesklang['nothx'];
        ?>
</label>
                        </div>
                    </div>
                </div>
            <?php 
    } else {
        ?>
                <div class="form-group">
                    <div class="col-md-offset-4 col-md-8">
                        <div class="checkbox">
                            <label><input type="checkbox" name="remember_user" value="JUSTUSER" <?php 
        echo $is_2;
        ?>
 /> <?php 
        echo $hesklang['remember_user'];
        ?>
</label>
                        </div>
                    </div>
                </div>
            <?php 
    }
    // End if $hesk_settings['autologin']
    ?>
            <div class="form-group">
                <div class="col-md-offset-4 col-md-8">
                    <input type="submit" value="<?php 
    echo $hesklang['click_login'];
    ?>
" class="btn btn-default" />
                    <input type="hidden" name="a" value="do_login" />
                    <?php 
    if (hesk_isREQUEST('goto') && ($url = hesk_REQUEST('goto'))) {
        echo '<input type="hidden" name="goto" value="' . $url . '" />';
    }
    // Do we allow staff password reset?
    if ($hesk_settings['reset_pass']) {
        echo '<br />&nbsp;<br /><a href="password.php" class="smaller">' . $hesklang['fpass'] . '</a>';
    }
    ?>
                </div>
            </div>

            </form>
        </div>
    </div>

    </div>

    <p>&nbsp;</p>

	<?php 
    hesk_cleanSessionVars('a_iserror');
    require_once HESK_PATH . 'inc/footer.inc.php';
    exit;
}
Example #3
0
/* This will handle error, success and notice messages */
hesk_handle_messages();
/* Show a message? */
if ($action == 'read') {
    show_message();
}
/* Hide list of messages? */
if (!isset($_SESSION['hide']['list'])) {
    mail_list_messages();
}
// END hide list of messages
/* Show new message form */
show_new_form();
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
hesk_cleanSessionVars('mail');
require_once HESK_PATH . 'inc/footer.inc.php';
exit;
/*** START FUNCTIONS ***/
function mail_delete()
{
    global $hesk_settings, $hesklang;
    /* A security check */
    hesk_token_check();
    $ids = mail_get_ids();
    if ($ids) {
        foreach ($ids as $id) {
            /* If both correspondents deleted the mail remove it from database, otherwise mark as deleted by this user */
            hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` SET `deletedby`='" . intval($_SESSION['id']) . "' WHERE `id`='" . intval($id) . "' AND (`to`='" . intval($_SESSION['id']) . "' OR `from`='" . intval($_SESSION['id']) . "') AND `deletedby`=0 LIMIT 1");
            if (hesk_dbAffectedRows() != 1) {
                hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `id`='" . intval($id) . "' AND (`to`='" . intval($_SESSION['id']) . "' OR `from`='" . intval($_SESSION['id']) . "') AND `deletedby`!=0 LIMIT 1");
function update_profile()
{
    global $hesk_settings, $hesklang, $can_view_unassigned;
    /* A security check */
    hesk_token_check('POST');
    $sql_pass = '';
    $sql_username = '';
    $hesk_error_buffer = '';
    $newvar['new']['name'] = hesk_input(hesk_POST('name')) or $hesk_error_buffer .= '<li>' . $hesklang['enter_your_name'] . '</li>';
    $newvar['new']['email'] = hesk_validateEmail(hesk_POST('email'), 'ERR', 0) or $hesk_error_buffer = '<li>' . $hesklang['enter_valid_email'] . '</li>';
    $newvar['new']['signature'] = hesk_input(hesk_POST('signature'));
    $newvar['new']['user'] = hesk_input(hesk_POST('user'));
    $newvar['new']['address'] = hesk_input(hesk_POST('address'));
    $newvar['new']['phonenumber'] = hesk_input(hesk_POST('phonenumber'));
    $newvar['new']['poz_detyres'] = hesk_input(hesk_POST('poz_detyres'));
    /* Signature */
    if (strlen($newvar['new']['signature']) > 1000) {
        $hesk_error_buffer .= '<li>' . $hesklang['signature_long'] . '</li>';
    }
    $sql_username = "******" . hesk_dbEscape($newvar['new']['user']) . "'";
    /* Change password? */
    $newpass_cl = hesk_input(hesk_POST('newpass_cl'));
    $passlen = strlen($newpass_cl);
    if ($passlen > 0) {
        /* At least 5 chars? */
        if ($passlen < 5) {
            $hesk_error_buffer .= '<li>' . $hesklang['password_not_valid'] . '</li>';
        } else {
            $newpass2_cl = hesk_input(hesk_POST('newpass2_cl'));
            if ($newpass_cl != $newpass2_cl) {
                $hesk_error_buffer .= '<li>' . $hesklang['passwords_not_same'] . '</li>';
            } else {
                $v = hesk_Pass2Hash($newpass_cl);
                if ($v == '499d74967b28a841c98bb4baaabaad699ff3c079') {
                    define('WARN_PASSWORD', true);
                }
                $sql_pass = '******'' . $v . '\'';
            }
        }
    }
    $id = hesk_input(hesk_POST('userid'));
    /* Any errors? */
    if (strlen($hesk_error_buffer)) {
        /* Process the session variables */
        $newvar['new'] = hesk_stripArray($newvar['new']);
        $hesk_error_buffer = $hesklang['rfm'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>';
        //hesk_process_messages($hesk_error_buffer,'NOREDIRECT');
    }
    //else
    //{
    $query = "UPDATE " . hesk_dbEscape($hesk_settings['db_pfix']) . "clients SET \n\t\t\tname='" . hesk_dbEscape($newvar['new']['name']) . "', \n\t\t\temail='" . hesk_dbEscape($newvar['new']['email']) . "', \n\t\t\tuser='******'new']['user']) . "',\n\t\t\taddress='" . hesk_dbEscape($newvar['new']['address']) . "',\n\t\t\tphonenumber='" . hesk_dbEscape($newvar['new']['phonenumber']) . "',\n\t\t\tpoz_detyres='" . hesk_dbEscape($newvar['new']['poz_detyres']) . "',\n\t\t\tsignature='" . hesk_dbEscape($newvar['new']['signature']) . "'\n\t\t\t{$sql_pass}\n\t\t\tWHERE id=" . $id . " LIMIT 1";
    /* Update database */
    $result = hesk_dbQuery($query);
    /* Process the session variables */
    $newvar['new'] = hesk_stripArray($newvar['new']);
    $tmp = $_SESSION['id']['id'];
    $_SESSION['id'] = $newvar['new'];
    $_SESSION['id']['id'] = $tmp;
    /* Update session variables */
    /*foreach ($newvar['new'] as $k => $v)
      {
      	$_SESSION[$k] = $v;
      }*/
    unset($newvar['new']);
    hesk_cleanSessionVars('as_notify');
    hesk_process_messages($hesklang['profile_updated_success'], 'client_profile.php', 'SUCCESS');
    // }
}
Example #5
0
    echo $hesklang['asss2'];
    ?>
</label>
					</div>
					<?php 
}
?>
				</div>
		</div>
		
		<!-- Submit -->
		<div class="container">
			<input type="hidden" name="token" value="<?php 
hesk_token_echo();
?>
" />
			<input type="submit" value="<?php 
echo $hesklang['sub_ticket'];
?>
" class="btn btn-default submit-new-ticket-btn" />
		</div>
	</form><!-- END FORM -->
	</div>
</div><!-- end insert-new-ticket -->
		
	
<?php 
hesk_cleanSessionVars('iserror');
hesk_cleanSessionVars('isnotice');
require_once HESK_PATH . 'inc/footer.inc.php';
exit;
Example #6
0
function print_add_ticket()
{
    global $hesk_settings, $hesklang;
    // Auto-focus first empty or error field
    define('AUTOFOCUS', true);
    // Pre-populate fields
    // Customer name
    if (isset($_REQUEST['name'])) {
        $_SESSION['c_name'] = $_REQUEST['name'];
    }
    // Customer email address
    if (isset($_REQUEST['email'])) {
        $_SESSION['c_email'] = $_REQUEST['email'];
        $_SESSION['c_email2'] = $_REQUEST['email'];
    }
    // Category ID
    if (isset($_REQUEST['catid'])) {
        $_SESSION['c_category'] = intval($_REQUEST['catid']);
    }
    if (isset($_REQUEST['category'])) {
        $_SESSION['c_category'] = intval($_REQUEST['category']);
    }
    // Priority
    if (isset($_REQUEST['priority'])) {
        $_SESSION['c_priority'] = intval($_REQUEST['priority']);
    }
    // Subject
    if (isset($_REQUEST['subject'])) {
        $_SESSION['c_subject'] = $_REQUEST['subject'];
    }
    // Message
    if (isset($_REQUEST['message'])) {
        $_SESSION['c_message'] = $_REQUEST['message'];
    }
    // Custom fields
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && isset($_REQUEST[$k])) {
            $_SESSION['c_' . $k] = $_REQUEST[$k];
        }
    }
    // Varibles for coloring the fields in case of errors
    if (!isset($_SESSION['iserror'])) {
        $_SESSION['iserror'] = array();
    }
    if (!isset($_SESSION['isnotice'])) {
        $_SESSION['isnotice'] = array();
    }
    if (!isset($_SESSION['c_category']) && !$hesk_settings['select_cat']) {
        $_SESSION['c_category'] = 0;
    }
    hesk_cleanSessionVars('already_submitted');
    // Tell header to load reCaptcha API if needed
    if ($hesk_settings['recaptcha_use'] == 2) {
        define('RECAPTCHA', 1);
    }
    // Print header
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket'];
    require_once HESK_PATH . 'inc/header.inc.php';
    //box hijau
    ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"><img src="img/headerleftsm.jpg" width="3" height="25" alt="" /></td>
<td class="headersm"><?php 
    hesk_showTopBar($hesklang['submit_ticket']);
    ?>
</td>
<td width="3"><img src="img/headerrightsm.jpg" width="3" height="25" alt="" /></td>
</tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><span class="smaller"><a href="<?php 
    echo $hesk_settings['site_url'];
    ?>
" class="smaller"><?php 
    echo $hesk_settings['site_title'];
    ?>
</a> &gt;
<a href="<?php 
    echo $hesk_settings['hesk_url'];
    ?>
" class="smaller"><?php 
    echo $hesk_settings['hesk_title'];
    ?>
</a>
&gt; <?php 
    echo $hesklang['submit_ticket'];
    ?>
</span></td>
</tr>
</table>

</td>
</tr>
<tr>
<td>

<?php 
    // This will handle error, success and notice messages
    hesk_handle_messages();
    //table ni yang box untuk form
    ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td width="7" height="7"><img src="img/roundcornerslt.jpg" width="7" height="7" alt="" /></td>
	<td class="roundcornerstop"></td>
	<td><img src="img/roundcornersrt.jpg" width="7" height="7" alt="" /></td>
</tr>
<tr>
	<td class="roundcornersleft">&nbsp;</td>
	<td>
    <!-- START FORM -->

	<p style="text-align:center"><?php 
    echo $hesklang['use_form_below'];
    ?>
 <font class="important"> *</font></p>

	<form method="post" action="submit_ticket.php?submit=1" name="form1" enctype="multipart/form-data">

	<!-- Contact info -->
	<table border="0" width="100%">
	<tr>
	<td style="text-align:right" width="150"><?php 
    echo $hesklang['name'];
    ?>
: <font class="important">*</font></td>
	<td width="80%"><input type="text" name="name" size="40" maxlength="30" value="<?php 
    if (isset($_SESSION['c_name'])) {
        echo stripslashes(hesk_input($_SESSION['c_name']));
    }
    ?>
" <?php 
    if (in_array('name', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 /></td>
	</tr>
	<tr>
	<td style="text-align:right" width="150"><?php 
    echo $hesklang['email'];
    ?>
: <font class="important">*</font></td>
	<td width="80%"><input type="text" name="email" size="40" maxlength="1000" value="<?php 
    if (isset($_SESSION['c_email'])) {
        echo stripslashes(hesk_input($_SESSION['c_email']));
    }
    ?>
" <?php 
    if (in_array('email', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    } elseif (in_array('email', $_SESSION['isnotice'])) {
        echo ' class="isNotice" ';
    }
    ?>
 <?php 
    if ($hesk_settings['detect_typos']) {
        echo ' onblur="Javascript:hesk_suggestEmail(0)"';
    }
    ?>
 /></td>
	</tr>
    <?php 
    if ($hesk_settings['confirm_email']) {
        ?>
		<tr>
		<td style="text-align:right" width="150"><?php 
        echo $hesklang['confemail'];
        ?>
: <font class="important">*</font></td>
		<td width="80%"><input type="text" name="email2" size="40" maxlength="1000" value="<?php 
        if (isset($_SESSION['c_email2'])) {
            echo stripslashes(hesk_input($_SESSION['c_email2']));
        }
        ?>
" <?php 
        if (in_array('email2', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 /></td>
		</tr>
	    <?php 
    }
    // End if $hesk_settings['confirm_email']
    ?>
	</table>

	<div id="email_suggestions"></div>

	<hr />

	<!-- Department and priority -->

    <?php 
    $is_table = 0;
    hesk_load_database_functions();
    // Get categories
    hesk_dbConnect();
    $res = hesk_dbQuery("SELECT `id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `type`='0' ORDER BY `cat_order` ASC");
    if (hesk_dbNumRows($res) == 1) {
        // Only 1 public category, no need for a select box
        $row = hesk_dbFetchAssoc($res);
        echo '<input type="hidden" name="category" value="' . $row['id'] . '" />';
    } elseif (hesk_dbNumRows($res) < 1) {
        // No public categories, set it to default one
        echo '<input type="hidden" name="category" value="1" />';
    } else {
        // List available categories
        $is_table = 1;
        ?>
		<table border="0" width="100%">
		<tr>
		<td style="text-align:right" width="150"><?php 
        echo $hesklang['category'];
        ?>
: <font class="important">*</font></td>
		<td width="80%"><select name="category" <?php 
        if (in_array('category', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 >
		<?php 
        // Show the "Click to select"?
        if ($hesk_settings['select_cat']) {
            echo '<option value="">' . $hesklang['select'] . '</option>';
        }
        // List categories
        while ($row = hesk_dbFetchAssoc($res)) {
            echo '<option value="' . $row['id'] . '"' . ($_SESSION['c_category'] == $row['id'] ? ' selected="selected"' : '') . '>' . $row['name'] . '</option>';
        }
        ?>
		</select></td>
		</tr>
        <?php 
    }
    /* Can customer assign urgency? */
    if ($hesk_settings['cust_urgency']) {
        if (!$is_table) {
            echo '<table border="0" width="100%">';
            $is_table = 1;
        }
        ?>
		<tr>
		<td style="text-align:right" width="150"><?php 
        echo $hesklang['priority'];
        ?>
: <font class="important">*</font></td>
		<td width="80%"><select name="priority" <?php 
        if (in_array('priority', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 >
		<?php 
        // Show the "Click to select"?
        if ($hesk_settings['select_pri']) {
            echo '<option value="">' . $hesklang['select'] . '</option>';
        }
        ?>
		<option value="3" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 3) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['low'];
        ?>
</option>
		<option value="2" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 2) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['medium'];
        ?>
</option>
		<option value="1" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 1) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['high'];
        ?>
</option>
		</select></td>
		</tr>
		<?php 
    }
    /* Need to close the table? */
    if ($is_table) {
        echo '</table> <hr />';
    }
    ?>
	<!-- START CUSTOM BEFORE -->
	<?php 
    /* custom fields BEFORE comments */
    $print_table = 0;
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && $v['place'] == 0) {
            if ($print_table == 0) {
                echo '<table border="0" width="100%">';
                $print_table = 1;
            }
            $v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
            if ($v['type'] == 'checkbox') {
                $k_value = array();
                if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) {
                    foreach ($_SESSION["c_{$k}"] as $myCB) {
                        $k_value[] = stripslashes(hesk_input($myCB));
                    }
                }
            } elseif (isset($_SESSION["c_{$k}"])) {
                $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"]));
            } else {
                $k_value = '';
            }
            switch ($v['type']) {
                /* Radio box */
                case 'radio':
                    echo '
					<tr>
					<td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td>
	                <td width="80%">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (strlen($k_value) == 0 || $k_value == $option) {
                            $k_value = $option;
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</td>
					</tr>
					';
                    break;
                    /* Select drop-down box */
                /* Select drop-down box */
                case 'select':
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '
					<tr>
					<td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td>
	                <td width="80%"><select name="' . $k . '" ' . $cls . '>';
                    // Show "Click to select"?
                    $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
                    if ($num) {
                        echo '<option value="">' . $hesklang['select'] . '</option>';
                    }
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select></td>
					</tr>
					';
                    break;
                    /* Checkbox */
                /* Checkbox */
                case 'checkbox':
                    echo '
					<tr>
					<td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td>
	                <td width="80%">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (in_array($option, $k_value)) {
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</td>
					</tr>
					';
                    break;
                    /* Large text box */
                /* Large text box */
                case 'textarea':
                    $size = explode('#', $v['value']);
                    $size[0] = empty($size[0]) ? 5 : intval($size[0]);
                    $size[1] = empty($size[1]) ? 30 : intval($size[1]);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '
					<tr>
					<td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td>
					<td width="80%"><textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></td>
					</tr>
	                ';
                    break;
                    /* Default text input */
                /* Default text input */
                default:
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '
					<tr>
					<td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td>
					<td width="80%"><input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></td>
					</tr>
					';
            }
        }
    }
    /* If table was started we need to close it */
    if ($print_table) {
        echo '</table> <hr />';
        $print_table = 0;
    }
    ?>
	<!-- END CUSTOM BEFORE -->

	<!-- ticket info -->
	<table border="0" width="100%">
	<tr>
	<td style="text-align:right" width="150"><?php 
    echo $hesklang['subject'];
    ?>
: <font class="important">*</font></td>
	<td width="80%"><input type="text" name="subject" size="40" maxlength="40" value="<?php 
    if (isset($_SESSION['c_subject'])) {
        echo stripslashes(hesk_input($_SESSION['c_subject']));
    }
    ?>
" <?php 
    if (in_array('subject', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 /></td>
	</tr>
	<tr>
	<td style="text-align:right" width="150" valign="top"><?php 
    echo $hesklang['message'];
    ?>
: <font class="important">*</font></td>
	<td width="80%"><textarea name="message" rows="12" cols="60" <?php 
    if (in_array('message', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 ><?php 
    if (isset($_SESSION['c_message'])) {
        echo stripslashes(hesk_input($_SESSION['c_message']));
    }
    ?>
</textarea>

		<!-- START KNOWLEDGEBASE SUGGEST -->
		<?php 
    if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers']) {
        ?>
			<div id="kb_suggestions" style="display:none">
            <br />&nbsp;<br />
			<img src="img/loading.gif" width="24" height="24" alt="" border="0" style="vertical-align:text-bottom" /> <i><?php 
        echo $hesklang['lkbs'];
        ?>
</i>
			</div>

			<script language="Javascript" type="text/javascript"><!--
			hesk_suggestKB();
			//-->
			</script>
			<?php 
    }
    ?>
		<!-- END KNOWLEDGEBASE SUGGEST -->
    </td>
	</tr>
	</table>

	<!-- START CUSTOM AFTER -->
	<?php 
    /* custom fields AFTER comments */
    $print_table = 0;
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && $v['place']) {
            if ($print_table == 0) {
                echo '
                <hr />
                <table border="0" width="100%">
                ';
                $print_table = 1;
            }
            $v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
            if ($v['type'] == 'checkbox') {
                $k_value = array();
                if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) {
                    foreach ($_SESSION["c_{$k}"] as $myCB) {
                        $k_value[] = stripslashes(hesk_input($myCB));
                    }
                }
            } elseif (isset($_SESSION["c_{$k}"])) {
                $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"]));
            } else {
                $k_value = '';
            }
            switch ($v['type']) {
                /* Radio box */
                case 'radio':
                    echo '
					<tr>
					<td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td>
	                <td width="80%">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (strlen($k_value) == 0 || $k_value == $option) {
                            $k_value = $option;
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</td>
					</tr>
					';
                    break;
                    /* Select drop-down box */
                /* Select drop-down box */
                case 'select':
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '
					<tr>
					<td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td>
	                <td width="80%"><select name="' . $k . '" ' . $cls . '>';
                    // Show "Click to select"?
                    $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
                    if ($num) {
                        echo '<option value="">' . $hesklang['select'] . '</option>';
                    }
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select></td>
					</tr>
					';
                    break;
                    /* Checkbox */
                /* Checkbox */
                case 'checkbox':
                    echo '
					<tr>
					<td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td>
	                <td width="80%">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (in_array($option, $k_value)) {
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</td>
					</tr>
					';
                    break;
                    /* Large text box */
                /* Large text box */
                case 'textarea':
                    $size = explode('#', $v['value']);
                    $size[0] = empty($size[0]) ? 5 : intval($size[0]);
                    $size[1] = empty($size[1]) ? 30 : intval($size[1]);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '
					<tr>
					<td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td>
					<td width="80%"><textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></td>
					</tr>
	                ';
                    break;
                    /* Default text input */
                /* Default text input */
                default:
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '
					<tr>
					<td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td>
					<td width="80%"><input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></td>
					</tr>
					';
            }
        }
    }
    /* If table was started we need to close it */
    if ($print_table) {
        echo '</table>';
        $print_table = 0;
    }
    ?>
	<!-- END CUSTOM AFTER -->

	<?php 
    /* attachments */
    if ($hesk_settings['attachments']['use']) {
        ?>
    <hr />

	<table border="0" width="100%">
	<tr>
	<td style="text-align:right" width="150" valign="top"><?php 
        echo $hesklang['attachments'];
        ?>
:</td>
	<td width="80%" valign="top">
	<?php 
        for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) {
            $cls = $i == 1 && in_array('attachments', $_SESSION['iserror']) ? ' class="isError" ' : '';
            echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . $cls . ' /><br />';
        }
        ?>
	<a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php 
        echo $hesklang['ful'];
        ?>
</a>

	</td>
	</tr>
	</table>
	<?php 
    }
    if ($hesk_settings['question_use'] || $hesk_settings['secimg_use']) {
        ?>

        <hr />

        <!-- Security checks -->
		<table border="0" width="100%">
		<?php 
        if ($hesk_settings['question_use']) {
            ?>
			<tr>
			<td style="text-align:right;vertical-align:top" width="150"><?php 
            echo $hesklang['verify_q'];
            ?>
 <font class="important">*</font></td>
			<td width="80%">
            <?php 
            $value = '';
            if (isset($_SESSION['c_question'])) {
                $value = stripslashes(hesk_input($_SESSION['c_question']));
            }
            $cls = in_array('question', $_SESSION['iserror']) ? ' class="isError" ' : '';
            echo $hesk_settings['question_ask'] . '<br /><input type="text" name="question" size="20" value="' . $value . '" ' . $cls . '  />';
            ?>
<br />&nbsp;
	        </td>
			</tr>
            <?php 
        }
        if ($hesk_settings['secimg_use']) {
            ?>
			<tr>
			<td style="text-align:right;vertical-align:top" width="150"><?php 
            echo $hesklang['verify_i'];
            ?>
 <font class="important">*</font></td>
			<td width="80%">
			<?php 
            // SPAM prevention verified for this session
            if (isset($_SESSION['img_verified'])) {
                echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy'];
            } elseif ($hesk_settings['recaptcha_use'] == 1) {
                ?>
				<script type="text/javascript">
				var RecaptchaOptions = {
				theme : '<?php 
                echo isset($_SESSION['iserror']) && in_array('mysecnum', $_SESSION['iserror']) ? 'red' : 'white';
                ?>
',
				custom_translations : {
					visual_challenge : "<?php 
                echo hesk_slashJS($hesklang['visual_challenge']);
                ?>
",
					audio_challenge : "<?php 
                echo hesk_slashJS($hesklang['audio_challenge']);
                ?>
",
					refresh_btn : "<?php 
                echo hesk_slashJS($hesklang['refresh_btn']);
                ?>
",
					instructions_visual : "<?php 
                echo hesk_slashJS($hesklang['instructions_visual']);
                ?>
",
					instructions_context : "<?php 
                echo hesk_slashJS($hesklang['instructions_context']);
                ?>
",
					instructions_audio : "<?php 
                echo hesk_slashJS($hesklang['instructions_audio']);
                ?>
",
					help_btn : "<?php 
                echo hesk_slashJS($hesklang['help_btn']);
                ?>
",
					play_again : "<?php 
                echo hesk_slashJS($hesklang['play_again']);
                ?>
",
					cant_hear_this : "<?php 
                echo hesk_slashJS($hesklang['cant_hear_this']);
                ?>
",
					incorrect_try_again : "<?php 
                echo hesk_slashJS($hesklang['incorrect_try_again']);
                ?>
",
					image_alt_text : "<?php 
                echo hesk_slashJS($hesklang['image_alt_text']);
                ?>
",
				},
				};
				</script>
				<?php 
                require HESK_PATH . 'inc/recaptcha/recaptchalib.php';
                echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true);
            } elseif ($hesk_settings['recaptcha_use'] == 2) {
                ?>
				<div class="g-recaptcha" data-sitekey="<?php 
                echo $hesk_settings['recaptcha_public_key'];
                ?>
"></div>
				<?php 
            } else {
                $cls = in_array('mysecnum', $_SESSION['iserror']) ? ' class="isError" ' : '';
                echo $hesklang['sec_enter'] . '<br />&nbsp;<br /><img src="print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br />&nbsp;<br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />';
            }
            ?>
			</td>
			</tr>
			<?php 
        }
        ?>
		</table>

    <?php 
    }
    ?>

	<!-- Submit -->
    <?php 
    if ($hesk_settings['submit_notice']) {
        ?>

	    <hr />

		<div align="center">
		<table border="0">
		<tr>
		<td>

	    <b><?php 
        echo $hesklang['before_submit'];
        ?>
</b>
	    <ul>
	    <li><?php 
        echo $hesklang['all_info_in'];
        ?>
.</li>
		<li><?php 
        echo $hesklang['all_error_free'];
        ?>
.</li>
	    </ul>


		<b><?php 
        echo $hesklang['we_have'];
        ?>
:</b>
	    <ul>
	    <li><?php 
        echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']) . ' ' . $hesklang['recorded_ip'];
        ?>
</li>
		<li><?php 
        echo $hesklang['recorded_time'];
        ?>
</li>
		</ul>

		<p align="center"><input type="hidden" name="token" value="<?php 
        hesk_token_echo();
        ?>
" />
	    <input type="submit" value="<?php 
        echo $hesklang['sub_ticket'];
        ?>
" class="orangebutton"  onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /></p>

	    </td>
		</tr>
		</table>
		</div>
	    <?php 
    } else {
        ?>
        &nbsp;<br />&nbsp;<br />
		<table border="0" width="100%">
		<tr>
		<td style="text-align:right" width="150">&nbsp;</td>
		<td width="80%"><input type="hidden" name="token" value="<?php 
        hesk_token_echo();
        ?>
" />
	    <input type="submit" value="<?php 
        echo $hesklang['sub_ticket'];
        ?>
" class="orangebutton"  onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /><br />
	    &nbsp;<br />&nbsp;</td>
		</tr>
		</table>
	    <?php 
    }
    // End ELSE submit_notice
    ?>

	<!-- Do not delete or modify the code below, it is used to detect simple SPAM bots -->
	<input type="hidden" name="hx" value="3" /><input type="hidden" name="hy" value="" />
	<!-- >
	<input type="text" name="phone" value="3" />
	< -->

	</form>

    <!-- END FORM -->
	</td>
	<td class="roundcornersright">&nbsp;</td>
</tr>
<tr>
	<td><img src="img/roundcornerslb.jpg" width="7" height="7" alt="" /></td>
	<td class="roundcornersbottom"></td>
	<td width="7" height="7"><img src="img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
</tr>
</table>

<?php 
    hesk_cleanSessionVars('iserror');
    hesk_cleanSessionVars('isnotice');
}
Example #7
0
        $k++;
    }
    // End while
    ?>
	</table>
	</div>
    <?php 
}
?>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<?php 
hesk_cleanSessionVars(array('new_sm', 'preview_sm', 'edit_sm'));
require_once HESK_PATH . 'inc/footer.inc.php';
exit;
/*** START FUNCTIONS ***/
function save_sm()
{
    global $hesk_settings, $hesklang, $listBox;
    global $hesk_error_buffer;
    // A security check
    # hesk_token_check('POST');
    $hesk_error_buffer = array();
    // Get service messageID
    $id = intval(hesk_POST('id')) or hesk_error($hesklang['sm_e_id']);
    $style = intval(hesk_POST('style', 0));
    if ($style > 4 || $style < 0) {
        $style = 0;
Example #8
0
function print_login()
{
    global $hesk_settings, $hesklang;
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['admin_login'];
    require_once HESK_PATH . 'inc/header.inc.php';
    if (hesk_isREQUEST('notice')) {
        hesk_process_messages($hesklang['session_expired'], 'NOREDIRECT');
    }
    if (!isset($_SESSION['a_iserror'])) {
        $_SESSION['a_iserror'] = array();
    }
    ?>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td width="3"><img src="../img/headerleftsm.jpg" width="3" height="25" alt="" /></td>
	<td class="headersm"><?php 
    echo $hesklang['login'];
    ?>
</td>
	<td width="3"><img src="../img/headerrightsm.jpg" width="3" height="25" alt="" /></td>
	</tr>
	</table>

	<table width="100%" border="0" cellspacing="0" cellpadding="3">
	<tr>
	<td><span class="smaller"><a href="<?php 
    echo $hesk_settings['site_url'];
    ?>
" class="smaller"><?php 
    echo $hesk_settings['site_title'];
    ?>
</a> &gt;
	<?php 
    echo $hesklang['admin_login'];
    ?>
</span></td>
	</tr>
	</table>

	</td>
	</tr>
	<tr>
	<td>

	<br />

	<?php 
    /* This will handle error, success and notice messages */
    hesk_handle_messages();
    ?>

    <br />

    <div align="center">
	<table border="0" cellspacing="0" cellpadding="0" width="<?php 
    echo $hesk_settings['secimg_use'] == 2 ? '60' : '50';
    ?>
% ">
	<tr>
		<td width="7" height="7"><img src="../img/roundcornerslt.jpg" width="7" height="7" alt="" /></td>
		<td class="roundcornerstop"></td>
		<td><img src="../img/roundcornersrt.jpg" width="7" height="7" alt="" /></td>
	</tr>
	<tr>
		<td class="roundcornersleft">&nbsp;</td>
		<td>

        <form action="index.php" method="post" name="form1">

        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
                <td width="60" style="text-align:center"><img src="../img/login.png" alt="" width="24" height="24" /></td>
                <td>
                <p><b><?php 
    echo $hesklang['admin_login'];
    ?>
</a></b></p>
                </td>
        </tr>
        <tr>
                <td width="60">&nbsp;</td>
                <td>&nbsp;</td>
        </tr>
        <tr>
                <td width="60">&nbsp;</td>
                <td><?php 
    echo $hesklang['username'];
    ?>
:<br />
				<?php 
    $cls = in_array('user', $_SESSION['a_iserror']) ? ' class="isError" ' : '';
    if (defined('HESK_USER')) {
        $savedUser = HESK_USER;
    } else {
        $savedUser = hesk_htmlspecialchars(hesk_COOKIE('hesk_username'));
    }
    $is_1 = '';
    $is_2 = '';
    $is_3 = '';
    $remember_user = hesk_POST('remember_user');
    if ($hesk_settings['autologin'] && (isset($_COOKIE['hesk_p']) || $remember_user == 'AUTOLOGIN')) {
        $is_1 = 'checked="checked"';
    } elseif (isset($_COOKIE['hesk_username']) || $remember_user == 'JUSTUSER') {
        $is_2 = 'checked="checked"';
    } else {
        $is_3 = 'checked="checked"';
    }
    if ($hesk_settings['list_users']) {
        echo '<select name="user" ' . $cls . '>';
        $res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'users` ORDER BY `user` ASC');
        while ($row = hesk_dbFetchAssoc($res)) {
            $sel = strtolower($savedUser) == strtolower($row['user']) ? 'selected="selected"' : '';
            echo '<option value="' . $row['user'] . '" ' . $sel . '>' . $row['user'] . '</option>';
        }
        echo '</select>';
    } else {
        echo '<input type="text" name="user" size="35" value="' . $savedUser . '" ' . $cls . ' />';
    }
    ?>
                </td>
        </tr>
        <tr>
                <td width="60">&nbsp;</td>
                <td>&nbsp;</td>
        </tr>
        <tr>
                <td width="60">&nbsp;</td>
                <td><?php 
    echo $hesklang['pass'];
    ?>
:<br /><input type="password" name="pass" size="35" <?php 
    if (in_array('pass', $_SESSION['a_iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 /></td>
        </tr>
		<?php 
    if ($hesk_settings['secimg_use'] == 2) {
        ?>
			<tr>
				<td width="60">&nbsp;</td>
				<td>
                <hr />
				<?php 
        // SPAM prevention verified for this session
        if (isset($_SESSION['img_a_verified'])) {
            echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy'];
        } elseif ($hesk_settings['recaptcha_use']) {
            ?>
					<script type="text/javascript">
					var RecaptchaOptions = {
					theme : '<?php 
            echo isset($_SESSION['a_iserror']) && in_array('mysecnum', $_SESSION['a_iserror']) ? 'red' : 'white';
            ?>
',
					custom_translations : {
						visual_challenge : "<?php 
            echo hesk_slashJS($hesklang['visual_challenge']);
            ?>
",
						audio_challenge : "<?php 
            echo hesk_slashJS($hesklang['audio_challenge']);
            ?>
",
						refresh_btn : "<?php 
            echo hesk_slashJS($hesklang['refresh_btn']);
            ?>
",
						instructions_visual : "<?php 
            echo hesk_slashJS($hesklang['instructions_visual']);
            ?>
",
						instructions_context : "<?php 
            echo hesk_slashJS($hesklang['instructions_context']);
            ?>
",
						instructions_audio : "<?php 
            echo hesk_slashJS($hesklang['instructions_audio']);
            ?>
",
						help_btn : "<?php 
            echo hesk_slashJS($hesklang['help_btn']);
            ?>
",
						play_again : "<?php 
            echo hesk_slashJS($hesklang['play_again']);
            ?>
",
						cant_hear_this : "<?php 
            echo hesk_slashJS($hesklang['cant_hear_this']);
            ?>
",
						incorrect_try_again : "<?php 
            echo hesk_slashJS($hesklang['incorrect_try_again']);
            ?>
",
						image_alt_text : "<?php 
            echo hesk_slashJS($hesklang['image_alt_text']);
            ?>
",
					},
					};
					</script>
					<?php 
            require_once HESK_PATH . 'inc/recaptcha/recaptchalib.php';
            echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, $hesk_settings['recaptcha_ssl']);
        } else {
            $cls = in_array('mysecnum', $_SESSION['a_iserror']) ? ' class="isError" ' : '';
            echo $hesklang['sec_enter'] . '<br />&nbsp;<br /><img src="' . HESK_PATH . 'print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'' . HESK_PATH . 'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="' . HESK_PATH . 'img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br />&nbsp;<br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />';
        }
        ?>
                <hr />
				</td>
			</tr>
            <?php 
    } else {
        ?>
	        <tr>
	                <td width="60">&nbsp;</td>
	                <td>&nbsp;</td>
	        </tr>
	        <?php 
    }
    // End if $hesk_settings['secimg_use'] == 2
    if ($hesk_settings['autologin']) {
        ?>
			<tr>
				<td width="60">&nbsp;</td>
				<td><label><input type="radio" name="remember_user" value="AUTOLOGIN" <?php 
        echo $is_1;
        ?>
 /> <?php 
        echo $hesklang['autologin'];
        ?>
</label><br />
				<label><input type="radio" name="remember_user" value="JUSTUSER" <?php 
        echo $is_2;
        ?>
 /> <?php 
        echo $hesklang['just_user'];
        ?>
</label><br />
				<label><input type="radio" name="remember_user" value="NOTHANKS" <?php 
        echo $is_3;
        ?>
 /> <?php 
        echo $hesklang['nothx'];
        ?>
</label></td>
			</tr>
			<?php 
    } else {
        ?>
			<tr>
				<td width="60">&nbsp;</td>
				<td><label><input type="checkbox" name="remember_user" value="JUSTUSER" <?php 
        echo $is_2;
        ?>
 /> <?php 
        echo $hesklang['remember_user'];
        ?>
</label></td>
			</tr>
			<?php 
    }
    // End if $hesk_settings['autologin']
    ?>
        <tr>
                <td width="60">&nbsp;</td>
                <td>&nbsp;</td>
        </tr>
        <tr>
                <td width="60">&nbsp;</td>
				<td><input type="submit" value="<?php 
    echo $hesklang['click_login'];
    ?>
" class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" />
                <input type="hidden" name="a" value="do_login" />
				<?php 
    if (hesk_isREQUEST('goto') && ($url = hesk_REQUEST('goto'))) {
        echo '<input type="hidden" name="goto" value="' . $url . '" />';
    }
    ?>
                <br />&nbsp;
				</td>
        </tr>
        </table>

        </form>

		</td>
		<td class="roundcornersright">&nbsp;</td>
	</tr>
	<tr>
		<td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td>
		<td class="roundcornersbottom"></td>
		<td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
	</tr>
	</table>
    </div>

    <p>&nbsp;</p>

	<?php 
    hesk_cleanSessionVars('a_iserror');
    require_once HESK_PATH . 'inc/footer.inc.php';
    exit;
}
Example #9
0
function update_profile()
{
    global $hesk_settings, $hesklang, $can_view_unassigned;
    /* A security check */
    hesk_token_check('POST');
    $sql_pass = '';
    $sql_username = '';
    $hesk_error_buffer = '';
    $_SESSION['new']['name'] = hesk_input(hesk_POST('name')) or $hesk_error_buffer .= '<li>' . $hesklang['enter_your_name'] . '</li>';
    $_SESSION['new']['email'] = hesk_validateEmail(hesk_POST('email'), 'ERR', 0) or $hesk_error_buffer = '<li>' . $hesklang['enter_valid_email'] . '</li>';
    $_SESSION['new']['address'] = hesk_input(hesk_POST('address'));
    $_SESSION['new']['phonenumber'] = hesk_input(hesk_POST('phonenumber'));
    $_SESSION['new']['poz_detyres'] = hesk_input(hesk_POST('poz_detyres'));
    $_SESSION['new']['signature'] = hesk_input(hesk_POST('signature'));
    /* Signature */
    if (strlen($_SESSION['new']['signature']) > 1000) {
        $hesk_error_buffer .= '<li>' . $hesklang['signature_long'] . '</li>';
    }
    /* Admins can change username */
    if ($_SESSION['isadmin']) {
        $_SESSION['new']['user'] = hesk_input(hesk_POST('user')) or $hesk_error_buffer .= '<li>' . $hesklang['enter_username'] . '</li>';
        /* Check for duplicate usernames */
        $result = hesk_dbQuery("SELECT `id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `user`='" . hesk_dbEscape($_SESSION['new']['user']) . "' AND `id`!='" . intval($_SESSION['id']) . "' LIMIT 1");
        if (hesk_dbNumRows($result) != 0) {
            $hesk_error_buffer .= '<li>' . $hesklang['duplicate_user'] . '</li>';
        } else {
            $sql_username = "******" . hesk_dbEscape($_SESSION['new']['user']) . "'";
        }
    }
    /* Change password? */
    $newpass = hesk_input(hesk_POST('newpass'));
    $passlen = strlen($newpass);
    if ($passlen > 0) {
        /* At least 5 chars? */
        if ($passlen < 5) {
            $hesk_error_buffer .= '<li>' . $hesklang['password_not_valid'] . '</li>';
        } else {
            $newpass2 = hesk_input(hesk_POST('newpass2'));
            if ($newpass != $newpass2) {
                $hesk_error_buffer .= '<li>' . $hesklang['passwords_not_same'] . '</li>';
            } else {
                $v = hesk_Pass2Hash($newpass);
                if ($v == '499d74967b28a841c98bb4baaabaad699ff3c079') {
                    define('WARN_PASSWORD', true);
                }
                $sql_pass = '******'' . $v . '\'';
            }
        }
    }
    /* After reply */
    $_SESSION['new']['afterreply'] = intval(hesk_POST('afterreply'));
    if ($_SESSION['new']['afterreply'] != 1 && $_SESSION['new']['afterreply'] != 2) {
        $_SESSION['new']['afterreply'] = 0;
    }
    // Defaults
    $_SESSION['new']['autostart'] = isset($_POST['autostart']) ? 1 : 0;
    $_SESSION['new']['notify_customer_new'] = isset($_POST['notify_customer_new']) ? 1 : 0;
    $_SESSION['new']['notify_customer_reply'] = isset($_POST['notify_customer_reply']) ? 1 : 0;
    $_SESSION['new']['show_suggested'] = isset($_POST['show_suggested']) ? 1 : 0;
    /* Notifications */
    $_SESSION['new']['notify_new_unassigned'] = empty($_POST['notify_new_unassigned']) || !$can_view_unassigned ? 0 : 1;
    $_SESSION['new']['notify_new_my'] = empty($_POST['notify_new_my']) ? 0 : 1;
    $_SESSION['new']['notify_reply_unassigned'] = empty($_POST['notify_reply_unassigned']) || !$can_view_unassigned ? 0 : 1;
    $_SESSION['new']['notify_reply_my'] = empty($_POST['notify_reply_my']) ? 0 : 1;
    $_SESSION['new']['notify_assigned'] = empty($_POST['notify_assigned']) ? 0 : 1;
    $_SESSION['new']['notify_note'] = empty($_POST['notify_note']) ? 0 : 1;
    $_SESSION['new']['notify_pm'] = empty($_POST['notify_pm']) ? 0 : 1;
    /* Any errors? */
    if (strlen($hesk_error_buffer)) {
        /* Process the session variables */
        $_SESSION['new'] = hesk_stripArray($_SESSION['new']);
        $hesk_error_buffer = $hesklang['rfm'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>';
        hesk_process_messages($hesk_error_buffer, 'NOREDIRECT');
    } else {
        /* Update database */
        hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET\n\t\t`name`='" . hesk_dbEscape($_SESSION['new']['name']) . "',\n\t\t`email`='" . hesk_dbEscape($_SESSION['new']['email']) . "',\n\t\t`address`='" . hesk_dbEscape($_SESSION['new']['address']) . "',\n\t\t`phonenumber`='" . hesk_dbEscape($_SESSION['new']['phonenumber']) . "',\n\t\t`poz_detyres`='" . hesk_dbEscape($_SESSION['new']['poz_detyres']) . "',\n\t\t`signature`='" . hesk_dbEscape($_SESSION['new']['signature']) . "'\n\t\t{$sql_username}\n\t\t{$sql_pass} ,\n\t\t`afterreply`='" . $_SESSION['new']['afterreply'] . "' ,\n\t\t" . ($hesk_settings['time_worked'] ? "`autostart`='" . $_SESSION['new']['autostart'] . "'," : '') . "\n\t\t`notify_customer_new`='" . $_SESSION['new']['notify_customer_new'] . "' ,\n\t\t`notify_customer_reply`='" . $_SESSION['new']['notify_customer_reply'] . "' ,\n\t\t`show_suggested`='" . $_SESSION['new']['show_suggested'] . "' ,\n\t\t`notify_new_unassigned`='" . $_SESSION['new']['notify_new_unassigned'] . "' ,\n\t\t`notify_new_my`='" . $_SESSION['new']['notify_new_my'] . "' ,\n\t\t`notify_reply_unassigned`='" . $_SESSION['new']['notify_reply_unassigned'] . "' ,\n\t\t`notify_reply_my`='" . $_SESSION['new']['notify_reply_my'] . "' ,\n\t\t`notify_assigned`='" . $_SESSION['new']['notify_assigned'] . "' ,\n\t\t`notify_pm`='" . $_SESSION['new']['notify_pm'] . "',\n\t\t`notify_note`='" . $_SESSION['new']['notify_note'] . "'\n\t\tWHERE `id`='" . intval($_SESSION['id']) . "' LIMIT 1");
        /* Process the session variables */
        $_SESSION['new'] = hesk_stripArray($_SESSION['new']);
        /* Update session variables */
        foreach ($_SESSION['new'] as $k => $v) {
            $_SESSION[$k] = $v;
        }
        unset($_SESSION['new']);
        hesk_cleanSessionVars('as_notify');
        hesk_process_messages($hesklang['profile_updated_success'], 'profile.php', 'SUCCESS');
    }
}
Example #10
0
	</td>
	<td class="roundcornersright">&nbsp;</td>
	</tr>
	<tr>
	<td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td>
	<td class="roundcornersbottom"></td>
	<td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
	</tr>
</table>
<?php 
}
/* Clear unneeded session variables */
hesk_cleanSessionVars('ticket_message');
hesk_cleanSessionVars('time_worked');
hesk_cleanSessionVars('note_message');
require_once HESK_PATH . 'inc/footer.inc.php';
/*** START FUNCTIONS ***/
function hesk_listAttachments($attachments = '', $reply = 0, $white = 1)
{
    global $hesk_settings, $hesklang, $trackingID, $can_edit, $can_delete;
    /* Attachments disabled or not available */
    if (!$hesk_settings['attachments']['use'] || !strlen($attachments)) {
        return false;
    }
    /* Style and mousover/mousout */
    $tmp = $white ? 'White' : 'Blue';
    $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"';
    /* List attachments */
    echo '<p><b>' . $hesklang['attachments'] . ':</b><br />';
    $att = explode(',', substr($attachments, 0, -1));
Example #11
0
function hesk_handle_messages()
{
    global $hesk_settings, $hesklang;
    $return_value = true;
    // Primary message - only one can be displayed and HESK_MESSAGE is required
    if (isset($_SESSION['HESK_MESSAGE'])) {
        if (isset($_SESSION['HESK_SUCCESS'])) {
            hesk_show_success($_SESSION['HESK_MESSAGE']);
        } elseif (isset($_SESSION['HESK_ERROR'])) {
            hesk_show_error($_SESSION['HESK_MESSAGE']);
            $return_value = false;
        } elseif (isset($_SESSION['HESK_NOTICE'])) {
            hesk_show_notice($_SESSION['HESK_MESSAGE']);
        } elseif (isset($_SESSION['HESK_INFO'])) {
            hesk_show_info($_SESSION['HESK_MESSAGE']);
        }
        hesk_cleanSessionVars('HESK_MESSAGE');
    }
    // Cleanup any primary message types set
    hesk_cleanSessionVars('HESK_ERROR');
    hesk_cleanSessionVars('HESK_SUCCESS');
    hesk_cleanSessionVars('HESK_NOTICE');
    hesk_cleanSessionVars('HESK_INFO');
    // Secondary message
    if (isset($_SESSION['HESK_2ND_NOTICE']) && isset($_SESSION['HESK_2ND_MESSAGE'])) {
        hesk_show_notice($_SESSION['HESK_2ND_MESSAGE']);
        hesk_cleanSessionVars('HESK_2ND_NOTICE');
        hesk_cleanSessionVars('HESK_2ND_MESSAGE');
    }
    return $return_value;
}
Example #12
0
function print_add_ticket()
{
    global $hesk_settings, $hesklang;
    // Auto-focus first empty or error field
    define('AUTOFOCUS', true);
    // Pre-populate fields
    // Customer name
    if (isset($_REQUEST['name'])) {
        $_SESSION['c_name'] = $_REQUEST['name'];
    }
    // Customer email address
    if (isset($_REQUEST['email'])) {
        $_SESSION['c_email'] = $_REQUEST['email'];
        $_SESSION['c_email2'] = $_REQUEST['email'];
    }
    // Category ID
    if (isset($_REQUEST['catid'])) {
        $_SESSION['c_category'] = intval($_REQUEST['catid']);
    }
    if (isset($_REQUEST['category'])) {
        $_SESSION['c_category'] = intval($_REQUEST['category']);
    }
    // Priority
    if (isset($_REQUEST['priority'])) {
        $_SESSION['c_priority'] = intval($_REQUEST['priority']);
    }
    // Subject
    if (isset($_REQUEST['subject'])) {
        $_SESSION['c_subject'] = $_REQUEST['subject'];
    }
    // Message
    if (isset($_REQUEST['message'])) {
        $_SESSION['c_message'] = $_REQUEST['message'];
    }
    // Custom fields
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && isset($_REQUEST[$k])) {
            $_SESSION['c_' . $k] = $_REQUEST[$k];
        }
    }
    // Varibles for coloring the fields in case of errors
    if (!isset($_SESSION['iserror'])) {
        $_SESSION['iserror'] = array();
    }
    if (!isset($_SESSION['isnotice'])) {
        $_SESSION['isnotice'] = array();
    }
    if (!isset($_SESSION['c_category']) && !$hesk_settings['select_cat']) {
        $_SESSION['c_category'] = 0;
    }
    // Tell header to load reCaptcha API if needed
    if ($hesk_settings['recaptcha_use'] == 2) {
        define('RECAPTCHA', 1);
    }
    // Print header
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket'];
    require_once HESK_PATH . 'inc/header.inc.php';
    ?>
	<nav class="row navbar navbar-default" id="showTopBar-indexPhp">
	<div class="menu-wrapper">
		<div class="container showTopBar"><?php 
    hesk_showTopBar($hesk_settings['hesk_title']);
    ?>
</div>
	</div><!-- end showTopBar-indexPhp -->
	</nav>
	<nav class="row navbar userMenu">
      <div class="container">
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
			<li id="userMenu-home"><a href="index.php"><?php 
    echo $hesklang['main_page'];
    ?>
</a></li>
			<li id="userMenu-submitTicket"><a href="index.php?a=add"><?php 
    echo $hesklang['submit_tick'];
    ?>
</a></li>
			<li id="client-username"><a href="client_profile.php"><?php 
    echo $hesklang['hello'];
    if (isset($_SESSION['id']['user']) && $_SESSION['id']['user']) {
        echo $_SESSION['id']['user'];
    }
    ?>
</a></li>
			<li id="userMenu-logout"><a href="logout.php"><?php 
    echo $hesklang['logout'];
    ?>
</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
	
<div class="container siteUrl-title-indexPhp">
<div class="container form-inline">
<span><a href="<?php 
    echo $hesk_settings['site_url'];
    ?>
" class="smaller" style="text-decoration: none;"><?php 
    echo $hesk_settings['site_title'];
    ?>
</a> &gt;
<a href="<?php 
    echo $hesk_settings['hesk_url'];
    ?>
" class="smaller"><?php 
    echo 'Help Desk';
    ?>
</a>
&gt; <?php 
    echo $hesklang['submit_ticket'];
    ?>
</span>
</div>
</div><!-- end siteUrl-title-indexPhp -->
<br/>
<br/>

<!--</td>
</tr>-->

<!--start in this page end in line 947
<tr>
<td>-->

<?php 
    // This will handle error, success and notice messages
    hesk_handle_messages();
    ?>

<div class="container" id="view-submitTicket"> 
<img src="img/existingticket.jpg" alt="existingticket"/><span><?php 
    echo $hesklang['submit_ticket'];
    ?>
</span></div>

<br/>
<div class="container form-submit-support-request">
	<br/>
	<div><?php 
    echo $hesklang['use_form_below'];
    ?>
 <font class="important"> *</font></div><br/>
	<!-- START FORM -->
			<form class="form-horizontal" method="post" action="submit_ticket.php?submit=1" name="form1" enctype="multipart/form-data"  autocomplete="off">

			<!-- Contact info -->
				<div class="form-group" style="margin-bottom: 5px;">
					<label class="col-sm-2" for="name-contact-info-support-request"><?php 
    echo $hesklang['name'];
    ?>
: <font class="important">*</font></label>
					<div class="col-sm-4"><input type="text" class="form-control contact-support-request" id="name-contact-info-support-request" name="name"  value="<?php 
    if (isset($_SESSION['id']['user'])) {
        echo $_SESSION['id']['user'];
    }
    ?>
" <?php 
    if (in_array('name', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 readonly></div>
				</div>
				<div class="form-group" style="margin-bottom: 5px;">
					<label class="col-sm-2" for="email-contact-info-support-request"><?php 
    echo $hesklang['email'];
    ?>
: <font class="important">*</font></label>
					<div class="col-sm-4"><input type="text" class="form-control contact-support-request" id="email-contact-info-support-request" name="email" value="<?php 
    if (isset($_SESSION['id']['email'])) {
        echo $_SESSION['id']['email'];
    }
    ?>
" <?php 
    if (in_array('email', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    } elseif (in_array('email', $_SESSION['isnotice'])) {
        echo ' class="isNotice" ';
    }
    ?>
 <?php 
    if ($hesk_settings['detect_typos']) {
        echo ' onblur="Javascript:hesk_suggestEmail(0)"';
    }
    ?>
 readonly></div>
				</div>

				<?php 
    if ($hesk_settings['confirm_email']) {
        ?>
					<div class="form-group" style="margin-bottom: 5px;">
						<label class="col-sm-2" for="confemail-contact-info-support-request"><?php 
        echo $hesklang['confemail'];
        ?>
: <font class="important">*</font></label>
						<div class="col-sm-4"><input type="text" class="form-control contact-support-request" id="confemail-contact-info-support-request" name="email2"  value="<?php 
        if (isset($_SESSION['c_email2'])) {
            echo stripslashes(hesk_input($_SESSION['c_email2']));
        }
        ?>
" <?php 
        if (in_array('email2', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 /></div>
					</div>
					<?php 
    }
    // End if $hesk_settings['confirm_email']
    ?>
			

			<?php 
    hesk_load_database_functions();
    hesk_dbConnect();
    ?>
			
			<div class="form-group" style="margin-bottom: 5px;">
				<label class="col-sm-2" for="select-cont"><?php 
    echo $hesklang['contract'];
    ?>
: <font class="important">*</font></label>
				<div class="col-sm-4"><select class="form-control contact-support-request" required="required" title="Required field" id="select-cont" name="contract_name">

					<option></option>
					<?php 
    $res_client = hesk_dbQuery('SELECT contract_Id FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'contractforclient` WHERE `client_Id`=' . $_SESSION["id"]["id"]);
    $i = 1;
    while ($row_client = mysqli_fetch_array($res_client)) {
        $result_contract = hesk_dbQuery('SELECT id, contract_name FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'contracts` WHERE id=' . $row_client['contract_Id']);
        $cont_result = mysqli_fetch_array($result_contract);
        echo '<option value="' . $cont_result['id'] . '">' . $cont_result['contract_name'] . '</option>';
    }
    ?>
		
				</select></div>
				<?php 
    ?>
			</div>
				<?php 
    $result_client = hesk_dbQuery('SELECT contract_Id FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . "contractforclient` WHERE `client_Id`='" . $_SESSION["id"]["id"] . "' LIMIT 1");
    $row_client = mysqli_fetch_array($result_client);
    $result_client = hesk_dbQuery('SELECT company_id FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . "contracts` WHERE `id`='" . $row_client['contract_Id'] . "' LIMIT 1");
    if ($row_client = mysqli_fetch_array($result_client)) {
        $result_company = hesk_dbQuery('SELECT id, company_name FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'companies` WHERE id=' . $row_client['company_id']);
        $company_result = mysqli_fetch_array($result_company);
        echo '<input type="hidden" class="form-control"  name="company_name" value="' . $company_result['id'] . '" size="40" maxlength="1000" />';
    }
    ?>
			<!-- Department and priority -->
			<?php 
    $is_table = 0;
    // Get categories
    $res = hesk_dbQuery("SELECT `id`, `categ_impro_id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `type`='0' AND `active`='1' ORDER BY `cat_order` ASC");
    /*if (hesk_dbNumRows($res) == 1)
    		{
    			// Only 1 public category, no need for a select box
    			$row = hesk_dbFetchAssoc($res);
    			echo '<input type="hidden" name="category" value="'.$row['id'].'" />';
    		}
    		/*elseif (hesk_dbNumRows($res) < 1)
    		{
    			// No public categories, set it to default one
    			echo '<input type="hidden" name="category" value="1" />';
    		}*/
    /*else
    		{*/
    // List available categories
    $is_table = 1;
    ?>

				<!-- start table here end in line 304 -->
					<div class="form-group" style="margin-bottom: 5px;">
						<label class="col-sm-2" for="category-department-priority-support-request"><?php 
    echo $hesklang['category'];
    ?>
: <font class="important">*</font></label>
						<div class="col-sm-4"><select class="form-control contact-support-request" required="required" title="Required field" id="category-department-priority-support-request" name="category" <?php 
    if (in_array('category', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 >
						<option></option>
						<?php 
    // Show the "Click to select"?
    if ($hesk_settings['select_cat']) {
        echo '<option value="">' . $hesklang['select'] . '</option>';
    }
    // List categories
    while ($row = hesk_dbFetchAssoc($res)) {
        echo '<option value="' . $row['id'] . '"' . ($_SESSION['c_category'] == $row['id'] ? ' selected="selected"' : '') . '>' . $row['name'] . '</option>';
    }
    ?>
						</select></div>
					</div>
					<?php 
    /*}*/
    /* Can customer assign urgency? */
    if ($hesk_settings['cust_urgency']) {
        if (!$is_table) {
            echo '<div class="form-group department-priority-support-request">';
            $is_table = 1;
        }
        ?>

					<div class="form-group" style="margin-bottom: 5px;">
						<label class="col-sm-2" for="priority-department-priority-support-request"><?php 
        echo $hesklang['priority'];
        ?>
: <font class="important">*</font></label>
						<div class="col-sm-4"><select class="form-control contact-support-request" required="required" title="Required field" id="priority-department-priority-support-request" name="priority" <?php 
        if (in_array('priority', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 >

						<option></option>
						<?php 
        // Show the "Click to select"?
        if ($hesk_settings['select_pri']) {
            echo '<option value="">' . $hesklang['select'] . '</option>';
        }
        ?>
						<option value="3" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 3) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['low'];
        ?>
</option>
						<option value="2" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 2) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['medium'];
        ?>
</option>
						<option value="1" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 1) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['high'];
        ?>
</option>
						</select></div>
					</div>
					<?php 
    }
    /* Need to close the table? */
    if ($is_table) {
        echo '';
    }
    ?>
			<!-- START CUSTOM BEFORE -->
			<?php 
    /* custom fields BEFORE comments */
    $print_table = 0;
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && $v['place'] == 0) {
            if ($print_table == 0) {
                echo '<div class="custom-before-support-request">';
                /* start table in line 317-486*/
                $print_table = 1;
            }
            $v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
            if ($v['type'] == 'checkbox') {
                $k_value = array();
                if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) {
                    foreach ($_SESSION["c_{$k}"] as $myCB) {
                        $k_value[] = stripslashes(hesk_input($myCB));
                    }
                }
            } elseif (isset($_SESSION["c_{$k}"])) {
                $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"]));
            } else {
                $k_value = '';
            }
            switch ($v['type']) {
                /* Radio box */
                case 'radio':
                    /*start tr in line 348-375*/
                    echo '
							<div class="form-inline ">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (strlen($k_value) == 0 || $k_value == $option) {
                            $k_value = $option;
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '
							</div>
							';
                    break;
                    /* Select drop-down box */
                /* Select drop-down box */
                case 'select':
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    /*start tr in line 382-414*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							<select name="' . $k . '" ' . $cls . '>';
                    // Show "Click to select"?
                    $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
                    if ($num) {
                        echo '<option value="">' . $hesklang['select'] . '</option>';
                    }
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select>
							</div>
							';
                    break;
                    /* Checkbox */
                /* Checkbox */
                case 'checkbox':
                    /*start tr in line 418-444*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (in_array($option, $k_value)) {
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '
							</div>
							';
                    break;
                    /* Large text box */
                /* Large text box */
                case 'textarea':
                    $size = explode('#', $v['value']);
                    $size[0] = empty($size[0]) ? 5 : intval($size[0]);
                    $size[1] = empty($size[1]) ? 30 : intval($size[1]);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    /*start tr in line 454-460*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							<textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea>
							</div>
							';
                    break;
                    /* Default text input */
                /* Default text input */
                default:
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    /*start tr in line 471-477*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							<input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' />
							</div>
							';
            }
        }
    }
    /* If table was started we need to close it */
    if ($print_table) {
        echo '</div> <br/><br/>';
        /*end custom-before-support-request table*/
        $print_table = 0;
    }
    ?>
			<!-- END CUSTOM BEFORE -->

			<!-- ticket info -->

			<div class="">
				<div  class="form-group" style="padding-right: 0px; margin-bottom: 5px;">
					<label class="col-sm-2" for="subject-ticket-info-support-request"><?php 
    echo $hesklang['subject'];
    ?>
: <font class="important">*</font></label>
					<div class="col-sm-4"><input class="form-control contact-support-request" required="required" title="Required field" type="text" id="subject-ticket-info-support-request" name="subject" size="40" maxlength="40" value="<?php 
    if (isset($_SESSION['c_subject'])) {
        echo stripslashes(hesk_input($_SESSION['c_subject']));
    }
    ?>
" <?php 
    if (in_array('subject', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 /></div>

				</div>
				<div class="form-group" style="margin-bottom: 5px;">
					<div>

						<label class="col-sm-2" for="message-ticket-info-support-request" ><?php 
    echo $hesklang['message'];
    ?>
: <font class="important">*</font></label>
						<div class="col-sm-4"><textarea class="form-control contact-support-request" required="required" title="Required field" id="message-ticket-info-support-request" name="message" rows="12" cols="60" <?php 
    if (in_array('message', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 ><?php 
    if (isset($_SESSION['c_message'])) {
        echo stripslashes(hesk_input($_SESSION['c_message']));
    }
    ?>
</textarea></div>

					</div>
				</div>
			</div><!-- ticket-info-support-request -->

			<!-- START CUSTOM AFTER -->
			<?php 
    /* custom fields AFTER comments */
    $print_table = 0;
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && $v['place']) {
            if ($print_table == 0) {
                /*start table in line 534-705*/
                echo '
						<br/><br/>
						<div class="custom-after-support-request">
						';
                $print_table = 1;
            }
            $v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
            if ($v['type'] == 'checkbox') {
                $k_value = array();
                if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) {
                    foreach ($_SESSION["c_{$k}"] as $myCB) {
                        $k_value[] = stripslashes(hesk_input($myCB));
                    }
                }
            } elseif (isset($_SESSION["c_{$k}"])) {
                $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"]));
            } else {
                $k_value = '';
            }
            switch ($v['type']) {
                /* Radio box */
                case 'radio':
                    /*start tr in line 567-594*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (strlen($k_value) == 0 || $k_value == $option) {
                            $k_value = $option;
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '
							</div>
							';
                    break;
                    /* Select drop-down box */
                /* Select drop-down box */
                case 'select':
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    /*start tr in line 601-633*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							<select name="' . $k . '" ' . $cls . '>';
                    // Show "Click to select"?
                    $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
                    if ($num) {
                        echo '<option value="">' . $hesklang['select'] . '</option>';
                    }
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select>
							</div>
							';
                    break;
                    /* Checkbox */
                /* Checkbox */
                case 'checkbox':
                    /*start tr in line 637-663*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (in_array($option, $k_value)) {
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '
							</div>
							';
                    break;
                    /* Large text box */
                /* Large text box */
                case 'textarea':
                    $size = explode('#', $v['value']);
                    $size[0] = empty($size[0]) ? 5 : intval($size[0]);
                    $size[1] = empty($size[1]) ? 30 : intval($size[1]);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    /*start tr in line 673-679*/
                    echo '
							<div class="form-inline">
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							<textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea>
							</div>
							';
                    break;
                    /* Default text input */
                /* Default text input */
                default:
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    /*start tr in line 690-696*/
                    echo '
							<div>
							<label>' . $v['name'] . ': ' . $v['req'] . '</label>
							<input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' />
							</div>
							';
            }
        }
    }
    /* If table was started we need to close it */
    if ($print_table) {
        echo '</div>';
        /*end custom-after-support-request*/
        $print_table = 0;
    }
    ?>
			<!-- END CUSTOM AFTER -->

			<?php 
    /* attachments */
    if ($hesk_settings['attachments']['use']) {
        ?>
			<br/><br/>


			<div class="">
				<div class="form-group">
					<label class="col-sm-2" style="vertical-align: top;"><?php 
        echo $hesklang['attachments'];
        ?>
:</label>
					<div class="col-sm-4 contact-support-request">

						<?php 
        for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) {
            $cls = $i == 1 && in_array('attachments', $_SESSION['iserror']) ? ' class="isError" ' : '';
            echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . $cls . ' style="margin-bottom: 10px;"/>';
        }
        ?>
						<a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php 
        echo $hesklang['ful'];
        ?>
</a>
					</div>
				</div>
			</div><!-- end attachments-support-request -->
			<?php 
    }
    if ($hesk_settings['question_use'] || $hesk_settings['secimg_use']) {
        ?>

				<br/><br/>

				<!-- Security checks -->
				<div class="security-checks-support-request">
				<?php 
        if ($hesk_settings['question_use']) {
            ?>
					<div class="form-group">

						<label class="col-sm-2 control-label" style="text-align:right;vertical-align:top" width="150"><?php 
            echo $hesklang['verify_q'];
            ?>
 <font class="important">*</font></label>

						<?php 
            $value = '';
            if (isset($_SESSION['c_question'])) {
                $value = stripslashes(hesk_input($_SESSION['c_question']));
            }
            $cls = in_array('question', $_SESSION['iserror']) ? ' class="isError" ' : '';
            echo $hesk_settings['question_ask'] . '<br /><input class="form-control" type="text" name="question" size="20" value="' . $value . '" ' . $cls . '  />';
            ?>
<br />&nbsp;

					</div>
					<?php 
        }
        if ($hesk_settings['secimg_use']) {
            ?>

					<div class="form-group">

						<label class="col-sm-2 control-label" style="text-align:right;vertical-align:top" width="150"><?php 
            echo $hesklang['verify_i'];
            ?>
 <font class="important">*</font></label>

						<?php 
            // SPAM prevention verified for this session
            if (isset($_SESSION['img_verified'])) {
                echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy'];
            } elseif ($hesk_settings['recaptcha_use'] == 1) {
                ?>
							<script type="text/javascript">
							var RecaptchaOptions = {
							theme : '<?php 
                echo isset($_SESSION['iserror']) && in_array('mysecnum', $_SESSION['iserror']) ? 'red' : 'white';
                ?>
',
							custom_translations : {
								visual_challenge : "<?php 
                echo hesk_slashJS($hesklang['visual_challenge']);
                ?>
",
								audio_challenge : "<?php 
                echo hesk_slashJS($hesklang['audio_challenge']);
                ?>
",
								refresh_btn : "<?php 
                echo hesk_slashJS($hesklang['refresh_btn']);
                ?>
",
								instructions_visual : "<?php 
                echo hesk_slashJS($hesklang['instructions_visual']);
                ?>
",
								instructions_context : "<?php 
                echo hesk_slashJS($hesklang['instructions_context']);
                ?>
",
								instructions_audio : "<?php 
                echo hesk_slashJS($hesklang['instructions_audio']);
                ?>
",
								help_btn : "<?php 
                echo hesk_slashJS($hesklang['help_btn']);
                ?>
",
								play_again : "<?php 
                echo hesk_slashJS($hesklang['play_again']);
                ?>
",
								cant_hear_this : "<?php 
                echo hesk_slashJS($hesklang['cant_hear_this']);
                ?>
",
								incorrect_try_again : "<?php 
                echo hesk_slashJS($hesklang['incorrect_try_again']);
                ?>
",
								image_alt_text : "<?php 
                echo hesk_slashJS($hesklang['image_alt_text']);
                ?>
",
							},
							};
							</script>
							<?php 
                require HESK_PATH . 'inc/recaptcha/recaptchalib.php';
                echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true);
            } elseif ($hesk_settings['recaptcha_use'] == 2) {
                ?>
							<div class="g-recaptcha" data-sitekey="<?php 
                echo $hesk_settings['recaptcha_public_key'];
                ?>
"></div>
							<?php 
            } else {
                $cls = in_array('mysecnum', $_SESSION['iserror']) ? ' class="isError" ' : '';
                echo $hesklang['sec_enter'] . '<br />&nbsp;<br /><img src="print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br />&nbsp;<br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />';
            }
            ?>

					</div>
					<?php 
        }
        ?>
				</div><!-- end security-checks-support-request -->

			<?php 
    }
    ?>

			<!-- Submit -->
			<?php 
    /*if ($hesk_settings['submit_notice'])
    			{
    				?>
    
    				<br/><br/>
    
    				<div align="center">
    				<div class="submit-notice-support-request">
    					<div>
    						<div>
    
    						<b><?php echo $hesklang['before_submit']; ?></b>
    						<ul>
    						<li><?php echo $hesklang['all_info_in']; ?>.</li>
    						<li><?php echo $hesklang['all_error_free']; ?>.</li>
    						</ul>
    
    
    						<b><?php echo $hesklang['we_have']; ?>:</b>
    						<ul>
    						<li><?php echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']).' '.$hesklang['recorded_ip']; ?></li>
    						<li><?php echo $hesklang['recorded_time']; ?></li>
    						</ul>
    
    						<div class="col-sm-7 col-sm-offset-5"><input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" />
    						<input type="submit" value="<?php echo $hesklang['sub_ticket']; ?>" class="btn btn-default submit-ticket-btn" /></div>
    
    						</div>
    					</div>
    				</div><!-- end submit-notice-support-request -->
    				</div>
    				<?php
    			} // End IF submit_notice
    			else
    			{*/
    ?>
				
				<div class="else-submit-notice-support-request form-group">
					<div class="col-sm-offset-2 col-sm-3">
					<input type="hidden" name="token" value="<?php 
    hesk_token_echo();
    ?>
" />
					<input type="submit" value="<?php 
    echo $hesklang['sub_ticket'];
    ?>
" class="btn btn-default submit-ticket-btn"  />
					</div>
				</div><!-- end else-submit-notice-support-request -->
				<?php 
    /*}*/
    // End ELSE submit_notice
    ?>

			<!-- Do not delete or modify the code below, it is used to detect simple SPAM bots -->
			<input type="hidden" name="hx" value="3" /><input type="hidden" name="hy" value="" />
			<!-- >
			<input type="text" name="phone" value="3" />
			< -->
			</form>
		<!-- END FORM -->
</div><!-- end form-submit-support-request -->	

		
<!-- Go back -->
<div class="container"><a href="javascript:history.go(-1)"> <button type="submit" class="btn btn-default goback-btn"><?php 
    echo $hesklang['back'];
    ?>
</button></a></div>


<?php 
    hesk_cleanSessionVars('iserror');
    hesk_cleanSessionVars('isnotice');
}
Example #13
0
function print_login()
{
    global $hesk_settings, $hesklang;
    // Tell header to load reCaptcha API if needed
    if ($hesk_settings['recaptcha_use'] == 2) {
        define('RECAPTCHA', 1);
    }
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['admin_login'];
    require_once HESK_PATH . 'inc/header.inc.php';
    if (hesk_isREQUEST('notice')) {
        hesk_process_messages($hesklang['session_expired'], 'NOREDIRECT');
    }
    if (!isset($_SESSION['a_iserror'])) {
        $_SESSION['a_iserror'] = array();
    }
    ?>
	
<nav class="row navbar navbar-default" id="showTopBar-indexPhp">
	<div class="menu-wrapper">
		<div class="container showTopBar"><?php 
    hesk_showTopBar($hesk_settings['hesk_title']);
    ?>
</div>
	</div><!-- end showTopBar-indexPhp -->
</nav>

<div class="container siteUrl-title-admin-indexPhp">
	<div class="form-inline">
		<span><a href="<?php 
    echo $hesk_settings['site_url'];
    ?>
" class="smaller"><?php 
    echo $hesk_settings['site_title'];
    ?>
</a></span> &gt;
		<span><?php 
    echo $hesklang['admin_login'];
    ?>
</span>
	</div>
</div>

<!--
</td>
</tr>-->
	
<!-- start in this page end somewhere...
<tr>
<td>-->
	
	<br/>
	<br/>
	<br/>
	
	<?php 
    /* This will handle error, success and notice messages */
    hesk_handle_messages();
    ?>

	
<div class="container">
<div class="col-sm-5 admin-login-top-latest-kb">
	<div class="form-group admin-login">	
		<br/>
		
		<div class="container form-group">
			<form action="index.php" method="post" name="form1">

					<div id="ad-log"><b><?php 
    echo $hesklang['admin_login'];
    ?>
</a></b></div>
					
				</br>
				
				<div class="form-inline">
				<h4><label class="control-label" for="username-admin"><?php 
    echo $hesklang['username'];
    ?>
:</label></h4>
					<?php 
    $cls = in_array('user', $_SESSION['a_iserror']) ? ' class="isError" ' : '';
    if (defined('HESK_USER')) {
        $savedUser = HESK_USER;
    } else {
        $savedUser = hesk_htmlspecialchars(hesk_COOKIE('hesk_username'));
    }
    $is_1 = '';
    $is_2 = '';
    $is_3 = '';
    $remember_user = hesk_POST('remember_user');
    if ($hesk_settings['autologin'] && (isset($_COOKIE['hesk_p']) || $remember_user == 'AUTOLOGIN')) {
        $is_1 = 'checked="checked"';
    } elseif (isset($_COOKIE['hesk_username']) || $remember_user == 'JUSTUSER') {
        $is_2 = 'checked="checked"';
    } else {
        $is_3 = 'checked="checked"';
    }
    if ($hesk_settings['list_users']) {
        echo '<select name="user" ' . $cls . '>';
        $res = hesk_dbQuery('SELECT `user` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'users` ORDER BY `user` ASC');
        while ($row = hesk_dbFetchAssoc($res)) {
            $sel = strtolower($savedUser) == strtolower($row['user']) ? 'selected="selected"' : '';
            echo '<option value="' . $row['user'] . '" ' . $sel . '>' . $row['user'] . '</option>';
        }
        echo '</select>';
    } else {
        echo '<input class="form-control" id="username-admin" type="text" name="user" size="35" value="' . $savedUser . '" ' . $cls . ' />';
    }
    ?>
					</div>

					<br/>

					<div class="form-inline">
					<h4><label class="control-label" for="password-admin"><?php 
    echo $hesklang['pass'];
    ?>
:</h4><input class="form-control" id="password-admin" type="password" name="pass" size="35" <?php 
    if (in_array('pass', $_SESSION['a_iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 />
					</div>
					<?php 
    if ($hesk_settings['secimg_use'] == 2) {
        ?>
							<br/><br/>
							<?php 
        // SPAM prevention verified for this session
        if (isset($_SESSION['img_a_verified'])) {
            echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy'];
        } elseif ($hesk_settings['recaptcha_use'] == 1) {
            ?>
								<script type="text/javascript">
								var RecaptchaOptions = {
								theme : '<?php 
            echo isset($_SESSION['a_iserror']) && in_array('mysecnum', $_SESSION['a_iserror']) ? 'red' : 'white';
            ?>
',
								custom_translations : {
									visual_challenge : "<?php 
            echo hesk_slashJS($hesklang['visual_challenge']);
            ?>
",
									audio_challenge : "<?php 
            echo hesk_slashJS($hesklang['audio_challenge']);
            ?>
",
									refresh_btn : "<?php 
            echo hesk_slashJS($hesklang['refresh_btn']);
            ?>
",
									instructions_visual : "<?php 
            echo hesk_slashJS($hesklang['instructions_visual']);
            ?>
",
									instructions_context : "<?php 
            echo hesk_slashJS($hesklang['instructions_context']);
            ?>
",
									instructions_audio : "<?php 
            echo hesk_slashJS($hesklang['instructions_audio']);
            ?>
",
									help_btn : "<?php 
            echo hesk_slashJS($hesklang['help_btn']);
            ?>
",
									play_again : "<?php 
            echo hesk_slashJS($hesklang['play_again']);
            ?>
",
									cant_hear_this : "<?php 
            echo hesk_slashJS($hesklang['cant_hear_this']);
            ?>
",
									incorrect_try_again : "<?php 
            echo hesk_slashJS($hesklang['incorrect_try_again']);
            ?>
",
									image_alt_text : "<?php 
            echo hesk_slashJS($hesklang['image_alt_text']);
            ?>
",
								},
								};
								</script>
								<?php 
            require_once HESK_PATH . 'inc/recaptcha/recaptchalib.php';
            echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true);
        } elseif ($hesk_settings['recaptcha_use'] == 2) {
            ?>
								<div class="g-recaptcha" data-sitekey="<?php 
            echo $hesk_settings['recaptcha_public_key'];
            ?>
"></div>
								<?php 
        } else {
            $cls = in_array('mysecnum', $_SESSION['a_iserror']) ? ' class="isError" ' : '';
            echo $hesklang['sec_enter'] . '<br />&nbsp;<br /><img src="' . HESK_PATH . 'print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'' . HESK_PATH . 'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="' . HESK_PATH . 'img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br />&nbsp;<br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />';
        }
        ?>
							<br/><br/>
						<?php 
    } else {
        ?>

						<?php 
    }
    // End if $hesk_settings['secimg_use'] == 2
    if ($hesk_settings['autologin']) {
        ?>
				
				<br/>
			
				<div class="radios" style="text-align: -webkit-auto; display: inline-block;">
					<div class="">
						<span>
							<input type="checkbox" name="remember_user" id="optionsRadios1" value="kot" <?php 
        echo $is_1;
        ?>
 checked="checked" /> <?php 
        echo $hesklang['remember_user'];
        ?>
<br />
						</span>
					</div>	
					<div class="radio">
						<span>
							<input type="hidden" name="remember_user" id="optionsRadios2" value="AUTOLOGIN" <?php 
        echo $is_2;
        ?>
 checked="checked"  /><br />
						</span>
					</div>						
				</div>

				<?php 
    } else {
        ?>
					
						<label><input type="checkbox" name="remember_user" value="JUSTUSER" class="form-control"<?php 
        echo $is_2;
        ?>
 /> <?php 
        echo $hesklang['remember_user'];
        ?>
</label>
					
					<?php 
    }
    // End if $hesk_settings['autologin']
    ?>
				<br/><br/>
					
					<button type="submit" class="btn btn-default" id="submit-login"><?php 
    echo $hesklang['click_login'];
    ?>
</button>
					<input type="hidden" name="a" value="do_login" />
					<?php 
    if (hesk_isREQUEST('goto') && ($url = hesk_REQUEST('goto'))) {
        echo '<input type="hidden" name="goto" value="' . $url . '" />';
    }
    // Do we allow staff password reset?
    if ($hesk_settings['reset_pass']) {
        echo '<br />&nbsp;<br /><div id="forgotpassw"><a href="password.php" class="smaller">' . $hesklang['fpass'] . '</a></div>';
    }
    ?>
					<br />&nbsp;

			</form>
		</div>
			
	</div>
	<div class="form-inline top-latest-kb-button">
	<a href="http://localhost/support/knowledgebase.php#tab_home" target="_blank"><button type="submit" class="btn btn-default" id="top-kb-button" onmouseover="hesk_btn(this,'btn btn-defaultover');" onmouseout="hesk_btn(this,'btn btn-default');">Top Knowledgebase <br/> articles</button></a>
	<a href="http://localhost/support/knowledgebase.php#tab_profile" target="_blank"><button type="submit" class="btn btn-default" id="latest-kb-button" onmouseover="hesk_btn(this,'btn btn-defaultover');" onmouseout="hesk_btn(this,'btn btn-default');">Latest Knowledgebase <br/> articles</button></a>
	</div>
</div>	
<div class="col-sm-7 help-staf"><img src="../img/help.jpg" alt="help" /></div>
</div>


	<?php 
    hesk_cleanSessionVars('a_iserror');
    require_once HESK_PATH . 'inc/footer.inc.php';
    exit;
}
Example #14
0
function print_add_ticket()
{
    global $hesk_settings, $hesklang, $modsForHesk_settings;
    // Auto-focus first empty or error field
    define('AUTOFOCUS', true);
    // Pre-populate fields
    // Customer name
    if (isset($_REQUEST['name'])) {
        $_SESSION['c_name'] = $_REQUEST['name'];
    }
    // Customer email address
    if (isset($_REQUEST['email'])) {
        $_SESSION['c_email'] = $_REQUEST['email'];
        $_SESSION['c_email2'] = $_REQUEST['email'];
    }
    // Category ID
    if (isset($_REQUEST['catid'])) {
        $_SESSION['c_category'] = intval($_REQUEST['catid']);
    }
    if (isset($_REQUEST['category'])) {
        $_SESSION['c_category'] = intval($_REQUEST['category']);
    }
    // Priority
    if (isset($_REQUEST['priority'])) {
        $_SESSION['c_priority'] = intval($_REQUEST['priority']);
    }
    // Subject
    if (isset($_REQUEST['subject'])) {
        $_SESSION['c_subject'] = $_REQUEST['subject'];
    }
    // Message
    if (isset($_REQUEST['message'])) {
        $_SESSION['c_message'] = $_REQUEST['message'];
    }
    // Custom fields
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && isset($_REQUEST[$k])) {
            $_SESSION['c_' . $k] = $_REQUEST[$k];
        }
    }
    // Variables for coloring the fields in case of errors
    if (!isset($_SESSION['iserror'])) {
        $_SESSION['iserror'] = array();
    }
    if (!isset($_SESSION['isnotice'])) {
        $_SESSION['isnotice'] = array();
    }
    if (!isset($_SESSION['c_category']) && !$hesk_settings['select_cat']) {
        $_SESSION['c_category'] = 0;
    }
    hesk_cleanSessionVars('already_submitted');
    // Tell header to load reCaptcha API if needed
    if ($hesk_settings['recaptcha_use'] == 2) {
        define('RECAPTCHA', 1);
    }
    // Print header
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket'];
    require_once HESK_PATH . 'inc/header.inc.php';
    ?>

<ol class="breadcrumb">
  <li><a href="<?php 
    echo $hesk_settings['site_url'];
    ?>
"><?php 
    echo $hesk_settings['site_title'];
    ?>
</a></li>
  <li><a href="<?php 
    echo $hesk_settings['hesk_url'];
    ?>
"><?php 
    echo $hesk_settings['hesk_title'];
    ?>
</a></li>
  <li class="active"><?php 
    echo $hesklang['sub_support'];
    ?>
</li>
</ol>	

<!-- START MAIN LAYOUT -->
<?php 
    $columnWidth = 'col-md-8';
    hesk_dbConnect();
    $showRs = hesk_dbQuery("SELECT `show` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "quick_help_sections` WHERE `id` = 1");
    $show = hesk_dbFetchAssoc($showRs);
    if (!$show['show']) {
        $columnWidth = 'col-md-10 col-md-offset-1';
    }
    ?>
    <div class="row">
        <?php 
    if ($columnWidth == 'col-md-8') {
        ?>
        <div align="left" class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading"><?php 
        echo $hesklang['quick_help'];
        ?>
</div>
                <div class="panel-body">
                    <p><?php 
        echo $hesklang['quick_help_submit_ticket'];
        ?>
</p>
                </div>
            </div>
	    </div>
        <?php 
    }
    ?>
        <div class="<?php 
    echo $columnWidth;
    ?>
">
            <?php 
    // This will handle error, success and notice messages
    hesk_handle_messages();
    ?>
            <!-- START FORM -->
            <div class="form">
	            <h2><?php 
    hesk_showTopBar($hesklang['submit_ticket']);
    ?>
</h2>
	            <small><?php 
    echo $hesklang['use_form_below'];
    ?>
</small>
                <div class="blankSpace"></div>
	
            <div align="left" class="h3"><?php 
    echo $hesklang['add_ticket_general_information'];
    ?>
</div>
            <div class="footerWithBorder"></div>
            <div class="blankSpace"></div>
	            <form class="form-horizontal" role="form" method="post" action="submit_ticket.php?submit=1" name="form1" enctype="multipart/form-data">
		            <!-- Contact info -->
		            <div class="form-group">
			            <label for="name" class="col-sm-3 control-label"><?php 
    echo $hesklang['name'];
    ?>
: <font class="important">*</font></label>
			            <div class="col-sm-9">
                            <input type="text" class="form-control" id="name" name="name" size="40" maxlength="30" value="<?php 
    if (isset($_SESSION['c_name'])) {
        echo stripslashes(hesk_input($_SESSION['c_name']));
    }
    ?>
" <?php 
    if (in_array('name', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 placeholder="<?php 
    echo htmlspecialchars($hesklang['name']);
    ?>
" />
		                </div>
                    </div>
		            <div class="form-group">
			            <label for="email" class="col-sm-3 control-label"><?php 
    echo $hesklang['email'];
    ?>
: <font class="important">*</font></label>
			            <div class="col-sm-9"> 
                            <input type="text" class="form-control" id="email" name="email" size="40" maxlength="1000" value="<?php 
    if (isset($_SESSION['c_email'])) {
        echo stripslashes(hesk_input($_SESSION['c_email']));
    }
    ?>
" <?php 
    if (in_array('email', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    } elseif (in_array('email', $_SESSION['isnotice'])) {
        echo ' class="isNotice" ';
    }
    ?>
 <?php 
    if ($hesk_settings['detect_typos']) {
        echo ' onblur="Javascript:hesk_suggestEmail(0)"';
    }
    ?>
 placeholder="<?php 
    echo htmlspecialchars($hesklang['email']);
    ?>
" />
		                </div>
                    </div>
                    <?php 
    if ($hesk_settings['confirm_email']) {
        ?>
		            <div class="form-group">
                        <label for="email2" class="col-sm-3 control-label"><?php 
        echo $hesklang['confemail'];
        ?>
: <font class="important">*</font></label>
                        <div class="col-sm-9">
                            <input type="text" id="email2" class="form-control" name="email2" size="40" maxlength="1000" value="<?php 
        if (isset($_SESSION['c_email2'])) {
            echo stripslashes(hesk_input($_SESSION['c_email2']));
        }
        ?>
" <?php 
        if (in_array('email2', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 placeholder="<?php 
        echo htmlspecialchars($hesklang['confemail']);
        ?>
" />
                        </div>
                    </div>
                    <?php 
    }
    ?>
                    <div id="email_suggestions"></div>
                    <!-- Department and priority -->
                    <?php 
    $is_table = 0;
    // Get categories
    hesk_dbConnect();
    $orderBy = $modsForHesk_settings['category_order_column'];
    $res = hesk_dbQuery("SELECT `id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `type`='0' ORDER BY `" . $orderBy . "` ASC");
    if (hesk_dbNumRows($res) == 1) {
        // Only 1 public category, no need for a select box
        $row = hesk_dbFetchAssoc($res);
        echo '<input type="hidden" name="category" value="' . $row['id'] . '" />';
    } elseif (hesk_dbNumRows($res) < 1) {
        // No public categories, set it to default one
        echo '<input type="hidden" name="category" value="1" />';
    } else {
        // List available categories
        $is_table = 1;
        ?>
                    <div class="form-group">
                        <label for="category" class="col-sm-3 control-label"><?php 
        echo $hesklang['category'];
        ?>
: <font class="important">*</font></label>
                        <div class="col-sm-9">
                            <select name="category" id="category" class="form-control" <?php 
        if (in_array('category', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 ><?php 
        // Show the "Click to select"?
        if ($hesk_settings['select_cat']) {
            echo '<option value="">' . $hesklang['select'] . '</option>';
        }
        // List categories
        while ($row = hesk_dbFetchAssoc($res)) {
            echo '<option value="' . $row['id'] . '"' . ($_SESSION['c_category'] == $row['id'] ? ' selected="selected"' : '') . '>' . $row['name'] . '</option>';
        }
        ?>
                            </select>
                        </div>
                    </div>
                    <?php 
    }
    /* Can customer assign urgency? */
    if ($hesk_settings['cust_urgency']) {
        ?>
                    <div class="form-group">
                        <label for="priority" class="col-sm-3 control-label"><?php 
        echo $hesklang['priority'];
        ?>
: <font class="important">*</font></label>
                        <div class="col-sm-9">   
                            <select id="priority" class="form-control" name="priority" <?php 
        if (in_array('priority', $_SESSION['iserror'])) {
            echo ' class="isError" ';
        }
        ?>
 >
                                <?php 
        // Show the "Click to select"?
        if ($hesk_settings['select_pri']) {
            echo '<option value="">' . $hesklang['select'] . '</option>';
        }
        ?>
		                        <option value="3" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 3) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['low'];
        ?>
</option>
		                        <option value="2" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 2) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['medium'];
        ?>
</option>
		                        <option value="1" <?php 
        if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 1) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $hesklang['high'];
        ?>
</option>
		                    </select>
                        </div>
                    </div>
                    <?php 
    }
    ?>

	            <!-- START CUSTOM BEFORE -->
	            <?php 
    /* custom fields BEFORE comments */
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && $v['place'] == 0) {
            if ($modsForHesk_settings['custom_field_setting']) {
                $v['name'] = $hesklang[$v['name']];
            }
            $v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
            if ($v['type'] == 'checkbox') {
                $k_value = array();
                if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) {
                    foreach ($_SESSION["c_{$k}"] as $myCB) {
                        $k_value[] = stripslashes(hesk_input($myCB));
                    }
                }
            } elseif (isset($_SESSION["c_{$k}"])) {
                $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"]));
            } else {
                $k_value = '';
            }
            switch ($v['type']) {
                /* Radio box */
                case 'radio':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (strlen($k_value) == 0 || $k_value == $option) {
                            $k_value = $option;
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</div></div>';
                    break;
                    /* Select drop-down box */
                /* Select drop-down box */
                case 'select':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
                                <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '" ' . $cls . '>';
                    // Show "Click to select"?
                    $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
                    if ($num) {
                        echo '<option value="">' . $hesklang['select'] . '</option>';
                    }
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select></div></div>';
                    break;
                    /* Checkbox */
                /* Checkbox */
                case 'checkbox':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (in_array($option, $k_value)) {
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</div></div>';
                    break;
                    /* Large text box */
                /* Large text box */
                case 'textarea':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    $size = explode('#', $v['value']);
                    $size[0] = empty($size[0]) ? 5 : intval($size[0]);
                    $size[1] = empty($size[1]) ? 30 : intval($size[1]);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group">
                                <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
					            <div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div>
                                </div>';
                    break;
                case 'multiselect':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
                                <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select>
                                <div class="btn-group" role="group">
                                    <button type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button>
                                    <button type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button>
                                </div>
                                </div></div>';
                    break;
                case 'date':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' isError ' : '';
                    echo '
                                <div class="form-group">
                                    <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="datepicker form-control white-readonly ' . $cls . '" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40"
                                            maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" readonly/>
                                        <span class="help-block">' . $hesklang['date_format'] . '</span>
                                    </div>
                                </div>';
                    break;
                case 'email':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    if ($v['value'] == 'cc' || $v['value'] == 'bcc') {
                        // (b)cc isn't a valid email but is the "value" used by settings. Just remove it.
                        $v['value'] = '';
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group">
                                <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
					            <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
                                </div>';
                    break;
                    /* Default text input */
                /* Default text input */
                default:
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group">
                                <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
					            <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
                                </div>';
            }
        }
    }
    ?>
	            <!-- END CUSTOM BEFORE -->

	           <div class="blankSpace"></div>   
               <div align="left" class="h3"><?php 
    echo $hesklang['add_ticket_your_message'];
    ?>
</div>
               <div class="footerWithBorder"></div>
               <div class="blankSpace"></div>    
                <!-- ticket info -->
	            <div class="form-group">
                    <label for="subject" class="col-sm-3 control-label"><?php 
    echo $hesklang['subject'];
    ?>
: <font class="important">*</font></label>
	                <div class="col-sm-9">
                        <input type="text" id="subject" class="form-control" name="subject" size="40" maxlength="40" value="<?php 
    if (isset($_SESSION['c_subject'])) {
        echo stripslashes(hesk_input($_SESSION['c_subject']));
    }
    ?>
" <?php 
    if (in_array('subject', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 placeholder="<?php 
    echo htmlspecialchars($hesklang['subject']);
    ?>
"/>
	                </div>
                </div>
                <div class="form-group">
                    
	                <div class="col-sm-12">
                        <textarea placeholder="<?php 
    echo htmlspecialchars($hesklang['message']);
    ?>
" name="message" id="message" class="form-control" rows="12" cols="60" <?php 
    if (in_array('message', $_SESSION['iserror'])) {
        echo ' class="isError" ';
    }
    ?>
 ><?php 
    if (isset($_SESSION['c_message'])) {
        echo stripslashes(hesk_input($_SESSION['c_message']));
    }
    ?>
</textarea>
                    </div>
                </div>

		            <!-- START KNOWLEDGEBASE SUGGEST -->
		            <?php 
    if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers']) {
        ?>
			            <div id="kb_suggestions" style="display:none">
                        <br />&nbsp;<br />
			            <img src="img/loading.gif" width="24" height="24" alt="" border="0" style="vertical-align:text-bottom" /> <i><?php 
        echo $hesklang['lkbs'];
        ?>
</i>
			            </div>

			            <script language="Javascript" type="text/javascript"><!--
			            hesk_suggestKB();
			            //-->
			            </script>
			            <?php 
    }
    ?>
		            <!-- END KNOWLEDGEBASE SUGGEST -->

	            <!-- START CUSTOM AFTER -->
	            <?php 
    /* custom fields AFTER comments */
    foreach ($hesk_settings['custom_fields'] as $k => $v) {
        if ($v['use'] && $v['place']) {
            if ($modsForHesk_settings['custom_field_setting']) {
                $v['name'] = $hesklang[$v['name']];
            }
            $v['req'] = $v['req'] ? '<font class="important">*</font>' : '';
            if ($v['type'] == 'checkbox') {
                $k_value = array();
                if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) {
                    foreach ($_SESSION["c_{$k}"] as $myCB) {
                        $k_value[] = stripslashes(hesk_input($myCB));
                    }
                }
            } elseif (isset($_SESSION["c_{$k}"])) {
                $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"]));
            } else {
                $k_value = '';
            }
            switch ($v['type']) {
                /* Radio box */
                case 'radio':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (strlen($k_value) == 0 || $k_value == $option) {
                            $k_value = $option;
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</div></div>';
                    break;
                    /* Select drop-down box */
                /* Select drop-down box */
                case 'select':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
                                <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '" ' . $cls . '>';
                    // Show "Click to select"?
                    $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
                    if ($num) {
                        echo '<option value="">' . $hesklang['select'] . '</option>';
                    }
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select></div></div>';
                    break;
                    /* Checkbox */
                /* Checkbox */
                case 'checkbox':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">';
                    $options = explode('#HESK#', $v['value']);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    foreach ($options as $option) {
                        if (in_array($option, $k_value)) {
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                        echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
                    }
                    echo '</div></div>';
                    break;
                    /* Large text box */
                /* Large text box */
                case 'textarea':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    $size = explode('#', $v['value']);
                    $size[0] = empty($size[0]) ? 5 : intval($size[0]);
                    $size[1] = empty($size[1]) ? 30 : intval($size[1]);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group">
                                <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
					            <div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div>
                                </div>';
                    break;
                case 'multiselect':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
                                <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>';
                    $options = explode('#HESK#', $v['value']);
                    foreach ($options as $option) {
                        if ($k_value == $option) {
                            $k_value = $option;
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo '<option ' . $selected . '>' . $option . '</option>';
                    }
                    echo '</select>
                                <div class="btn-group" role="group">
                                    <button type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button>
                                    <button type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button>
                                </div></div></div>';
                    break;
                case 'date':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' isError ' : '';
                    echo '
                                <div class="form-group">
                                    <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
                                    <div class="col-sm-9">
                                        <input type="text" class="datepicker form-control white-readonly ' . $cls . '" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40"
                                            maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" readonly/>
                                        <span class="help-block">' . $hesklang['date_format'] . '</span>
                                    </div>
                                </div>';
                    break;
                case 'email':
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    if ($v['value'] == 'cc' || $v['value'] == 'bcc') {
                        // (b)cc isn't a valid email but is the "value" used by settings. Just remove it.
                        $v['value'] = '';
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group">
                                <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
					            <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
                                </div>';
                    break;
                    /* Default text input */
                /* Default text input */
                default:
                    //Clean up multiple dashes or whitespaces
                    $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']);
                    $formattedId = preg_replace("/[\\s_]/", "-", $formattedId);
                    if (strlen($k_value) != 0) {
                        $v['value'] = $k_value;
                    }
                    $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
                    echo '<div class="form-group">
                                <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label>
					            <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div>
                                </div>';
            }
        }
    }
    ?>
	            <!-- END CUSTOM AFTER -->

	            <?php 
    /* attachments */
    if ($hesk_settings['attachments']['use']) {
        ?>
                <div class="form-group">
	                <label for="attachments" class="col-sm-3 control-label"><?php 
        echo $hesklang['attachments'];
        ?>
:</label>
	                <div align="left" class="col-sm-9">
                        <?php 
        for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) {
            $cls = $i == 1 && in_array('attachments', $_SESSION['iserror']) ? ' class="isError" ' : '';
            echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . $cls . ' /><br />';
        }
        ?>
	                    <a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php 
        echo $hesklang['ful'];
        ?>
</a>
                    </div>
                </div>
	            <?php 
    }
    if ($hesk_settings['question_use'] || $hesk_settings['secimg_use']) {
        ?>

                    <!-- Security checks -->
		            <?php 
        if ($hesk_settings['question_use']) {
            ?>
			            <div class="form-group">
			            <label for="question" class="col-sm-3 control-label"><?php 
            echo $hesklang['verify_q'];
            ?>
 <span class="important">*</span></label>
			
                        <?php 
            $value = '';
            if (isset($_SESSION['c_question'])) {
                $value = stripslashes(hesk_input($_SESSION['c_question']));
            }
            $cls = in_array('question', $_SESSION['iserror']) ? ' class="isError" ' : '';
            echo '<div class="col-md-9">' . $hesk_settings['question_ask'] . '<br /><input class="form-control" id="question" type="text" name="question" size="20" value="' . $value . '" ' . $cls . ' /></div>';
            ?>
                        </div>
                    <?php 
        }
        if ($hesk_settings['secimg_use']) {
            ?>
			            <div class="form-group">
			                <label for="secimage" class="col-sm-3 control-label"><?php 
            echo $hesklang['verify_i'];
            ?>
 <font class="important">*</font></label>
			                <?php 
            // SPAM prevention verified for this session
            if (isset($_SESSION['img_verified'])) {
                echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy'];
            } elseif ($hesk_settings['recaptcha_use'] == 1) {
                ?>
				                <script type="text/javascript">
				                var RecaptchaOptions = {
				                theme : '<?php 
                echo isset($_SESSION['iserror']) && in_array('mysecnum', $_SESSION['iserror']) ? 'red' : 'white';
                ?>
',
				                custom_translations : {
					                visual_challenge : "<?php 
                echo hesk_slashJS($hesklang['visual_challenge']);
                ?>
",
					                audio_challenge : "<?php 
                echo hesk_slashJS($hesklang['audio_challenge']);
                ?>
",
					                refresh_btn : "<?php 
                echo hesk_slashJS($hesklang['refresh_btn']);
                ?>
",
					                instructions_visual : "<?php 
                echo hesk_slashJS($hesklang['instructions_visual']);
                ?>
",
					                instructions_context : "<?php 
                echo hesk_slashJS($hesklang['instructions_context']);
                ?>
",
					                instructions_audio : "<?php 
                echo hesk_slashJS($hesklang['instructions_audio']);
                ?>
",
					                help_btn : "<?php 
                echo hesk_slashJS($hesklang['help_btn']);
                ?>
",
					                play_again : "<?php 
                echo hesk_slashJS($hesklang['play_again']);
                ?>
",
					                cant_hear_this : "<?php 
                echo hesk_slashJS($hesklang['cant_hear_this']);
                ?>
",
					                incorrect_try_again : "<?php 
                echo hesk_slashJS($hesklang['incorrect_try_again']);
                ?>
",
					                image_alt_text : "<?php 
                echo hesk_slashJS($hesklang['image_alt_text']);
                ?>
"
				                     }
				                };
				                </script>
                                <div class="col-md-9">
				                <?php 
                require HESK_PATH . 'inc/recaptcha/recaptchalib.php';
                echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true);
                ?>
                                </div>
                            <?php 
            } elseif ($hesk_settings['recaptcha_use'] == 2) {
                ?>
                                <div class="col-md-9">
                                    <div class="g-recaptcha" data-sitekey="<?php 
                echo $hesk_settings['recaptcha_public_key'];
                ?>
"></div>
                                </div>
                            <?php 
            } else {
                $cls = in_array('mysecnum', $_SESSION['iserror']) ? ' class="isError" ' : '';
                echo '<div align="left" class="col-sm-9">';
                echo $hesklang['sec_enter'] . '<br />&nbsp;<br /><img src="print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br />&nbsp;<br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />';
            }
            echo '</div></div>';
        }
        ?>

                <?php 
    }
    if ($modsForHesk_settings['request_location']) {
        ?>

                <div class="form-group">
                    <label for="location" class="col-md-3 control-label"><?php 
        echo $hesklang['location_colon'];
        ?>
</label>
                    <div class="col-sm-9">
                        <p id="console"><?php 
        echo $hesklang['requesting_location_ellipsis'];
        ?>
</p>
                        <div id="map" style="height: 300px; display:none">
                        </div>
                    </div>
                </div>

	            <!-- Submit -->
                <?php 
    }
    if ($hesk_settings['submit_notice']) {
        ?>

                    <div class="row">
                        <div class="col-md-12">
                            <div class="alert alert-info">
                                <b><?php 
        echo $hesklang['before_submit'];
        ?>
</b>
                                <ul>
                                    <li><?php 
        echo $hesklang['all_info_in'];
        ?>
.</li>
                                    <li><?php 
        echo $hesklang['all_error_free'];
        ?>
.</li>
                                </ul>


                                <b><?php 
        echo $hesklang['we_have'];
        ?>
:</b>
                                <ul>
                                    <li><?php 
        echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']) . ' ' . $hesklang['recorded_ip'];
        ?>
</li>
                                    <li><?php 
        echo $hesklang['recorded_time'];
        ?>
</li>
                                </ul>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-9 col-md-offset-3">
                            <input type="hidden" id="latitude" name="latitude" value="E-0">
                            <input type="hidden" id="longitude" name="longitude" value="E-0">
                            <input type="hidden" name="token" value="<?php 
        hesk_token_echo();
        ?>
">
                            <input type="submit" value="<?php 
        echo $hesklang['sub_ticket'];
        ?>
" class="btn btn-default">
                        </div>
                    </div>

	                <?php 
    } else {
        ?>
                    <div class="row">
                        <div class="col-md-9 col-md-offset-3">
                            <input type="hidden" id="latitude" name="latitude" value="E-0">
                            <input type="hidden" id="longitude" name="longitude" value="E-0">
                            <input type="hidden" name="token" value="<?php 
        hesk_token_echo();
        ?>
">
                            <input class="btn btn-default" type="submit" value="<?php 
        echo $hesklang['sub_ticket'];
        ?>
">
                        </div>
                    </div>

	                <?php 
    }
    // End ELSE submit_notice
    ?>

                <!-- Do not delete or modify the code below, it is used to detect simple SPAM bots -->
                <input type="hidden" name="hx" value="3" /><input type="hidden" name="hy" value="" />
                <!-- >
                <input type="text" name="phone" value="3" />
                < -->

                </form>
            </div>
		</div>
        <?php 
    if ($columnWidth == 'col-md-10 col-md-offset-1') {
        ?>
            <div class="col-md-1">&nbsp;</div></div>
        <?php 
    }
    ?>
                 <!-- END FORM -->


<?php 
    // Request for the users location if enabled
    if ($modsForHesk_settings['request_location']) {
        echo '
    <script>
        requestUserLocation("' . $hesklang['your_current_location'] . '", "' . $hesklang['unable_to_determine_location'] . '");
    </script>
    ';
    }
    hesk_cleanSessionVars('iserror');
    hesk_cleanSessionVars('isnotice');
}
Example #15
0
                <td width="60">&nbsp;</td>
				<td><input type="submit" value="<?php 
echo $hesklang['passs'];
?>
" class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" />
                <br />&nbsp;
				</td>
        </tr>
        </table>

        </form>

		</td>
		<td class="roundcornersright">&nbsp;</td>
	</tr>
	<tr>
		<td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td>
		<td class="roundcornersbottom"></td>
		<td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
	</tr>
	</table>
</div>

<p>&nbsp;</p>

<?php 
// Clean session errors
hesk_cleanSessionVars('a_iserror');
hesk_cleanSessionVars('img_a_verified');
// Print footer
require_once HESK_PATH . 'inc/footer.inc.php';
Example #16
0
} elseif (!$ticket['owner']) {
    hesk_notifyStaff('new_ticket_staff', " `id` != " . intval($_SESSION['id']) . " AND `notify_new_unassigned` = '1' ");
}
// Unset temporary variables
unset($tmpvar);
hesk_cleanSessionVars('tmpvar');
hesk_cleanSessionVars('as_name');
hesk_cleanSessionVars('as_email');
hesk_cleanSessionVars('as_category');
hesk_cleanSessionVars('as_priority');
hesk_cleanSessionVars('as_subject');
hesk_cleanSessionVars('as_message');
hesk_cleanSessionVars('as_owner');
hesk_cleanSessionVars('as_notify');
hesk_cleanSessionVars('as_show');
foreach ($hesk_settings['custom_fields'] as $k => $v) {
    if ($v['use']) {
        hesk_cleanSessionVars("as_{$k}");
    }
}
// If ticket has been assigned to the person submitting it lets show a message saying so
if ($ticket['owner'] && $ticket['owner'] == intval($_SESSION['id'])) {
    $hesklang['new_ticket_submitted'] .= '<br />&nbsp;<br />
    <img src="' . HESK_PATH . 'img/notice.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> <b>' . (isset($autoassign_owner) ? $hesklang['taasy'] : $hesklang['tasy']) . '</b>';
}
// Show the ticket or just the success message
if ($show) {
    hesk_process_messages($hesklang['new_ticket_submitted'], 'admin_ticket.php?track=' . $ticket['trackid'] . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS');
} else {
    hesk_process_messages($hesklang['new_ticket_submitted'] . '. <a href="admin_ticket.php?track=' . $ticket['trackid'] . '&Refresh=' . mt_rand(10000, 99999) . '">' . $hesklang['view_ticket'] . '</a>', 'new_ticket.php', 'SUCCESS');
}
Example #17
0
                    $tmpvar[$k] = '';
                    foreach ($_POST[$k] as $myCB) {
                        $tmpvar[$k] .= (is_array($myCB) ? '' : hesk_input($myCB)) . '<br />';
                    }
                    $tmpvar[$k] = substr($tmpvar[$k], 0, -6);
                } else {
                    $tmpvar[$k] = hesk_makeURL(nl2br(hesk_input($_POST[$k])));
                }
            } else {
                $tmpvar[$k] = '';
            }
        }
        hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET\n\t\t`name`='" . hesk_dbEscape($tmpvar['name']) . "',\n\t\t`email`='" . hesk_dbEscape($tmpvar['email']) . "',\n\t\t`subject`='" . hesk_dbEscape($tmpvar['subject']) . "',\n\t\t`message`='" . hesk_dbEscape($tmpvar['message']) . "',\n\t\t`custom1`='" . hesk_dbEscape($tmpvar['custom1']) . "',\n\t\t`custom2`='" . hesk_dbEscape($tmpvar['custom2']) . "',\n\t\t`custom3`='" . hesk_dbEscape($tmpvar['custom3']) . "',\n\t\t`custom4`='" . hesk_dbEscape($tmpvar['custom4']) . "',\n\t\t`custom5`='" . hesk_dbEscape($tmpvar['custom5']) . "',\n\t\t`custom6`='" . hesk_dbEscape($tmpvar['custom6']) . "',\n\t\t`custom7`='" . hesk_dbEscape($tmpvar['custom7']) . "',\n\t\t`custom8`='" . hesk_dbEscape($tmpvar['custom8']) . "',\n\t\t`custom9`='" . hesk_dbEscape($tmpvar['custom9']) . "',\n\t\t`custom10`='" . hesk_dbEscape($tmpvar['custom10']) . "',\n\t\t`custom11`='" . hesk_dbEscape($tmpvar['custom11']) . "',\n\t\t`custom12`='" . hesk_dbEscape($tmpvar['custom12']) . "',\n\t\t`custom13`='" . hesk_dbEscape($tmpvar['custom13']) . "',\n\t\t`custom14`='" . hesk_dbEscape($tmpvar['custom14']) . "',\n\t\t`custom15`='" . hesk_dbEscape($tmpvar['custom15']) . "',\n\t\t`custom16`='" . hesk_dbEscape($tmpvar['custom16']) . "',\n\t\t`custom17`='" . hesk_dbEscape($tmpvar['custom17']) . "',\n\t\t`custom18`='" . hesk_dbEscape($tmpvar['custom18']) . "',\n\t\t`custom19`='" . hesk_dbEscape($tmpvar['custom19']) . "',\n\t\t`custom20`='" . hesk_dbEscape($tmpvar['custom20']) . "'\n\t\tWHERE `id`='" . intval($ticket['id']) . "' LIMIT 1");
    }
    unset($tmpvar);
    hesk_cleanSessionVars('tmpvar');
    hesk_process_messages($hesklang['edt2'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS');
}
$ticket['message'] = hesk_msgToPlain($ticket['message'], 0, 0);
/* Print header */
require_once HESK_PATH . 'inc/header.inc.php';
/* Print admin navigation */
require_once HESK_PATH . 'inc/show_admin_nav.inc.php';
?>

<!--
</td>
</tr>-->

<!-- start in this page end somewhere...
<tr>
function manage_category()
{
    global $hesk_settings, $hesklang;
    $catid = intval(hesk_GET('catid')) or hesk_error($hesklang['kb_cat_inv']);
    $result = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'kb_categories` ORDER BY `parent` ASC, `cat_order` ASC');
    $kb_cat = array();
    while ($cat = hesk_dbFetchAssoc($result)) {
        $kb_cat[] = $cat;
        if ($cat['id'] == $catid) {
            $this_cat = $cat;
        }
    }
    if (isset($_SESSION['manage_cat'])) {
        $_SESSION['manage_cat'] = hesk_stripArray($_SESSION['manage_cat']);
        $this_cat['type'] = $_SESSION['manage_cat']['type'];
        $this_cat['parent'] = $_SESSION['manage_cat']['parent'];
        $this_cat['name'] = $_SESSION['manage_cat']['title'];
    }
    /* Translate main category "Knowledgebase" if needed */
    $kb_cat[0]['name'] = $hesklang['kb_text'];
    require HESK_PATH . 'inc/treemenu/TreeMenu.php';
    $icon = HESK_PATH . 'img/folder.gif';
    $expandedIcon = HESK_PATH . 'img/folder-expanded.gif';
    $menu = new HTML_TreeMenu();
    $thislevel = array('0');
    $nextlevel = array();
    $i = 1;
    $j = 1;
    while (count($kb_cat) > 0) {
        foreach ($kb_cat as $k => $cat) {
            if (in_array($cat['parent'], $thislevel)) {
                $up = $cat['parent'];
                $my = $cat['id'];
                $type = $cat['type'] ? '*' : '';
                $text_short = $cat['name'] . $type . ' (' . $cat['articles'] . ', ' . $cat['articles_private'] . ', ' . $cat['articles_draft'] . ')';
                if (isset($node[$up])) {
                    $node[$my] =& $node[$up]->addItem(new HTML_TreeNode(array('hesk_parent' => $this_cat['parent'], 'text' => 'Text', 'text_short' => $text_short, 'hesk_catid' => $cat['id'], 'hesk_select' => 'option' . $j, 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true)));
                } else {
                    $node[$my] = new HTML_TreeNode(array('hesk_parent' => $this_cat['parent'], 'text' => 'Text', 'text_short' => $text_short, 'hesk_catid' => $cat['id'], 'hesk_select' => 'option' . $j, 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true));
                }
                $nextlevel[] = $cat['id'];
                $j++;
                unset($kb_cat[$k]);
            }
        }
        $thislevel = $nextlevel;
        $nextlevel = array();
        /* Break after 20 recursions to avoid hang-ups in case of any problems */
        if ($i > 20) {
            break;
        }
        $i++;
    }
    $menu->addItem($node[1]);
    // Create the presentation class
    $listBox =& ref_new(new HTML_TreeMenu_Listbox($menu));
    /* Print header */
    require_once HESK_PATH . 'inc/header.inc.php';
    /* Print main manage users page */
    require_once HESK_PATH . 'inc/show_admin_nav.inc.php';
    ?>

	
     <div class="container manage-kb-category-title"><a href="manage_knowledgebase.php" class="smaller"><b><?php 
    echo $hesklang['kb'];
    ?>
</b></a> &gt; <?php 
    echo $hesklang['kb_cat_man'];
    ?>
</div>

	<!-- SUB NAVIGATION -->
	<?php 
    show_subnav('', $catid);
    ?>
	<!-- SUB NAVIGATION -->

	<?php 
    if (!isset($_SESSION['hide']['article_list'])) {
        ?>

     <div class="container category-kb"><?php 
        echo $hesklang['category'];
        ?>
: <span class="black"><?php 
        echo $this_cat['name'];
        ?>
</span></div>

    &nbsp;<br />

    <?php 
        $result = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `catid`='{$catid}' ORDER BY `sticky` DESC, `art_order` ASC");
        $num = hesk_dbNumRows($result);
        if ($num == 0) {
            echo '<div class="container kb_no_article">' . $hesklang['kb_no_art'] . ' &nbsp;<br/><br/> 
		<a href="manage_knowledgebase.php?a=add_article&amp;catid=' . $catid . '"><img src="../img/add_article.png" width="16" height="16" alt="' . $hesklang['kb_i_art2'] . '" title="' . $hesklang['kb_i_art2'] . '" border="0" style="border:none;vertical-align:text-bottom" /></a>' . '<a href="manage_knowledgebase.php?a=add_article&amp;catid=' . $catid . '"><b>' . $hesklang['kb_i_art2'] . '</b></a></div>';
        } else {
            /* Get number of sticky articles */
            $res2 = hesk_dbQuery("SELECT COUNT(*) FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `catid`='{$catid}' AND `sticky` = '1' ");
            $num_sticky = hesk_dbResult($res2);
            $num_nosticky = $num - $num_sticky;
            ?>
        <div class="container insertArticle">
	        <?php 
            echo '<a href="manage_knowledgebase.php?a=add_article&amp;catid=' . $catid . '"><img src="../img/add_article.png" width="16" height="16" alt="' . $hesklang['kb_i_art2'] . '" title="' . $hesklang['kb_i_art2'] . '" border="0" style="border:none;vertical-align:text-bottom" /></a> <a href="manage_knowledgebase.php?a=add_article&amp;catid=' . $catid . '"><b>' . $hesklang['kb_i_art2'] . '</b></a>';
            ?>
	    </div>

	     <div class="container kb_cat_art_title"><?php 
            echo $hesklang['kb_cat_art'];
            ?>
</div>

		<div class="container">
		<table class="table table-bordered table-responsive kb_cat_art_table">
		<tr>
        <th class="admin_white">&nbsp;</th>
		<th class="admin_white"><b><i><?php 
            echo $hesklang['kb_subject'];
            ?>
</i></b></th>
		<th class="admin_white"><b><i><?php 
            echo $hesklang['kb_type'];
            ?>
</i></b></th>
        <th class="admin_white"><b><i><?php 
            echo $hesklang['views'];
            ?>
</i></b></th>
        <?php 
            if ($hesk_settings['kb_rating']) {
                ?>
	        <th class="admin_white" style="white-space:nowrap" nowrap="nowrap" width="130"><b><i><?php 
                echo $hesklang['rating'] . ' (' . $hesklang['votes'] . ')';
                ?>
</i></b></th>
	        <?php 
            }
            ?>
        <th class="admin_white" style="width:120px"><b><i>&nbsp;<?php 
            echo $hesklang['opt'];
            ?>
&nbsp;</i></b></th>
		</tr>
    	<?php 
            $i = 1;
            $j = 1;
            $k = 1;
            $previous_sticky = 1;
            $num = $num_sticky;
            while ($article = hesk_dbFetchAssoc($result)) {
                if ($previous_sticky != $article['sticky']) {
                    $k = 1;
                    $num = $num_nosticky;
                    $previous_sticky = $article['sticky'];
                }
                if (isset($_SESSION['artord']) && $article['id'] == $_SESSION['artord']) {
                    $color = 'admin_green';
                    unset($_SESSION['artord']);
                } elseif ($article['sticky']) {
                    $color = 'admin_yellow';
                } else {
                    $color = $i ? 'admin_white' : 'admin_gray';
                }
                $tmp = $i ? 'White' : 'Blue';
                $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"';
                $i = $i ? 0 : 1;
                switch ($article['type']) {
                    case '1':
                        $type = '<span class="kb_private">' . $hesklang['kb_private'] . '</span>';
                        break;
                    case '2':
                        $type = '<span class="kb_draft">' . $hesklang['kb_draft'] . '</span>';
                        break;
                    default:
                        $type = '<span class="kb_published">' . $hesklang['kb_published'] . '</span>';
                }
                if ($hesk_settings['kb_rating']) {
                    $alt = $article['rating'] ? sprintf($hesklang['kb_rated'], sprintf("%01.1f", $article['rating'])) : $hesklang['kb_not_rated'];
                    $rat = '<td class="' . $color . '" style="white-space:nowrap;"><img src="../img/star_' . hesk_round_to_half($article['rating']) * 10 . '.png" width="85" height="16" alt="' . $alt . '" title="' . $alt . '" border="0" style="vertical-align:text-bottom" /> (' . $article['votes'] . ') </td>';
                } else {
                    $rat = '';
                }
                ?>
			<tr>
			<td class="<?php 
                echo $color;
                ?>
"><?php 
                echo $j;
                ?>
.</td>
			<td class="<?php 
                echo $color;
                ?>
"><?php 
                echo $article['subject'];
                ?>
</td>
            <td class="<?php 
                echo $color;
                ?>
"><?php 
                echo $type;
                ?>
</td>
            <td class="<?php 
                echo $color;
                ?>
"><?php 
                echo $article['views'];
                ?>
</td>
            <?php 
                echo $rat;
                ?>
            <td class="<?php 
                echo $color;
                ?>
" style="text-align:center; white-space:nowrap;">
			<?php 
                if ($num > 1) {
                    if ($k == 1) {
                        ?>
                    <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />
                	<a href="manage_knowledgebase.php?a=order_article&amp;id=<?php 
                        echo $article['id'];
                        ?>
&amp;catid=<?php 
                        echo $catid;
                        ?>
&amp;move=15&amp;token=<?php 
                        hesk_token_echo();
                        ?>
"><img src="../img/move_down.png" width="16" height="16" alt="<?php 
                        echo $hesklang['move_dn'];
                        ?>
" title="<?php 
                        echo $hesklang['move_dn'];
                        ?>
" <?php 
                        echo $style;
                        ?>
 /></a>
	            <?php 
                    } elseif ($k == $num) {
                        ?>
					<a href="manage_knowledgebase.php?a=order_article&amp;id=<?php 
                        echo $article['id'];
                        ?>
&amp;catid=<?php 
                        echo $catid;
                        ?>
&amp;move=-15&amp;token=<?php 
                        hesk_token_echo();
                        ?>
"><img src="../img/move_up.png" width="16" height="16" alt="<?php 
                        echo $hesklang['move_up'];
                        ?>
" title="<?php 
                        echo $hesklang['move_up'];
                        ?>
" <?php 
                        echo $style;
                        ?>
 /></a>
                    <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />
	            <?php 
                    } else {
                        ?>
					<a href="manage_knowledgebase.php?a=order_article&amp;id=<?php 
                        echo $article['id'];
                        ?>
&amp;catid=<?php 
                        echo $catid;
                        ?>
&amp;move=-15&amp;token=<?php 
                        hesk_token_echo();
                        ?>
"><img src="../img/move_up.png" width="16" height="16" alt="<?php 
                        echo $hesklang['move_up'];
                        ?>
" title="<?php 
                        echo $hesklang['move_up'];
                        ?>
" <?php 
                        echo $style;
                        ?>
 /></a>
					<a href="manage_knowledgebase.php?a=order_article&amp;id=<?php 
                        echo $article['id'];
                        ?>
&amp;catid=<?php 
                        echo $catid;
                        ?>
&amp;move=15&amp;token=<?php 
                        hesk_token_echo();
                        ?>
"><img src="../img/move_down.png" width="16" height="16" alt="<?php 
                        echo $hesklang['move_dn'];
                        ?>
" title="<?php 
                        echo $hesklang['move_dn'];
                        ?>
" <?php 
                        echo $style;
                        ?>
 /></a>
	            <?php 
                    }
                } elseif ($num_sticky > 1 || $num_nosticky > 1) {
                    echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;vertical-align:text-bottom;" /> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;vertical-align:text-bottom;" />';
                }
                ?>
            <a href="manage_knowledgebase.php?a=sticky&amp;s=<?php 
                echo $article['sticky'] ? 0 : 1;
                ?>
&amp;id=<?php 
                echo $article['id'];
                ?>
&amp;catid=<?php 
                echo $catid;
                ?>
&amp;token=<?php 
                hesk_token_echo();
                ?>
"><img src="../img/sticky<?php 
                if (!$article['sticky']) {
                    echo '_off';
                }
                ?>
.png" width="16" height="16" alt="<?php 
                echo $article['sticky'] ? $hesklang['stickyoff'] : $hesklang['stickyon'];
                ?>
" title="<?php 
                echo $article['sticky'] ? $hesklang['stickyoff'] : $hesklang['stickyon'];
                ?>
" <?php 
                echo $style;
                ?>
 /></a>
            <a href="knowledgebase_private.php?article=<?php 
                echo $article['id'];
                ?>
&amp;back=1<?php 
                if ($article['type'] == 2) {
                    echo '&amp;draft=1';
                }
                ?>
" target="_blank"><img src="../img/article_text.png" width="16" height="16" alt="<?php 
                echo $hesklang['viewart'];
                ?>
" title="<?php 
                echo $hesklang['viewart'];
                ?>
" <?php 
                echo $style;
                ?>
 /></a>
            <a href="manage_knowledgebase.php?a=edit_article&amp;id=<?php 
                echo $article['id'];
                ?>
"><img src="../img/edit.png" width="16" height="16" alt="<?php 
                echo $hesklang['edit'];
                ?>
" title="<?php 
                echo $hesklang['edit'];
                ?>
" <?php 
                echo $style;
                ?>
 /></a>
            <a href="manage_knowledgebase.php?a=remove_article&amp;id=<?php 
                echo $article['id'];
                ?>
&amp;token=<?php 
                hesk_token_echo();
                ?>
" onclick="return hesk_confirmExecute('<?php 
                echo hesk_makeJsString($hesklang['del_art']);
                ?>
');"><img src="../img/delete.png" width="16" height="16" alt="<?php 
                echo $hesklang['delete'];
                ?>
" title="<?php 
                echo $hesklang['delete'];
                ?>
" <?php 
                echo $style;
                ?>
 /></a>&nbsp;</td>
			</tr>
            <?php 
                $j++;
                $k++;
            }
            // End while
            ?>
		</table>
		</div>
		<?php 
        }
    }
    // END if hide article list
    /* Manage Category (except the default one) */
    if ($catid != 1) {
        ?>

        &nbsp;<br />


    <div class="container insertCategory">
		<?php 
        echo '<a href="manage_knowledgebase.php?a=add_category&amp;parent=' . $catid . '"><img src="../img/add_category.png" width="16" height="16" alt="' . $hesklang['kb_i_cat2'] . '" title="' . $hesklang['kb_i_cat2'] . '" border="0" style="border:none;vertical-align:text-bottom" /></a> <a href="manage_knowledgebase.php?a=add_category&amp;parent=' . $catid . '"><b>' . $hesklang['kb_i_cat2'] . '</b></a>';
        ?>
	</div>

	<div class="container category-settings-title"><?php 
        echo $hesklang['catset'];
        ?>
</div>
	<div class="container category-settings-form">
	<br/>
		<form action="manage_knowledgebase.php" method="post" name="form1" onsubmit="Javascript:return hesk_deleteIfSelected('dodelete','<?php 
        echo hesk_makeJsString($hesklang['kb_delcat']);
        ?>
')">
			<div class="form-inline">
				<span class="col-sm-2"><b><?php 
        echo $hesklang['kb_cat_title'];
        ?>
:</b></span>
				<span><input class="form-control" type="text" name="title" size="70" maxlength="255" value="<?php 
        echo $this_cat['name'];
        ?>
" /></span>
			</div>
			<br/>
			<div class="form-inline">
				<span class="col-sm-2"><b><?php 
        echo $hesklang['kb_cat_parent'];
        ?>
:</b></span>
				<span><select class="form-control" name="parent"><?php 
        $listBox->printMenu();
        ?>
</select></span>
			</div>
			<br/>
			<div class="form-inline">
				<span class="col-sm-2"><b><?php 
        echo $hesklang['kb_type'];
        ?>
:</b></span>
				<div class="form-group">
					<label><input type="radio" name="type" value="0" <?php 
        if (!$this_cat['type']) {
            echo 'checked="checked"';
        }
        ?>
 /> <b><i><?php 
        echo $hesklang['kb_published'];
        ?>
</i></b></label><br />
					<span><?php 
        echo $hesklang['kb_cat_published'];
        ?>
</span><br/><br/>
					<label><input type="radio" name="type" value="1" <?php 
        if ($this_cat['type']) {
            echo 'checked="checked"';
        }
        ?>
 /> <b><i><?php 
        echo $hesklang['kb_private'];
        ?>
</i></b></label><br />
					<span><?php 
        echo $hesklang['kb_cat_private'];
        ?>
</span>
				</div>
			</div>
			<br/>
	        <div class="form-inline">
				<span class="col-sm-2"><b><?php 
        echo $hesklang['opt'];
        ?>
:</b></span>
				<div class="form-group">
					<label><input type="checkbox" name="dodelete" id="dodelete" value="Y" onclick="Javascript:hesk_toggleLayerDisplay('deleteoptions')" /> <i><?php 
        echo $hesklang['delcat'];
        ?>
</i></label>
					<div id="deleteoptions" style="display: none;">
					<label><input type="radio" name="movearticles" value="Y" checked="checked" /> <?php 
        echo $hesklang['move1'];
        ?>
</label><br />
					<label><input type="radio" name="movearticles" value="N" /> <?php 
        echo $hesklang['move2'];
        ?>
</label>
					</div>
				</div>
	        </div>
			<br/>
	</div>
	<br/>
		<div class="col-sm-6 col-sm-offset-6">
			<input type="hidden" name="a" value="edit_category" />
	        <input type="hidden" name="token" value="<?php 
        hesk_token_echo();
        ?>
" />
	        <input type="hidden" name="catid" value="<?php 
        echo $catid;
        ?>
" /><input type="submit" value="<?php 
        echo $hesklang['save_changes'];
        ?>
" class="btn btn-default save-cat-changes-btn" />
		</div>
	</form>
	

	<?php 
    }
    // END if $catid != 1
    /* Clean unneeded session variables */
    hesk_cleanSessionVars(array('hide', 'manage_cat', 'edit_article'));
    require_once HESK_PATH . 'inc/footer.inc.php';
    exit;
}
function new_cat()
{
    global $hesk_settings, $hesklang;
    /* A security check */
    hesk_token_check('POST');
    /* Options */
    $_SESSION['cat_autoassign'] = hesk_POST('autoassign') == 'Y' ? 1 : 0;
    $_SESSION['cat_type'] = hesk_POST('type') == 'Y' ? 1 : 0;
    // Default priority
    $_SESSION['cat_priority'] = intval(hesk_POST('priority', 3));
    if ($_SESSION['cat_priority'] < 0 || $_SESSION['cat_priority'] > 3) {
        $_SESSION['cat_priority'] = 3;
    }
    /* Category name */
    $catname = hesk_input(hesk_POST('name'), $hesklang['enter_cat_name'], 'manage_categories.php');
    /* Do we already have a category with this name? */
    $res = hesk_dbQuery("SELECT `id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `name` LIKE '" . hesk_dbEscape(hesk_dbLike($catname)) . "' LIMIT 1");
    if (hesk_dbNumRows($res) != 0) {
        $_SESSION['catname'] = $catname;
        hesk_process_messages($hesklang['cndupl'], 'manage_categories.php');
    }
    /* Get the latest cat_order */
    $res = hesk_dbQuery("SELECT `cat_order` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ORDER BY `cat_order` DESC LIMIT 1");
    $row = hesk_dbFetchRow($res);
    $my_order = $row[0] + 10;
    hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` (`name`,`cat_order`,`autoassign`,`type`, `priority`) VALUES ('" . hesk_dbEscape($catname) . "','" . intval($my_order) . "','" . intval($_SESSION['cat_autoassign']) . "','" . intval($_SESSION['cat_type']) . "','{$_SESSION['cat_priority']}')");
    hesk_cleanSessionVars('catname');
    hesk_cleanSessionVars('cat_autoassign');
    hesk_cleanSessionVars('cat_type');
    hesk_cleanSessionVars('cat_priority');
    $_SESSION['selcat2'] = hesk_dbInsertID();
    hesk_process_messages(sprintf($hesklang['cat_name_added'], '<i>' . stripslashes($catname) . '</i>'), 'manage_categories.php', 'SUCCESS');
}
Example #20
0
    hesk_process_messages(sprintf($hesklang['num_tickets_deleted'], $i), $referer, 'SUCCESS');
} elseif ($_POST['a'] == 'merge') {
    /* Check permissions for this feature */
    hesk_checkPermission('can_merge_tickets');
    /* A security check */
    hesk_token_check('POST');
    /* Sort IDs, tickets will be merged to the lowest ID */
    sort($_POST['id'], SORT_NUMERIC);
    /* Select lowest ID as the target ticket */
    $merge_into = array_shift($_POST['id']);
    /* Merge tickets or throw an error */
    if (hesk_mergeTickets($_POST['id'], $merge_into)) {
        hesk_process_messages($hesklang['merged'], $referer, 'SUCCESS');
    } else {
        $hesklang['merge_err'] .= ' ' . $_SESSION['error'];
        hesk_cleanSessionVars($_SESSION['error']);
        hesk_process_messages($hesklang['merge_err'], $referer);
    }
} elseif ($_POST['a'] == 'tag' || $_POST['a'] == 'untag') {
    /* Check permissions for this feature */
    hesk_checkPermission('can_add_archive');
    /* A security check */
    hesk_token_check('POST');
    if ($_POST['a'] == 'tag') {
        $archived = 1;
        $action = $hesklang['num_tickets_tag'];
    } else {
        $archived = 0;
        $action = $hesklang['num_tickets_untag'];
    }
    foreach ($_POST['id'] as $this_id) {
Example #21
0
	<td class="roundcornersbottom"></td>
	<td width="7" height="7"><img src="img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
</tr>
</table>

<?php 
/* Print "Submit a reply" form? */
if ($ticket['locked'] != 1 && $ticket['status'] != 3 && !$hesk_settings['reply_top']) {
    hesk_printCustomerReplyForm();
}
/* If needed update unread replies as read for staff to know */
if (count($unread_replies)) {
    hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` SET `read` = '1' WHERE `id` IN ('" . implode("','", $unread_replies) . "')");
}
/* Clear unneeded session variables */
hesk_cleanSessionVars('ticket_message');
require_once HESK_PATH . 'inc/footer.inc.php';
/*** START FUNCTIONS ***/
function print_form()
{
    global $hesk_settings, $hesklang;
    global $hesk_error_buffer, $my_email, $trackingID, $do_remember, $display;
    /* Print header */
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['view_ticket'];
    require_once HESK_PATH . 'inc/header.inc.php';
    ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"><img src="img/headerleftsm.jpg" width="3" height="25" alt="" /></td>
<td class="headersm"><?php 
    hesk_showTopBar($hesklang['view_ticket']);
Example #22
0
</ul>

	</td>
	<td class="roundcornersright">&nbsp;</td>
	</tr>
	<tr>
	<td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td>
	<td class="roundcornersbottom"></td>
	<td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
	</tr>
</table>
<?php 
}
/* Clear unneeded session variables */
hesk_cleanSessionVars('ticket_message');
hesk_cleanSessionVars('time_worked');
require_once HESK_PATH . 'inc/footer.inc.php';
/*** START FUNCTIONS ***/
function hesk_listAttachments($attachments = '', $reply = 0, $white = 1)
{
    global $hesk_settings, $hesklang, $trackingID, $can_edit, $can_delete;
    /* Attachments disabled or not available */
    if (!$hesk_settings['attachments']['use'] || !strlen($attachments)) {
        return false;
    }
    /* Style and mousover/mousout */
    $tmp = $white ? 'White' : 'Blue';
    $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"';
    /* List attachments */
    echo '<p><b>' . $hesklang['attachments'] . ':</b><br />';
    $att = explode(',', substr($attachments, 0, -1));