public function find_subscribers(Request $request, $id) { //ищем подписчиков $user_name = Auth::user(); $subscribers_find; $no_subscribers = null; $tmp_segment = Segment::where('id', '=', $id)->first(); if (isset($tmp_segment) && $tmp_segment != null) { $tmp_user_site = Users_site::where('id', '=', $tmp_segment['domen_id'])->where('user_id', '=', $user_name['id'])->get(); } else { $no_subscribers = "Подпичик не найден"; } if (isset($tmp_user_site) && $tmp_user_site != null) { $subscribers_find = Subscribers::where('email', '=', $request->search)->where('segment_id', '=', $id)->first(); } else { $no_subscribers = "Подписчик не найден"; } if (!isset($subscribers_find)) { $no_subscribers = "Подписчик не найден"; } return redirect()->back()->with('subscribers_find', $subscribers_find)->with('not_found', $no_subscribers); }
echo '<td> - </td>'; echo '<td><a class="subscribers__update">Нет действий</a></td>'; echo '</tr>'; } else { if (isset($subscribers_find)) { echo '<tr>'; echo '<td>' . $subscribers_find->name . ' ' . $subscribers_find->surname . '</td>'; echo '<td>' . $subscribers_find->email . '</td>'; echo '<td>' . Subscriber_status::where('id', '=', $subscribers_find->status_id)->first()->status_name . '</td>'; echo '<td><a href="/dashboard/get_subscriber/' . $subscribers_find->id . '/' . $current_segment . '" class="subscribers__update">Редактировать</a></td>'; echo '</tr>'; } else { if (isset($subscribers_change_status) && $subscribers_change_status != null) { $subscribes = Subscribers::where('segment_id', '=', $current_segment)->where('status_id', '=', $subscribers_change_status)->paginate($pagination_number); } else { $subscribes = Subscribers::where('segment_id', '=', $current_segment)->paginate($pagination_number); } foreach ($subscribes as $value) { echo '<tr>'; echo '<td>' . $value->name . ' ' . $value->surname . '</td>'; echo '<td>' . $value->email . '</td>'; echo '<td>' . Subscriber_status::where('id', '=', $value->status_id)->first()->status_name . '</td>'; echo '<td><a href="/dashboard/get_subscriber/' . $value->id . '/' . $current_segment . '" class="subscribers__update">Редактировать</a></td>'; echo '</tr>'; } } } ?> </tbody> </table> <div class="row">