<?php $__env->startSection('css_page_level'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/bootstrap-select/bootstrap-select.min.css')); ?>"/>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css')); ?>"/>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/clockface/css/clockface.css')); ?>"/>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css')); ?>"/>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css')); ?>"/>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css')); ?>"/>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css')); ?>"/>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-content-wrapper'); ?>
	<div class="page-content-wrapper" id="main">
		<div class="page-content">
			<!-- BEGIN PAGE HEADER-->
			<h3 class="page-title">
			<?php $setting = app('anlutro\LaravelSettings\Facade'); ?>
			<?php $Setting = app('anlutro\LaravelSettings\SettingStore'); ?>
			<?php echo e($setting::get('system_name','全方位建築智慧化管理系統')); ?> <small><?php echo e($setting::get('company_name','新保科技')); ?></small>
			</h3>
			<div class="page-bar">
				<ul class="page-breadcrumb">
					<li>
						<i class="fa fa-home"></i>
						<a href="<?php echo e(route('manage::index')); ?>"><?php echo app('translator')->get('messages.homepage'); ?></a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="javascript:;"><?php echo app('translator')->get('messages.community_manage'); ?></a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="<?php echo e(action('Manage\Platform\ActivityController@index')); ?>"><?php echo app('translator')->get('messages.neighberhood_party'); ?></a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="<?php echo e(action('Manage\Platform\ActivityController@edit')); ?>"><?php echo app('translator')->get('messages.edit_neighberhood_party'); ?></a>
					</li>
				</ul>
				<div class="page-toolbar">

				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN DASHBOARD STATS -->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PORTLET-->
					<?php if(count($errors) > 0): ?>
						<div id="form_error_alert" class="alert alert-danger">
						<button class="close" data-close="alert"></button>
							<ul>
					            <?php foreach($errors->all() as $error): ?>
					                <li><?php echo e($error); ?></li>
					            <?php endforeach; ?>
					        </ul>
						</div>
					<?php endif; ?>
					<div id="form_add_activity_error" class="alert alert-danger display-hide">
						<button class="close" data-close="alert"></button>
						<?php echo app('translator')->get('messages.col_invalid'); ?>
					</div>
					<div id="form_add_activity_success" class="alert alert-success display-hide">
						<button class="close" data-close="alert"></button>
						<?php echo app('translator')->get('messages.add_success'); ?>
					</div>
					<div class="portlet box red-pink">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-plus"></i><?php echo app('translator')->get('messages.edit_neighberhood_party'); ?>
							</div>
							<ul class="nav nav-tabs">
								<li class="active">
									<a href="#normal" data-toggle="tab">
									<?php echo app('translator')->get('messages.general_setting'); ?> </a>
								</li>
								<li>
									<a href="#adv" data-toggle="tab">
									<?php echo app('translator')->get('messages.apply_setting'); ?> </a>
								</li>
							</ul>
						</div>
						<div class="portlet-body">
							<form action="<?php echo e(action('Manage\Platform\ActivityController@update')); ?>" method="POST" id="form_add_activity" class="form-horizontal form-bordered"  enctype="multipart/form-data">
							<div class="tab-content form-horizontal form-bordered">
								<div class="tab-pane active" id="normal">
									<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
									<input type="hidden" name="id" value="<?php echo e($activity->id); ?>">
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.party_name'); ?><span class="required" aria-required="true"> * </span></label>
										<div class="col-md-6">
											<input name="title" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_party_name'); ?>" value="<?php echo e($activity->title); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.category'); ?><span class="required" aria-required="true"> * </span></label>
										<div class="col-md-4">
											<select name="type" class="bs-select form-control">
												<optgroup>
											        <option value="<?php echo e($activity->type); ?>"><?php echo e($activity->type); ?></option>
											    </optgroup>
												<optgroup>
													<option value="<?php echo app('translator')->get('messages.eating'); ?>"><?php echo app('translator')->get('messages.eating'); ?></option>
													<option value="<?php echo app('translator')->get('messages.dressing'); ?>"><?php echo app('translator')->get('messages.dressing'); ?></option>
													<option value="<?php echo app('translator')->get('messages.living'); ?>"><?php echo app('translator')->get('messages.living'); ?></option>
													<option value="<?php echo app('translator')->get('messages.going'); ?>"><?php echo app('translator')->get('messages.going'); ?></option>
													<option value="<?php echo app('translator')->get('messages.eduing'); ?>"><?php echo app('translator')->get('messages.eduing'); ?></option>
													<option value="<?php echo app('translator')->get('messages.loking'); ?>"><?php echo app('translator')->get('messages.loking'); ?></option>
												</optgroup>
											</select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.party_start_time'); ?><span class="required" aria-required="true"> * </span></label>
										<div class="col-md-6">
											<div class="input-group date form_datetime">
												<input name="time_start" type="text" size="16" readonly class="form-control" value="<?php echo e($activity->time_start); ?>">
												<span class="input-group-btn">
												<button class="btn default date-set" type="button"><i class="fa fa-calendar"></i></button>
												</span>
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.party_over_time'); ?><span class="required" aria-required="true"> * </span></label>
										<div class="col-md-6">
											<div class="input-group date form_datetime">
												<input name="time_end" type="text" size="16" readonly class="form-control" value="<?php echo e($activity->time_end); ?>">
												<span class="input-group-btn">
												<button class="btn default date-set" type="button"><i class="fa fa-calendar"></i></button>
												</span>
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.party_time'); ?><span class="required" aria-required="true"> * </span></label>
										<div class="col-md-6">
											<input name="time_range" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_party_time'); ?>" value="<?php echo e($activity->time_range); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.purpose_of_party'); ?></label>
										<div class="col-md-6">
											<input name="purpose" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_purpose_of_party'); ?>" value="<?php echo e($activity->purpose); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.organizer_of_party'); ?></label>
										<div class="col-md-6">
											<input name="holder" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_organizer_of_party'); ?>"  value="<?php echo e($activity->holder); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.party_place'); ?></label>
										<div class="col-md-6">
											<input name="location" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_party_place'); ?>" value="<?php echo e($activity->location); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.place_from'); ?></label>
										<div class="col-md-6">
											<?php if($Setting->get('npm_version') ==  '0'): ?>
											<input name="area" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_place_from'); ?>" value="<?php echo e($activity->area); ?>">
											<?php else: ?>
											<input name="area" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_place_from'); ?>" value="<?php echo e($activity->area); ?>" disabled>
											<?php endif; ?>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.fill'); ?></label>
										<div class="col-md-6">
											<input name="fee" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_fill'); ?>" value="<?php echo e($activity->fee); ?>">
										</div>
									</div>
									<div class="form-group cover">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.cover_img_party'); ?></label>
										<div class="col-md-4">
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
													<?php if(!empty($activity->cover_img)): ?>
													<img src="<?php echo e($activity->cover_img); ?>?fit_w=200&fit_h=150" alt=""/>
													<?php else: ?>
													<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
													<?php endif; ?>
												</div>
												<div>
													<span class="btn default btn-file">
													<span class="fileinput-new">
													<?php echo app('translator')->get('messages.select_img'); ?> </span>
													<span class="fileinput-exists">
													<?php echo app('translator')->get('messages.change'); ?> </span>
													<input type="file" name="cover_img" id="cover_img">
													<input type="hidden" name="compressed_cover" id="compressed_cover" value="">
													</span>
													<a href="javascript:;" id="cover_reset" class="btn red fileinput" data-dismiss="fileinput">
													<?php echo app('translator')->get('messages.remove'); ?> </a>
												</div>
											</div>
										</div>
									</div>
									<div class="form-group photo1">
										<label class="col-md-3 control-label">相片</label>
										<div class="col-md-8">
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
													<?php if(!empty($activity->photo1_img)): ?>
													<img src="<?php echo e($activity->photo1_img); ?>?fit_w=200&fit_h=150" alt=""/>
													<?php else: ?>
													<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
													<?php endif; ?>
												</div>
												<div>
													<span class="btn default btn-file">
													<span class="fileinput-new">
													選擇圖片 </span>
													<span class="fileinput-exists">
													更換 </span>
													<input type="file" name="photo1_img" id="photo1_img">
													<input type="hidden" name="compressed_photo1" id="compressed_photo1" value="">
													</span>
													<a href="javascript:;" id="photo1_reset" class="btn red fileinput-exists" data-dismiss="fileinput">
													移除 </a>
												</div>
											</div>
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
													<?php if(!empty($activity->photo2_img)): ?>
													<img src="<?php echo e($activity->photo2_img); ?>?fit_w=200&fit_h=150" alt=""/>
													<?php else: ?>
													<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
													<?php endif; ?>
												</div>
												<div>
													<span class="btn default btn-file">
													<span class="fileinput-new">
													選擇圖片 </span>
													<span class="fileinput-exists">
													更換 </span>
													<input type="file" name="photo2_img" id="photo2_img">
													<input type="hidden" name="compressed_photo2" id="compressed_photo2" value="">
													</span>
													<a href="javascript:;" id="photo2_reset" class="btn red fileinput-exists" data-dismiss="fileinput">
													移除 </a>
												</div>
											</div>
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
													<?php if(!empty($activity->photo3_img)): ?>
													<img src="<?php echo e($activity->photo3_img); ?>?fit_w=200&fit_h=150" alt=""/>
													<?php else: ?>
													<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
													<?php endif; ?>
												</div>
												<div>
													<span class="btn default btn-file">
													<span class="fileinput-new">
													選擇圖片 </span>
													<span class="fileinput-exists">
													更換 </span>
													<input type="file" name="photo3_img" id="photo3_img">
													<input type="hidden" name="compressed_photo3" id="compressed_photo3" value="">
													</span>
													<a href="javascript:;" id="photo3_reset" class="btn red fileinput-exists" data-dismiss="fileinput">
													移除 </a>
												</div>
											</div>
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
													<?php if(!empty($activity->photo4_img)): ?>
													<img src="<?php echo e($activity->photo4_img); ?>?fit_w=200&fit_h=150" alt=""/>
													<?php else: ?>
													<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
													<?php endif; ?>
												</div>
												<div>
													<span class="btn default btn-file">
													<span class="fileinput-new">
													選擇圖片 </span>
													<span class="fileinput-exists">
													更換 </span>
													<input type="file" name="photo4_img" id="photo4_img">
													<input type="hidden" name="compressed_photo4" id="compressed_photo4" value="">
													</span>
													<a href="javascript:;" id="photo4_reset" class="btn red fileinput-exists" data-dismiss="fileinput">
													移除 </a>
												</div>
											</div>
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
													<?php if(!empty($activity->photo5_img)): ?>
													<img src="<?php echo e($activity->photo5_img); ?>?fit_w=200&fit_h=150" alt=""/>
													<?php else: ?>
													<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
													<?php endif; ?>
												</div>
												<div>
													<span class="btn default btn-file">
													<span class="fileinput-new">
													選擇圖片 </span>
													<span class="fileinput-exists">
													更換 </span>
													<input type="file" name="photo5_img" id="photo5_img">
													<input type="hidden" name="compressed_photo5" id="compressed_photo5" value="">
													</span>
													<a href="javascript:;" id="photo5_reset" class="btn red fileinput-exists" data-dismiss="fileinput">
													移除 </a>
												</div>
											</div>
										</div>
									</div>
									<div class="form-group place_cover">
										<label class="col-md-3 control-label">場地圖片</label>
										<div class="col-md-4">
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
													<?php if(!empty($activity->place_cover_img)): ?>
													<img src="<?php echo e($activity->place_cover_img); ?>?fit_w=200&fit_h=150" alt=""/>
													<?php else: ?>
													<img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt=""/>
													<?php endif; ?>
												</div>
												<div>
													<span class="btn default btn-file">
													<span class="fileinput-new">
													選擇圖片 </span>
													<span class="fileinput-exists">
													更換 </span>
													<input type="file" name="place_cover_img" id="place_cover_img">
													<input type="hidden" name="compressed_place_cover" id="compressed_place_cover" value="">
													</span>
													<a href="javascript:;" id="place_cover_reset" class="btn red fileinput-exists" data-dismiss="fileinput">
													移除 </a>
												</div>
											</div>
										</div>
									</div>
									<div class="form-group file">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.annex'); ?></label>
										<div class="col-md-4">
											<div class="fileinput fileinput-new" data-provides="fileinput">
											<?php if($activity->file != ''): ?>
											<a type="button" class="btn green btn-xs" href="<?php echo e($activity->file); ?>"><?php echo e($original_filename); ?></a>
											<?php endif; ?>
												<div class="input-group input-large">
													<div class="form-control uneditable-input input-fixed input-medium" data-trigger="fileinput">
														<i class="fa fa-file fileinput-exists"></i>&nbsp; <span class="fileinput-filename">
														</span>
													</div>
													<span class="input-group-addon btn default btn-file">
													<span class="fileinput-new">
													<?php echo app('translator')->get('messages.select_file'); ?> </span>
													<span class="fileinput-exists">
													<?php echo app('translator')->get('messages.change'); ?> </span>
													<input type="file" name="file">
													</span>
													<a href="javascript:;" id="file_reset" class="input-group-addon btn red fileinput-exists" data-dismiss="fileinput">
													<?php echo app('translator')->get('messages.remove'); ?> </a>
												</div>
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.admin_party'); ?></label>
										<div class="col-md-6">
											<input name="forwho" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_admin_party'); ?>"  value="<?php echo e($activity->forwho); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.apply_paperwork'); ?></label>
										<div class="col-md-6">
											<input name="need_cards" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_apply_paperwork'); ?>" value="<?php echo e($activity->need_cards); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.safety_precautions'); ?></label>
										<div class="col-md-8">
											<textarea name="safe_note" class="form-control" rows="3"><?php echo e($activity->safe_note); ?></textarea>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-2"><?php echo app('translator')->get('messages.intro_party'); ?><span class="required" aria-required="true"> * </span></label>
										<div class="col-md-12">
											<textarea name="content" id="content" rows="50" cols="80">
											<?php echo e($activity->content); ?>

								            </textarea>
										</div>
									</div>
									<div class="form-actions">
										<div class="row">
											<div class="col-md-offset-3 col-md-9">
												<button type="submit" class="btn red-pink pull-right"><i class="fa fa-check"></i> <?php echo app('translator')->get('messages.save'); ?></button>
											</div>
										</div>
									</div>
								</div>
								<div class="tab-pane" id="adv">
									<div class="form-group">
										<label class="control-label col-md-3"><?php echo app('translator')->get('messages.open_apply_or_not'); ?></label>
										<div class="col-md-6">
											<?php if($activity->sign_flag ==1): ?>
											<input type="checkbox" name="sign_flag" class="make-switch" data-on-text="<?php echo app('translator')->get('messages.open_apply'); ?>" data-off-text="<?php echo app('translator')->get('messages.close_apply'); ?>" checked>
											<?php else: ?>
											<input type="checkbox" name="sign_flag" class="make-switch" data-on-text="<?php echo app('translator')->get('messages.open_apply'); ?>" data-off-text="<?php echo app('translator')->get('messages.close_apply'); ?>">
											<?php endif; ?>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.open_apply_time'); ?><br><small class="text-muted"><?php echo app('translator')->get('messages.autosys_open_apply'); ?></small></label>
										<div class="col-md-6">
											<div class="input-group date form_datetime">
												<input name="sign_start" type="text" size="16" readonly class="form-control" value="<?php echo e($activity->sign_start); ?>">
												<span class="input-group-btn">
												<button class="btn default date-set" type="button"><i class="fa fa-calendar"></i></button>
												</span>
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-3 control-label"><?php echo app('translator')->get('messages.over_apply_time'); ?><br><small class="text-muted"><?php echo app('translator')->get('messages.over_apply_time_autosys_close'); ?></small></label>
										<div class="col-md-6">
											<div class="input-group date form_datetime">
												<input name="sign_end" type="text" size="16" readonly class="form-control" value="<?php echo e($activity->sign_end); ?>">
												<span class="input-group-btn">
												<button class="btn default date-set" type="button"><i class="fa fa-calendar"></i></button>
												</span>
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3"><?php echo app('translator')->get('messages.limit_apply_amount'); ?></label>
										<div class="col-md-3">
											<?php if($activity->sign_person_max_flag ==1): ?>
											<input type="checkbox" name="sign_person_max_flag" class="make-switch" data-on-text="<?php echo app('translator')->get('messages.limit'); ?>" data-off-text="<?php echo app('translator')->get('messages.unlimit'); ?>" checked>
											<?php else: ?>
											<input type="checkbox" name="sign_person_max_flag" class="make-switch" data-on-text="<?php echo app('translator')->get('messages.limit'); ?>" data-off-text="<?php echo app('translator')->get('messages.unlimit'); ?>">
											<?php endif; ?>
										</div>
										<div class="col-md-4">
											<input name="sign_person_max" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_limit_amount'); ?>" value="<?php echo e($activity->sign_person_max); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3"><?php echo app('translator')->get('messages.limit_apply_amount_max'); ?></label>
										<div class="col-md-3">
										<?php if($activity->sign_person_each_max_flag ==1): ?>
											<input type="checkbox" name="sign_person_each_max_flag" class="make-switch" data-on-text="<?php echo app('translator')->get('messages.limit'); ?>" data-off-text="<?php echo app('translator')->get('messages.unlimit'); ?>" checked>
											<?php else: ?>
											<input type="checkbox" name="sign_person_each_max_flag" class="make-switch" data-on-text="<?php echo app('translator')->get('messages.limit'); ?>" data-off-text="<?php echo app('translator')->get('messages.unlimit'); ?>">
											<?php endif; ?>
										</div>
										<div class="col-md-4">
											<input name="sign_person_each_max" type="text" class="form-control" placeholder="<?php echo app('translator')->get('messages.enter_limit_amount'); ?>"value="<?php echo e($activity->sign_person_each_max); ?>">
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-md-3"><?php echo app('translator')->get('messages.apply_explanation'); ?></label>
										<div class="col-md-9">
											<textarea class="form-control" name="sign_info" rows="6"><?php echo e($activity->sign_info); ?></textarea>
										</div>
									</div>
								</div>
							</div>
							</form>
						</div>
					</div>
					<!-- END PORTLET-->
				</div>
			</div>
		</div>
	</div>


