<?php
session_start();
include("../../php_crud/my_class.php");
$obj = new my_class();
//echo "goods management here";
?>

<style>
    input[type="text"],
    textarea,
    select {
        width: 100%;
    }
</style>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.1/css/all.css" rel="stylesheet" media="all" type="text/css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>

<script src="module/mobiledatalog/js/office_list.js" type="text/javascript"></script>

<div id="cover-spin"></div>
<div class="table-header">
    <i class="fas fa-th-list"></i> Office List
<?php
	if ($_SESSION['add']=='Y') { ?>
		<a class="btn btn-small btn-yellow" href="#modal_add_office" data-toggle="modal" onclick="load_office_add_form()" style="margin-right:10px;margin-top:3px;float:right;hover:cursor;">
	<i class="fa fa-plus-circle"></i> Add office</a>
	<?php } ?>
</div>
<div class="row-fluid" style="background-color:#f5f5f5;-webkit-box-shadow: 0 8px 6px -6px black; -moz-box-shadow: 0 8px 6px -6px black; box-shadow: 0 8px 6px -6px black; padding-bottom:10px;">
<!--	<div class="span3"></div>-->
	<div class="span3" style="margin-top: 5px; padding-left: 10px;">
		<div class="control-group">
			<label class="control-label" for="form-field-1"><b>Status<font color="#FF0000"></font></b></label>
			<div class="controls">
				<select id="office_status" name="office_status" style="width: 70%;">
					<option value="A">Active</option>
					<option value="I">Inactive</option>
					<option value="all">All</option>
				</select>
			</div> 
		</div>
	</div>
	<div class="span3">
		<div class="control-group">
			<label class="control-label" for="form-field-1">&nbsp;&nbsp;</label>
			<div class="controls">
				<button class="btn btn-small btn-success" type="button" onclick="load_office_list()">
					<i class="icon-search"></i> Search
				</button>
			</div> 
		</div>
	</div>
	<!--<div class="span3"></div>-->
</div>

<div style="margin-top: 20px;" id="office_list_holder"></div>

<div id="modal_add_office" class="modal hide fade" tabindex="-1">
	<div class="modal-header no-padding">
		<div class="table-header">
			<button type="button" class="close" data-dismiss="modal" style="opacity:1 !important"><i class="fa fa-window-close" style="font-size: 26px;font-weight: bold;color: #FFF;"></i> </button>
			<i class="fab fa-wpforms"></i> Office Entry Form 
		</div>
	</div>
	<div class="modal-body " id="modal_body_add_office"></div>
	<div class="modal-footer">
		<div class="row-fluid">
			<div class="span6">
				<button class="btn btn-small btn-success pull-right" type="button" id="btn_save" onclick="add_office()">
					<i class="fa fa-check"></i>
					Save
				</button>
			</div>
			<div class="span6" style="padding-left: 10px;">
				<button class="btn btn-small btn-danger pull-left" type="button" class="close" data-dismiss="modal" >
					<i class="icon-remove"></i>
					Close
				</button>
			</div>
		</div>
	</div>								
</div>

<div id="modal_edit_office" class="modal hide fade" tabindex="-1">
	<div class="modal-header no-padding">
		<div class="table-header">
			<button type="button" class="close" data-dismiss="modal" style="opacity:1 !important"><i class="fa fa-window-close" style="font-size: 26px;font-weight: bold;color: #FFF;"></i> </button>
			<i class="fab fa-wpforms"></i> Office Edit Form 
		</div>
	</div>
	<div class="modal-body " id="modal_body_edit_office"></div>
	<div class="modal-footer">
		<div class="row-fluid">
			<div class="span6">
				<button class="btn btn-small btn-success pull-right" type="button" id="btn_save" onclick="update_office()">
					<i class="fa fa-check"></i>
					Save
				</button>
			</div>
			<div class="span6" style="padding-left: 10px;">
				<button class="btn btn-small btn-danger pull-left" type="button" class="close" data-dismiss="modal" >
					<i class="icon-remove"></i>
					Close
				</button>
			</div>
		</div>
	</div>								
</div>

<script type="text/javascript">
	load_office_list();
</script>
