コード例 #1
0
>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";
コード例 #2
0
 public function contestdelete()
 {
     $data = Input::get('contestid');
     $searchkey = Input::get('searchkey');
     /// Contest details /////
     $contestdetailsformail = contestModel::select('user.firstname', 'user.lastname', 'user.username', 'contest.contest_name', 'contest.contesttype', 'user.email', 'contest.themephoto')->LeftJoin('user', 'user.ID', '=', 'contest.createdby')->where('contest.ID', $data)->first();
     $contestname = $contestdetailsformail->contest_name;
     $contesttype = $contestdetailsformail->contesttype;
     if ($contestdetailsformail->firstname != '') {
         $name = $contestdetailsformail->firstname . ' ' . $contestdetailsformail->lastname;
     } else {
         $name = $contestdetailsformail->username;
     }
     $contest_id = $data;
     $email = $contestdetailsformail->email;
     $details = "Your contest " . $contestname . " is deleted by admin.";
     $contestimage = $contestdetailsformail->themephoto;
     $contestdetails = contestparticipantModel::where('contest_id', $data)->get();
     for ($i = 0; $i < count($contestdetails); $i++) {
         $contestparticipantid = $contestdetails[$i]['ID'];
         $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();
         }
     }
     $contestcatgory = contestinterestModel::where('contest_id', $data)->count();
     if ($contestcatgory) {
         contestinterestModel::where('contest_id', $data)->delete();
     }
     $deleteinvitecontest = invitegroupforcontestModel::where('contest_id', $data)->count();
     if ($deleteinvitecontest) {
         invitegroupforcontestModel::where('contest_id', $data)->delete();
     }
     $deletefollowercontest = invitefollowerforcontestModel::where('contest_id', $data)->count();
     if ($deletefollowercontest) {
         invitefollowerforcontestModel::where('contest_id', $data)->delete();
     }
     $privatecontestdelete = privateusercontestModel::where('contest_id', $data)->count();
     if ($privatecontestdelete) {
         privateusercontestModel::where('contest_id', $data)->delete();
     }
     $deletecontest = contestModel::where('ID', $data)->delete();
     if ($deletecontest) {
         $this->contestchangesmaildelete($email, $name, $contestname, $contest_id, $contestimage, $details);
     }
     $er_data['message'] = 'Contest removed successfully';
     return Redirect::to('managecontest')->with('er_data', $er_data)->with('usercontestlist', '')->with('searchkey', $searchkey);
 }
