?> <?php } ?> </div> </td> <td align="left" valign="top"> <div id="edit_url"> <span>File Name: </span><?php echo $FILEINFO['fileName']; ?> </div> <div id="edit_url"> <span>Size: </span><?php echo formatBytesToHumanReadable($FILEINFO['fileSize']); ?> </div> <div id="edit_url"> <span>Uploaded by: </span><?php echo $FileUploadInfo['uploadedBy']; ?> </div> <div id="edit_url"> <span>Uploaded Date: </span><?php echo caldateTS_to_humanWithTS($FileUploadInfo['uploadedDate']); ?> </div> </td>
<p id="files_result" style="display:none; color:red; font-size:14px;"></p> <div id="search"> <input type='text' class='date_input' size=12 id='files_date'><input type="button" id="Go" name="Go" value="Go" onclick="searchFiles()" /> </div> <div id='BOOKMARKSLIST'> <?php $MF = new ManageFiles(); $LASTX_FILES_SQL = $MF->get_Last_XFiles_RelatedToUser_fullDetails_sql($CURRENT_USERID, 200); $result = mysql_query($LASTX_FILES_SQL); while ($row = mysql_fetch_array($result)) { $FUPLOAD_INFO = $MF->getChatFileUploadInfo($row['fileId']); // fileId, fileName, fileRandomName, fileExt, fileSize, fileCode, fileType $tmp_preview_str = "<div style='margin-top: 10px; padding: 10px; background-color: #F1F4E3; border-bottom: 2px solid #E7E7E7; text-align:left; display: table; width: 96%;'>"; $tmp_preview_str .= "<div style='float:left; line-height:150%;'><a href=\"chatfiledownload.php?fc={$row['fileId']}\">{$row['fileName']}</a>"; if (in_array($row['fileExt'], array('jpg', 'png', 'gif', 'bmp', 'jpeg', 'pjpeg'))) { $tmp_preview_str .= "<br/><a href=\"chatfiledownload.php?fc={$row['fileId']}\"><img src=files/chat_files/thumbs/{$row['fileRandomName']}></a>"; } $tmp_preview_str .= "</div>"; $tmp_preview_str .= "<div style='float:right;color: #C7AD8B; margin-right: 10px;'>" . caldateTS_to_humanWithTS($GMU->convert_to_UsersTimeZone($FUPLOAD_INFO['uploadedDate'])) . "</div>"; $tmp_preview_str .= "<div style='float:right; color: #C7AD8B; margin-right: 10px;'>- {$FUPLOAD_INFO['uploadedBy']}</div>"; $tmp_preview_str .= "<div style='float:right; color: #C7AD8B; margin-right: 10px;'>" . formatBytesToHumanReadable($row['fileSize']) . "</div>"; $tmp_preview_str .= "</div>"; echo $tmp_preview_str; } ?> </div> </center> <?php include_once "include_footer.php";
public function get_attachments($workID, $asDiv = true) { $result = mysql_query("select Id as attachId, uploadname, filesize , uploadedby, uploadedOn from attachments where workid='{$workID}'"); if (@mysql_num_rows($result) == 0) { return ''; } if ($asDiv) { $str = "<div id='fileAttachments_container'>"; } else { $str = "<TR><TD valign=top align=right><span style=\"color: #3D4399; padding:1px; margin-right: 5px;font-weight:bold;\">Attachments: </span></TD><TD class='fileAttachments_container'>"; } $target_path = "./attachments/" . $_SESSION["subdomain"] . "/"; while ($row = mysql_fetch_assoc($result)) { // $row['attachId'] , $row['uploadname'] if ($asDiv) { $str .= "<div class='filename' attachId=\"" . $row['attachId'] . "\">" . $row['uploadname'] . "</div>"; } else { $thisfilesize = formatBytesToHumanReadable($row['filesize']); $str .= "<div style='padding:3px;'>"; $str .= "<span class='filename' attachId=\"" . $row['attachId'] . "\">" . $row['uploadname'] . "</span>"; $str .= "<span> {$thisfilesize} by {$row['uploadedby']} - " . caldateTS_to_humanWithTS($row['uploadedOn'], true) . "</span>"; $str .= "</div>"; } } $str .= $asDiv ? "</div>" : "</TD></TR>"; return $str; }
public function get_Archives_fromRoom($date, $roomId, $UserId) { $this_query = ''; $NEW_MESSAGES = array(); $MU = new ManageUsers(); $MU->userId = $UserId; $TMP_MF = new ManageFiles(); if (!$MU->has_AccessToRoom($roomId)) { return; } list($stDay, $stMonth, $stYear) = explode("-", $date); $start_time = $stYear . '-' . $stMonth . '-' . $stDay . ' 00:00:00'; $end_time = $stYear . '-' . $stMonth . '-' . $stDay . ' 23:59:59'; $GMT_start_time = $MU->convert_from_UsersTimeZone($start_time); $GMT_end_time = $MU->convert_from_UsersTimeZone($end_time); $this_query = "SELECT * FROM tbl_ChatRooms WHERE chatRoom='{$roomId}' AND msgtime between '{$GMT_start_time}' and '{$GMT_end_time}'"; $result = mysql_query($this_query); while ($row = mysql_fetch_array($result)) { $LASTFETCHEDMSGID = $row['msgid']; $converted_date = $MU->convert_to_UsersTimeZone($row['msgtime']); if ($row['msgType'] == 'F') { $fileInfo = $TMP_MF->get_file_Info($row['fileId'], $UserId); $tmp_preview_str = "{$row['saidBy_username']} has uploaded a file <a href='chatfiledownload.php?fc={$fileInfo['fileId']}'>{$fileInfo['fileName']}</a> <span style='color: #A9A9A9;'>" . formatBytesToHumanReadable($fileInfo['fileSize']) . "</span> <a rel='prettyPhoto[iframes]' href='filemail.php?fid={$fileInfo['fileId']}&iframe=true&width=800&height=400'>Email</a>"; if (in_array($fileInfo['fileExt'], array('jpg', 'jpeg', 'gif', 'png', 'bmp'))) { $tmp_preview_str .= "<br/><img src=files/chat_files/thumbs/{$fileInfo['fileRandomName']}>"; } $row['message_base64'] = base64_encode($tmp_preview_str); } if ($row['msgType'] == 'L') { $row['msgid'] = 0; } if ($row['msgType'] == 'E') { $row['msgid'] = 0; $tmp_preview_str = $row['message_plain_mysqlescaped']; $row['message_base64'] = base64_encode($tmp_preview_str); } $NEW_MESSAGES[] = array('msgid' => $row['msgid'], 'msgBy' => $row['saidBy_username'], 'msgTime' => $converted_date, 'msg_base64' => $row['message_base64'], 'bookmark' => $row['bkm_id'], 'msgType' => $row['msgType']); } return array('NEW_MESSAGES' => $NEW_MESSAGES, 'LASTFETCHEDMSGID' => $LASTFETCHEDMSGID); }
<center> <div style='margin-left: auto; margin-right: auto; margin:2px; font-size: 110%; font-weight: bold; padding: 10px; width: 82%;'>List of Recent BookMarks</div> <div id='BOOKMARKSLIST'> <?php $MB = new ManageBookMarks(); $LASTX_BOOKMARKS_SQL = $MB->get_LastX_BookMarks_query($CURRENT_USERID, 200); $result = mysql_query($LASTX_BOOKMARKS_SQL); $MCR = new ManageChatRooms(); while ($row = mysql_fetch_array($result)) { $tmp_preview_str = "<div style='margin-top: 10px; padding: 10px; background-color: #F1F4E3; border-bottom: 2px solid #E7E7E7; text-align:left; display: table; width: 96%;' id='{$row['bkm_msgId']}'>"; if ($row['msgType'] == 'F') { $TMP_MF = new ManageFiles(); $d_fileId = $row['fileId']; $fileInfo = $TMP_MF->get_file_Info($d_fileId, $CURRENT_USERID); $tmp_preview_str .= "<div class='umsg' style='float:left; line-height:150%;'>" . USERID_TO_USERNAME($row['saidBy_empl_id']) . " has uploaded a file <a href='chatfiledownload.php?fc={$fileInfo['fileId']}'>{$fileInfo['fileName']}</a> <span style='color: #A9A9A9;'>" . formatBytesToHumanReadable($fileInfo['fileSize']) . "</span> <a rel='prettyPhoto[iframes]' href='filemail.php?fid={$fileInfo['fileId']}&iframe=true&width=800&height=400'>Email</a>"; if (in_array($fileInfo['fileExt'], array('jpg', 'jpeg', 'gif', 'png', 'bmp'))) { $tmp_preview_str .= "<br/><img src=files/chat_files/thumbs/{$fileInfo['fileRandomName']}>"; } $tmp_preview_str .= "</div>"; } else { // bkm_id, bkms.bkm_msgId, bkms.bkm_dmsgid, bkms.bkm_roomId, cRoom.message_base64 $tmp_preview_str .= "<div style='float:left; line-height:150%;'>" . USERID_TO_USERNAME($row['saidBy_empl_id']) . ": " . base64_decode($row['message_base64']) . "</div>"; } $tmp_preview_str .= "<div style='float:right;'><img src='images/bookmark.png' class='bmarkstar' msgid='{$row['bkm_msgId']}' rid='{$row['bkm_roomId']}' ></div>"; $tmp_preview_str .= "<div style='float:right; color: #C7AD8B; margin-right: 10px;'> " . $MCR->get_roomTitle($row['bkm_roomId']) . "</div>"; $tmp_preview_str .= "</div>"; echo $tmp_preview_str; } ?> </div>
</tr> <?php $sqlquery = "select Id as fileID, workid, uploadname, uploadedOn, filesize from attachments order by uploadedOn DESC"; $query = mysql_query($sqlquery) or die("Invalid query: " . mysql_error()); while ($row = @mysql_fetch_array($query)) { extract($row); // fileID, workid , uploadname, uploadedOn, filesize ?> <tr> <td align=left> <?php echo "<A href='getattachment.php?attachId={$fileID}'>{$uploadname}</A>"; ?> </td> <td align=right><?php echo formatBytesToHumanReadable($filesize); ?> </td> <td><span style='margin-left: 25px;'><?php echo caldateTS_to_humanWithOutTS($uploadedOn); ?> </span></td> <td align=center><A href='#' onclick="ManageTasksJsFunction.detailsWork('<?php echo $workid; ?> ')"><?php echo $workid; ?> </A></td> </tr> <?php