<!-- LAST MODIFIED : ZUL ZOLKAFFLY (16/08/2016) -->
<script>
$(document).ready(function() {
	var url = window.location.href;
	var reviewID = url.substring(url.lastIndexOf('/') + 1);

	var printUrl = '<?php echo base_url() ?>review/printdetails/' + reviewID;
	$('#printReview').attr('href', printUrl);

	$('input[type="radio"][name*="detAnswer"]').off('click').on('click',function() {
		var ischecked = $(this).is(':checked');
		if(ischecked) {
			var val = Number($(this).val());
			var arr = $(this).attr('name').replace('][','_').replace('detAnswer[','').replace(']','').split('_');

			if(val == 2) {
				var currComment = $('input[type="text"][name="detComment['+arr[0]+']['+arr[1]+']').val();

				if ($.trim( currComment.toUpperCase() ) == "MEMATUHI" || $.trim( currComment.toUpperCase() ) == "TIDAK BERKAITAN") {
					$('input[type="text"][name="detComment['+arr[0]+']['+arr[1]+']').val('Tidak Mematuhi');
				}
				$('input[type="text"][name="detComment['+arr[0]+']['+arr[1]+']').removeAttr('disabled');
				OpenComment(arr[0], arr[1]);
			} else if (val == 1) {
				$('input[type="text"][name="detComment['+arr[0]+']['+arr[1]+']').val('Mematuhi');
				$('input[type="text"][name="detComment['+arr[0]+']['+arr[1]+']').attr('disabled','disabled');
			} else if (val == 0) {
				$('input[type="text"][name="detComment['+arr[0]+']['+arr[1]+']').val('Tidak Berkaitan');
				$('input[type="text"][name="detComment['+arr[0]+']['+arr[1]+']').attr('disabled','disabled');
			}
		}
	});

	$('select#status').off('change').on('change',function() {
		var sts  = $(this).val();
		var scoring = ($('#scoringmethod').val()).toUpperCase();

		if (sts == 'MEMATUHI') {
			if(scoring == "SCORETENNULL") $('#mark').val('10');
			if(scoring == "SCALEONEFIVE") $('#mark').val('5').removeAttr('disabled');
		} else if (sts == 'TIDAK MEMATUHI') {
			$('#mark').val('0');
			if(scoring == "SCALEONEFIVE") $('select#mark').attr('disabled','disabled');
		} else {
			$('#mark').val('');
			if(scoring == "SCALEONEFIVE") $('select#mark').attr('disabled','disabled');
		}
	});

	// CHANGE UPLOAD BUTTON TEXT BASED ON DEVICE
	if(typeof window.orientation !== 'undefined') $('#uploadButtonText').append(' / Camera');

	// ASSIGN HANDLER WHEN ATTACHMENT INPUT CHANGED : ONLY FOR IMAGE TYPE FILE
	$('input[type="file"]#attachmentImage').off('change').on('change', function() {
		PreviewImage(this);
	});

	// DELETE ATTACHMENT CONFIRMATION
	$('a[id*="attDel_"]').off('click').on('click', function() {
		if(!confirm('Are you sure to delete this attachment?')) return false;
	});
	
	var winW = Math.round( window.innerWidth );
	if(typeof window.orientation !== 'undefined' || winW <= 768) {		
		$('input[type="radio"][name*="detAnswerM["]').each(function() {
			var name = $(this).attr('name');
			$(this).attr('name', name.replace('detAnswerM[','detAnswer['));
		});
	}
});

