public function insertAction($args) { require_once APPLICATION_PATH . '/public/facebook-php-sdk-v4-5.0.0/src/Facebook/autoload.php'; //Variables sans Logo & Banner $id = '0'; $title = $_POST['title']; $date_begin = $_POST['begin']; $date_ending = $_POST['ending']; $description = $_POST['description']; $color_theme = $_POST['color-theme']; $active_contest = 0; $delete_contest = 0; if (!empty($_POST['active-contest'])) { $active_contest = $_POST['active-contest']; } //Création de l'album avec le logo et le banner $this->createAlbum(); //Récupération de l'album ID $albumId = $this->getAlbum(); //Récupération des URL du logo et du banner $template = $this->getBannerLogo($albumId); //Logo & Banner $logo = $template[0]; $banner = $template[1]; $addContestObj = new contestModel($id, $title, $date_begin, $date_ending, $description, $color_theme, $banner, $logo, $active_contest, $delete_contest); $getActiveContest = $this->getActiveContest(); if (!$getActiveContest == FALSE & isset($_POST['active-contest'])) { $this->unsetActiveContest($getActiveContest['id']); } $addContestObj->save(); header("Location: /contestList"); }
<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">
}); </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()">«<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 = "";
<?php include "dashboardHead.php"; $contestListObj = new contestModel(); $contests = $contestListObj->getAllContest(); ?> <div id="wrapper"> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Ajouter un lot de prix</h1> <ol class="breadcrumb"> <li><i class="fa fa-dashboard"></i> <a href="/dashboard">Dashboard</a></li> <li class="active"><i class="fa fa-edit"></i> Ajouter un lot de prix</li> </ol> </div> </div> <!-- /.row --> <div class="form-content"> <form method="post" class="search-contest col-md-6"> <div class="box-body"> </div><!-- /.box-body --> </form> </div><!-- /.form-content --> <div class="form-content"> <form role="form" method="POST" action="/addPrice/insert" id="add-prices" enctype="multipart/form-data">
?> <div id="select-contest-id"></div> </option> <?php } ?> </select> <input type="submit" name="choose-contest-name" class="choose-contest-name" value="Rechercher"/> </div><!-- /.box-body --> </form> </div><!-- /.form-content --> <?php if (isset($_POST['choose-contest-name'])) { $selected_contest = $_POST['contest-name']; $contestObj = new contestModel(); $contestResult = $contestObj->getOneContest($selected_contest); } ?> <!-- Main content --> <?php if (isset($_POST['choose-contest-name'])) { ?> <div class="form-content" style="margin-top: 50px;"> <form method="post" id="update-contest" action="updateContest/update/<?php echo $contestResult['id']; ?>
>Create Group</option> </select> </div> <div class="tab-body-wrapper"> <!-- Contest participant List --> <div id="tab-body-1" class="tab-body"> @if(isset($er_data['message'])) <p class="alert" style="color:green; font-size:13px;">{{ $er_data['message'] }}</p> @endif <span class="alert" id="ajaxmessage" style="color:green;"></span> <h1><?php if ($contest_id != '') { $contestname = contestModel::select('contest_name', 'contesttype')->where('ID', $contest_id)->first(); } echo $contestname->contest_name; ?> </h1> <table class="display" cellspacing="0" width="100%" id="dd_group_list"> <thead> <tr> <th>S.NO</th> <th>Participant name</th> <th><?php if ($contestname->contesttype == 'p') { echo "Photo"; } elseif ($contestname->contesttype == 'v') { echo "Video";
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; } }
<th>Reported data</th> <th>Contest name</th> <th>Reported by</th> <th>Posted by</th> <th>Media</th> <th>View</th> </tr> </thead> <tbody> <?php $reportdetails = reportflagModel::select('reportflag.contest_id', 'contestparticipant.dropbox_path', 'contestparticipant.uploadtopic', 'contestparticipant.user_id as participantuserid', 'contest.contesttype', 'reportflag.report_userid', 'contest.ID as contestid', 'reportflag.contest_participant_id', 'reportflag.ID as reportflagprimaryid', 'reportflag.action_taken', 'reportflag.postedby_userid', 'reportflag.report_description', 'contestparticipant.ID as contestpartipantid', 'contestparticipant.uploadfile')->LeftJoin('contestparticipant', 'contestparticipant.ID', '=', 'reportflag.contest_participant_id')->LeftJoin('contest', 'contest.ID', '=', 'contestparticipant.contest_id')->get(); for ($i = 0; $i < count($reportdetails); $i++) { $participantdetails = ProfileModel::select('firstname', 'lastname', 'username')->where('ID', $reportdetails[$i]['postedby_userid'])->get()->first(); $reporteduserdetails = ProfileModel::select('firstname', 'lastname', 'username')->where('ID', $reportdetails[$i]['report_userid'])->get()->first(); $contestname = contestModel::select('contest_name')->where('ID', $reportdetails[$i]['contest_id'])->first(); ?> <tr> <td><input type="checkbox" id="action_<?php echo $reportdetails[$i]['contest_participant_id']; ?> " name="action" onclick="action('<?php echo $reportdetails[$i]['contest_participant_id']; ?> ', '<?php echo $reportdetails[$i]['reportflagprimaryid']; ?> ', '<?php echo $reportdetails[$i]['contest_id']; ?> ')" <?php
</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 getContest($title) { $contestObj = new contestModel(); $contestResult = $contestObj->getOneContest($title); return $contestResult; }
include "dashboardHead.php"; /* Count Member */ $memberCountObj = new memberModel(); $nbMember = $memberCountObj->countRow(); /* Count Picture */ $pictureCountObj = new pictureModel(); $nbPicture = $pictureCountObj->countRow(); /* Count Contest */ $contestCountObj = new contestModel(); $nbContest = $contestCountObj->countRow(); // Select user limit 8 $memberListObj = new memberModel(); $members = $memberListObj->getUserByLimit(); // Select contest limit 8 $contestListObj = new contestModel(); $contests = $contestListObj->getContestByLimit(); ?> <div id="wrapper"> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"> Dashboard <small>Statistics</small> </h1> <ol class="breadcrumb"> <li class="active"><i class="fa fa-dashboard"></i> Les Statistiques</li>
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 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); } }
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; } }
(function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/fr_FR/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <!-- Bannière & Title --> <?php $contestObj = new contestModel(); $contestObj->getOneByActive(true); $title = $contestObj->getTitle(); $description = $contestObj->getDescription(); $id_contest = $contestObj->getId(); $banner = $contestObj->getBanner(); $color = $contestObj->getColorTheme(); $_SESSION['color'] = $color; $_SESSION['idContest'] = $idContest; $priceObj1 = new priceModel(); $priceObj1->getAll(true); $priceCountObj = new priceModel(); $nbPrice = $priceCountObj->countRow(); if (!empty($id_contest)) { ?>
APPLICATION_PATH; ?> /public/js/jquery-1.12.0.min.js" type="text/javascript"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script src="<?php APPLICATION_PATH; ?> /public/js/bootstrap.min.js" type="text/javascript"></script> <script src="<?php APPLICATION_PATH; ?> /public/ckeditor/ckeditor.js"></script> </head> <?php $contestObj = new contestModel(); $contestObj->getOneByActive(true); $idContest = $contestObj->getId(); $color = $contestObj->getColorTheme(); $_SESSION['color'] = $color; $_SESSION['idContest'] = $idContest; $activeContest = $contestObj->getActiveContest(); $logo = $activeContest['logo']; $banner = $activeContest['banner']; ?> <body cz-shortcut-listen="true"> <div class="site-wrapper"> <div class="site-wrapper-inner"> <!-- Navigation -->
<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']; } ?>