示例#1
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);
 }
示例#2
0
    public function putfollow($data = Null)
    {
        //return $data;
        $followerid = $_GET['followerid'];
        $contest_id = $_GET['contest_id'];
        $participant_id = $_GET['participant_id'];
        $authusrid = Auth::user()->ID;
        $curdate = date('Y-m-d h:i:s');
        $inputdetails['followerid'] = $followerid;
        $inputdetails['userid'] = $authusrid;
        $inputdetails['createddate'] = $curdate;
        $followers = followModel::create($inputdetails);
        if ($followers) {
            ////// Send Mail /////////
            $followedetails = user::find($followerid);
            $email = $followedetails['email'];
            if (Auth::user()->firstname != '') {
                $username = Auth::user()->firstname . ' ' . Auth::user()->lastname;
            } else {
                $username = Auth::user()->username;
            }
            if ($followedetails['firstname'] != '') {
                $followingusername = $followedetails['firstname'] . ' ' . $followedetails['lastname'];
            } else {
                $followingusername = $followedetails['username'];
            }
            //$email ='*****@*****.**';
            Mail::send([], array('followingusername' => $followingusername, 'email' => $email, 'username' => $username), function ($message) use($followingusername, $email, $username) {
                $mail_body = '<style>.thank{text-align:center; width:100%;}
					.but_color{color:#ffffff;}
					.cont_name{width:100px;}
					.cont_value{width:500px;}
					
					</style>
			 <body style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif; margin:0px auto; padding:0px;">

				<div style="margin:0px auto;background:#e5e5e5;float:left;	width:98%;	height:30px;margin:0px 1%;  border-bottom:#005377 1px solid;vertical-align: text-middle;">
					&nbsp;&nbsp;<a href="' . URL() . '"><img src="' . URL::to('assets/images/logo.png') . '" style="margin-top:3px; line-height:20px;" /></a>&nbsp;&nbsp;
				</div>
				<div style="background:#ffffff;float:left;padding:10px 20px;margin:1px 1%;" >
					<div class="thank" style="font-size:16px;color: #078AC2;font-weight:bold;float:left;width:100%;margin-top:10px;text-align:left;">Dear ' . $followingusername . '</div>
					
					<div style="font-size:12px;	color: #000000;	float:left;padding:10px 2px;width:100%;margin:15px;">The Member ' . $username . ' is following you.
			 </div>
					
					<div style="margin:10px;"><a href="' . URL() . '"><img src="' . URL::to('assets/inner/images/vist_dingdatt.png') . '" width="120" height="30" /></a>
					</div>
				</div>
											
				<div style="font-size:12px; margin-top:10px;color: #5b5b5b;/*	background:#e5e5e5;*/width:95%;vertical-align: text-middle;height:30px;margin:0% 1%;padding:0px 15px; border-top:#005377 1px solid; border-bottom:5px solid background:#e5e5e5;line-height:25px; ">
				
				</body>';
                $message->setBody($mail_body, 'text/html');
                $message->to($email);
                $message->subject('Follower details - DingDatt');
            });
            //return $participant_id;
            $contestparticipantname = contestparticipantModel::select('user.firstname', 'user.lastname', 'user.username')->where('contestparticipant.ID', $participant_id)->LeftJoin('user', 'user.ID', '=', 'user_id')->get();
            if ($contestparticipantname[0]['firstname'] != '') {
                $follwusrname = $contestparticipantname[0]['firstname'] . ' ' . $contestparticipantname[0]['lastname'];
            } else {
                $follwusrname = $contestparticipantname[0]['username'];
            }
            return Redirect::to("contest_info/" . $contest_id)->with('tab', 'gallery')->with('gallerytype', 'comment')->with('viewcommentforparticipant', $participant_id)->with('Massage', 'You are following ' . $follwusrname);
        }
    }
    echo "Photo";
} elseif ($contestname->contesttype == 'v') {
    echo "Video";
} else {
    echo "Topic";
}
?>
</th>           
                        <th class="tr_wid_button1" align="center"><span class="txt_view">View</span></th>            
                        <th class="tr_wid_edit"><span class="txt_delete">Delete<span></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <?php 
