| Server IP : 208.122.213.31 / Your IP : 216.73.216.185 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/www.superporner.com/tube/ |
Upload File : |
<?
session_start();
include('admin/db.php');
if(!$_SESSION[userid]) {
header("Location: /login.php");
exit();
}
$title = 'Private Messages';
$headertitle = "Private Messages";
include($basepath.'/templates/template.overall_header.php');
$user= $_SESSION[userid];
$option = strip_tags(mysql_real_escape_string(trim($_GET['option'])));
$id = strip_tags(mysql_real_escape_string (trim($_GET['id'])));
$box = strip_tags(mysql_real_escape_string (trim($_GET['box'])));
switch($box)
{
case 'inbox':
$headertitle='Inbox';
break;
case 'outbox':
$headertitle='Sent Items';
break;
case 'trash_in':
$headertitle='Trash In';
break;
case 'trash_out':
$headertitle='Trash Out';
break;
}
?>
<!-- MAIL -->
<!-- general info-->
<div id="view_box">
<h3>Private Messaging - <? echo $headertitle;?></h3>
<div style="width:100%; float:left">
<!-- foldery-->
<div id="message_foldery">
<table width="100%" border="0">
<tr>
<td width="12%"><img src="<? echo $basehttp;?>/images/Get_Mail.png" width="32" height="32" /></td>
<td width="88%"><a href="mail.php?box=inbox">Inbox</a></td>
</tr>
<tr>
<td><img src="<? echo $basehttp;?>/images/Send_Mail.png" width="32" height="32" /></td>
<td><a href="mail.php?box=outbox">Sent</a></td>
</tr>
</table>
</div>
<!-- foldery-->
<!-- wiadomosci-->
<div id="message_wiadomosci">
<?
//dodaj do koszas
if( $option=="del" and !empty($id) ) {
$sql="UPDATE `mail` SET `trash` = 'Y', `read`='Y' WHERE `id` =$id ";
mysql_query($sql);
$showMsg = "Success!<br/>";
}
//dodaj do kosza jesli jestes w wyslanych
if( $option=="del_a" and !empty($id) ) {
$sql="UPDATE `mail` SET `trash_a` = 'Y' WHERE `id` =$id ";
mysql_query($sql);
$showMsg = "Success!<br/>";
}
//usun jeden
if( $option=="del_one_in") {
$sql="UPDATE `mail` SET `display` = 'N' WHERE `id` =$id ";
mysql_query($sql);
$showMsg = "Success!<br/>";
}
//usun jeden
if( $option=="del_one_out") {
$sql="UPDATE `mail` SET `display_a` = 'N' WHERE `id` =$id ";
mysql_query($sql);
$showMsg = "Success!<br/>";
}
//usun wszystko z trasz inbox
if( $option=="del_all_in") {
$sql="DELETE FROM `mail` WHERE `trash`='Y' AND `to`='$user' ";
echo $sql;
mysql_query($sql);
$showMsg = "Success!<br/>";
}
//usun wszystko z trasz inbox
if( $option=="del_all_out") {
$sql="DELETE FROM `mail` WHERE `trash_a`='Y' AND `from`='$user' ";
echo $sql;
mysql_query($sql);
$showMsg = "Success!<br/>";
}
$showPreview = true;
if(isset($_POST['send'])){
$text=strip_tags(mysql_real_escape_string($_POST['text']));
$to=mysql_real_escape_string($_POST['to']);
$subject=strip_tags(mysql_real_escape_string($_POST['subject']));
$from=mysql_real_escape_string($_POST['from']);
$date= mysql_real_escape_string(date("Y-m-d"));
$text=strip_tags(htmlspecialchars($text));
$subject=strip_tags(htmlspecialchars($subject));
$subject="RE: ".$subject;
$sql= "INSERT INTO `mail` (`id` ,`from` ,`to` ,`subject` ,`date` ,`text` ,`read` ,`trash`)
VALUES (NULL , '$from', '$to', '$subject', '$date', '$text', 'N', 'N')";
mysql_query($sql);
if($sql) {
$showMsg = "Your message has been sent!";
$showPreview = false;
}
else { $showMsg = "An error has occured and your message has NOT been sent!"; }
}
if($showMsg) { echo "<div style='clear: both; style='font-weight: bold; color: #ffffff;'>$showMsg<br><br></div>"; }
?>
<div id="message_naglowek">
<div id="message_komorka1">
<? if ($box=="outbox" or $box=="trash_out") { echo "To";} else { echo "From";} ?>
</div>
<div id="message_komorka2">Subject </div>
<div id="message_komorka3">Date</div>
<div id="message_komorka4">Option</div>
</div>
<?
$licznik=0;
if ($box=="inbox") {
$sql="SELECT * FROM mail AS m, users AS u WHERE m.to = '$user' AND u.record_num = '$user' AND m.trash='N' AND m.display='Y' ORDER BY `date` DESC";
}
elseif ($box=="outbox"){
$sql="SELECT * FROM mail AS m, users AS u WHERE m.from = '$user' AND u.record_num = '$user' AND m.trash_a='N' AND m.display_a='Y' ORDER BY `date` DESC";
}
elseif ($box=="trash_in") {
$sql="SELECT * FROM mail AS m, users AS u WHERE m.to = '$user' AND u.record_num = '$user' AND m.trash='Y' ORDER BY `date` DESC";
}
elseif($box=="trash_out") {
$sql="SELECT * FROM mail AS m, users AS u WHERE m.from = '$user' AND u.record_num = '$user' AND m.trash_a='Y' AND m.display_a='Y' ORDER BY `date` DESC";
}
else {
exit("An Error has occured.");
}
$ltmp = 5; // porcji na stronie
$first = mysql_real_escape_string(trim($_GET['first']));
if (empty($first)) { $first = 0; }
$sql2 = $sql." LIMIT $first,$ltmp;";
$count = mysql_num_rows(mysql_query($sql));
$count = $count/$ltmp;
$ile = ceil($count);
$result = mysql_query($sql2);
if(@mysql_num_rows($result) < 1) { echo "No message";} else {
while($r = mysql_fetch_array($result))
{
//sprawdzanie usernname
if ($box=="inbox") {$sql=("SELECT * FROM users WHERE record_num='$r[1]' ");};
if ($box=="trash_in") {$sql=("SELECT * FROM users WHERE record_num='$r[1]' ");};
if ($box=="trash_out") {$sql=("SELECT * FROM users WHERE record_num='$r[2]' ");};
if ($box=="outbox"){$sql=("SELECT * FROM users WHERE record_num='$r[2]' ");};
$wynik = mysql_query($sql);
$c = mysql_fetch_array($wynik);
$from=$c[0];
$licznik=$licznik+1;
$reszta=$licznik % 2;
if ($r['read']=="N" and $box=="inbox"){$style="class=\"message_unread\"";} else {$style="class=\"message_read\"";}
if ($reszta == 0) {echo "<div id=\"message_wiersz1\"".$style.">"; }else { echo "<div id=\"message_wiersz2\" ".$style.">";}
$link="mail.php?box=".$box."&id=".$r['id'];
?>
<div id="message_komorka1"><a href="#"><? echo $from;?></a></div>
<div id="message_komorka2"><a href="<? echo $link;?>&option=show"><? echo $r['subject'];?></a></div>
<div id="message_komorka3"><? echo $r['date'];?></div>
<div id="message_komorka4">
<? if ($box=="trash_in" ) { ?><a href="<? echo $link;?>&option=del_one_in" class="message_del"></a><? }?>
<? if ($box=="trash_out" ) { ?><a href="<? echo $link;?>&option=del_one_out" class="message_del"></a><? }?>
<? if ($box=="inbox") { ?><a href="<? echo $link;?>&option=del" class="message_del"></a><? }?>
<? if ($box=="outbox") { ?><a href="<? echo $link;?>&option=del_a" class="message_del"></a><? }?>
<a href="<? echo $link;?>&option=show" <? echo $style;?>></a>
</div>
</div>
<? }
if ($box=="trash_in" ){echo "<div align='right'><a href='mail.php?box=trash_in&option=del_all_in'>Delete ALL ?</a></div>";}
if ($box=="trash_out" ){echo "<div align='right'><a href='mail.php?box=trash_out&option=del_all_out'>Delete ALL ?</a></div>";}
}?>
<!-- pagination-->
<div id="message_pagination">
<?
if ($first!=0) print ("<a href=\"".$link."&first=" . ($first-$ltmp) . "\" title=\"Prev\">Prev</a> ");
for ($i=1;$i<=$ile;$i++){
print ("<a href=\"".$link."&first=". ($i*$ltmp-$ltmp) . "\" title=\"" . ($i*$ltmp-($ltmp-1)) . "-" . ($i*$ltmp) ."\">"); if ($first==($i*$ltmp-$ltmp))
{ print ("<b>" . $i . "</b></a> "); $akt=$i; } else { print ("" . $i . "</a> "); }
}
if ($akt<$ile) print ("<a href=\"".$link."&first=" . ($first+$ltmp) . "\" title=\"Next\">Next</a>");
?>
</div>
<!-- pagination-->
</div>
<!-- wiadomosci-->
</div></div>
</div>
<!-- end-->
<?
if( $option=="show" and !empty($id) ) {
if($box=="inbox") {
$sql="SELECT * FROM mail WHERE id = '$id' and `to`='$user'";
} else {
$sql="SELECT * FROM mail WHERE id = '$id' and `from`='$user'";
}
$result = mysql_query($sql);
while($r = mysql_fetch_array($result))
{
//sprawdzanie usernname
if ($box=="inbox") {$sql=("SELECT * FROM users WHERE record_num='$r[1]' ");};
if ($box=="outbox"){$sql=("SELECT * FROM users WHERE record_num='$r[2]' ");};
if ($box=="trash_in") {$sql=("SELECT * FROM users WHERE record_num='$r[1]' ");};
if ($box=="trash_out"){$sql=("SELECT * FROM users WHERE record_num='$r[2]' ");};
$wynik = mysql_query($sql);
$c = mysql_fetch_array($wynik);
$from=$c[0];
?>
<!-- message preview-->
<div id="view_box" <? if(!$showPreview) { ?>style='display: none;'<? } ?>>
<h3>Preview Message</h3>
<div style="width:95%; margin-left:10px; float:left; line-height:18px;">
<strong><? if ($box=="outbox") { echo "To: ";} else { echo "From: ";} ?></strong><a href="#"><? echo $from;?></a><br />
<strong>Subject: </strong><? echo $r['subject'];?><br />
<strong>Date:</strong> <? echo $r['date'];?><br />
<br /><br />
<strong>Message:</strong>
<div id="message_prev">
<? echo $r['text'];?>
</div>
<div id="view_box" style="height:20px; margin-top:0px;"></div>
<a href="<? echo $link;?>&option=del" style="float:left; padding-left:18px; margin-left:20px;" class="message_del">Delete</a>
<div id="view_box" style="height:20px; margin-top:0px;"></div>
</div>
</div>
<!-- message preview-->
<?
// zaznacz ze przeczytaba
if ($box=="inbox") {
$sql="UPDATE `mail` SET `read` = 'Y' WHERE `id` =$id ";
mysql_query($sql);
}
}
// REPLY
if( $option=="show" and !empty($id) and $box=="inbox" or $box=="trash_in" ) {
$sql="SELECT * FROM mail WHERE id = '$id' ";
$result = mysql_query($sql);
while($r = mysql_fetch_array($result))
{
//sprawdzanie usernname
if ($box=="inbox") {$sql=("SELECT * FROM users WHERE record_num='$r[1]' ");};
if ($box=="outbox"){$sql=("SELECT * FROM users WHERE record_num='$r[2]' ");};
$wynik = mysql_query($sql);
$c = mysql_fetch_array($wynik);
$from=$c[0];
?>
<!-- send message -->
<div id="view_box" <? if(!$showPreview) { ?>style='display: none;'<? } ?> >
<h3>Reply</h3>
<div style="width:95%; margin-left:10px; float:left; line-height:18px;">
<? if($_POST[send]) { $display="\"style=display:none\""; } ?>
<div <? echo $display; ?>>
<form method="post" action="">
<br />
<strong>Your Message:</strong>
<br />
<textarea name="text" cols="" rows="" style="width:100%; height:100px;" ></textarea>
<input type="hidden" name="to" value="<? echo $r['from'];?>" />
<input type="hidden" name="from" value="<? echo $r['to'];?>" />
<input type="hidden" name="subject" value="<? echo $r['subject'];?>" />
<br />
<input name="send" type="submit" value="send" />
<br />
</form>
<div id="view_box" style="height:20px;" > </div>
</div> </div></div>
<!-- send message-->
<? } }}?>
<!-- MAIL-->
<div>
<? include($basepath.'/templates/template.overall_footer.php'); ?>