コード例 #3
0
 public function getcontestList()
 {
     $maintab = $_POST['main_tab'];
     $subtab = $_POST['sub_tab'];
     //return $subtab;
     $tsearch = $_POST['tsearch'];
     $interest = $_POST['interest'];
     if ($interest == 0) {
         $interest = '';
     }
     $currentdate = date('Y-m-d H:i:s');
     if ($maintab == "tab1") {
         $contest_type = "p";
     } elseif ($maintab == "tab2") {
         $contest_type = "v";
     } elseif ($maintab == "tab3") {
         $contest_type = "t";
     }
     if ($subtab == "tab4") {
         if (isset($tsearch) && $tsearch != '' && $interest == '') {
             ///// current with search ////
             $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->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('contest.contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
         } else {
             if (isset($tsearch) && $tsearch != '' && $interest != '') {
                 $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->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);
                     });
                 })->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('contest.contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
             } else {
                 if (isset($interest) && $interest != '') {
                     $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->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);
                         });
                     })->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('contest.contesttype', $contest_type)->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 } else {
                     ///// current without search ////
                     $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->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', $contest_type)->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 }
             }
         }
     } elseif ($subtab == "tab5") {
         if (isset($tsearch) && $tsearch != '') {
             ///// upcoming with search ////
             $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('conteststartdate', '>', $currentdate)->where('contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
         } else {
             if (isset($tsearch) && $tsearch != '' && $interest != '') {
                 $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('conteststartdate', '>', $currentdate)->where('contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->where('contest.status', '1')->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
             } else {
                 if (isset($interest) && $interest != '') {
                     $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('conteststartdate', '>', $currentdate)->where('contesttype', $contest_type)->where('contest.status', '1')->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 } else {
                     ///// upcoming without search ////
                     $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('conteststartdate', '>', $currentdate)->where('contesttype', $contest_type)->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 }
             }
         }
     } elseif ($subtab == "tab6") {
         if (isset($tsearch) && $tsearch != '' && $interest == '') {
             ///// Archieve with search ////
             $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('contestenddate', '<', $currentdate)->where('votingenddate', '<', $currentdate)->where('contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
         } else {
             if (isset($tsearch) && $tsearch != '' && $interest != '') {
                 $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('contestenddate', '<', $currentdate)->where('votingenddate', '<', $currentdate)->where('contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
             } else {
                 if (isset($interest) && $interest != '') {
                     $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('contestenddate', '<', $currentdate)->where('votingenddate', '<', $currentdate)->where('contesttype', $contest_type)->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 } else {
                     ///// Archieve without search ////
                     $photocontest = contestModel::select('contest.themephoto', 'contest.contestenddate', 'contest.ID', 'contest.contest_name', 'contest.createdby')->where('contestenddate', '<', $currentdate)->where('votingenddate', '<', $currentdate)->where('contesttype', $contest_type)->where('contest.status', '1')->where('visibility', 'u')->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 }
             }
         }
     } elseif ($subtab == "tab7") {
         if (isset($tsearch) && $tsearch != '' && $interest == '') {
             ///// private with search ////
             $photocontest = contestModel::where('visibility', 'p')->where('contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->select('contest.ID', 'contest_name', 'themephoto', 'contestenddate', 'description', 'noofparticipant', 'contest.createdby')->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')->where('private_contest_users.user_id', Auth::User()->ID)->where('contest.status', 1)->where('private_contest_users.status', '1')->distinct()->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
         } else {
             if (isset($tsearch) && $tsearch != '' && $interest != '') {
                 $photocontest = contestModel::where('visibility', 'p')->where('contesttype', $contest_type)->where('contest_name', 'like', '%' . $tsearch . '%')->select('contest.ID', 'contest_name', 'themephoto', 'contestenddate', 'description', 'noofparticipant', 'contest.createdby')->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('private_contest_users.user_id', Auth::User()->ID)->where('contest.status', 1)->where('private_contest_users.status', '1')->distinct()->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
             } else {
                 if (isset($interest) && $interest != '') {
                     $photocontest = contestModel::where('visibility', 'p')->where('contesttype', $contest_type)->select('contest.ID', 'contest_name', 'themephoto', 'contestenddate', 'description', 'noofparticipant', 'contest.createdby')->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('contest_interest_categories.category_id', $interest)->where('private_contest_users.user_id', Auth::User()->ID)->where('contest.status', 1)->where('private_contest_users.status', '1')->distinct()->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 } else {
                     ///// private without search ////
                     $photocontest = contestModel::where('visibility', 'p')->where('contesttype', $contest_type)->select('contest.ID', 'contest_name', 'themephoto', 'contestenddate', 'description', 'noofparticipant', 'contest.createdby')->leftJoin('private_contest_users', 'private_contest_users.contest_id', '=', 'contest.ID')->LeftJoin('contest_interest_categories', 'contest_interest_categories.contest_id', '=', 'contest.ID')->where('private_contest_users.user_id', Auth::User()->ID)->where('contest.status', 1)->where('private_contest_users.status', '1')->distinct()->leftJoin('user', 'user.ID', '=', 'contest.createdby')->where('user.status', 1)->get();
                 }
             }
         }
     }
     $contestcount = count($photocontest);
     $return_string = "";
     $loginuser = Auth::user()->ID;
     for ($i = 0; $i < $contestcount; $i++) {
         if (strlen($photocontest[$i]['contest_name']) < 20) {
             $contest_name = $photocontest[$i]['contest_name'];
         } else {
             $contest_name = substr($photocontest[$i]['contest_name'], 0, 20) . "...";
         }
         $backgroundclr = $photocontest[$i]['createdby'] == $loginuser ? "style='border:5px solid rgb(82, 195, 16)'" : "";
         $return_string .= "<div class='crsl-item' " . ($i >= 14 ? "style='display:none'" : "") . $backgroundclr . " >\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, 'd-M-Y h:i a') . "</span>\n\t\t\t  </div>\n\t\t\t  <h3><a href='" . URL::to('contest_info/' . $photocontest[$i]['ID']) . "'>" . $contest_name . "</a></h3>\n\t\t\t</div>";
     }
     return $return_string . "||" . $contestcount;
 }
コード例 #4
0
 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)->where('status', 1)->orderby('ID', 'DESC')->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;
             }
             $createdcontest[$i]['themephoto'] = url() . '/public/assets/upload/contest_theme_photo/' . $createdcontest[$i]['themephoto'];
         }
         $Response = array('success' => '1', 'message' => 'Created Contest details are fetched Successfully', 'msgcode' => "c179");
         $final = array("response" => $Response, "createdcontest" => $createdcontest);
         return json_encode($final);
     } else {
         $Response = array('success' => '0', 'message' => 'No Data Available', 'msgcode' => "c117");
         $final = array("response" => $Response);
         return json_encode($final);
     }
 }
