Пример #1
0
 public function unfollowforweb()
 {
     $data = $_GET['followerid'];
     $userid = $_GET['user_id'];
     $followtab = $_GET['followtab'];
     $followers = followModel::where('userid', $userid)->where('followerid', $data)->delete();
     if ($followers) {
         if ($followtab == 'following') {
             $userid = $userid;
         } else {
             $userid = $data;
         }
         return Redirect::to("other_profile/" . $userid)->with('tab', $followtab)->with('Message', 'You are unfollowing that user');
     }
 }
Пример #2
0
 public function userdelete()
 {
     $userid = $_GET['userid'];
     /// Comment delete //////////
     $cmtcnt = commentModel::select('id')->where('userid', $userid)->get();
     for ($i = 0; $i < count($cmtcnt); $i++) {
         $replycnt = replycommentModel::where('comment_id', $cmtcnt[$i]['id'])->get()->count();
         if ($replycnt) {
             replycommentModel::where('comment_id', $cmtcnt[$i]['id'])->delete();
         }
     }
     /// REply comt delete /////
     $replycmtcnt = replycommentModel::where('user_id', $userid)->get()->count();
     if ($replycmtcnt) {
         replycommentModel::where('user_id', $userid)->delete();
     }
     /// Contest delete/////
     $contestcnt = contestModel::select('ID')->where('createdby', $userid)->get();
     for ($k = 0; $k < count($contestcnt); $k++) {
         $conpartdet = contestparticipantModel::select('ID')->where('contest_id', $contestcnt[$k]['ID'])->get();
         for ($p = 0; $p < count($conpartdet); $p++) {
             $cmtcnt = commentModel::where('contest_participant_id', $conpartdet[$p]['ID'])->delete();
             votingModel::where('contest_participant_id', $conpartdet[$p]['ID'])->delete();
         }
         $contestintrdlet = contestinterestModel::where('contest_id', $contestcnt[$k]['ID'])->delete();
         invitefollowerforcontestModel::where('contest_id', $contestcnt[$k]['ID'])->delete();
         invitegroupforcontestModel::where('contest_id', $contestcnt[$k]['ID'])->delete();
         leaderboardModel::where('contest_id', $contestcnt[$k]['ID'])->delete();
         privateusercontestModel::where('contest_id', $contestcnt[$k]['ID'])->delete();
         contestModel::where('createdby', $userid)->delete();
         contestparticipantModel::where('contest_id', $contestcnt[$k]['ID'])->delete();
     }
     ///Contestparticipant delete ///////////
     $contestparticipant = contestparticipantModel::where('user_id', $userid)->get();
     for ($p = 0; $p < count($contestparticipant); $p++) {
         $cmtcnt = commentModel::where('contest_participant_id', $contestparticipant[$p]['ID'])->delete();
         votingModel::where('contest_participant_id', $contestparticipant[$p]['ID'])->delete();
     }
     ///////////////Group //////////////////
     $group = groupModel::select('ID')->where('createdby', $userid)->get();
     if (count($group) > 0) {
         groupmemberModel::where('group_id', $group[0]['ID'])->delete();
         invitegroupforcontestModel::where('group_id', $group[0]['ID'])->delete();
         invitememberforgroupModel::where('group_id', $group[0]['ID'])->delete();
     }
     contestparticipantModel::where('user_id', $userid)->delete();
     followModel::where('userid', $userid)->delete();
     followModel::where('followerid', $userid)->delete();
     userinterestModel::where('user_id', $userid)->delete();
     votingModel::where('user_id', $userid)->delete();
     invitememberforgroupModel::where('user_id', $userid)->delete();
     groupmemberModel::where('user_id', $userid)->delete();
     ProfileModel::where('ID', $userid)->delete();
     $er_data['message'] = 'User details deleted successfully';
     return Redirect::to('user')->with('er_data', $er_data);
 }
 public function getfollowerlistforinvitecontest()
 {
     $contest_id = Input::get('contest_id');
     $userid = contestModel::select('createdby')->where('ID', $contest_id)->get();
     $userid = $userid[0]['createdby'];
     $followers = followModel::where('followerid', $userid)->select('followers.id as followerprimaryid', 'user.profilepicture', 'user.firstname', 'user.lastname', 'user.username', 'user.ID as followerid', 'followers.followerid as followid')->leftJoin('user', 'user.ID', '=', 'followers.userid')->get();
     for ($k = 0; $k < count($followers); $k++) {
         $invitecnt = invitefollowerforcontestModel::where('follower_id', $followers[$k]['followerid'])->where('contest_id', $contest_id)->get()->count();
         if ($invitecnt == 1) {
             $followers[$k]['invite'] = $invitecnt;
         } else {
             $followers[$k]['invite'] = 0;
         }
         if ($followers[$k]['firstname'] != '') {
             $followers[$k]['name'] = $followers[$k]['firstname'] . ' ' . $followers[$k]['lastname'];
         } else {
             $followers[$k]['name'] = $followers[$k]['username'];
         }
         if ($followers[$k]['profilepicture'] != '') {
             $followers[$k]['profilepicture'] = url() . '/public/assets/upload/profile/' . $followers[$k]['profilepicture'];
         }
     }
     $Response = array('success' => '1', 'message' => 'Followers  List', 'msgcode' => "c173");
     $final = array("response" => $Response, "followerlist" => $followers);
     return json_encode($final);
 }
