<!--begin::Card-->
<div class="card card-custom gutter-b example example-compact">
	<div class="card-header">
		<h3 class="card-title"><?=$form_heading?></h3>
	</div>
	<?=form_open_multipart('',['class'=>'form','autocomplete'=>'off','onsubmit'=>'blockPage()'])?>
		<div class="card-body">
			<div class="form-group row">
				<label class="col-lg-1 col-form-label text-lg-right">Album</label>
				<div class="col-lg-3">
					<select required name="photo_album_id" id="photo_album_id" class="form-control">
						<?=$cmObj->get_photo_album_options(set_value('photo_album_id',($update_data['photo_album_id'] ?? '')))?>
					</select>
					<?=$validation->showError('photo_album_id')?>
				</div>	
				<label class="col-lg-1 col-form-label text-lg-right">Image</label>
				<div class="col-lg-3">
					<div class="custom-file" data-toggle="tooltip" data-placement="bottom"  title="Image size should 900x600px or 3:2 Ratio">
						<input type="file" class="custom-file-input" id="image" name="image" accept=".png,.jpg,.gif,.jpeg"/>
						<label class="custom-file-label" for="image">Choose file</label>
					</div>
					<?=$validation->showError('image')?>
					<?php $uploaded_photo = set_value('uploaded_photo',$update_data['image'] ?? ''); ?>
					<input type="hidden" name="uploaded_photo" id="uploaded_photo" value="<?=set_value('uploaded_photo',$uploaded_photo)?>" />
					<?php if($uploaded_photo!=""){ ?>
						<div class="text-primary"><a href="<?=base_url('/public/uploads/'.$uploaded_photo)?>" target="_blank">View uploaded</a></div>					
					<?php } ?>
				</div>	
				<label class="col-lg-1 col-form-label text-lg-right">Status</label>
				<div class="col-lg-1">
					<select required name="status" id="status" class="form-control">
						<?=$cmObj->get_status_options(set_value('status',($update_data['status'] ?? '')))?>
					</select>
					<?=$validation->showError('status')?>
				</div>
				
				<label class="col-lg-1 col-form-label text-lg-right">Sort Order</label>
				<div class="col-lg-1">
					<input type="number" name="sort_order" id="sort_order" value="<?=set_value('sort_order',$update_data['sort_order'] ?? '')?>" class="form-control" placeholder="Sort Order" required />					
					<?=$validation->showError('sort_order')?>
				</div>
				
			</div>
			<?php if($language_list){ ?>
			<div class="accordion accordion-toggle-arrow form-group" id="accordionLanguage">
			<?php foreach($language_list as $language){ ?>	
				<input type="hidden" name="photo_gallery_ln_id_<?=$language['code']?>" value="<?=set_value('photo_gallery_ln_id_'.$language['code'],$update_data['photo_gallery_ln_id_'.$language['code']] ?? '')?>">
				<div class="card">
					<div class="card-header">
						<div class="card-title" data-toggle="collapse" data-target="#<?=$language['code']?>">
							<?=$language['name']?>
						</div>
					</div>
					<div id="<?=$language['code']?>" class="collapse show" data-parent="#accordionLanguage">
						<div class="card-body">
							<div class="form-group row">
								<label class="col-lg-1 col-form-label text-lg-right">Title</label>
								<div class="col-lg-5">
									<input type="text" name="title_<?=$language['code']?>" id="title_<?=$language['code']?>" value="<?=set_value('title_'.$language['code'],$update_data['title_'.$language['code']] ?? '')?>" class="form-control" placeholder="Title" required />					
									<?=$validation->showError('title_'.$language['code'])?>
								</div>
							</div>							
						</div>
					</div>
				</div>
			<?php } ?>
			</div>
		<?php } ?>	
		</div>
		<div class="card-footer">
			<div class="row">
				<div class="col-lg-12 text-center">
					<button type="submit" name="save" value="Save" class="btn btn-primary mr-2">Save</button>
				</div>
			</div>
		</div>
	</form>
</div>