<div class="con_search">
                        <form name="tab1-search" method="post" action="my_contest">
                            <div style="vertical-align:top;margin:0; padding:0;">
                                <input type="hidden" name="tab" value="created">
                                <input type="text" name="tsearch2" id="tsearch" value="{{ isset($inputs['tsearch2'])?$inputs['tsearch2']:'' }}" class="pch_searchcontest" placeholder="Search Contest" />
                                <input class="search_btn" type="submit" value="" />
                            </div>
                        </form>
                    </div>
                </div>
<?php 
$created_user = Auth::user()->ID;
if (isset($inputs['tsearch2']) && $inputs['tsearch2'] != '') {
    $photocontest = contestModel::where('createdby', $created_user)->where('contest_name', 'like', "%" . $inputs['tsearch2'] . "%")->where('status', 1)->get();
} else {
    $photocontest = contestModel::where('createdby', $created_user)->where('status', 1)->get();
}
$contestcount = count($photocontest);
?>
                <div class="clrscr"></div>

                <div class="crsl-items_v" 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'" : "";
    ?>
 >
                                <div class="thumbnail">
Example #2
0
 public function regenerateleaderboard()
 {
     $contestid = Input::get('contestid');
     if ($contestid) {
         $iputdetails['leaderboard'] = 0;
         $leaderboard = contestModel::where('ID', $contestid)->update($iputdetails);
         $leaderboardcnt = leaderboardModel::where('contest_id', $contestid)->get()->count();
         if ($leaderboardcnt > 0) {
             leaderboardModel::where('contest_id', $contestid)->delete();
         }
         return 1;
     }
 }
Example #3
0
 public function inviteall_follower()
 {
     $follower_ids = Input::get("follower_list");
     $contest_id = Input::get("contest_id");
     $follower_ids = explode(',', $follower_ids);
     $followercount = count($follower_ids);
     $curdate = date('Y-m-d H:i:s');
     $contest_det = contestModel::where("ID", $contest_id)->first();
     if (Auth::user()->firstname != '') {
         $inviter = Auth::user()->firstname . " " . Auth::user()->lastname;
     } else {
         $inviter = Auth::user()->username;
     }
     if ($contest_det['contesttype'] == "p") {
         $contesttype = "Photo";
     } else {
         if ($contest_det['contesttype'] == "v") {
             $contesttype = "Video";
         } else {
             if ($contest_det['contesttype'] == "t") {
                 $contesttype = "Topic";
             }
         }
     }
     $contestname = $contest_det['contest_name'];
     if ($followercount > 0) {
         for ($i = 0; $i < $followercount; $i++) {
             $invited = invitefollowerforcontestModel::where('follower_id', $follower_ids[$i])->where('contest_id', $contest_id)->count();
             if ($invited == 0) {
                 $input_details['follower_id'] = $follower_ids[$i];
                 $input_details['contest_id'] = $contest_id;
                 $input_details['invitedate'] = $curdate;
                 invitefollowerforcontestModel::create($input_details);
                 $invited_member = privateusercontestModel::where("contest_id", $contest_id)->where('user_id', $follower_ids[$i])->count();
                 if ($contest_det['visibility'] == "p" && $invited_member == 0) {
                     $privat_user['user_id'] = $follower_ids[$i];
                     $privat_user['contest_id'] = $contest_id;
                     $privat_user['requesteddate'] = date('Y-m-d H:i:s');
                     $privat_user['status'] = 1;
                     privateusercontestModel::create($privat_user);
                 }
                 if ($invited_member == 0) {
                     $user = ProfileModel::where('ID', $followerid)->first();
                     if ($user['firstname'] != '') {
                         $name = $user['firstname'] . ' ' . $user['lastname'];
                     } else {
                         $name = $user['username'];
                     }
                     $email = $user['email'];
                     $this->invitefollowerforcontestmail($name, $email, $inviter, $contesttype, $contestname, $contest_id);
                 }
             }
         }
         return 1;
     } else {
         return 0;
     }
 }
});
</script>
@stop

@section('body')
{{ Form::hidden('pagename','edit_contest', array('id'=> 'pagename')) }}

<div class="tabs-wrapper">
    <input type="radio" name="tab" id="tab1" class="tab-head" checked="checked"/>
    <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()">&laquo;<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 = "";
Example #5
0
                </div>
				
				<script>
				$(document).ready(function(){ 
				$(".selectintersttopic").change(function(){
				$(".topic").trigger("click");
				});
				});				
				</script>
<?php 
$topiccontest = 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', 't')->where('status', '1')->where('visibility', 'u')->get();
// $topiccontest=contestModel::where('conteststartdate', '<=', $currentdate)->where('contestenddate', '>=', $currentdate)->where('contesttype','t')->where('status','1')->where('visibility','u')->orWhere('votingstartdate', '<=', $currentdate)->where('votingenddate', '>=', $currentdate)->get();
$topiccontestcount = count($topiccontest);
?>
                <div class="clrscr"></div>
                <div class="crsl-items_t" data-navigation="navbtns">
                    <div class="crsl-wrap">
