Beispiel #1
0
function show_message()
{
    global $hesk_settings, $hesklang, $admins;
    $id = intval(hesk_GET('id'));
    /* Get the message details */
    $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `id`='" . intval($id) . "' AND `deletedby`!='" . intval($_SESSION['id']) . "' LIMIT 1");
    $num = hesk_dbNumRows($res);
    if ($num) {
        $pm = hesk_dbFetchAssoc($res);
        /* Allowed to read the message? */
        if ($pm['to'] == $_SESSION['id']) {
            if (!isset($_SESSION['mail']['subject'])) {
                $_SESSION['mail']['subject'] = $hesklang['m_re'] . ' ' . $pm['subject'];
            }
            if (!isset($_SESSION['mail']['to'])) {
                $_SESSION['mail']['to'] = $pm['from'];
            }
        } elseif ($pm['from'] == $_SESSION['id']) {
            if (!isset($_SESSION['mail']['subject'])) {
                $_SESSION['mail']['subject'] = $hesklang['m_fwd'] . ' ' . $pm['subject'];
            }
            if (!isset($_SESSION['mail']['to'])) {
                $_SESSION['mail']['to'] = $pm['to'];
            }
            $hesk_settings['mailtmp']['this'] = 'from';
            $hesk_settings['mailtmp']['other'] = 'to';
            $hesk_settings['mailtmp']['m_from'] = $hesklang['m_to'];
            $hesk_settings['mailtmp']['outbox'] = '<b>' . $hesklang['outbox'] . '</b>';
            $hesk_settings['mailtmp']['inbox'] = '<a href="mail.php">' . $hesklang['inbox'] . '</a>';
            $hesk_settings['mailtmp']['outbox'] = '<a href="mail.php?folder=outbox">' . $hesklang['outbox'] . '</a>';
        } else {
            hesk_process_message($hesklang['m_ena'], 'mail.php');
        }
        /* Mark as read */
        if ($hesk_settings['mailtmp']['this'] == 'to' && !$pm['read']) {
            $res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` SET `read`='1' WHERE `id`='" . intval($id) . "' LIMIT 1");
        }
        $pm['name'] = isset($admins[$pm[$hesk_settings['mailtmp']['other']]]) ? '<a href="mail.php?a=new&amp;id=' . $pm[$hesk_settings['mailtmp']['other']] . '">' . $admins[$pm[$hesk_settings['mailtmp']['other']]] . '</a>' : ($pm['from'] == 9999 ? '<a href="http://www.hesk.com" target="_blank">HESK.com</a>' : $hesklang['e_udel']);
        $pm['dt'] = hesk_dateToString($pm['dt'], 0, 1, 0, true);
        ?>

	<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>

			<table border="0" cellspacing="0" cellpadding="0" width="100%">
			<tr>
			<td valign="top">
				<table border="0">
				<tr>
					<td><b><?php 
        echo $hesk_settings['mailtmp']['m_from'];
        ?>
</b></td>
					<td><?php 
        echo $pm['name'];
        ?>
</td>
				</tr>
				<tr>
					<td><b><?php 
        echo $hesklang['date'];
        ?>
</b></td>
					<td><?php 
        echo $pm['dt'];
        ?>
</td>
				</tr>
				<tr>
					<td><b><?php 
        echo $hesklang['m_sub'];
        ?>
</b></td>
					<td><?php 
        echo $pm['subject'];
        ?>
</td>
				</tr>
				</table>
			</td>
			<td style="text-align:right; vertical-align:top;">

				<?php 
        $folder = '&amp;folder=outbox';
        if ($pm['to'] == $_SESSION['id']) {
            echo '<a href="mail.php?a=mark_unread&amp;id=' . $id . '&amp;token=' . hesk_token_echo(0) . '"><img src="../img/mail.png" width="16" height="16" alt="' . $hesklang['mau'] . '" title="' . $hesklang['mau'] . '" class="optionWhiteOFF" onmouseover="this.className=\'optionWhiteON\'" onmouseout="this.className=\'optionWhiteOFF\'" /></a> ';
            $folder = '';
        }
        echo '<a href="mail.php?a=delete&amp;id=' . $id . '&amp;token=' . hesk_token_echo(0) . $folder . '" onclick="return hesk_confirmExecute(\'' . hesk_makeJsString($hesklang['delm']) . '?\');"><img src="../img/delete.png" width="16" height="16" alt="' . $hesklang['delm'] . '" title="' . $hesklang['delm'] . '" class="optionWhiteOFF" onmouseover="this.className=\'optionWhiteON\'" onmouseout="this.className=\'optionWhiteOFF\'" /></a>';
        ?>

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

		<hr />

		<p><?php 
        echo $pm['message'];
        ?>
</p>

	    </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>

	<br /><hr />


			<?php 
    }
    // END if $num
    $_SESSION['hide']['list'] = 1;
}
Beispiel #2
0
function show_message()
{
    global $hesk_settings, $hesklang, $admins;
    $id = intval(hesk_GET('id'));
    /* Get the message details */
    $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `id`='" . intval($id) . "' AND `deletedby`!='" . intval($_SESSION['id']) . "' LIMIT 1");
    $num = hesk_dbNumRows($res);
    if ($num) {
        $pm = hesk_dbFetchAssoc($res);
        /* Allowed to read the message? */
        if ($pm['to'] == $_SESSION['id']) {
            if (!isset($_SESSION['mail']['subject'])) {
                $_SESSION['mail']['subject'] = $hesklang['m_re'] . ' ' . $pm['subject'];
            }
            if (!isset($_SESSION['mail']['to'])) {
                $_SESSION['mail']['to'] = $pm['from'];
            }
        } elseif ($pm['from'] == $_SESSION['id']) {
            if (!isset($_SESSION['mail']['subject'])) {
                $_SESSION['mail']['subject'] = $hesklang['m_fwd'] . ' ' . $pm['subject'];
            }
            if (!isset($_SESSION['mail']['to'])) {
                $_SESSION['mail']['to'] = $pm['to'];
            }
            $hesk_settings['mailtmp']['this'] = 'from';
            $hesk_settings['mailtmp']['other'] = 'to';
            $hesk_settings['mailtmp']['m_from'] = $hesklang['m_to'];
            $hesk_settings['mailtmp']['outbox'] = '<b>' . $hesklang['outbox'] . '</b>';
            $hesk_settings['mailtmp']['inbox'] = '<a href="mail.php">' . $hesklang['inbox'] . '</a>';
            $hesk_settings['mailtmp']['outbox'] = '<a href="mail.php?folder=outbox">' . $hesklang['outbox'] . '</a>';
        } else {
            hesk_process_message($hesklang['m_ena'], 'mail.php');
        }
        /* Mark as read */
        if ($hesk_settings['mailtmp']['this'] == 'to' && !$pm['read']) {
            $res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` SET `read`='1' WHERE `id`='" . intval($id) . "' LIMIT 1");
        }
        $pm['name'] = isset($admins[$pm[$hesk_settings['mailtmp']['other']]]) ? '<a href="mail.php?a=new&amp;id=' . $pm[$hesk_settings['mailtmp']['other']] . '">' . $admins[$pm[$hesk_settings['mailtmp']['other']]] . '</a>' : ($pm['from'] == 9999 ? '<a href="http://www.hesk.com" target="_blank">HESK.com</a>' : $hesklang['e_udel']);
        $pm['dt'] = hesk_dateToString($pm['dt'], 0, 1, 0, true);
        ?>

	<div class="container mail-from-user-table">
		<div>
			&nbsp;
			<div>

				<div class="form-inline mail-info-table">
					<div class="form-group mail-from-date-subject">
						<div class="form-inline">
							<span><b><?php 
        echo $hesk_settings['mailtmp']['m_from'];
        ?>
</b></span>
							<span><?php 
        echo $pm['name'];
        ?>
</span>
						</div>
						<div class="form-inline">
							<span><b><?php 
        echo $hesklang['date'];
        ?>
</b></span>
							<span><?php 
        echo $pm['dt'];
        ?>
</span>
						</div>
						<div class="form-inline">
							<span><b><?php 
        echo $hesklang['m_sub'];
        ?>
</b></span>
							<span><?php 
        echo $pm['subject'];
        ?>
</span>
						</div>
					</div><!-- end mail-from-date-subject -->
					<div class="form-group mail-icons" style="float: right;">

						<?php 
        $folder = '&amp;folder=outbox';
        if ($pm['to'] == $_SESSION['id']) {
            echo '<a href="mail.php?a=mark_unread&amp;id=' . $id . '&amp;token=' . hesk_token_echo(0) . '"><img src="../img/mail.png" width="16" height="16" alt="' . $hesklang['mau'] . '" title="' . $hesklang['mau'] . '" class="optionWhiteOFF" onmouseover="this.className=\'optionWhiteON\'" onmouseout="this.className=\'optionWhiteOFF\'" /></a> ';
            $folder = '';
        }
        echo '<a href="mail.php?a=delete&amp;id=' . $id . '&amp;token=' . hesk_token_echo(0) . $folder . '" onclick="return hesk_confirmExecute(\'' . hesk_makeJsString($hesklang['delm']) . '?\');"><img src="../img/delete.png" width="16" height="16" alt="' . $hesklang['delm'] . '" title="' . $hesklang['delm'] . '" class="optionWhiteOFF" onmouseover="this.className=\'optionWhiteON\'" onmouseout="this.className=\'optionWhiteOFF\'" /></a>';
        ?>

					</div><!-- end mail-icons -->
				</div>

			<br/><br/>

			<p><?php 
        echo strip_tags($pm['message']);
        ?>
</p>

			</div>
			&nbsp;
		</div>
	</div><!-- end mail-from-user-table -->

	<br /><br/><br/>


			<?php 
    }
    // END if $num
    $_SESSION['hide']['list'] = 1;
}
Beispiel #3
0
function show_message()
{
    global $hesk_settings, $hesklang, $admins;
    $id = intval(hesk_GET('id'));
    /* Get the message details */
    $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `id`='" . intval($id) . "' AND `deletedby`!='" . intval($_SESSION['id']) . "' LIMIT 1");
    $num = hesk_dbNumRows($res);
    if ($num) {
        $pm = hesk_dbFetchAssoc($res);
        /* Allowed to read the message? */
        if ($pm['to'] == $_SESSION['id']) {
            if (!isset($_SESSION['mail']['subject'])) {
                $_SESSION['mail']['subject'] = $hesklang['m_re'] . ' ' . $pm['subject'];
            }
            if (!isset($_SESSION['mail']['to'])) {
                $_SESSION['mail']['to'] = $pm['from'];
            }
        } elseif ($pm['from'] == $_SESSION['id']) {
            if (!isset($_SESSION['mail']['subject'])) {
                $_SESSION['mail']['subject'] = $hesklang['m_fwd'] . ' ' . $pm['subject'];
            }
            if (!isset($_SESSION['mail']['to'])) {
                $_SESSION['mail']['to'] = $pm['to'];
            }
            $hesk_settings['mailtmp']['this'] = 'from';
            $hesk_settings['mailtmp']['other'] = 'to';
            $hesk_settings['mailtmp']['m_from'] = $hesklang['m_to'];
            $hesk_settings['mailtmp']['outbox'] = '<b>' . $hesklang['outbox'] . '</b>';
            $hesk_settings['mailtmp']['inbox'] = '<a href="mail.php">' . $hesklang['inbox'] . '</a>';
            $hesk_settings['mailtmp']['outbox'] = '<a href="mail.php?folder=outbox">' . $hesklang['outbox'] . '</a>';
        } else {
            hesk_process_message($hesklang['m_ena'], 'mail.php');
        }
        /* Mark as read */
        if ($hesk_settings['mailtmp']['this'] == 'to' && !$pm['read']) {
            $res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` SET `read`='1' WHERE `id`='" . intval($id) . "' LIMIT 1");
        }
        $pm['name'] = isset($admins[$pm[$hesk_settings['mailtmp']['other']]]) ? '<a href="mail.php?a=new&amp;id=' . $pm[$hesk_settings['mailtmp']['other']] . '">' . $admins[$pm[$hesk_settings['mailtmp']['other']]] . '</a>' : ($pm['from'] == 9999 ? '<a href="http://www.hesk.com" target="_blank">HESK.com</a>' : $hesklang['e_udel']);
        echo $pm['dt'];
        $pm['dt'] = hesk_dateToString($pm['dt'], 0, 1, 0, true);
        ?>

            <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td>

                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                <tr>
                <td valign="top">
                    <table border="0">
                    <tr>
                        <td><b><?php 
        echo $hesk_settings['mailtmp']['m_from'];
        ?>
</b></td>
                        <td><?php 
        echo $pm['name'];
        ?>
</td>
                    </tr>
                    <tr>
                        <td><b><?php 
        echo $hesklang['date'];
        ?>
</b></td>
                        <td><?php 
        echo $pm['dt'];
        ?>
</td>
                    </tr>
                    <tr>
                        <td><b><?php 
        echo $hesklang['m_sub'];
        ?>
</b></td>
                        <td><?php 
        echo $pm['subject'];
        ?>
</td>
                    </tr>
                    </table>
                </td>
                <td class="text-right" style="vertical-align:top;">

                    <?php 
        $folder = '&amp;folder=outbox';
        if ($pm['to'] == $_SESSION['id']) {
            echo '<a href="mail.php?a=mark_unread&amp;id=' . $id . '&amp;token=' . hesk_token_echo(0) . '"><i style="font-size: 14px" class="fa fa-envelope-o"></i></a> ';
            $folder = '';
        }
        echo '<a href="mail.php?a=delete&amp;id=' . $id . '&amp;token=' . hesk_token_echo(0) . $folder . '" onclick="return hesk_confirmExecute(\'' . hesk_makeJsString($hesklang['delm']) . '?\');"><i class="fa fa-times" style="font-size: 14px; color: red"></i></a>';
        ?>

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

            <p><?php 
        echo $pm['message'];
        ?>
</p>

            </td>
            </tr>
        </table>
    </div><hr />


			<?php 
    }
    // END if $num
    $_SESSION['hide']['list'] = 1;
}