<?php
$permission  = explode(',',$_SESSION['permission_id']);
if(!in_array(6,$permission) && !in_array(1,$permission) ){

?>
<script>
window.location="starter.php";
</script>
<?php
}
?>
<style >
	tfoot {
    display: table-header-group !important;
	}

	.dataTable {
        font-size: 14px;
	}

	td {
		padding: 5px 5px !important;
	}

	.thumb img:not(.media-preview) {
    height: 100px;
	}

	td.details-control {
    	
    	cursor: pointer;
	}

	div.tokenfield  {
		border-bottom-color: #ddd !important;
		border-bottom-width: 1px !important;
	}
	

</style>

	<div id="add-form-cont" class="panel-collapse collapse panel" aria-expanded="false" style="height: 0px; position: relative; top:-3px; width:98%; margin:0px auto;">
		<div class="panel-body">
			<form class="form-horizontal" method="post" id="add_form" enctype="multipart/form-data">
				

				<div class="col-sm-12">

					<div class="form-group">


						<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
							<label class="control-label multi_lang">اسم الفرع</label>
							<input type="text" id="branch_name" name="branch_name" class="form-control multi_lang stop_enter" placeholder="اسم الفرع" required="required">
							<div class="form-control-feedback">
								<i class="icon-office text-muted"></i>
							</div>
						</div>

						<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
							<label class="control-label multi_lang ">رقم الهاتف</label>
							<input type="text" id="branch_phone" name="branch_phone" class="form-control multi_lang stop_enter" placeholder="رقم الهاتف" >
							<div class="form-control-feedback">
								<i class="icon-phone text-muted"></i>
							</div>
						</div>

						<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
							<label class="control-label multi_lang ">البريد الالكتروني</label>
							<input type="text" id="branch_email" name="branch_email" class="form-control multi_lang stop_enter" placeholder="البريد الالكتروني" >
							<div class="form-control-feedback">
								<i class="icon-envelop2 text-muted"></i>
							</div>
						</div>

						
						

					</div>

					

					<div class="form-group">


						<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
							<label class="control-label multi_lang">الموقع</label>
							<input type="text" id="location" name="location" class="form-control multi_lang stop_enter" placeholder="الموقع" required="required" >
							<div class="form-control-feedback">
								<i class="icon-location3 text-muted"></i>
							</div>
						</div>
						
						<div class="form-group has-feedback has-feedback-left form-group-material col-sm-8">
							<label class="control-label multi_lang">العنوان</label>
							<input type="text" id="branch_address" name="branch_address" class="form-control multi_lang stop_enter" placeholder="العنوان" required="required">
							<div class="form-control-feedback">
								<i class="icon-map text-muted"></i>
							</div>
						</div>

						


						

					</div>

					


					

				</div>


				<div class="text-right">
					<button type="submit" id="submit_add_btn" class="btn btn-primary btn-labeled btn-labeled-left ">
						<span class="multi_lang">حفظ</span> <b><i class="icon-floppy-disk"></i></b>
					</button>
					<a href="#add-form-cont" id="add_form_cancel" class="btn btn-labeled btn-labeled-left bg-danger heading-btn" data-toggle="collapse">
						<span class="multi_lang">اغلاق</span> <b><i class="icon-cross"></i></b>
					</a>
				</div>
			</form>
		</div>
	</div>

	<div id="edit_form_cont" class="modal fade" style="display: none; ">
		<div class="modal-dialog modal-lg" style="width: 85%;">
			<form class="form-horizontal"  name="edit_form" method="post" id="edit_form" enctype="multipart/form-data">
				

				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><i class="icon-cross"></i></button>
						<h4 class="modal-title multi_lang">تحرير</h4>
					</div>

					<div class="modal-body">
						<input type="hidden" name="edit_objid" id="edit_objid" value="">
						
						<div class="col-sm-12">

							<div class="form-group">


								<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
									<label class="control-label multi_lang">اسم الفرع</label>
									<input type="text" id="edit_branch_name" name="edit_branch_name" class="form-control multi_lang stop_enter" placeholder="اسم الفرع" required="required">
									<div class="form-control-feedback">
										<i class="icon-office text-muted"></i>
									</div>
								</div>

								<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
									<label class="control-label multi_lang ">رقم الهاتف</label>
									<input type="text" id="edit_branch_phone" name="edit_branch_phone" class="form-control multi_lang stop_enter" placeholder="رقم الهاتف" >
									<div class="form-control-feedback">
										<i class="icon-phone text-muted"></i>
									</div>
								</div>

								<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
									<label class="control-label multi_lang ">البريد الالكتروني</label>
									<input type="text" id="edit_branch_email" name="edit_branch_email" class="form-control multi_lang stop_enter" placeholder="البريد الالكتروني" >
									<div class="form-control-feedback">
										<i class="icon-envelop2 text-muted"></i>
									</div>
								</div>

								
								

							</div>

							

							<div class="form-group">


								<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4">
									<label class="control-label multi_lang">الموقع</label>
									<input type="text" id="edit_location" name="edit_location" class="form-control multi_lang stop_enter" placeholder="الموقع" required="required" >
									<div class="form-control-feedback">
										<i class="icon-location3 text-muted"></i>
									</div>
								</div>
								
								<div class="form-group has-feedback has-feedback-left form-group-material col-sm-8">
									<label class="control-label multi_lang">العنوان</label>
									<input type="text" id="edit_branch_address" name="edit_branch_address" class="form-control multi_lang stop_enter" placeholder="العنوان" required="required">
									<div class="form-control-feedback">
										<i class="icon-map text-muted"></i>
									</div>
								</div>

								


								

							</div>

							


							

						</div>

					</div>
					<div class="modal-footer">
						<button type="submit" class="btn btn-labeled btn-labeled-left heading-btn btn-primary"> <span class="multi_lang">حفظ</span> <b><i class="icon-floppy-disk"></i></b>
						</button>
						<button type="button" class="btn btn-warning" data-dismiss="modal"><span class="multi_lang">الغاء</span>
						</button>
					</div>
				</div>
			</form>
		</div>
	</div>

	





	

	<!-- Individual column searching (text inputs) -->
	<div class="panel panel-flat">
		
		<table class="table  datatable-column-search-inputs table-bordered table-hover datatable-highlight datatable-row-full datatable-key-class">
			<thead>
				<tr>
	        		<th width="5%">ID</th>
					<th class="multi_lang">اسم الفرع</th>
					<th class="multi_lang">الموقع</th>
					<th class="multi_lang">العنوان</th>
					<th class="multi_lang">رقم الهاتف</th>
					<th class="multi_lang">البريد الالكتروني</th>
					
					<th class="multi_lang">حدث بواسطة</th>
	        		<th class="multi_lang">العمليات</th>
	      		</tr>
			</thead>
			<tbody>
				
			</tbody>
			<tfoot>
				<tr>
	                <td></td>
	                <td></td>
	                <td></td>
	                <td>username</td>
	                <td>full_name</td>
	                <td>EMail</td>
	                <td>Phone</td>
	                <td></td>
	                
	    
	                
	            </tr>
			</tfoot>
		</table>
	</div>
	<!-- /individual column searching (text inputs) -->



<script type="text/javascript" src="controllers/branch.js?random=<?php echo uniqid(); ?>"></script>