public function getcommentsdetails()
 {
     $userid = Input::get('userid');
     $contest_participant_id = Input::get('contest_participant_id');
     /// Verifying the followers
     $contestdetailscount = contestparticipantModel::where('ID', $contest_participant_id)->get()->count();
     $contestdetails = contestparticipantModel::where('ID', $contest_participant_id)->get()->toArray();
     $contestparticipantid = $contestdetails[0]['user_id'];
     $followers = followModel::where('userid', $userid)->where('followerid', $contestparticipantid)->get()->count();
     //// Get Comments
     $getcommentscount = commentModel::where('contest_participant_id', $contest_participant_id)->get()->count();
     if ($getcommentscount) {
         $getcomments = commentModel::select('comments.id as comment_id', 'comments.contest_participant_id', 'comments.comment', 'user.ID as userid', 'user.firstname', 'user.lastname', 'user.username', 'user.profilepicture')->where('comments.contest_participant_id', $contest_participant_id)->LeftJoin('user', 'user.ID', '=', 'comments.userid')->get();
         for ($i = 0; $i < count($getcomments); $i++) {
             if ($getcomments[$i]['firstname'] != '') {
                 $getcomments[$i]['name'] = $getcomments[$i]['firstname'] . ' ' . $getcomments[$i]['lastname'];
             } else {
                 $getcomments[$i]['name'] = $getcomments[$i]['username'];
             }
             if ($getcomments[$i]['profilepicture'] != '') {
                 $getcomments[$i]['profilepicture'] = url() . '/public/assets/upload/profile/' . $getcomments[$i]['profilepicture'];
             }
         }
         /*DB::select("SELECT user.*,DATE_FORMAT(CONVERT_TZ(`dateofbirth`,'+00:00','$timezone'),'%Y-%m-%d') as converteddateofbirth  FROM user WHERE ID =$userid");
         	
         	 $getcomments = commentModel::select('comments.id as comment_id','comments.contest_participant_id','comments.comment','user.ID as userid','user.firstname','user.profilepicture' )
         	->where('comments.contest_participant_id',$contest_participant_id)
         	->LeftJoin('user','user.ID','=','comments.userid')->get();
         	*/
         $Response = array('success' => '1', 'message' => 'Getting Comments details', 'msgcode' => "c132");
         $final = array("response" => $Response, "Comments" => $getcomments, "followers" => $followers);
         return json_encode($final);
     } else {
         $Response = array('success' => '0', 'message' => 'No Comments Available in this Contest participant', 'msgcode' => "c133");
         $final = array("response" => $Response, "followers" => $followers);
         return json_encode($final);
     }
     /*return replycommentModel::select('replycomment.id', 'comments.id as comment_id','comments.contest_participant_id','replycomment.replycomment','comments.comment' )
     	->RIGHTJOIN('comments','comments.id','=','replycomment.comment_id')
     	->where('comments.contest_participant_id',$contest_participant_id)->get();
     */
 }
Esempio n. 2
0
 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);
         }
     }
 }
Esempio n. 3
0
                        <a href="{{ URL::to('contesttab?contest_id='.$contest_id.'&contest_partipant_id='.$viewcommentforparticipant) }}" class="ib-close" >Close</a>
                        <h1>{{ $contestdetails[0]['contest_name']}}</h1>
                        <div class="cont_det_con">

                            <div class="cont_des_con">

                                {{ isset($Massage)?"<p style='color:red;text-align:center'>".$Massage."</p>":""}}

                                <strong>Contest Comment</strong>
                                <input type="hidden" class="contest_participant_id" value="<?php 
    echo $viewcommentforparticipant;
    ?>
" >

    <?php 
    $commentcnt = commentModel::select('comments.id as comment_id', 'comments.userid as commentuserid', 'comments.comment', 'user.profilepicture', 'user.firstname', 'user.lastname', 'user.username')->LeftJoin('user', 'user.ID', '=', 'comments.userid')->where('contest_participant_id', $viewcommentforparticipant)->get();
    for ($i = 0; $i < count($commentcnt); $i++) {
        ?>

                                    <table width="98%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td align="left">
                                                <div>
                                                    <textarea  id="cmt" name="cmt" value="" class="full_cmt rud_gry" disabled>{{ $commentcnt[$i]['comment'] }}</textarea>
                                                    <input type="button" value="Reply" class="cmt_btn reply_div" id="showdiv_<?php 
        echo $i;
        ?>
"   >
                                                </div>
                                            </td>
                                            <td width="1%"></td>