コード例 #1
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'" : "";
    ?>
 >
                                <div class="thumbnail">
                                    <a href="{{ URL::to('contest_info/'.$photocontest[$i]['ID']) }}"><img src="{{ URL::to('public/assets/upload/contest_theme_photo/'.$photocontest[$i]['themephoto']) }}" alt="nyc subway"></a>
                                    <span class="postdate">Ends on : {{ (timezoneModel::convert($photocontest[$i]['contestenddate'],'UTC',Auth::user()->timezone, 'm/d/Y h:i a')) }}</span>
コード例 #2
0
 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;
 }