if ($contest_id != '') {
    $participantlist = contestparticipantModel::select('contestparticipant.ID', 'user.firstname', 'user.lastname', 'user.username', 'user.profilepicture', 'contestparticipant.dropbox_path', 'contestparticipant.uploadfile', 'contestparticipant.uploadtopic')->LeftJoin('user', 'user.ID', '=', 'contestparticipant.user_id')->where('contestparticipant.contest_id', $contest_id)->get();
    for ($i = 0; $i < count($participantlist); $i++) {
        if ($participantlist[$i]['firstname'] != '') {
            $name = $participantlist[$i]['firstname'] . ' ' . $participantlist[$i]['lastname'];
        } else {
            $name = $participantlist[$i]['username'];
        }
        ?>
                                                <tr>
                                                    <td>{{ $i+1; }} </td>
                                                    <td class="tr_wid_id">{{ $name }}</td>
                                                    <td ><?php 
        if ($contestname->contesttype == 'p') {
            ?>
<img src="<?php 
            echo url() . '/public/assets/upload/contest_participant_photo/' . $participantlist[$i]['uploadfile'];
 function reportflag()
 {
     $reporteddata = Input::get('reporteddata');
     $participantid = Input::get('participantid');
     $authuserid = Input::get('user_id');
     $inputdetails['contest_participant_id'] = $participantid;
     $inputdetails['report_description'] = $reporteddata;
     $inputdetails['report_userid'] = $authuserid;
     $participant_details = contestparticipantModel::select('user_id', 'contest_id')->where('ID', $participantid)->first();
     $inputdetails['postedby_userid'] = $participant_details['user_id'];
     $inputdetails['contest_id'] = $participant_details['contest_id'];
     $inputdetails['createddate'] = date('Y-m-d h:i:s');
     //reportflagModel::where()
     //return $inputdetails;
     $validation = Validator::make($inputdetails, reportflagModel::$rules);
     if ($validation->passes()) {
         $created = reportflagModel::create($inputdetails);
         //if($created) return 1;
         $Response = array('success' => '1', 'message' => 'You are reported successfully', 'msgcode' => "c194");
         $final = array("response" => $Response);
         return json_encode($final);
     } else {
         $Response = array('success' => '0', 'message' => $validation->messages(), 'msgcode' => "c195");
         $final = array("response" => $Response);
         return json_encode($final);
     }
 }
        }
    }
    ?>
  </th>
                                    <th><span class="txt_contestantname">Contestant Name</span></th>
                                    <th><span class="txt_noofvotes">No of Dings</span></th>
                                    <th><span class="txt_view">View</span></th>
                                </tr>
                            </thead>
                            <tbody>
    <?php 
    for ($i = 0; $i < count($leaderboarddata); $i++) {
        // $leaderboarddata[$i]['leaderusrid'];
        $participantcnt = contestparticipantModel::where('user_id', $leaderboarddata[$i]['leaderusrid'])->get()->count();
        if ($participantcnt != 0) {
            $contestparticipatedimg = contestparticipantModel::select('uploadfile', 'uploadtopic', 'dropbox_path')->where('contest_id', $contest_id)->where('user_id', $leaderboarddata[$i]['leaderusrid'])->first();
            ?>
                                        <tr>
                                            <td>{{ $leaderboarddata[$i]['position'] }}</td>
                                            <td align="center">
            <?php 
            if ($contestdetails[0]['contesttype'] == 'p') {
                ?>
                                                    <img src="<?php 
                echo url() . '/public/assets/upload/contest_participant_photo/' . $contestparticipatedimg->uploadfile;
                ?>
" width="50" height="50">
            <?php 
            } else {
                if ($contestdetails[0]['contesttype'] == 'v') {
                    ?>
 function report()
 {
     $reporteddata = Input::get('reporteddata');
     $participantid = Input::get('participantid');
     $authuserid = Auth::user()->ID;
     $description = Input::get('');
     $participant_details = contestparticipantModel::select('user_id', 'contest_id')->where('ID', $participantid)->first();
     $inputdetails['contest_participant_id'] = $participantid;
     $inputdetails['report_description'] = $reporteddata;
     $inputdetails['report_userid'] = $authuserid;
     $inputdetails['postedby_userid'] = $participant_details['user_id'];
     $inputdetails['contest_id'] = $participant_details['contest_id'];
     $inputdetails['createddate'] = date('Y-m-d h:i:s');
     //reportflagModel::where()
     $validation = Validator::make($inputdetails, reportflagModel::$rules);
     if ($validation->passes()) {
         $created = reportflagModel::create($inputdetails);
         if ($created) {
             return 1;
         }
     }
 }
 public function getcontestlistmobile()
 {
     $inputdetails = Input::except(array('_token'));
     $contestlisttype = Input::get('contestlisttype');
     $contesttype = Input::get('contesttype');
     $loggeduserid = Input::get('loggeduserid');
     $currentdate = Carbon::now();
     $timezone = Input::get('timezone');
     if ($contestlisttype == 'current') {
         $contestDetailscount = contestModel::where(function ($query) {
             $query->where(function ($query) {
                 $currentdate = date('Y-m-d H:i:s');
                 $query->where('conteststartdate', '<=', $currentdate);
                 $query->where('contestenddate', '>=', $currentdate);
             });
             $query->orWhere(function ($query) {
                 $currentdate = date('Y-m-d H:i:s');
                 $query->where('votingstartdate', '<=', $currentdate);
                 $query->where('votingenddate', '>=', $currentdate);
             });
         })->where('contesttype', $contesttype)->where('status', '1')->where('visibility', 'u')->get()->count();
         $contestDetails = contestModel::where(function ($query) {
             $query->where(function ($query) {
                 $currentdate = date('Y-m-d H:i:s');
                 $query->where('conteststartdate', '<=', $currentdate);
                 $query->where('contestenddate', '>=', $currentdate);
             });
             $query->orWhere(function ($query) {
                 $currentdate = date('Y-m-d H:i:s');
                 $query->where('votingstartdate', '<=', $currentdate);
                 $query->where('votingenddate', '>=', $currentdate);
             });
         })->where('contesttype', $contesttype)->where('status', '1')->where('visibility', 'u')->get();
     } else {
         if ($contestlisttype == 'upcoming') {
             /*$contestDetailscount = contestModel::where('conteststartdate', '>', $currentdate)->where('contesttype',$contesttype)->where('status','1')->where('visibility','u')->get()->count();
             		
             	$contestDetails = contestModel::where('conteststartdate', '>', $currentdate)->where('contesttype',$contesttype)->where('status','1')->where('visibility','u')->get();  */
             $contestDetailscount = contestModel::where('conteststartdate', '>', $currentdate)->where('contesttype', $contesttype)->where('status', '1')->where('visibility', 'u')->get()->count();
             $contestDetails = contestModel::where('conteststartdate', '>', $currentdate)->where('contesttype', $contesttype)->where('status', '1')->where('visibility', 'u')->get();
         } else {
             if ($contestlisttype == 'archive') {
                 $contestDetailscount = contestModel::where('contestenddate', '<', $currentdate)->where('votingenddate', '<', $currentdate)->where('contesttype', $contesttype)->where('status', '1')->where('visibility', 'u')->leftJoin('contestparticipant', 'contestparticipant.contest_id', '=', 'contest.ID')->get()->count();
                 $contestDetails = contestModel::where('contestenddate', '<', $currentdate)->select('contest.*', 'contestparticipant.ID as contestparticipantid')->where('votingenddate', '<', $currentdate)->where('contesttype', $contesttype)->where('status', '1')->where('visibility', 'u')->leftJoin('contestparticipant', 'contestparticipant.contest_id', '=', 'contest.ID')->get();
                 /*$contestDetailscount=contestModel::where('contestenddate', '<', $currentdate)
                 												->where('votingenddate', '<', $currentdate)
                 												->where('contesttype',$contesttype)
                 												->where('status','1')
                 												->where('visibility','u')
                 												->get()->count();
                 	
                 	$contestDetails=contestModel::where('contestenddate', '<', $currentdate)
                 												->where('votingenddate', '<', $currentdate)
                 												->where('contesttype',$contesttype)
                 												->where('status','1')
                 												->where('visibility','u')
                 												->get();
                 	*/
             } else {
                 if ($contestlisttype == 'private') {
                     /* $contestDetailscount = contestModel::where('visibility','p')
                     			->select('contest.ID','contest_name','description','noofparticipant','contestparticipant.ID as contestparticipantid')
                     			->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')
                     			->leftJoin('contestparticipant', 'contestparticipant.contest_id', '=', 'contest.ID')			
                                 ->where('private_contest_users.user_id',$loggeduserid)
                                 ->get()->count();
                     			
                     	 $contestDetails = contestModel::where('visibility','p')
                     			->select('contest.ID','contest_name','description','noofparticipant','contestparticipant.ID as contestparticipantid')
                     			->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')
                     			->leftJoin('contestparticipant', 'contestparticipant.contest_id', '=', 'contest.ID')			
                                 ->where('private_contest_users.user_id',$loggeduserid)
                                 ->get();	
                     */
                     $contestDetailscount = contestModel::where('visibility', 'p')->where('contesttype', $contesttype)->select('contest.ID', 'contest_name', 'themephoto', 'description', 'noofparticipant', 'contest.prize', 'contest.conteststartdate', 'contest.contestenddate', 'contest.votingstartdate', 'contest.votingenddate', 'contest.createdby')->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')->where('private_contest_users.user_id', $loggeduserid)->where('private_contest_users.status', '1')->distinct()->get()->count();
                     $contestDetails = contestModel::where('visibility', 'p')->where('contesttype', $contesttype)->select('contest.ID', 'contest_name', 'themephoto', 'description', 'noofparticipant', 'contest.prize', 'contest.conteststartdate', 'contest.contestenddate', 'contest.votingstartdate', 'contest.votingenddate', 'contest.createdby')->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')->where('private_contest_users.user_id', $loggeduserid)->where('private_contest_users.status', '1')->distinct()->get();
                     /*  $contestDetailscount = contestModel::where('visibility','p')
                     			->select('contest.ID','contest_name','description','noofparticipant')
                     			->leftJoin('contestparticipant', 'contestparticipant.contest_id', '=', 'contest.ID')
                                 ->where('contestparticipant.user_id',$loggeduserid)
                                 ->get()->count();
                     		
                     	$contestDetails = contestModel::where('visibility','p')
                     			->leftJoin('contestparticipant', 'contestparticipant.contest_id', '=', 'contest.ID')
                                 ->select('contest.ID','contest_name','description','noofparticipant')
                     			->where('contestparticipant.user_id',$loggeduserid)
                                 ->get();  */
                     //$languageDetailscount = contestparticipantModel::where('ID',$loggeduserid)->get();
                 }
             }
         }
     }
     if ($contestDetailscount) {
         for ($i = 0; $i < count($contestDetails); $i++) {
             $participant = contestparticipantModel::select('ID')->where('contest_id', $contestDetails[$i]->ID)->where('user_id', $loggeduserid)->get()->count();
             if ($participant != '') {
                 $contestDetails[$i]->contestparticipantid = 1;
             } else {
                 $contestDetails[$i]->contestparticipantid = 0;
             }
             $contestDetails[$i]->conteststartdate = timezoneModel::convert($contestDetails[$i]->conteststartdate, 'UTC', $timezone, 'd-M-Y h:i a');
             $contestDetails[$i]->contestenddate = timezoneModel::convert($contestDetails[$i]->contestenddate, 'UTC', $timezone, 'd-M-Y h:i a');
             $contestDetails[$i]->votingstartdate = timezoneModel::convert($contestDetails[$i]->votingstartdate, 'UTC', $timezone, 'd-M-Y h:i a');
             $contestDetails[$i]->votingenddate = timezoneModel::convert($contestDetails[$i]->votingenddate, 'UTC', $timezone, 'd-M-Y h:i a');
             $contestDetails[$i]->createddate = timezoneModel::convert($contestDetails[$i]->createddate, 'UTC', $timezone, 'd-M-Y h:i a');
             //themephoto
         }
         //return $contestDetails;
         $Response = array('success' => '1', 'message' => 'Data Get Successfully');
         $final = array("response" => $Response, 'contestdetails' => $contestDetails);
         return json_encode($final);
     } else {
         $Response = array('success' => '0', 'message' => 'No Data Available');
         $final = array("response" => $Response);
         return json_encode($final);
     }
 }
                    <div class="clrscr"></div>

                    <div class="loginbox">
                    </div>
                </form>
            </div>
        </div>

        <div id="tab-body-2" class="tab-body">
            <div id="p">
                <div class="clrscr"></div>
                <div class="crsl-items_p" data-navigation="navbtns">
                    <div class="crsl-wrap">
                                <?php 
$curdate = date('Y-m-d H:i:s');
$myhistory = contestparticipantModel::select('contest.contest_name', 'contestparticipant.contest_id', 'contestparticipant.uploadfile', 'contestparticipant.uploadtopic', 'contest.contesttype', 'contestparticipant.dropbox_path')->where('contestparticipant.user_id', $profileid)->LeftJoin('contest', 'contest.ID', '=', 'contestparticipant.contest_id')->where('contest.votingenddate', '<', $curdate)->LeftJoin('user', 'user.ID', '=', 'contest.createdby')->get();
for ($i = 0; $i < count($myhistory); $i++) {
    $leaderboard = leaderboardModel::select('position')->where('contest_id', $myhistory[$i]['contest_id'])->where('user_id', $profileid)->get();
    ?>
                            <div class="crsl-item">
                                <div class="thumbnail">


                            <?php 
    if ($myhistory[$i]['contesttype'] == 'p') {
        ?>
<img src="<?php 
        echo url() . '/public/assets/upload/contest_participant_photo/' . $myhistory[$i]['uploadfile'];
        ?>
" alt="danny antonucci"> <?php 
    } elseif ($myhistory[$i]['contesttype'] == 'v') {