<?php 
for ($i = 0; $i < $topiccontestcount; $i++) {
}
if ($videocontestcount == 0) {
 function uninvitegroupmemberforcontest()
 {
     $groupmemberlist = Input::get('groupmemberid');
     $group_id = Input::get('group_id');
     $contest_id = Input::get('contest_id');
     $groupmemberlistid = explode(',', $groupmemberlist);
     $inv_suc_message = 0;
     for ($i = 0; $i < count($groupmemberlistid); $i++) {
         $groupmemberid = groupmemberModel::where('id', $groupmemberlistid[$i])->get()->first();
         $invited = invitegroupforcontestModel::where('group_id', $group_id)->where('contest_id', $contest_id)->where('user_id', $groupmemberid->user_id)->count();
         if ($invited != 0) {
             $invited = invitegroupforcontestModel::where('group_id', $group_id)->where('contest_id', $contest_id)->where('user_id', $groupmemberid->user_id)->delete();
             $invited_member = privateusercontestModel::where("contest_id", $contest_id)->where('user_id', $groupmemberid->user_id)->count();
             if ($invited_member) {
                 $contestdetails = contestModel::where('ID', $contest_id)->get()->first();
                 if ($contestdetails['createdby'] != $groupmemberid->user_id) {
                     $invited_memberdelete = privateusercontestModel::where("contest_id", $contest_id)->where('user_id', $groupmemberid->user_id)->delete();
                 }
             }
             $inv_suc_message = 1;
         } else {
             $inv_suc_message = 2;
         }
     }
     if ($inv_suc_message == 1) {
         $Response = array('success' => '1', 'message' => 'Uninvited successfully', 'msgcode' => "c198");
         $final = array("response" => $Response);
         return json_encode($final);
     } else {
         if ($inv_suc_message == 2) {
             $Response = array('success' => '0', 'message' => 'You are not invited.So cant able to uninvite', 'msgcode' => "c201");
             $final = array("response" => $Response);
             return json_encode($final);
         } else {
             $Response = array('success' => '0', 'message' => 'No data', 'msgcode' => "c199");
             $final = array("response" => $Response);
             return json_encode($final);
         }
     }
 }
 public function mycontestresponsive()
 {
     $tabname = $_GET['tabname'];
     if ($tabname == 'participate') {
         $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'] . "%")->get();
         } else {
             $photocontest = contestModel::whereIn('ID', $participants)->get();
         }
         $contestcount = count($photocontest);
     } else {
         $created_user = Auth::user()->ID;
         if (isset($inputs['tsearch2']) && $inputs['tsearch2'] != '') {
             $photocontest = contestModel::where('createdby', $created_user)->where('contest_name', 'like', "%" . $inputs['tsearch2'] . "%")->get();
         } else {
             $photocontest = contestModel::where('createdby', $created_user)->get();
         }
         $contestcount = count($photocontest);
     }
     $contestcount = count($photocontest);
     $return_string = "";
     for ($i = 0; $i < $contestcount; $i++) {
         $return_string .= "<div class='crsl-item' >\n\t\t\t  <div class='thumbnail'>\n\t\t\t\t<a href='" . URL::to('contest_info/' . $photocontest[$i]['ID']) . "' >\n\t\t\t\t\t<img src='" . URL::to('public/assets/upload/contest_theme_photo/' . $photocontest[$i]['themephoto']) . "' alt='nyc subway'>\n\t\t\t\t\t</a>\n\t\t\t\t<span class='postdate'>Ends on : " . timezoneModel::convert($photocontest[$i]['contestenddate'], 'UTC', Auth::user()->timezone, 'Y-m-d h:i a') . "</span>\n\t\t\t  </div>\n\t\t\t  <h3><a href='" . URL::to('contest_info/' . $photocontest[$i]['ID']) . "'>" . $photocontest[$i]['contest_name'] . "</a></h3>\n\t\t\t</div>";
     }
     return $return_string . "||" . $contestcount;
 }
 public function getcontestinfo()
 {
     $contestid = Input::get('contestid');
     $timezone = Input::get('timezone');
     $user_id = Input::get('user_id');
     if ($contestid) {
         $contestDetails = contestModel::where('ID', $contestid)->get();
         for ($i = 0; $i < count($contestDetails); $i++) {
             $contestparticipantid = contestparticipantModel::where('contest_id', $contestid)->where('user_id', $user_id)->get()->count();
             if ($contestparticipantid) {
                 $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');
         }
         $contestparticipantcount = contestparticipantModel::where('contest_id', $contestid)->get()->count();
     }
     $Response = array('success' => '1', 'message' => 'Data Get Successfully');
     $contestparticipantcount = array('contestparticipantcount' => $contestparticipantcount);
     $final = array("response" => $Response, "contestdetails" => $contestDetails, "contestparticipantcount" => $contestparticipantcount);
     return json_encode($final);
 }
                        <th>Visibility type</th>
                        <th>Image</th>
                        <th>Leaderboard </br>regenerate</th>
                        <th>Active/Inactive</th>
                        <th class="tr_wid_button1" align="center"><span class="txt_view">Participant</span></th>
                        <th class="tr_wid_button1" align="center"><span class="txt_edit">Edit</span></th>
                        <th class="tr_wid_edit"><span class="txt_delete">Delete<span></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <?php 
if ($usercontestlist != '') {
    $usercontestlist = contestModel::where('createdby', $usercontestlist)->get();
} else {
    if ($searchkey != '') {
        $usercontestlist = contestModel::where('contest_name', 'like', '%' . $searchkey . '%')->get();
    } else {
        $usercontestlist = contestModel::get();
    }
}
for ($i = 0; $i < count($usercontestlist); $i++) {
    $createdowner = User::select('firstname', 'lastname', 'username')->where('ID', $usercontestlist[$i]['createdby'])->get();
    ?>
                                            <tr>
                                                <td>{{ $i+1; }} </td>
                                                <td class="tr_wid_id"><a href="{{ URL::to('contest_info/'.$usercontestlist[$i]['ID']) }}" style="text-decoration:none;">{{ $usercontestlist[$i]['contest_name'] }}</a></td>
                                               <td><?php 
    if ($createdowner[0]['firstname'] != '') {
        echo $createdowner[0]['firstname'] . ' ' . $createdowner[0]['lastname'];
    } else {
        echo $createdowner[0]['username'];