<!--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','onsubmit'=>'blockPage()'])?>
		<div class="card-body">			
		<?php if($language_list){ ?>
			<div class="accordion accordion-toggle-arrow form-group" id="accordionLanguage">
			<?php foreach($language_list as $language){ ?>	
				<input type="hidden" name="product_ln_id_<?=$language['code']?>" value="<?=set_value('product_ln_id_'.$language['code'],$update_data['product_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>
								<label class="col-lg-1 col-form-label text-lg-right">Meta Title</label>
								<div class="col-lg-5">
									<input required type="text" name="meta_title_<?=$language['code']?>" id="meta_title_<?=$language['code']?>" value="<?=set_value('meta_title_'.$language['code'],$update_data['meta_title_'.$language['code']] ?? '')?>" class="form-control" placeholder="Enter Meta Title in Selected Language"/>					
									<?=$validation->showError('meta_title_'.$language['code'])?>
								</div>
							</div>
							<div class="form-group row">				
								<label class="col-lg-1 col-form-label text-lg-right">Meta Keywords</label>
								<div class="col-lg-5">
									<textarea name="meta_keywords_<?=$language['code']?>" id="meta_keywords_<?=$language['code']?>" class="form-control" placeholder="Meta Keywords in Selected Language"><?=set_value('meta_keywords_'.$language['code'],$update_data['meta_keywords_'.$language['code']] ?? '')?></textarea>					
									<?=$validation->showError('meta_keywords_'.$language['code'])?>
								</div>
								<label class="col-lg-1 col-form-label text-lg-right">Meta Description</label>
								<div class="col-lg-5">
									<textarea name="meta_description_<?=$language['code']?>" id="meta_description_<?=$language['code']?>" class="form-control" placeholder="Meta Description in Selected Language"><?=set_value('meta_description_'.$language['code'],$update_data['meta_description_'.$language['code']] ?? '')?></textarea>					
									<?=$validation->showError('meta_description_'.$language['code'])?>
								</div>							
							</div>
							<div class="form-group row">				
								<label class="col-lg-1 col-form-label text-lg-right">Dose</label>
								<div class="col-lg-5">
									<textarea name="dose_<?=$language['code']?>" id="dose_<?=$language['code']?>" class="form-control" placeholder="Dose in Selected Language"><?=set_value('dose_'.$language['code'],$update_data['dose_'.$language['code']] ?? '')?></textarea>					
									<?=$validation->showError('dose_'.$language['code'])?>
								</div>
								<label class="col-lg-1 col-form-label text-lg-right">Compatibility</label>
								<div class="col-lg-5">
									<textarea name="compatibility_<?=$language['code']?>" id="compatibility_<?=$language['code']?>" class="form-control" placeholder="Compatibility in Selected Language"><?=set_value('compatibility_'.$language['code'],$update_data['compatibility_'.$language['code']] ?? '')?></textarea>					
									<?=$validation->showError('compatibility_'.$language['code'])?>
								</div>							
							</div>
							<div class="form-group row d-none">
								<label class="col-lg-1 col-form-label text-lg-right">Short Description</label>
								<div class="col-lg-11">
									<textarea name="short_description_<?=$language['code']?>" id="short_description_<?=$language['code']?>" class="form-control" placeholder="Short Description in Selected Language"><?=set_value('short_description_'.$language['code'],$update_data['short_description_'.$language['code']] ?? '')?></textarea>					
									<?=$validation->showError('short_description_'.$language['code'])?>
								</div>
							</div>							
							<div class="form-group row">
								<label class="col-lg-1 col-form-label text-lg-right">Description</label>
								<div class="col-lg-11">
									<textarea name="description_<?=$language['code']?>" id="description_<?=$language['code']?>" class="form-control" placeholder="Description in Selected Language"><?=set_value('description_'.$language['code'],$update_data['description_'.$language['code']] ?? '')?></textarea>					
									<?=$validation->showError('description_'.$language['code'])?>
								</div>				
							</div>
							<div class="form-group row">
								<label class="col-lg-1 col-form-label text-lg-right">Benefit</label>
								<div class="col-lg-5 text-lg-left">
									<textarea id="benefit_<?=$language['code']?>" class="form-control tagify" name="benefit_<?=$language['code']?>" placeholder="Product Benefit"><?=set_value('benefit_'.$language['code'],$update_data['benefit_'.$language['code']] ?? '')?></textarea>
									<?=$validation->showError('benefit_'.$language['code'])?>
								</div>
								<label class="col-lg-1 col-form-label text-lg-right">Packing</label>
								<div class="col-lg-5 text-lg-left">
									<textarea id="packing_<?=$language['code']?>" class="form-control tagify" name="packing_<?=$language['code']?>" placeholder="Available Packing"><?=set_value('packing_'.$language['code'],$update_data['packing_'.$language['code']] ?? '')?></textarea>
									<?=$validation->showError('packing_'.$language['code'])?>
								</div>
							</div>
						</div>
					</div>
				</div>
			<?php } ?>
			</div>
		<?php } ?>
			<fieldset class="bordered-fieldset">
			<legend>Product Images</legend>
			<div class="row">			
			<?php for($pi=1;$pi<=5;$pi++){ ?>
				<label class="form-group col-lg-1 col-form-label text-lg-right">Image <?=$pi?></label>
				<div class="form-group col-lg-3">
					<div class="custom-file" data-toggle="tooltip" data-placement="bottom"  title="Image size should 600x600px png or 1:1 Ratio">
						<input type="file" class="custom-file-input" id="product_image_<?=$pi?>" name="product_image_<?=$pi?>" accept=".png,.jpg,.gif,.jpeg"/>
						<label class="custom-file-label" for="product_image_<?=$pi?>">Choose file</label>
					</div>
					<?=$validation->showError('product_image_'.$pi)?>
					<?php $uploaded_product_image = set_value('uploaded_product_image_'.$pi,$update_data['product_image_'.$pi] ?? ''); ?>
					<input type="hidden" name="uploaded_product_image_<?=$pi?>" id="uploaded_product_image_<?=$pi?>" value="<?=set_value('uploaded_product_image_'.$pi,$uploaded_product_image)?>" />
					<?php if($uploaded_product_image!=""){ ?>
						<div class="text-primary" id="view_product_image_<?=$pi?>"><a href="javascript:;" onclick="showProductImage(<?=$pi?>);">View uploaded</a><a href="javascript:;" onclick="deleteFile(<?=$product_id?>,'product_image_<?=$pi?>');" class="ml-3"><i class="fa fa-times text-danger"></i></a></div>					
					<?php } ?>
				</div>
			<?php } ?>
			<?php for($pii=1;$pii<=1;$pii++){ ?>
				<label class="form-group col-lg-1 col-form-label text-lg-right">Icon</label>
				<div class="form-group col-lg-3">
					<div class="custom-file" data-toggle="tooltip" data-placement="bottom"  title="Image size should 500x500px or 1:1 Ratio">
						<input type="file" class="custom-file-input" id="product_icon_img_<?=$pii?>" name="product_icon_img_<?=$pii?>" accept=".png,.jpg,.gif,.jpeg" />
						<label class="custom-file-label" for="product_icon_img_<?=$pii?>">Choose file</label>
					</div>
					<?=$validation->showError('product_icon_img_'.$pii)?>
					<?php $uploaded_product_icon_img = set_value('uploaded_product_icon_img_'.$pii,$update_data['product_icon_img_'.$pii] ?? ''); ?>
					<input type="hidden" name="uploaded_product_icon_img_<?=$pii?>" id="uploaded_product_icon_img_<?=$pii?>" value="<?=set_value('uploaded_product_icon_img_'.$pii,$uploaded_product_icon_img)?>" />
					<?php if($uploaded_product_icon_img!=""){ ?>
						<div class="text-primary"><a href="javascript:;" onclick="showProductIcon(<?=$pii?>);">View uploaded</a></div>					
					<?php } ?>
				</div>
			<?php } ?>
			</div>
			</fieldset>
			<div class="form-group row">
				<label class="col-lg-1 col-form-label text-lg-right">Url</label>
				<div class="col-lg-4">
					<input required type="text" name="product_url" id="product_url" value="<?=set_value('product_url',$update_data['product_url'] ?? '')?>" class="form-control" placeholder="product Url"/>					
					<?=$validation->showError('product_url')?>
				</div>
				<div class="col-lg-1 pl-0 text-right">
					<button type="button" class="btn btn-info" style="width:100%" name="btn_generate_url" onclick="genAlnumStr('title_en','product_url');">Generate</button>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">Banner</label>
				<div class="col-lg-4">
					<div class="custom-file">
						<input type="file" class="custom-file-input" id="banner_image" name="banner_image" accept=".png,.jpg,.gif,jpeg"/>
						<label class="custom-file-label" for="banner_image">Choose file</label>
					</div>
					<?=$validation->showError('banner_image')?>
			<?php $uploaded_banner_image = set_value('uploaded_banner_image',$update_data['banner_image'] ?? ''); ?>
					<input type="hidden" name="uploaded_banner_image" id="uploaded_banner_image" value="<?=set_value('uploaded_banner_image',$uploaded_banner_image)?>" />
					<?php if($uploaded_banner_image!=""){ ?>
						<div class="text-primary"><a href="javascript:;" onclick="showBannerImage();">View uploaded</a></div>					
					<?php } ?>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-lg-1 col-form-label text-lg-right">Category</label>
				<div class="col-lg-4">
					<select name="product_category_id" id="product_category_id" class="form-control">
						<?=$cmObj->get_product_category_options(set_value('product_category_id',($update_data['product_category_id'] ?? '')))?>
					</select>
					<?=$validation->showError('product_category_id')?>
				</div>
				<label class="col-lg-2 col-form-label text-lg-right">Status</label>
				<div class="col-lg-4">
					<select required name="status" id="status" class="form-control">
						<?=$cmObj->get_status_options(set_value('status',($update_data['status'] ?? '')))?>
					</select>
					<?=$validation->showError('status')?>
				</div>
			</div>
			<!-- start -->			
			<div class="form-group row d-none">
				<label class="col-lg-2 col-form-label text-lg-right">Products Document</label>
				<div class="col-lg-3">
					<div class="custom-file">
						<input type="file" class="custom-file-input" id="product_doc_file" name="product_doc_file" accept=".doc,.pdf,.text"/>
						<label class="custom-file-label" for="product_doc_file">Choose file</label>
					</div>
					<?=$validation->showError('product_doc_file')?>
					<?php $uploaded_product_doc_file = set_value('uploaded_product_doc_file',$update_data['product_doc_file'] ?? ''); ?>
					<input type="hidden" name="uploaded_product_doc_file" id="uploaded_product_doc_file" value="<?=set_value('uploaded_product_doc_file',$uploaded_product_doc_file)?>" />
					<?php if($uploaded_product_doc_file!=""){ ?>
						<div class="text-primary"><a href="javascript:;" onclick="showProduct_doc_file();">View uploaded</a></div>					
					<?php } ?>
				</div>					
			</div>			
			<!-- end -->
		</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>