function OpenComment(key,det) {
	var text = $('td#detText_'+key+'_'+det).html();
	var val = $('input[type="text"][name="detComment['+key+']['+det+']').val();
	$('#commentModal .modal-body h4 span').html(text);
	$('#commentModal .modal-body textarea').val(val);
	$('#commentModal .modal-body #commentKey').val(key);
	$('#commentModal .modal-body #commentDet').val(det);

	$('#commentModal').modal('show');

	$('#commentModal #commentSet').off('click').on('click',function() {
		var key = $('#commentModal .modal-body #commentKey').val();
		var det = $('#commentModal .modal-body #commentDet').val();
		var val = $('#commentModal .modal-body textarea').val();

		$('input[type="text"][name="detComment['+key+']['+det+']').val(val);

		$('#commentModal').modal('hide');

		$('#commentModal .modal-body h4 span').html('');
		$('#commentModal .modal-body textarea').val('');
		$('#commentModal .modal-body #commentKey').val('');
		$('#commentModal .modal-body #commentDet').val('');
	});
}

function OpenAttachment() {
	var id = $('input[type="hidden"]#ID').val();
	console.log(id);
	$('#attachmentModal .modal-body #attachmentDescription').val('');
	$('#attachmentModal .modal-body #attachmentReviewID').val(id);

	$('#attachmentModal').modal('show');
}

function PreviewImage(input) {
	if (input.files && input.files[0]) {
		var name = input.files[0].name;
		var ext = name.substr(name.lastIndexOf('.') + 1);

		$('#attachmentPreview').attr('src', '');
		$('#attachmentPreview').addClass('hidden');
		$('#attachmentName').html('');
		$('#attachmentName').addClass('hidden');

		var img = ['PNG','JPG','JPEG','GIF','BMP'];
		if(img.indexOf(ext.toUpperCase()) >= 0) {
			$('#attachmentPreview').attr('src', '');
			var reader = new FileReader();
			reader.onload = function (e) {
				$('#attachmentPreview').attr('src', e.target.result);
			}
			reader.readAsDataURL(input.files[0]);
			$('#attachmentPreview').removeClass('hidden');
		} else {
			$('#attachmentName').html('<i class="fa fa-book"></i>&nbsp;'+name).removeClass('hidden');
		}
	}
}
</script>

<style>
[class*="text-"] { font-size: 16px !important; }
.in_number { width: 8vw !important; text-align: center !important; }
@media only screen and (max-width: 767px) {
	.in_number { width: 20vw !important; text-align: center !important; }
}
</style>



