?> <tr class="<?php echo $count % 2 == 1 ? 'odd' : 'even'; ?> "> <td class="firstcol"> <?php if ($current_user_edit_perm) { echo '<a href="?ctrl=user&user_tab=profile&user_ID=' . $affected_User->ID . '"><strong>' . $affected_User->login . '</strong></a>'; } else { echo '<strong>' . $affected_User->login . '</strong>'; } ?> </td> <td><?php echo $affected_User->first_name(); ?> </td> <td><?php echo $affected_User->last_name(); ?> </td> <td><?php echo $affected_User->nick_name(); ?> </td> <td><?php echo '<strong>' . $affected_User->get('url') . '</strong>'; ?> </td> </tr>
public function postSendtoUser() { $business_id = Message::getBusinessIdByMessageId(Input::get('message_id')); if (Helper::isPartOfBusiness($business_id, Helper::userId())) { $timestamp = time(); if (Input::get('preview_type') == 'other') { $thread_key = Message::getThreadKeyByMessageId(Input::get('message_id')); $data = json_decode(file_get_contents(public_path() . '/json/messages/' . $thread_key . '.json')); $data[] = array('timestamp' => $timestamp, 'contmessage' => Input::get('messageContent'), 'attachment' => Input::get('attachment'), 'sender' => 'user'); $data = json_encode($data); file_put_contents(public_path() . '/json/messages/' . $thread_key . '.json', $data); return json_encode(array('timestamp' => date("Y-m-d h:i A", $timestamp))); } else { /* * ARA removed sms sending if (Input::get('sendbyphone')) { $business_name = Business::name(Input::get('business_id')); $text_message = 'From: ' . $business_name . "\n" . 'To: ' . Input::get('phonenumber') . "\n" . Input::get('messageContent') . "\n\nThanks for using FeatherQ"; Notifier::sendFrontlineSMS($text_message, Input::get('phonenumber'), FRONTLINE_SMS_URL, FRONTLINE_SMS_SECRET); } */ if (!Input::get('message_id')) { if (Input::get('business_id') && Input::get('email')) { $business_id = Input::get('business_id'); $email = Input::get('email'); $thread_key = $this->threadKeyGenerator($business_id, $email); Message::createThread(array('contactname' => User::first_name(Auth::user()->user_id) . ' ' . User::last_name(Auth::user()->user_id), 'business_id' => $business_id, 'email' => $email, 'thread_key' => $thread_key)); } } else { $thread_key = Message::getThreadKeyByMessageId(Input::get('message_id')); $data = json_decode(file_get_contents(public_path() . '/json/messages/' . $thread_key . '.json')); } $attachment = Input::get('attachment'); $data[] = array('timestamp' => $timestamp, 'contmessage' => Input::get('messageContent'), 'attachment' => $attachment, 'sender' => 'business'); $data = json_encode($data); file_put_contents(public_path() . '/json/messages/' . $thread_key . '.json', $data); /* $business_name = Business::name(Message::getBusinessIdByMessageId(Input::get('message_id'))); $subject = 'Message From ' . $business_name; if (Input::get('attachment')) { $attachment = '<br><br><a href="' . Input::get('attachment') . '" download>Download Attachment</a>'; } Notifier::sendEmail(Input::get('contactemail'), 'emails.messaging', $subject, array( 'messageContent' => Input::get('messageContent') . $attachment, 'businessName' => $business_name, )); */ return json_encode(array('timestamp' => date("Y-m-d h:i A", $timestamp))); } } else { return json_encode(array('messages' => 'You are not allowed to access this function.')); } }