<?php

	$this->set_css($this->default_theme_path.'/flexigrid/css/flexigrid.css');
	$this->set_js_lib($this->default_theme_path.'/flexigrid/js/jquery.form.js');
	$this->set_js_config($this->default_theme_path.'/flexigrid/js/flexigrid-edit.js');

	$this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js');
	$this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js');
?>
<style>img{max-width:100%;}</style>
<div class="flexigrid crud-form" style='width: 100%;' data-unique-hash="<?php echo $unique_hash; ?>">
	<div class="mDiv">
		<div class="ftitle">
			<div class='ftitle-left'>
				<i class="fa fa-binoculars"></i> <?php echo $this->l('list_record'); ?> <?php echo $subject?>
			</div>
			<div class='clear'></div>
		</div>
		<!-- <div title="<?php echo $this->l('minimize_maximize');?>" class="ptogtitle">
			<span></span>
		</div> -->
	</div>
<div id='main-table-box'>
	<?php echo form_open( $read_url, 'method="post" id="crudForm" autocomplete="off" enctype="multipart/form-data"'); ?>
	<div class='form-div'>
		<?php
		$counter = 0;
			foreach($fields as $field)
			{
				$even_odd = $counter % 2 == 0 ? 'odd' : 'even';
				$counter++;
		?>
			<br/>
			<div class='clearfix bs-callout bs-callout-info form-field-box <?php //echo $even_odd?>' style="padding:10px 20px;margin:0 20px;" id="<?php echo $field->field_name; ?>_field_box">
				<div style="float:none;" class='form-display-as-box' id="<?php echo $field->field_name; ?>_display_as_box">
					<h4><i class="fa fa-minus"></i> <?php echo $input_fields[$field->field_name]->display_as?><?php echo ($input_fields[$field->field_name]->required)? "<span class='required'>*</span> " : ""?> <h4>
				</div>
				<br/>
				<p>
				<div class='form-input-box' style="float:none;" id="<?php echo $field->field_name; ?>_input_box">
					<?php echo html_entity_decode($input_fields[$field->field_name]->input);?>
				</div>
				</p>
				<div class='clear'></div>
			</div>
		<?php }?>
		<?php if(!empty($hidden_fields)){?>
		<!-- Start of hidden inputs -->
			<?php
				foreach($hidden_fields as $hidden_field){
					echo $hidden_field->input;
				}
			?>
		<!-- End of hidden inputs -->
		<?php }?>
		<?php if ($is_ajax) { ?><input type="hidden" name="is_ajax" value="true" /><?php }?>
		<div id='report-error' class='report-div error'></div>
		<div id='report-success' class='report-div success'></div>
	</div>
	<!-- <div class="pDiv">
		<div class='form-button-box'>
			<input type='button' value='<?php echo $this->l('form_back_to_list'); ?>' class="btn btn-large back-to-list btn-info" id="cancel-button" />
		</div>
		<div class='form-button-box'>
			<div class='small-loading' id='FormLoading'><?php echo $this->l('form_update_loading'); ?></div>
		</div>
		<div class='clear'></div>
	</div> -->
	<?php echo form_close(); ?>
</div>
</div>
<script>
	var validation_url = '<?php echo $validation_url?>';
	var list_url = '<?php echo $list_url?>';

	var message_alert_edit_form = "<?php echo $this->l('alert_edit_form')?>";
	var message_update_error = "<?php echo $this->l('update_error')?>";

	$crud("select").attr("disabled","true");
</script>

<style>
	select,textarea,input{margin-top:-12px !important;color:black !important;border-width:0 !important;background:#fff !important;-webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;}
	select option{color:black !important;background:#fff !important;}
	.hide_in_read{display:none;}
</style>
