?> class="add-link backclr_<?php echo $categorydetails[$i]['Interest_id']; ?>"></a></td> <td><a href="<?php echo url() . '/gotoeditcategory?interestid=' . $categorydetails[$i]['Interest_id']; ?>" class="edit-link" ></a></td> <td><a href="#" onclick="deletecategory('<?php echo $categorydetails[$i]['Interest_id']; ?>')" class="del-link" ></a></td> </tr> <?php } ?> </tbody> </table> </div> </div> <div id="tab-body-2" class="tab-body"> <div id="p"> <div class="clrscr"></div> <?php if ($categoryid != '') { ?> <form id="editprofile" name="group" enctype="multipart/form-data" action="<?php echo url() . '/editcategory/' . $categoryid; ?>" method="post" class="form_mid"> <?php $categorydetails = InterestCategoryModel::where('Interest_id', $categoryid)->first(); } else { ?><form id="editprofile" name="group" enctype="multipart/form-data" action="addcategory" method="post" class="form_mid"><?php } ?> <div class="loginform loginbox grp_ctr"><!-- mar1--> <legend class="radius" style="min-height:100px;"><div class="leg_head">Category details</div> <div class="leg_head"> </div> @if(isset($er_data)) <p class="alert" style="color:green;padding:5px;text-align:center;font-size:13px">{{ $er_data }}</p> @endif <p> <div class="inp_pfix aft_fst_mar"><img src="{{ URL::to('/assets/inner/images/pass_icons.png') }}" width="25" height="25"></div> <input ="text" id="categoryname" name="categoryname" value="{{ isset($categorydetails->Interest_name)?$categorydetails->Interest_name:"" }}" placeholder="Category Name" class="radius pfix_mar" /> </p>
} ?> value="{{ isset($old_data['prize'])?$old_data['prize']:$contestdetails['prize'] }}" class="radius pfix_mar" /> </p>--> <p> <!--<div class="inp_pfix"><img src="img/gender_icons.png" width="25" height="25"></div>--> <textarea name="description" cols="" rows="" class="radius" placeholder="Contest Information" title="Contest Information">{{ isset($old_data['description'])?$old_data['description']:$contestdetails['description'] }}</textarea> </p> </legend> <legend class="radius"><div class="leg_head"><span id="txt_favorite">Favorite</span></div> <p> <div class="inp_pfix mbmtop"><img src="{{ URL::to($assets_path.'img/interest_icons.png')}}" width="25" height="25"></div> <?php $interestList = InterestCategoryModel::where('status', 1)->lists('Interest_name', 'Interest_id'); $contestInterest = contestinterestModel::where('contest_id', $contest_id)->lists('category_id'); ?> {{ Form::select('interest[]', $interestList,$contestInterest, array('class'=>'SlectBox testsel radius','multiple'=>'multiple',(($noofparticipants>0)?'disabled':''),'placeholder'=>'Select Interest','onchange'=>'console.log($(this).children(":selected").length)')) }} </p> </legend> </div> <div class="loginform loginbox mar2"> <legend class="radius"><div class="leg_head"><span id="txt_contestschedule">Contest Schedule</span></div> <p> <div class="inp_pfix "><img src="{{ URL::to($assets_path.'img/date_icons.png')}}" width="25" height="25"></div> <input type="text" value="{{ isset($old_data['conteststartdate'])?date('m/d/Y h:i a',strtotime($old_data['conteststartdate'])):(timezoneModel::convert($contestdetails['conteststartdate'],'UTC',Auth::user()->timezone, 'm/d/Y h:i a')) }}" <?php if (Auth::user()->ID != 1) { if ($noofparticipants > 0 || $contestdetails['conteststartdate'] <= date('Y-m-d H:i:s')) {
public function deletecategory() { $categoryid = Input::get('categoryid'); $usercategory = userinterestModel::where('interest_id', $categoryid)->get()->count(); $contestcategory = contestinterestModel::where('category_id', $categoryid)->get()->count(); if ($usercategory > 0 || $contestcategory > 0) { $er_data = 'This category is used. So not able to delete '; return Redirect::to('category')->with('er_data', $er_data); } else { $deletecategory = InterestCategoryModel::where('Interest_id', $categoryid)->delete(); if ($deletecategory) { $er_data = 'Category deleted successfully'; return Redirect::to('category')->with('er_data', $er_data); } } }