Пример #4
0
                                    <div class="clr"></div>
                                </div>
                            </div><!-- ib-main -->
                        </div><!-- ib-main-wrapper -->
                        <!-- </div>-->
                    </div>

                                <?php 
} else {
    ////// Same tab for comments also ///////////////
    $viewcommentforparticipant;
    $participantdetails = contestparticipantModel::select('user.username', 'user.firstname', 'user.lastname', 'user.ID as usrid', 'contestparticipant.uploadfile', 'contestparticipant.uploadtopic', 'contestparticipant.dropbox_path')->LeftJoin('user', 'user.ID', '=', 'contestparticipant.user_id')->where('contestparticipant.ID', $viewcommentforparticipant)->get();
    $contestdetails = contestModel::select('contest_name', 'themephoto', 'contesttype')->where('ID', $contest_id)->get();
    $authusrid = Auth::user()->ID;
    $participantusrid = $participantdetails[0]['usrid'];
    $followercnt = followModel::where('userid', $authusrid)->where('followerid', $participantusrid)->get()->count();
    ?>
                    <div id="comments" >

                                <?php 
    /* if(Session::has('Massage')) { ?>
       <p class="alert" style="color:red;"><?php echo Session::get('Massage'); ?> </p>
       <?php} */
    ?>

                        <div class="cont_img_con radius">
    <?php 
    if ($contestdetails[0]['contesttype'] == 'p') {
        ?>
                                <img src="<?php 
        echo url() . '/public/assets/upload/contest_participant_photo/' . $participantdetails[0]['uploadfile'];
Пример #5
0
 public function creategroupinweb()
 {
     $userid = Auth::user()->ID;
     $curdate = date('Y-m-d h:i:s');
     $inputdetails['groupname'] = Input::get('groupname');
     $inputdetails['createdby'] = $userid;
     $inputdetails['createddate'] = $curdate;
     $inputdetails['grouptype'] = Input::get('grouptype');
     $inputdetails['status'] = 1;
     if (Input::file('groupimage')) {
         $inputdetails['groupimage'] = Input::file('groupimage');
         $destinationPath = 'public/assets/upload/group';
         $filename = Input::file('groupimage')->getClientOriginalName();
         $Image = str_random(8) . '_' . $filename;
         $inputdetails['groupimage'] = $Image;
     }
     $lantyp = Session::get('language');
     if ($lantyp == "") {
         $lantyp = "value_en";
     }
     $validation = Validator::make($inputdetails, groupModel::$rules);
     if ($validation->passes()) {
         if (Input::file('groupimage')) {
             $file = Input::file('groupimage');
             $uploadSuccess = $file->move($destinationPath, $Image);
         }
         $savegroup = groupModel::create($inputdetails);
         $group_id = groupModel::max('id');
         //// Group Owner add in the group member table////
         $inputgroupmember['group_id'] = $group_id;
         $inputgroupmember['user_id'] = $userid;
         $inputgroupmember['createddate'] = $curdate;
         $groupmember = groupmemberModel::create($inputgroupmember);
         ///if Followers or following checked And the group Private //////////
         ////////////
         if ($inputdetails['grouptype'] == 'private') {
             //return Input::get('follower');
             if (Input::get('follower')) {
                 $follower = followModel::select('followerid as id')->where('userid', $userid)->get();
             }
             if (Input::get('following')) {
                 $following = followModel::select('userid as id')->where('followerid', $userid)->get();
             }
             if (Input::get('follower') || Input::get('following')) {
                 if (Input::get('follower')) {
                     for ($i = 0; $i < count($follower); $i++) {
                         $id[$i] = $follower[$i]['id'];
                     }
                 }
                 if (Input::get('following')) {
                     for ($j = 0; $j < count($following); $j++) {
                         $id1[$j] = $following[$j]['id'];
                     }
                 }
                 if (Input::get('follower') != 0 && count($follower) >= 1 && Input::get('following') != 0 && count($following) >= 1) {
                     $id = array_values(array_unique(array_merge($id, $id1)));
                 } elseif (Input::get('following') != 0 && count($following) >= 1) {
                     $id = $id1;
                 } elseif (Input::get('follower') != 0 && count($follower) >= 1) {
                     $id = $id;
                 } else {
                     $id = 0;
                 }
                 $inviteinputdetails['inviteddate'] = $curdate;
                 $inviteinputdetails['group_id'] = $group_id;
                 if ($id != 0) {
                     for ($i = 0; $i < count($id); $i++) {
                         $inviteinputdetails['user_id'] = $id[$i];
                         $inviteinputdetails['invitetype'] = 'm';
                         $invite = invitememberforgroupModel::create($inviteinputdetails);
                         if ($invite) {
                             // HERE SET THE NOTIFIATION //
                         }
                     }
                 }
             }
         }
         ///////////
         if ($savegroup) {
             $languageDetails = languageModel::select($lantyp, 'ctrlCaptionId')->whereIn('value_en', ['Group Details Added successfully'])->get()->toArray();
             foreach ($languageDetails as $key => $val) {
                 $er_data['messagesave'] = "<span id='" . $val['ctrlCaptionId'] . "'>" . $val[$lantyp] . "</span>";
             }
             return Redirect::to("group")->withInput()->with('er_data', $er_data)->with('tab', 'creategroup');
         }
     } else {
         $languageDetails = languageModel::select($lantyp, 'ctrlCaptionId')->whereIn('value_en', [$validation->messages()->first('groupname')])->get()->toArray();
         foreach ($languageDetails as $key => $val) {
             $er_data['groupname'] = "<span id='" . $val['ctrlCaptionId'] . "'>" . $val[$lantyp] . "</span>";
         }
         return Redirect::to("group")->with('er_data', $er_data)->with('tab', 'creategroup');
     }
 }
 public function getfollowerlistforinvitecontest()
 {
     $contest_id = Input::get('contest_id');
     $userid = contestModel::select('createdby')->where('ID', $contest_id)->get();
     $userid = $userid[0]['createdby'];
     $followers = followModel::where('userid', $userid)->select('followers.id as followerprimaryid', 'user.profilepicture', 'user.firstname', 'user.ID as followerid')->leftJoin('user', 'user.ID', '=', 'followers.followerid')->get();
     for ($k = 0; $k < count($followers); $k++) {
         $invitecnt = invitefollowerforcontestModel::where('follower_id', $followers[$k]['followerprimaryid'])->where('contest_id', $contest_id)->get()->count();
         $followers[$k]['invite'] = $invitecnt;
     }
     $Response = array('success' => '1', 'message' => 'Followers  List');
     $final = array("response" => $Response, "followerlist" => $followers);
     return json_encode($final);
 }
Пример #7
0
                            <th><Span class="txt_sno">S.No</span></th>
                            <th><span class="txt_img">Image</span></th>
                            <th><span class="txt_following_username">Following User Name</span></th>

<?php 
if ($profileid == Auth::user()->ID || Auth::user()->ID == 1) {
    ?>
<th><span class="txt_unfollow">Unfollow</span></th><?php 
}
?>
                            <th class="tr_wid_button1" align="center"><span class="txt_view">View</span></th>
                        </tr>
                    </thead>
                    <tbody>
<?php 
$followers = followModel::where('followers.userid', $profileid)->select('user.profilepicture', 'user.firstname', 'user.lastname', 'user.username', 'user.ID as followerid')->leftJoin('user', 'user.ID', '=', 'followers.followerid')->where('user.status', 1)->get();
for ($i = 0; $i < count($followers); $i++) {
    ?>
                            <tr>
                                <td>{{ $i+1; }}</td>
                                <td align="center"><img src="{{ ($followers[$i]['profilepicture']!='')?(URL::to('public/assets/upload/profile/'.$followers[$i]['profilepicture'])):(URL::to('assets/inner/images/avator.png')) }}" width="50" height="50"></td>
                                <td><?php 
    if ($followers[$i]['firstname'] != "") {
        echo $followers[$i]['firstname'] . ' ' . $followers[$i]['lastname'];
    } else {
        echo $followers[$i]['username'];
    }
    ?>
</td>

                            <?php