public function get_ListOfFiles_Search_with_details($userId = 0, $OnDay, $room_id = 0, $uploadBy = '') { if (!$userId) { $userId = $_SESSION['empl_id']; } $MU = new ManageUsers(); $MU->userId = $userId; $start_time_fixed = $OnDay . ' 00:00:00'; $end_time_fixed = $OnDay . ' 23:59:59'; $start_time_GMT = $MU->convert_from_UsersTimeZone($start_time_fixed); $end_time_GMT = $MU->convert_from_UsersTimeZone($end_time_fixed); $chatRoom_Condition = $room_id ? " and tbl_ChatRooms.chatRoom='{$room_id}' " : " and tbl_ChatRooms.chatRoom IN (select rid from tbl_RoomPrivilages where uid='{$userId}') "; //return executesql_returnStrictArray("select tbl_chatFiles.*, tbl_ChatRooms.* from tbl_chatFiles, tbl_ChatRooms where tbl_ChatRooms.fileId = tbl_chatFiles.fileId and (tbl_ChatRooms.msgtime between '{$start_time_GMT}' and '{$end_time_GMT}') $chatRoom_Condition "); $this_query = "select * from tbl_chatFiles, tbl_ChatRooms where tbl_ChatRooms.fileId = tbl_chatFiles.fileId and (tbl_ChatRooms.msgtime between '{$start_time_GMT}' and '{$end_time_GMT}') {$chatRoom_Condition} "; $result = mysql_query($this_query); while ($row = mysql_fetch_array($result)) { $converted_date = $MU->convert_to_UsersTimeZone($row['msgtime']); $NEW_FILES[] = array('fileid' => $row['fileId'], 'msgBy' => $row['saidBy_username'], 'msgTime' => $converted_date, 'filename' => $row['fileName'], 'fileRandomName' => $row['fileRandomName'], 'fileExt' => $row['fileExt'], 'filesize' => $row['fileSize']); } return array('NEW_FILES' => $NEW_FILES); }