コード例 #5
0
    echo $viewcommentforparticipant;
    ?>
)" >
                            </div>

                            <div class="clearfix"></div>

                        </div></div>
                            <?php 
}
?>
            </div>

            <div id="tab-body-5" class="tab-body">
<?php 
$contestdetails = contestModel::select('contest_name', 'conteststartdate', 'contestenddate', 'votingstartdate', 'votingenddate', 'prize', 'noofparticipant', 'themephoto', 'contesttype')->where('ID', $contest_id)->get();
?>

                <div class="cont_img_con radius">
                    <img src="<?php 
echo url();
?>
/public/assets/upload/contest_theme_photo/<?php 
echo $contestdetails[0]['themephoto'];
?>
" class="cont_img">
                    <div class="cont_list">
                        <div class="name"><strong><span class="pch_contestname"> Contest Name: </span> </strong><div class="mb_brk"></div><span class="mleft">{{ $contestdetails[0]['contest_name']}}</span></div>
                        <div class="cstart"><strong><span class="conteststart">Contest Start Date:</span> </strong><div class="mb_brk"></div><span class="mleft">{{ (timezoneModel::convert($contestdetails[0]['conteststartdate'],'UTC',Auth::user()->timezone, 'd-M-Y h:i a')) }}</span></div>
                        <div class="cend"><strong><span class="contestend"> Contest End Date: </span></strong><div class="mb_brk"></div><span class="mleft">{{ (timezoneModel::convert($contestdetails[0]['contestenddate'],'UTC',Auth::user()->timezone, 'd-M-Y h:i a')) }} </span></div>
                        <div class="vstart"><strong><span class="votingstart"> Voting start Date:</span> </strong><div class="mb_brk"></div><span class="mleft">{{ (timezoneModel::convert($contestdetails[0]['votingstartdate'],'UTC',Auth::user()->timezone, 'd-M-Y h:i a')) }} </span></div>
