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

?>
<script>
window.location="starter.php";
</script>
<?php
}
?>



<style >
	tfoot {
    display: table-header-group !important;
}

.tokenfield.form-control {
    height: 0px !important;
    padding: 0;
}

</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">
			
			<input type="hidden" id="access_token" name="access_token"  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" placeholder="اسم الزبون الكامل" class="form-control multi_lang" name="customer_full_name" id="customer_full_name" required="required">
						<div class="form-control-feedback">
							<i class="icon-profile 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">Customer Type</label>
						<input type="text" placeholder="Customer Type" class="form-control multi_lang" name="customer_company" id="customer_company" >
						<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" placeholder="البريد الالكتروني" class="form-control multi_lang" name="customer_email" id="customer_email" >
						<div class="form-control-feedback">
							<i class="icon-mail5 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" class="form-control multi_lang" name="customer_phone" id="customer_phone"  placeholder="رقم الهاتف">
						
						<div class="form-control-feedback">
							<i class="icon-phone2 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" class="form-control multi_lang" name="customer_phone2" id="customer_phone2"  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" placeholder="العنوان" class="form-control multi_lang" name="customer_address" id="customer_address" >
						<div class="form-control-feedback">
							<i class="icon-location4 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" placeholder="الحد الاعلى من المبلغ غير المدفوع والمسموح به" class="form-control multi_lang" name="allowed_max_money" id="allowed_max_money" required="required">
						<div class="form-control-feedback">
							<i class="icon-coins text-muted"></i>
						</div>
					</div> -->

					<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4" style="display: none;">
						<label class="control-label multi_lang">المهنة</label>
						<input type="text" placeholder="المهنة" class="form-control multi_lang" name="customer_job_title" id="customer_job_title" >
						<div class="form-control-feedback">
							<i class="icon-briefcase text-muted"></i>
						</div>
					</div>

					<div class="form-group has-feedback has-feedback-left col-sm-4">
						<label class="control-label multi_lang">اسم المستخدم</label>
						<input type="text" id="username" name="username" class="form-control multi_lang" placeholder="اسم المستخدم" required="required">
						<div class="form-control-feedback">
							<i class="icon-user text-muted"></i>
						</div>
					</div>

					<div class="form-group has-feedback has-feedback-left col-sm-4">
						<label class="control-label multi_lang">كلمة السر</label>
						<input type="password" id="password" name="password" class="form-control multi_lang" placeholder="كلمة السر" required="required">
						<div class="form-control-feedback">
							<i class="icon-key text-muted"></i>
						</div>
					</div>
					<div class="form-group has-feedback has-feedback-left col-sm-4">
						<label class="control-label multi_lang">اعادة كتابة كلمة السر</label>
						<input type="password" id="repassword" name="repassword" class="form-control multi_lang" placeholder="اعادة كتابة كلمة السر" required="required">
						<div class="form-control-feedback">
							<i class="icon-key text-muted"></i>
						</div>
					</div>

					<div class="form-group has-feedback has-feedback-left  col-sm-3">
						<label class="control-label multi_lang">المحافظة</label>
						<select class="form-control multi_lang"  name="city_id_fk" id="city_id_fk" data-width="100%" required="required">

							
							
						</select>
						<div class="form-control-feedback">
							<i class="icon-earth text-muted"></i>
						</div>
					</div>


					<div class="form-group form-group-material col-sm-3" >
						<label class="control-label animate">الفرع</label>
						<select name="branch_id_fk" id="branch_id_fk" class="form-control" required="required" data-live-search="true">
							
						</select>
					</div>

					<div class="form-group has-feedback has-feedback-left form-group-material col-sm-6">
						<label class="control-label multi_lang">ملاحظة</label>
						<input type="text" placeholder="ملاحظة" class="form-control multi_lang" name="note" id="note" >
						<div class="form-control-feedback">
							<i class="icon-info22 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: 92%;">
		<form class="form-horizontal"  name="edit_form" method="post" id="edit_form" enctype="multipart/form-data">
			<input type="hidden" id="access_token" name="access_token"  value="">

			<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="itemid" id="edit_objid" value="">
						


					<div class="col-sm-12">
						<div class="form-group">
							<div class="form-group has-feedback has-feedback-left col-sm-4">
								<label class="control-label multi_lang">اسم الزبون الكامل</label>
								<input type="text" placeholder="اسم الزبون الكامل" class="form-control multi_lang" name="edit_customer_full_name" id="edit_customer_full_name" required="required">
								<div class="form-control-feedback">
									<i class="icon-profile text-muted"></i>
								</div>
							</div>

							<div class="form-group has-feedback has-feedback-left col-sm-4">
								<label class="control-label multi_lang">Customer Type</label>
								<input type="text" placeholder="Customer Type" class="form-control multi_lang" name="edit_customer_company" id="edit_customer_company" >
								<div class="form-control-feedback">
									<i class="icon-office text-muted"></i>
								</div>
							</div>

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

							<div class="form-group has-feedback has-feedback-left col-sm-4">
								<label class="control-label multi_lang">الهاتف</label>
								<input type="text" placeholder="الهاتف" class="form-control multi_lang" name="edit_customer_phone" id="edit_customer_phone" >
								<div class="form-control-feedback">
									<i class="icon-phone2 text-muted"></i>
								</div>
							</div>

							<div class="form-group has-feedback has-feedback-left  col-sm-4">
								<label class="control-label multi_lang">الهاتف الثاني</label>
								<input type="text" class="form-control multi_lang" name="edit_customer_phone2" id="edit_customer_phone2"  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" placeholder="العنوان" class="form-control multi_lang" name="edit_customer_address" id="edit_customer_address" >
								<div class="form-control-feedback">
									<i class="icon-location4 text-muted"></i>
								</div>
							</div>

							

							<div class="form-group has-feedback has-feedback-left form-group-material col-sm-4" style="display: none;">
								<label class="control-label multi_lang">المهنة</label>
								<input type="text" placeholder="المهنة" class="form-control multi_lang" name="edit_customer_job_title" id="edit_customer_job_title" >
								<div class="form-control-feedback">
									<i class="icon-briefcase text-muted"></i>
								</div>
							</div>

							<div class="form-group has-feedback has-feedback-left col-sm-4">
								<label class="control-label multi_lang">اسم المستخدم</label>
								<input type="text" id="edit_username" name="edit_username" class="form-control multi_lang" placeholder="اسم المستخدم" required="required">
								<div class="form-control-feedback">
									<i class="icon-user text-muted"></i>
								</div>
							</div>

							<div class="form-group has-feedback has-feedback-left col-sm-4">
								<label class="control-label multi_lang">المحافظة</label>
								<select class="form-control multi_lang"  name="edit_city_id_fk" id="edit_city_id_fk" data-width="100%" required="required">

									
									
								</select>
								<div class="form-control-feedback">
									<i class="icon-earth text-muted"></i>
								</div>
							</div>


							<div class="form-group form-group-material col-sm-4" >
								<label class="control-label animate">الفرع</label>
								<select name="edit_branch_id_fk" id="edit_branch_id_fk" class="form-control" required="required" data-live-search="true">
									
								</select>
							</div>


							<div class="form-group has-feedback has-feedback-left form-group-material col-sm-12">
								<label class="control-label multi_lang">ملاحظة</label>
								<input type="text" placeholder="ملاحظة" class="form-control multi_lang" name="edit_note" id="edit_note" >
								<div class="form-control-feedback">
									<i class="icon-info22 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>

