<!--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">Upload Type</label>
				<div class="col-lg-3">
					<?php $upload_type = set_value('upload_type',($update_data['upload_type'] ?? '')); ?>
					<select required name="upload_type" id="upload_type" class="form-control" onchange="toggleUrlUploadField();">
						<?=$cmObj->get_upload_type_options($upload_type)?>
					</select>
					<?=$validation->showError('upload_type')?>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">File</label>
				<div class="col-lg-3">					
					<div class="input-group doc_file">
						<input type="hidden" name="prev_document_file" id="prev_document_file" value="<?=set_value('prev_document_file',$update_data['document_file'] ?? '')?>">
						<input type="text" name="document_file" value="<?=set_value('document_file',$update_data['document_file'] ?? '')?>" id="document_file" class="form-control" onblur="showHideDocumentViewBtn();" readonly>
						<span class="input-group-btn">
							<button type="button" id="btn_upload_document_file" data-loading-text="Loading..." onclick="loadDocumentFile();" class="btn btn-primary"><i class="fa fa-upload" style="color:white;"></i></button>
						</span>
						<span class="input-group-btn" id="view_document_file_btn">
							<button type="button" onclick="viewDocumentFile();" class="btn btn-primary" ><i class="fa fa-download" style="color:white;"></i></button>
						</span>
					</div>
					<?=$validation->showError('document_file')?>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">Category</label>
				<div class="col-lg-3">
					<select name="download_category_id" id="download_category_id" class="form-control" required>
						<?=$cmObj->get_download_category_options(set_value('download_category_id',($update_data['download_category_id'] ?? '')))?>
					</select>
					<?=$validation->showError('status')?>
				</div>				
			</div>
			<div class="form-group row">
				<label class="d-none col-lg-1 col-form-label text-lg-right">Icon</label>
				<div class="d-none col-lg-3">
					<select name="icon_id" id="icon_id" class="form-control">
						<?=$cmObj->get_icon_options(set_value('icon_id',($update_data['icon_id'] ?? 1)))?>
					</select>
					<?=$validation->showError('icon_id')?>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">Icon Image</label>
				<div class="col-lg-3">					
					<div class="input-group" data-toggle="tooltip" data-placement="bottom"  title="Image size should 400x400px or 1:1 Ratio">
						<input type="hidden" name="prev_icon_file" id="prev_icon_file" value="<?=set_value('prev_icon_file',$update_data['icon_file'] ?? '')?>">
						<input type="text" name="icon_file" value="<?=set_value('icon_file',$update_data['icon_file'] ?? '')?>" id="icon_file" class="form-control" onblur="showHideIconViewBtn();" readonly>
						<span class="input-group-btn">
							<button type="button" id="btn_upload_icon_file" data-loading-text="Loading..." onclick="loadIconFile();" class="btn btn-primary"><i class="fa fa-upload" style="color:white;"></i></button>
						</span>
						<span class="input-group-btn" id="view_icon_file_btn">
							<button type="button" onclick="viewIconFile();" class="btn btn-primary" ><i class="fa fa-download" style="color:white;"></i></button>
						</span>
					</div>
					<?=$validation->showError('icon_file')?>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">Status</label>
				<div class="col-lg-3">
					<select name="status" id="status" class="form-control" required>
						<?=$cmObj->get_status_type(set_value('status',($update_data['status'] ?? '')))?>
					</select>
					<?=$validation->showError('status')?>
				</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="download_ln_id_<?=$language['code']?>" value="<?=set_value('download_ln_id_'.$language['code'],$update_data['download_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>