<?php $__env->stopSection(); ?>

<?php $__env->startSection('plugins_page_level'); ?>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/jquery-validation/js/jquery.validate.min.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-fileinput/additional-methods.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootbox/bootbox.min.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/ckeditor/ckeditor.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/clockface/js/clockface.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-daterangepicker/moment.min.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-daterangepicker/daterangepicker.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js')); ?>"></script>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js_page_level'); ?>
<script>
$(document).ready(function(){
    CKEDITOR.replace( 'content' );

    //Time Picker
	$('.timepicker-24').timepicker({
        autoclose: true,
        minuteStep: 5,
        showSeconds: false,
        showMeridian: false
    });

    //TimePicker btn
    $('.timepicker').parent('.input-group').on('click', '.input-group-btn', function(e){
        e.preventDefault();
        $(this).parent('.input-group').find('.timepicker').timepicker('showWidget');
    });

    $(".form_datetime").datetimepicker({autoclose: true});

	//驗證送出表單
	$('#form_add_activity').validate({
		errorElement: 'span', //default input error message container
        errorClass: 'help-block help-block-error', // default input error message class
        focusInvalid: false, // do not focus the last invalid input
        ignore: "",  // validate all fields including form hidden input
		rules:{
			title:{
				required:true
			},
			cover_img:{
				extension:"jpg|gif",
			},
			place_cover_img:{
				extension:"jpg|gif",
			},
			file:{
				extension:"pdf"
			}

		},
		messages:{
			title:{
				required:'<?php echo app('translator')->get('messages.enter_party_name'); ?>'
			},
			cover_img:{
				extension: '<?php echo app('translator')->get('messages.correct_style'); ?> jpg / gif <?php echo app('translator')->get('messages.upload'); ?>',
			},
			place_cover_img:{
				extension: '請使用正確格式 jpg / gif上傳',
			},
			file:{
				extension: '<?php echo app('translator')->get('messages.correct_style'); ?> pdf <?php echo app('translator')->get('messages.upload'); ?>'
			}
		},

        invalidHandler: function (event, validator) { //display error alert on form submit
            $('#form_add_activity_success').hide();
            $('#form_add_activity_error').show();
            $('.modal').scrollTop($('#form_add_activity_error'));
        },

        highlight: function (element) { // hightlight error inputs
           $(element)
                .closest('.form-group').addClass('has-error'); // set error class to the control group
        },

        unhighlight: function (element) { // revert the change done by hightlight
            $(element)
                .closest('.form-group').removeClass('has-error'); // set error class to the control group
        },

        success: function (label) {
            label
                .closest('.form-group').removeClass('has-error'); // set success class to the control group
        },

        submitHandler: function (form) {
			$('textarea.ckeditor').each(function () {
			   var $textarea = $(this);
			   $textarea.val(CKEDITOR.instances[$textarea.attr('name')].getData());
			});

			if($('#compressed_cover').val() != ''){
				$("cover_img").prop('disabled', true);
			}
			if($('#compressed_place_cover').val() != ''){
				$("place_cover_img").prop('disabled', true);
			}

			form.submit();
        },

        errorPlacement: function(error, element) {
        	if (element.attr("name") === "cover_img" || element.attr("name") === "file") {
    			error.appendTo( element.parent().parent() );

    		} else {
    			error.insertAfter( element );
       		}
		},
	});


	$('.fileinput').on('change.bs.fileinput', function() {
		$("#form_add_activity").validate().element('input[name=cover_img]');
		$("#form_add_activity").validate().element('input[name=place_cover_img]');
		$("#form_add_activity").validate().element('input[name=file]');	
	});
});
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.manage', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>