<div class="content-wrapper">
	<!-- PAGE TITLE -->
	<section class="content-header">
		<h1>Semakan Audit <?php echo ($method) ? " : Bahagian " .$method['methodCode']." - ".$method['methodDesc'] : ""; ?></h1>
		<?php
		if($review) {
			?>
				<div class="callout bg-gray">
				<h5 class="row block">
					<div class="col-xs-2">
						<strong>Perkara <?php echo (($method) ? $method['methodCode']."-" : "").($review['code']); ?></strong>
					</div>
					<div class="col-xs-10">
						<?php
						$text = ($review['text']) ? nl2br($review['text']) : NULL;
						if($children) {
							$text .= "<br />";
							foreach($children as $child) {
								$text .= "<br />";
								$text .= ($child['code'] != $review['code']) ? $child['code'].") ".nl2br($child['text']) : NULL;
							}
						}
						echo $text;
						?>
					</div>
				</h5>
				<h5 class="row block">
					<div class="col-xs-2">
						<strong>Objektif Audit </strong>
					</div>
					<div class="col-xs-10">
						<?php echo ($review['objective']) ? nl2br($review['objective']) : NULL; ?>
					</div>
				</h5>
				</div>
			<?php
		}
		?>

		<ol class="breadcrumb">
			<li><a href="#"><i class="fa fa-dashboard"></i> Semakan Audit</a></li>
			<li class="active"><?php echo ($method) ? "Bahagian " .$method['methodCode'] : ""; ?></li>
		</ol>
	</section>

	<section class="content">
		<div class="row" style="margin-top: 0; margin-bottom: 20px;">
			<div class="col-md-12">
				<?php
				$query = $this->db->query("SELECT ID listID FROM (`_ref_review`) WHERE `is_delete` = 0 AND `parentID` = 0 AND `methodID` = '".$method['methodID']."' ORDER BY CONVERT(code, UNSIGNED INTEGER)");
				
				$revlist = NULL;
				if($query && ($rl = $query->result())) {
					$rl = json_decode(json_encode($rl),true);
					foreach($rl as $key=>$value) {
						$revlist[$key] = $value['listID'];
					}
				}
				if($revlist) {
					$curr = array_search($ID, $revlist);
					$prev = ($curr > 0) ? $curr-1 : NULL;
					$next = ($curr < (count($revlist) - 1)) ? $curr+1 : NULL;

					if($prev !== NULL) { ?><a href="<?php echo base_url(); ?>review/detail/<?php echo $revlist[$prev]; ?>" class="btn btn-warning btn-sm pull-left"><i class="fa fa-backward"></i>&nbsp;<span class="hidden-xs">Perkara </span>Sebelum</a><?php }
					?>
					<div class="pull-center text-center" style="position: absolute; left: 50%; transform: translate(-50%,0);">
						<a href="<?php echo base_url(); ?>review/printdetails/<?php echo $ID; ?>" target="_blank" class="btn btn-sm bg-blue pull-center">
							<i class="fa fa-print"></i>&nbsp;Cetak
						</a>
					</div>
					<?php
					if($next !== NULL) { ?><a href="<?php echo base_url(); ?>review/detail/<?php echo $revlist[$next]; ?>" class="btn btn-warning btn-sm pull-right"><span class="hidden-xs">Perkara </span>Seterusnya&nbsp;<i class="fa fa-forward"></i></a><?php }
				}
				?>
			</div>
		</div>

		<?php if($method['methodAppData']) : ?>
		<!-- DATA PERMOHONAN -->
		<div class="box box-danger">
			<div class="box-header with-border">
				<h3 class="box-title">Butiran Data Permohonan</h3>
				<div class="box-tools pull-right">
					<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
				</div>
			</div>

			<div class="box-body table-scroll-sm table-scroll-xs">
			<?php
			if($appl) {
				$this->lang->load('data_col', $this->session->userdata('language'));

				echo "<div class=\"row\">\n";
				$k = 0;
				foreach($appl as $key=>$value) {
					if($value['view']) {
						echo ($k > 0 && $k%2 == 0) ? "</div><div class=\"row\">\n" : NULL;
						if ($value['clearLeft']) { echo "</div><div class=\"row\">\n"; $k--; }
						echo "<div class=\"col-lg-6 col-md-6 col-sm-12 col-xs-12\">\n";
							$view = APPPATH.'views/'.$value['view'];
							$view = str_replace("\\","/",$view);
							$d['data'] = $value;

							if (file_exists($view.".php")) $this->load->view($value['view'],$d);

						echo "</div>\n";
						$k++;
						if ($value['clearRight']) { echo "</div><div class=\"row\">\n"; $k--; }
					}
				}
				echo "</div>\n";
			}
			?>
			</div>

			<div class="box-footer">
				<div class="pull-left">
					<a class="btn btn-sm btn-primary" href="<?php echo base_url(); ?>apply"><i class="fa fa-pencil"></i>&nbsp;Ubahsuai Permohonan</a>
				</div>
			</div>
		</div>
		<?php endif; ?>

		<form class="form-horizontal" method="post" action="<?php echo base_url(); ?>review/save">
			<input type="hidden" name="ID" id="ID" value="<?php echo $ID; ?>" />
			<input type="hidden" name="companyID" id="companyID" value="<?php echo $companyID; ?>" />

			<!-- AUDIT PROCEDURE -->
			<div class="box box-danger">
				 <div class="box-header with-border">
					<h3 class="box-title">Prosedur Audit</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
					</div>
				</div>

				<div class="box-body">
					<table id="datatable_list" class="table table-bordered table-responsive table-hover datatables">
						<thead>
							<tr>
								<th class="text-center col-sm-1">Bil</th>
								<th class="text-center col-sm-6">Butiran</th>
								<th class="text-center col-sm-1 hidden-sm hidden-xs">Ya</th>
								<th class="text-center col-sm-1 hidden-sm hidden-xs">Tidak</th>
								<th class="text-center col-sm-1 hidden-sm hidden-xs">Tidak Berkaitan</th>
								<th class="text-center col-sm-1 hidden-sm hidden-xs">Ulasan</th>
								<th class="hidden-lg hidden-md" style="width: 10%;"></th>
							</tr>
						</thead>

						<tbody>
						<?php
						$disabled = (!count($children)) ? " disabled=\"disabled\" " : "";
						if($children) {
							foreach($children as $key=>$value) {
								if($value['ID'] != $review['ID']) {
									?>
									<tr>
										<th colspan="1"><?php echo 'Pecahan '.$value['code']; ?></th>
										<th colspan="1"><?php echo $value['text']; ?></th>
										<th colspan="4" class="hidden-sm hidden-xs">&nbsp;</th>
										<th class="hidden-lg hidden-md"></th>
									</tr>
									<?php
								}

								$disabled = (!count($value['details'])) ? " disabled=\"disabled\" " : "";
								if($details = $value['details']) {
									foreach($details as $index=>$item) {
										$det = $item['ID'];
										$ansval = ($item['answer']) ? (($item['answer']['answer']) ? $item['answer']['answer'] : 0) : 0;
										$anscomment = ($item['answer']) ? (($item['answer']['comment']) ? $item['answer']['comment'] : NULL) : NULL;
										if(!$anscomment) {
											if($ansval == 0) {
												$anscomment = 'Tidak Berkaitan';
											} elseif($ansval == 1) {
												$anscomment = 'Mematuhi';
											}
										}
										?>
										<tr>
											<td style="text-align: right">
											<?php
												$bil = ($method) ? $method['methodCode'] : NULL;
												$bil .= ($review) ? "-".$review['code'] : NULL;
												$bil .= ($value['code'] != $review['code']) ? "-".$value['code'] : NULL;
												$bil .= "-".($index+1);
												echo $bil;
											?>
											</td>
											<td id="detText_<?php echo $key; ?>_<?php echo $det; ?>"><?php echo $item['text']; ?></td>
											<td class="text-center hidden-sm hidden-xs">
												<input type="radio" <?php echo ($ansval == '1') ? "checked=\"checked\" " : ""; ?> name="detAnswer[<?php echo $key; ?>][<?php echo $det; ?>]" value="1">
											</td>
											<td class="text-center hidden-sm hidden-xs">
												<input type="radio" name="detAnswer[<?php echo $key; ?>][<?php echo $det; ?>]" value="2" <?php echo ($ansval == '2') ? "checked=\"checked\" " : ""; ?>>
											</td>
											<td class="text-center hidden-sm hidden-xs">
												<input type="radio" name="detAnswer[<?php echo $key; ?>][<?php echo $det; ?>]" value="0" <?php echo ($ansval == '0') ? "checked=\"checked\" " : ""; ?>>
											</td>
											<td class="hidden-sm hidden-xs">
												<input type="text"
															name="detComment[<?php echo $key; ?>][<?php echo $det; ?>]"
															value="<?php echo ucfirst(strtolower($anscomment)); ?>"
															<?php echo ($ansval != '2') ? "disabled=\"disabled\" " : ""; ?>
															onclick="javascript:OpenComment(<?php echo $key; ?>,<?php echo $det; ?>)" />
											</td>
											<td class="hidden-lg hidden-md mobile">
												<div><input type="radio" name="detAnswerM[<?php echo $key; ?>][<?php echo $det; ?>]" value="1" <?php echo ($ansval == 1) ? "checked=\"checked\" " : ""; ?>>&nbsp;&nbsp;<strong>Ya</strong></div>
												<div><input type="radio" name="detAnswerM[<?php echo $key; ?>][<?php echo $det; ?>]" value="2" <?php echo ($ansval == 2) ? "checked=\"checked\" " : ""; ?>>&nbsp;&nbsp;<strong>Tidak</strong></div>
												<div><input type="radio" name="detAnswerM[<?php echo $key; ?>][<?php echo $det; ?>]" value="0" <?php echo ($ansval == 0) ? "checked=\"checked\" " : ""; ?>>&nbsp;&nbsp;<strong>Tidak Berkaitan</strong></div>
												<input type="text"
															name="detComment[<?php echo $key; ?>][<?php echo $det; ?>]"
															value="<?php echo ucfirst(strtolower($anscomment)); ?>"
															<?php echo ($ansval != '2') ? "disabled=\"disabled\" " : ""; ?>
															onclick="javascript:OpenComment(<?php echo $key; ?>,<?php echo $det; ?>)" />
											</td>
										</tr>
										<?php
									}
								}
							}
						}
						?>
						</tbody>
						<!--
						<tfoot>
							<tr>
								<th class="text-right" colspan="6">
									<a href="<?php echo base_url(); ?>review" class="btn btn-warning">Kembali</a>
									<button type="submit" class="btn bg-olive" <?php echo $disabled; ?>>Simpan</button>
									<a href="javascript:void(0);" class="btn bg-olive">Cetak</a>
								</th>
							</tr>
						</tfoot>
						-->
					</table>
				</div>

				<div class="box-footer">
				</div>

			</div>

			<!-- AUDITOR COMMENT -->
			<div class="box box-danger">
				<div class="box-header with-border">
					<h3 class="box-title">Ulasan & Keputusan</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
					</div>
				</div>

				<div class="box-body">
					<div class="col-sm-6">
						<fieldset class="fsStyle">
							<legend class="legendStyle">Ulasan Keseluruhan Pencarian Juruaudit</legend>
							<textarea class="form-control" rows="10" name="comment" id="comment"><?php echo ($review && $review['answer']) ? $review['answer']['comment'] : NULL; ?></textarea>
						</fieldset>
					</div>

					<div class="col-sm-6">
						<fieldset class="fsStyle">
							<legend class="legendStyle">Keputusan</legend>
								<div class="row">
									<label for="status" class="col-md-2">Status</label>
									<div class="col-md-10">
										<select name="status" id="status" class="form-control">
										<option value="SEDANG DIPROSES" <?php echo ($review['answer'] && $review['answer']['status'] == 'SEDANG DIPROSES') ? " selected=\"selected\" " : ""; ?>>Sedang diproses</option>
										<option value="MEMATUHI" <?php echo ($review['answer'] && $review['answer']['status'] == 'MEMATUHI') ? " selected=\"selected\" " : ""; ?>>Mematuhi</option>
										<option value="TIDAK MEMATUHI" <?php echo ($review['answer'] && $review['answer']['status'] == 'TIDAK MEMATUHI') ? " selected=\"selected\" " : ""; ?>>Tidak Mematuhi</option>
										</select>
									</div>
								</div>
								<div>&nbsp;</div>
								<div class="row">
									<label for="mark" class="col-md-2">Markah</label>
									<div class="col-md-10">
										<input type="hidden" id="scoringmethod" value="<?php echo strtoupper($method['methodScoring']); ?>" />
										<?php
										if(strtoupper($method['methodScoring']) == "SCORETENNULL") {
											$mark = NULL;
											if ($review['answer']) {
												if($review['answer']['status'] == 'TIDAK MEMATUHI') $mark = 0;
												if($review['answer']['status'] == 'MEMATUHI') $mark = 10;
												if($review['answer']['status'] == 'SEDANG DIPROSES') $mark = NULL;
											}
											echo "<input type=\"text\" class=\"in_number\" name=\"mark\" id=\"mark\" placeholder=\"markah\" value=\"".$mark."\" readonly />\n";
										} else {
											$mark = NULL;
											if ($review['answer']) {
												if($review['answer']['status'] == 'TIDAK MEMATUHI') $mark = 0;
												if($review['answer']['status'] == 'MEMATUHI') $mark = ($review['answer']['mark']) ? $review['answer']['mark']:NULL;
												if($review['answer']['status'] == 'SEDANG DIPROSES') $mark = NULL;
											}

											echo "<select name=\"mark\" id=\"mark\" class=\"in_number form-control\" ".(($review['answer']['status']!="MEMATUHI") ? "disabled=\"disabled\" " : "").">\n";
											echo "<option value=\"\" ".(($mark === NULL) ? "selected=\"selected\" " : "")." disabled>TIADA MARKAH</option>\n";
											for($i = 0; $i <= 5; $i++) {
												echo "<option value=\"".$i."\" ".(($mark == $i) ? "selected=\"selected\" " : "").">".$i."</option>\n";
											}
											echo "</select>\n";
										}
										?>
									</div>
								</div>
						</fieldset>
					</div>
				</div>

				<div class="box-footer">
					<!--
					<div class="pull-right">
					<a href="<?php echo base_url(); ?>review" class="btn btn-warning">Kembali</a>
					<button type="submit" class="btn bg-olive" <?php echo $disabled; ?>>Simpan</button>
					<a href="javascript:void(0);" class="btn bg-olive">Cetak</a>
					</div>
					-->
				</div>

			</div>

			<!-- ATTACHMENT -->
			<div class="box box-danger">
				<div class="box-header with-border">
					<h3 class="box-title">Lampiran</h3>
					<div class="box-tools pull-right">
						<?php
						$disUpload = ($disabled) ? $disabled : ((!$review['answer']) ? " disabled=\"disabled\" " : "");
						echo ($disUpload) ? "<i>Semua jawapan di atas mesti dihantar sebelum muat naik sebarang dokumen</i>&nbsp;&nbsp;\n" : NULL;
						?>
						<button type="button" class="btn bg-blue btn-sm" onclick="javascript:OpenAttachment();" <?php echo $disUpload; ?>><i class="fa fa-cloud-upload"></i>&nbsp;Muat Naik</button>
						<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
					</div>
				</div>
				<div class="box-body table-scroll-xs">
					<table id="attachments" class="table table-striped">
						<thead>
							<tr>
								<th class="text-center col-sm-1">#</th>
								<th class="text-center col-sm-1">Paparan</th>
								<th class="text-left col-sm-6">Keterangan</th>
								<th class="text-center col-sm-1">Tindakan</th>
							</tr>
						</thead>
						<tbody>
							<?php
							if($attachment) {
								$images = array('PNG','JPG','JPEG','BMP','GIF');
								foreach($attachment as $key=>$value) {
									$ext = (file_exists($value->attachment)) ? pathinfo($value->attachment, PATHINFO_EXTENSION) : NULL;
									if($value->attachment && $ext) {
										$att = str_replace("/","\\",$value->attachment);
										?>
										<tr>
											<td class="text-center"><?php echo ($key+1); ?></td>
											<td class="text-center">
												<a data-toggle="tooltip" title="Klik untuk melihat lampiran" target="_blank" href="<?php echo str_replace(FCPATH,base_url(),$att); ?>">
												<?php
												if(in_array(strtoupper($ext),$images)) {
													?><img class="img-polaroid" style="width:50px;" src="<?php echo str_replace(FCPATH,base_url(),$att); ?>" /><?php
												} else {
													echo pathinfo($value->attachment, PATHINFO_BASENAME);
												}
												?>
												</a>
											</td>
											<td class="text-left"><?php echo $value->title; ?></td>
											<td class="text-center">
												<div class="btn-group-vertical">
													<!--
													<a href="<?php echo str_replace(FCPATH,base_url(),$att); ?>"
															data-toggle="tooltip"
															title="Klik untuk muat turun lampiran"
															target="_blank"
															class="btn bg-olive btn-sm"
															id="attDl_<?php echo $key; ?>"><i class="fa fa-cloud-download"></i>&nbsp;Muat Turun</a>
															-->
													<a href="<?php echo base_url(); ?>review/deleteattachment/<?php echo $value->ID; ?>"
															class="btn btn-danger btn-sm" id="attDel_<?php echo $key; ?>"><i class="fa fa-trash"></i>&nbsp;Buang</a>
												</div>
											</td>
										</tr>
										<?php
									}
								}
							}
							?>
						</tbody>
					</table>
				</div>
			</div>

			<div class="box box-solid">
				<div class="box-body">
					<div class="pull-right">
						<a href="<?php echo base_url(); ?>review" class="btn btn-md btn-danger"><i class="fa fa-times"></i>&nbsp;Kembali</a>
						<button type="submit" class="btn btn-md bg-green" <?php echo $disabled; ?>><i class="fa fa-check"></i>&nbsp;Simpan</button>
						<a id="printReview" href="<?php echo base_url(); ?>review/printdetails/<?php echo $ID; ?>" target="_blank" class="btn btn-md bg-blue"><i class="fa fa-print"></i>&nbsp;Cetak</a>
					</div>
				</div>
			</div>
		</form>
	</section>
