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);
     }
 }
Пример #2
0
        echo $commentcnt[$i]['comment_id'];
        ?>
 >
                                        <textarea  id="cmt_<?php 
        echo $i;
        ?>
" name="cmt" value="" class="full_cmt" placeholder="Reply for the comment"></textarea>

                                        <input type="button" value="Submit" id="replycmt_<?php 
        echo $i;
        ?>
" class="cmt_btn submit replycmtsub"  >
                                    </div>
        <?php 
        $replycmtcnt = replycommentModel::select('user.profilepicture', 'user.firstname', 'user.lastname', 'user.username', 'replycomment.replycomment')->where('comment_id', $commentcnt[$i]['comment_id'])->LeftJoin('user', 'user.ID', '=', 'replycomment.user_id')->get()->count();
        $replycmt = replycommentModel::select('user.profilepicture', 'user.firstname', 'user.lastname', 'user.username', 'replycomment.replycomment')->where('comment_id', $commentcnt[$i]['comment_id'])->LeftJoin('user', 'user.ID', '=', 'replycomment.user_id')->get();
        if ($replycmtcnt) {
            for ($j = 0; $j < count($replycmt); $j++) {
                ?>


                                            <table width="98%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="70" align="center" style="background:url(img/reply_right.png) no-repeat top right; min-width:70px;"><img src="{{ ($replycmt[$j]['profilepicture']!='')?(URL::to('public/assets/upload/profile/'.$replycmt[$j]['profilepicture'])):(URL::to('assets/inner/images/avator.png')) }}" width="50" height="50" class="roundedimg brd_grn"><br>
                                                        <div class="cmt_uname radius"><?php 
                if ($replycmt[$j]['firstname'] == '') {
                    echo $replycmt[$j]['username'];
                } else {
                    echo $replycmt[$j]['firstname'] . ' ' . $replycmt[$j]['lastname'];
                }
                ?>