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); } } }
<label for="tab1"><span id="txt_editcontest">Edit Contest</span></label> <div id="subtab_div" class="con_cat_right mbnone" > <button class="bck_btn" onclick="goback()">«<span class="txt_back" > Back </span></button> </div> <?php $contestdetails = contestModel::where('ID', $contest_id)->first(); if (Session::has('er_data')) { $er_data = Session::get('er_data'); //print_r($er_data); } if (Session::has('old_data')) { $old_data = Session::get('old_data'); //print_r($old_data); } $noofparticipants = contestparticipantModel::where('contest_id', $contest_id)->get()->count(); if ($noofparticipants > 0) { $readonly = "readonly"; $disabled = "disabled"; } else { $readonly = ""; $disabled = ""; } ?> <div class="tab-body-wrapper"> <div id="tab-body-1" class="tab-body"> <form id="editcontest" action="{{ URL::to('update_contest') }}" method="post" enctype="multipart/form-data" class="form_mid"> <input type="hidden" name="contest_id" value="{{$contest_id}}"> @if(isset($er_data['Message'])) <p class="alert" style="text-align:left;margin-left:55px;color:green; font-size:13px">{{ $er_data['Message'] }}</p>
</div> <div class="con_search"> <form name="tab1-search" method="post" action="my_contest"> <div class="mb_con_search" style="vertical-align:top;margin:0; padding:0;"> <input type="hidden" name="tab" value="participate"> <input type="text" name="tsearch1" id="tsearch" value="{{ isset($inputs['tsearch1'])?$inputs['tsearch1']:'' }}" class="pch_searchcontest" placeholder="Search Contest" /> <input class="search_btn" type="submit" value="" /> </div> </form> </div> </div> <div class="clrscr"></div> <?php $created_user = Auth::user()->ID; $participants = contestparticipantModel::where('user_id', $created_user)->lists('contest_id'); if (isset($inputs['tsearch1']) && $inputs['tsearch1'] != '') { $photocontest = contestModel::whereIn('ID', $participants)->where('contest_name', 'like', "%" . $inputs['tsearch1'] . "%")->where('status', 1)->get(); } else { $photocontest = contestModel::whereIn('ID', $participants)->where('status', 1)->get(); } $contestcount = count($photocontest); ?> <div class="crsl-items_p" data-navigation="navbtns"> <div class="crsl-wrap"> <?php for ($i = 0; $i < $contestcount; $i++) { ?> <div class="crsl-item" <?php echo $i >= 14 ? "style='display:none'" : ""; ?>
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;"> <a href="' . URL() . '"><img src="' . URL::to('assets/images/logo.png') . '" style="margin-top:3px; line-height:20px;" /></a> </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 createdcontest() { $userid = Input::get('userid'); $timezone = Input::get('timezone'); $createdcontest = contestModel::select('ID', 'contest_name', 'themephoto', 'contestenddate', 'conteststartdate', 'votingstartdate', 'votingenddate', 'prize', 'createdby', 'description', 'noofparticipant')->where('createdby', $userid)->get(); if (count($createdcontest) != 0) { for ($i = 0; $i < count($createdcontest); $i++) { $createdcontest[$i]['contestenddate'] = timezoneModel::convert($createdcontest[$i]['contestenddate'], 'UTC', $timezone, 'd-M-Y h:i a'); $createdcontest[$i]['conteststartdate'] = timezoneModel::convert($createdcontest[$i]['conteststartdate'], 'UTC', $timezone, 'd-M-Y h:i a'); $createdcontest[$i]['votingstartdate'] = timezoneModel::convert($createdcontest[$i]['votingstartdate'], 'UTC', $timezone, 'd-M-Y h:i a'); $createdcontest[$i]['votingenddate'] = timezoneModel::convert($createdcontest[$i]['votingenddate'], 'UTC', $timezone, 'd-M-Y h:i a'); $participants = contestparticipantModel::where('user_id', $userid)->where('contest_id', $createdcontest[$i]['ID'])->get()->count(); if ($participants) { $createdcontest[$i]['contestparticipantid'] = 1; } else { $createdcontest[$i]['contestparticipantid'] = 0; } } $Response = array('success' => '1', 'message' => 'Created Contest details are fetched Successfully'); $final = array("response" => $Response, "createdcontest" => $createdcontest); 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') {