get('from_id') && $request->get('from_id') <> 'undefined'){ $data = $db->query("select distinct notice_messages.message, notice_messages.chat_type, notice_messages.from_id, notice_messages.file_name, notice_messages.mime, created_on, notice_members.id, notice_members.message_id, notice_members.status, notice_members.to_id FROM notice_messages join notice_members on notice_messages.message_id = notice_members.message_id WHERE notice_messages.chat_type = 3 and ((notice_members.to_id = 1 and notice_messages.from_id = ".$request->get('from_id').") or (notice_members.to_id = ".$request->get('from_id')." and notice_messages.from_id = 1)) and notice_members.id >". $id ); $counts = 0; $html = ""; if(count($data) > 0){ foreach ($data as $key => $value) { if(date("Y-m-d", strtotime($request->get('last_date'))) <> date("Y-m-d", strtotime($value['created_on']))) { if($counts == 0){ $counts = 1; $prev_date = date("Y-m-d", strtotime($value['created_on'])); $html .= '
  • ' . date("F j, Y", strtotime($value['created_on'])) . '
  • '; } } if(date("Y-m-d", strtotime($request->get('last_date'))) <> date("Y-m-d", strtotime($value['created_on']))) { if (date("Y-m-d", strtotime($prev_date)) <> date("Y-m-d", strtotime($value['created_on']))){ $prev_date = date("Y-m-d", strtotime($value['created_on'])); $html .= '
  • ' . date("F j, Y", strtotime($value['created_on'])) . '
  • '; } } if($value["from_id"] == "1" && $value["to_id"] == $request->get('from_id')){ $class="out"; }else{ $class="in"; $data = $db->query("UPDATE notice_members SET status = 1 WHERE id = '". $value['id'] . "'"); } $html .= '
  • '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '.$value['message']; $html .= '
    '.($value['from_id'] == 1 ? "Bot" : getProfileData($value["from_id"], "first_name"))." at ".date("H:i", strtotime($value['created_on'])).''.'
    '; $html .= '
    '; $html .= '
  • '; } echo $html; } } ?>