public function getreplycomments() { $comment_id = Input::get('comment_id'); $user_id = Input::get('user_id'); $getreplycnt = replycommentModel::where('comment_id', $comment_id)->get()->count(); if ($getreplycnt) { $getreply = replycommentModel::select('user.username', 'user.firstname', 'user.lastname', 'user.profilepicture', 'replycomment.comment_id', 'replycomment.replycomment', 'replycomment.user_id')->where('comment_id', $comment_id)->LeftJoin('user', 'user.ID', '=', 'replycomment.user_id')->get(); for ($i = 0; $i < count($getreply); $i++) { if ($getreply[$i]['firstname'] != '') { $getreply[$i]['name'] = $getreply[$i]['firstname'] . ' ' . $getreply[$i]['lastname']; } else { $getreply[$i]['name'] = $getreply[$i]['username']; } if ($getreply[$i]['profilepicture'] != '') { $getreply[$i]['profilepicture'] = url() . '/public/assets/upload/profile/' . $getreply[$i]['profilepicture']; } } $Response = array('success' => '1', 'message' => 'Reply Fetched Successfully', 'msgcode' => "c163"); $final = array("response" => $Response, "replydata" => $getreply); return json_encode($final); } else { $Response = array('success' => '0', 'message' => 'No reply Comments Available in this record', 'msgcode' => "c164"); $final = array("response" => $Response); return json_encode($final); } }
public function takeactionforreport() { $contestparticipantid = Input::get('contestparticipantid'); $contest_id = Input::get('contest_id'); $contest_partipant_id = Input::get('contest_partipant_id'); if ($contestparticipantid != '') { $comment = commentModel::select('id')->where('contest_participant_id', $contestparticipantid)->get(); for ($i = 0; $i < count($comment); $i++) { $replycmt = replycommentModel::where('comment_id', $comment[$i]['id'])->get()->count(); if ($replycmt) { replycommentModel::where('comment_id', $comment[$i]['id'])->delete(); } } if (count($comment)) { commentModel::select('id')->where('contest_participant_id', $contestparticipantid)->delete(); } $votingcnt = votingModel::where('contest_participant_id', $contestparticipantid)->get()->count(); if ($votingcnt) { votingModel::where('contest_participant_id', $contestparticipantid)->delete(); } $participantid = contestparticipantModel::where('ID', $contestparticipantid)->get()->count(); if ($participantid) { $delete = contestparticipantModel::where('ID', $contestparticipantid)->delete(); $data['message'] = 'That Contest participant details removed successfully'; } else { $data['message'] = 'That Contest participant details already removed'; } $reportflagcnt = reportflagModel::where('contest_participant_id', $contestparticipantid)->get()->count(); $inputdetails['action_taken'] = 1; if ($reportflagcnt) { reportflagModel::where('contest_participant_id', $contestparticipantid)->update($inputdetails); } if ($contest_partipant_id == "") { return Redirect::to('contest_info/' . $contest_id)->with('data', $data)->with('tab', 'gallery'); } else { $data['message'] = 'Action taken for this report'; return Redirect::to('reportlist')->with('data', $data); } } }
public function getreplycomments() { $comment_id = Input::get('comment_id'); $user_id = Input::get('user_id'); $getreplycnt = replycommentModel::where('comment_id', $comment_id)->get()->count(); if ($getreplycnt) { $getreply = replycommentModel::where('comment_id', $comment_id)->get(); $Response = array('success' => '0', 'message' => 'Reply Fetched Successfully'); $final = array("response" => $Response, "replydata" => $getreply); return json_encode($final); } else { $Response = array('success' => '0', 'message' => 'No reply Comments Available in this record'); $final = array("response" => $Response); return json_encode($final); } }