</div>





<!-- MODAL SECTION -->
<!-- COMMENT MODAL -->
<div class="modal fade" id="commentModal" role="dialog">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header" >
				<button type="button" class="close" data-dismiss="modal">&times;</button>
				<h3 class="modal-title" id="modal-details-label">Ulasan</h3>
			</div>
			<div class="modal-body">
				<h4><span></span> - Tidak Mematuhi</h4>
				<h6 class="italic">Sila berikan ulasan / sebab kenapa tidak mematuhi</h6>
				<div class="form-group">
					<input type="hidden" id="commentKey" value="" />
					<input type="hidden" id="commentDet" value="" />
					<textarea  class="form-control" cols="100" rows="3" style="resize:none;"></textarea>
				</div>
			</div>

			<div class="modal-footer">
				<a type="button" class="btn btn-danger btn-sm" data-dismiss="modal"><span class="fa fa-times"></span> Tutup</a>
				<a type="button" class="btn bg-olive btn-sm" id="commentSet">
					<span class="fa fa-check"></span>
					Guna
				</a>
			</div>
		</div>
	</div>
</div>
<!-- ATTACHMENT MODAL -->
<div class="modal fade in" id="attachmentModal" tabindex="-1" role="dialog" aria-labelledby="modal-attachments-label">
	<div class="modal-dialog">
		<div class="modal-content">
			<form id="attachmentForm" action="<?php echo base_url(); ?>review/saveattachment" method="POST" role="form" enctype="multipart/form-data">
				<div class="modal-header">
					<a href="javascript:void(0);" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></a>
					<h3 class="modal-title" id="modal-attachments-label">Lampiran</h3>
				</div>

				<div class="modal-body">

					<div class="form-group">
						<label for="description" class="control-label">Keterangan</label>
						<input type="hidden" id="attachmentReviewID" name="reviewID" value="" />
						<textarea id="attachmentDescription" name="title" class="form-control" cols="100" rows="3" style="resize:none;"></textarea>
						<div>&nbsp;</div>
					</div>

					<div class="form-group">
						<div class="btn bg-light-blue btn-file">
							<span class="fa fa-paperclip"></span>
							<span id="uploadButtonText">Pilih</span>
							<input type="file" id="attachmentImage" name="image" accept="image/*;capture=camera">
						</div>
						<img id="attachmentPreview" class="img-polaroid hidden" style="width:50px;" src="" />
						<span id="attachmentName" class="hidden"></span>
						<span>
							&nbsp;&nbsp;
							<strong>Format dibenarkan:</strong>
							<span>jpg/jpeg/png/bmp/pdf/doc/docx/xls/xlsx</span>
						</span>
						<div>&nbsp;</div>
					</div>

				</div>

				<div class="modal-footer">
					<a type="button" class="btn btn-danger btn-sm pull-left" data-dismiss="modal"><i class="fa fa-times"></i>&nbsp;Tutup</a>
					<button type="submit" class="btn bg-olive btn-sm pull-right"><i class="fa fa-check"></i>&nbsp;Muat Naik</button>
				</div>
			</form>
		</div>
	</div>
</div>