コード例 #6
0
 public function join_contest()
 {
     $curdate = Carbon::now();
     $timezone = Input::get('timezone');
     $inputdetails = Input::except(array('_token', 'uploadfile', 'submitphoto', 'uploadtopic', 'timezone', 'topicvideo', 'topicphoto'));
     $inputdetails['uploaddate'] = $curdate;
     if (Input::file('uploadfile') != '') {
         $destinationPath = 'public/assets/upload/contest_participant_photo';
         $filename = Input::file('uploadfile')->getClientOriginalName();
         $Image = str_random(8) . '_' . $filename;
         $inputdetails['uploadfile'] = $Image;
         $validation = Validator::make($inputdetails, contestparticipantModel::$rules);
     }
     if (Input::get('uploadtopic') != '') {
         ////////New requirements/////////////////
         if (Input::file('topicphoto') != '') {
             $destinationtopicphoto = 'public/assets/upload/topicphotovideo';
             $topicphoto = Input::file('topicphoto')->getClientOriginalName();
             $topicImage = str_random(8) . '_' . $topicphoto;
             $inputdetails['topicphoto'] = $topicImage;
         }
         if (Input::file('topicvideo') != '') {
             $destinationtopicvideo = 'public/assets/upload/topicphotovideo';
             $topicvideo = Input::file('topicvideo')->getClientOriginalName();
             $topicvideoname = str_random(8) . '_' . $topicvideo;
             $inputdetails['topicvideo'] = $topicvideoname;
         }
         $inputdetails['uploadtopic'] = Input::get('uploadtopic');
         //return $inputdetails;
         $validation = Validator::make($inputdetails, contestparticipantModel::$topicrules);
     }
     //return $validation->messages();
     $user_id = Input::get('user_id');
     $contest_id = Input::get('contest_id');
     $verifyid = contestparticipantModel::where('contest_id', $contest_id)->where('user_id', $user_id)->get()->count();
     $contestcount = contestModel::select('noofparticipant')->where('ID', $contest_id)->get();
     $participantcount = contestparticipantModel::where('contest_id', $contest_id)->get()->count();
     if ($verifyid) {
         if ($validation->passes()) {
             if (Input::file('uploadfile') != '') {
                 $file = Input::file('uploadfile');
                 $uploadSuccess = $file->move($destinationPath, $Image);
                 /// Dropbox //////////////
                 /*$appInfo = \Dropbox\AppInfo::loadFromJsonFile("app_info.json");
                 						
                 						$webAuth = new \Dropbox\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");
                 						$authorizeUrl = $webAuth->start();
                 
                 						$accessToken = "LUu8h-uvauAAAAAAAAAAHbDw-bulVL7u8BoRAJtedc0-eCDY-Xj4Qxf1iGucUN7j";
                 						$dbxClient = new \Dropbox\Client($accessToken, "PHP-Example/1.0");
                 
                 						$accountInfo = $dbxClient->getAccountInfo();
                 						
                 						//file_get_contents($file->getRealPath());
                 						
                 						
                 						$f = fopen($file->getRealPath(), "rb");
                 						$result = $dbxClient->uploadFile("/participant/".$Image, \Dropbox\WriteMode::add(), $f);
                 						fclose($f);
                 						
                 						$inputdetails['dropbox_path']=$this->fetchUrl('/participant/'.$inputdetails['uploadfile']); */
                 /// Dropbox end ////////
             }
             if (Input::get('uploadtopic') != '') {
                 if (Input::file('topicphoto') != '') {
                     $topicphotofile = Input::file('topicphoto');
                     $uploadSuccess = $topicphotofile->move($destinationtopicphoto, $topicImage);
                 }
                 if (Input::file('topicvideo') != '') {
                     $topicphotofile = Input::file('topicvideo');
                     $uploadSuccess = $topicphotofile->move($destinationtopicvideo, $topicvideoname);
                 }
             }
             $participant = contestparticipantModel::where('contest_id', $contest_id)->where('user_id', $user_id)->update($inputdetails);
             return Redirect::to("contest_info/" . $contest_id)->with('tab', 'gallery');
         } else {
             return Redirect::to("contest_info/" . $contest_id)->with('tab', 'join')->with('Massage', $validation->messages()->first());
         }
     } else {
         if ($contestcount[0]['noofparticipant'] == $participantcount && $contestcount[0]['noofparticipant'] != 0) {
             return Redirect::to("contest_info/" . $contest_id)->with('tab', 'join')->with('Massage', 'Participants Limit Exceeded');
         } else {
             if ($validation->passes()) {
                 if (Input::file('uploadfile') != '') {
                     $file = Input::file('uploadfile');
                     $uploadSuccess = $file->move($destinationPath, $Image);
                     /// Dropbox //////////////
                     /* $appInfo = \Dropbox\AppInfo::loadFromJsonFile("app_info.json");
                     						
                     						$webAuth = new \Dropbox\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");
                     						$authorizeUrl = $webAuth->start();
                     
                     						$accessToken = "LUu8h-uvauAAAAAAAAAAHbDw-bulVL7u8BoRAJtedc0-eCDY-Xj4Qxf1iGucUN7j";
                     						$dbxClient = new \Dropbox\Client($accessToken, "PHP-Example/1.0");
                     
                     						$accountInfo = $dbxClient->getAccountInfo();
                     						
                     						//file_get_contents($file->getRealPath());
                     						
                     						
                     						$f = fopen($file->getRealPath(), "rb");
                     						$result = $dbxClient->uploadFile("/participant/".$Image, \Dropbox\WriteMode::add(), $f);
                     						fclose($f);
                     						
                     						$inputdetails['dropbox_path']=$this->fetchUrl('/participant/'.$Image); */
                     /// Dropbox end ////////
                 }
                 if (Input::get('uploadtopic') != '') {
                     if (Input::file('topicphoto') != '') {
                         $topicphotofile = Input::file('topicphoto');
                         $uploadSuccess = $topicphotofile->move($destinationtopicphoto, $topicImage);
                     }
                     if (Input::file('topicvideo') != '') {
                         $topicphotofile = Input::file('topicvideo');
                         $uploadSuccess = $topicphotofile->move($destinationtopicvideo, $topicvideoname);
                     }
                 }
                 $participant = contestparticipantModel::create($inputdetails);
                 return Redirect::to("contest_info/" . $contest_id)->with('tab', 'gallery');
             } else {
                 return Redirect::to("contest_info/" . $contest_id)->with('tab', 'join')->with('Massage', $validation->messages()->first());
             }
         }
     }
 }
コード例 #7
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