<div id="edit_form_cont1" class="modal fade" style="display: none;">
	<div class="modal-dialog modal-lg">
		<form class="form-horizontal"  name="edit_formPass" method="post" id="edit_formPass" enctype="multipart/form-data">
			<input type="hidden" id="access_token" name="access_token"  value="">

			<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="itemid" id="edit_objidPass" value="">
						<div>
							

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

								<div class="form-group">
									
										<div class="form-group has-feedback has-feedback-left form-group-material col-sm-6">
											<label class="control-label multi_lang">كلمة السر الجديدة</label>
											<input type="password" id="edit_password" name="edit_password" class="form-control multi_lang" placeholder="كلمة السر الجديدة" required="required">
											<div class="form-control-feedback">
												<i class="icon-key2 text-muted"></i>
											</div>
										</div>
									
										<div class="form-group has-feedback has-feedback-left form-group-material col-sm-6">
											<label class="control-label multi_lang">اعادة كتابة كلمة السر</label>
											<input type="password" id="edit_repassword" name="edit_repassword" class="form-control multi_lang" placeholder="اعادة كتابة كلمة السر" required="required">
											<div class="form-control-feedback">
												<i class="icon-key2 text-muted"></i>
											</div>
										</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">
		<thead>
			<tr>
                <th>ID</th>
                <th class="multi_lang">UserName</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">Type</th>
                <th class="multi_lang">المحافظة</th>
                <th class="multi_lang">ملاحظة</th>
                
                <th class="multi_lang">Login Count</th>
                <th  class="text-center multi_lang">العمليات</th>
            </tr>
		</thead>
		<tbody>
			
		</tbody>
		<tfoot>
			<tr>
                <td>Name</td>
                <td>Position</td>
                <td>Start date</td>
                <td>Salary</td>
                <td>Salary</td>
                <td></td>
                <td></td>
                <!-- <td></td> -->
                <td></td>
                <td></td>
                <td></td>
            </tr>
		</tfoot>
	</table>
</div>
<!-- /individual column searching (text inputs) -->



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