2 include('encrypt.php');
3 require 'include/inbox.class.php';
4 require 'include/header.php';
6 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
7 header('location:index.php');
11 /*********************************************
12 function GetImgTrip($mail) {
14 $fdir = substr($mail, 0, 1);
15 $sdir = substr($mail, 1, 1);
16 $impo = file_get_contents(DB_PATH."$fdir/$sdir/$mail");
20 //*********************************************/
21 // $init = new Message;
23 $uid = $init->GetID($_COOKIE['DMDM'],$id_mail_path);
25 if(isset($_POST['delete'])){
26 if(!file_exists($_SESSION['sLoggedDir'].'del')){
27 chdir($_SESSION['sLoggedDir']);
31 if(is_dir($_SESSION['sLoggedDir'].'del')){
32 $delete = $_POST['delete'].".dat";
33 if(file_exists($_SESSION['sLoggedDir'].$delete)){
34 rename($_SESSION['sLoggedDir'].$delete, $_SESSION['sLoggedDir'].'del/'.$delete);
35 $_SESSION['msg'] = "<div class=\"alert alert-danger\">Message has been successfully deleted.</div>";
36 header('Location: '.$livesitePath.'inbox.php');
39 $_SESSION['msg'] = "<div class=\"alert alert-danger\">Doesn't Exists</div>";
40 header('Location: '.$livesitePath.'inbox.php');
48 <div
class="well well-sm pad3">
50 <?php
require 'include/nav.php' ?
>
53 <!-- <div
class="pad panel panel-default sp fxmrgn b "> -->
54 <!--Showing messages
-->
57 $inbox = new inboxRead();
58 $files = $inbox->getInbox();
62 echo "<div class=\"alert alert-danger\" id=\"delmsg\" style=\"display:none;\">
63 Are you sure you want to delete the conversation?
64 <input type=\"submit\" class=\"btn btn-default btn-sm\" id=\"deleteM\" value=\"Delete\"name=\"block\">
65 <input type=\"button\" class=\"btn btn-default btn-sm\" value=\"Cancel\" name=\"cancel\" onclick=\"document.getElementById('delmsg').style.display='none';\">
69 <!-- List of messages
-->
70 <div id
="page" class="pagination2" >
72 <ul
class="list-group" id
="list">
74 if(!empty($_SESSION['msg'])){
75 echo $_SESSION['msg'];
76 $_SESSION['msg'] = '';
79 foreach($files as $filename){
80 $value = $init->getContent($filename);
81 $from = $init->within_str($value[0], "<from>", "</from>");
82 $to = $init->within_str($value[0], "<to>", "</to>");
83 $id = $init->within_str(max($value), "<id>", "</id>");
84 $subj = $init->within_str($value[0], "<subj>", "</subj>");
85 $read = $init->within_str($value[0], "<read>", "</read>");
86 $msg = $init->within_str($value[0], "<msg>", "</msg>");
88 $array[$filename] = array("id" => $id, "subj" =>$subj, "read"=>$read, "msg"=>$msg ,"from" => $from, "to" => $to, );
93 // sort associative array
94 $array = $init->array_sort($array, 'id', SORT_DESC
);
99 foreach ($array as $key => $value) {
100 if (trim(urldecode($value["from"])) == trim($uid)) {
101 $ucode = urldecode($value["to"]);
103 $ucode = urldecode($value["from"]);
105 $ucode = $init->FindUser($ucode,$id_mail_path);
106 $ucode = trim($init->GetImgTrip($ucode));
107 $ucode = explode("\n", $ucode);
108 $uimg = trim($ucode[5]);
109 if (isset($ucode[7]) && ($ucode[7] != NULL ||
$ucode[7] != "")) {
114 $url = substr($key, 0,-4);
115 $ff = urldecode($value["subj"]);
117 if($init->countMessage($key) > 0 ){
118 $unreadMessage = "<span class='badge pull-right'>{$init->countMessage($key)}</span>";
124 // $unreadCounter = ($init->within_str(max($value), "<read>", "</read>")==1) ? 'read' : 'unread' ;
126 echo "<li class='list-group-item ".$class."' style=\"overflow:auto !important;\">
127 <div class='media panel6'>
130 <div class=\"dropdown pull-right\">
131 <a data-toggle=\"dropdown\" href=\"#\"><span class=\"caret\"></span></a>
133 <ul class=\"dropdown-menu dropdown-menu-right cuzdropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">
135 <form method=\"POST\" class='deleteForm'>
136 <input type='hidden' name='delete' value='{$url}'>
137 <small><a href='#' class='destroy'>Delete</a></small>
141 </ul><div class=\"clearfix\"></div>
151 <a class='pull-left' href='#'>
153 <img class='pic2' src=\"".$livesitePath2."/ico/{$uimg}\" >
156 <div class='media-body'>
158 <a href='message.php?d={$url}' class='pull-left'>
159 <h5 class='media-heading'>{$utrip}</h5>
160 <div class='limit'>{$ff}</div>
164 </div><!--media-body-->
174 </div
><!--hide
/"" pagination
-->
175 </div
><!--pad panel panel
-default-->
176 </div
><!--well well
-lg
-->
179 require 'include/footer.php';