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

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

	.dataTable {
        font-size: 13px;
	}

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

</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>
				<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-6">
								<label class="control-label multi_lang">تحديد الصنف</label>
								
								<select class="form-control" name="item_type_id" id="item_type_id" data-width="100%">

								</select>
								<div class="form-control-feedback">
									<i class="icon-basket 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="text" id="erbil_code" name="erbil_code" class="form-control multi_lang" placeholder="الرمز المحلي" required="required">
								<div class="form-control-feedback">
									<i class="icon-color-sampler text-muted"></i>
								</div>
							</div>

						</div>

						<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="text" id="turkish_code" name="turkish_code" class="form-control multi_lang" placeholder="الرمز الاجنبي" required="required">
								<div class="form-control-feedback">
									<i class="icon-shutter 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="text" id="barcode" name="barcode" class="form-control multi_lang" placeholder="الرمز التسلسلي" >
								<div class="form-control-feedback">
									<i class="icon-barcode2 text-muted"></i>
								</div>
							</div>


						</div>

						<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="text" id="product_min_notification" name="product_min_notification" class="form-control multi_lang" placeholder="الحد الادنى من الكمية في المخازن للتنبيه" >
								<div class="form-control-feedback">
									<i class="icon-bell3 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="text" id="product_note" name="product_note" class="form-control multi_lang" placeholder="الملاحظات" >
								<div class="form-control-feedback">
									<i class="icon-info22 text-muted"></i>
								</div>
							</div>

						</div>

						<div class="form-group">
							<!-- <label class="col-lg-1 control-label text-semibold">اختيار الصور</label> -->
							<div class="col-lg-12">
								<input type="file" class="file-input-ajax" id="files_upload" name="files_upload[]" multiple="multiple">
								<span class="help-block multi_lang">  تحميل صور المادة </span>
							</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">
			<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>


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

									<div class="form-group">


										<!-- <div class="form-group form-group-material col-sm-6">
											<label class="control-label animate multi_lang"> تحديد الفئة </label>
											<select name="edit_category_id" id="edit_category_id" class="form-control">

											</select>
										</div> -->

										<div class="form-group has-feedback has-feedback-left  col-sm-6">
											<label class="control-label multi_lang">تحديد الصنف</label>
											
											<select class="form-control" name="edit_item_type_id" id="edit_item_type_id" data-width="100%">

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

										<div class="form-group has-feedback has-feedback-left  col-sm-6">
											<label class="control-label multi_lang"> كود اربيل </label>
											<input type="text" id="edit_erbil_code" name="edit_erbil_code" class="form-control multi_lang" placeholder="كود اربيل" required="required">
											<div class="form-control-feedback">
												<i class="icon-color-sampler text-muted"></i>
											</div>
										</div>

									</div>

									<div class="form-group">
										

										<div class="form-group has-feedback has-feedback-left col-sm-6">
											<label class="control-label multi_lang"> كود تركيا </label>
											<input type="text" id="edit_turkish_code" name="edit_turkish_code" class="form-control multi_lang" placeholder="كود تركيا" required="required" >
											<div class="form-control-feedback">
												<i class="icon-shutter text-muted"></i>
											</div>
										</div>

										<div class="form-group has-feedback has-feedback-left  col-sm-6">
											<label class="control-label  multi_lang">الرمز التسلسلي</label>
											<input type="text" id="edit_barcode" name="edit_barcode" class="form-control multi_lang" placeholder="الرمز التسلسلي" >
											<div class="form-control-feedback">
												<i class="icon-barcode2 text-muted"></i>
											</div>
										</div>


									</div>

									<div class="form-group" id="come_type">
										
										<div class="form-group has-feedback has-feedback-left  col-sm-6">
											<label class="control-label multi_lang">الحد الادنى من الكمية في المخازن للتنبيه</label>
											<input type="text" id="edit_product_min_notification" name="edit_product_min_notification" class="form-control multi_lang" placeholder="الحد الادنى من الكمية في المخازن للتنبيه" >
											<div class="form-control-feedback">
												<i class="icon-bell3 text-muted"></i>
											</div>
										</div>
										<div class="form-group has-feedback has-feedback-left  col-sm-6">
											<label class="control-label animate is-visible multi_lang">الملاحظات</label>
											<input type="text" id="edit_product_note" name="edit_product_note" class="form-control multi_lang" placeholder="الملاحظات" >
											<div class="form-control-feedback">
												<i class=" icon-info22 text-muted"></i>
											</div>
										</div>

									</div>


									<div class="form-group" >
										<div class="col-lg-12">
											<input type="file" class="file-input-ajax" id="edit_files_upload" name="edit_files_upload[]" multiple="multiple">
											<span class="help-block multi_lang">  تحميل صور المادة </span>
										</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="add_new_category" class="modal fade" >
			<div class="modal-dialog modal-lg">
			<form class="form-horizontal"  name="add_new_category_form" method="post" id="add_new_category_form" enctype="multipart/form-data">
				<input type="hidden" id="access_token" name="access_token"  value="<?php //echo $_SESSION['access_token']; ?>">

				<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">
							<div>
								<div class="col-sm-12">
									<div class="form-group">
										<div class="col-sm-6">
											<div class="input-group">
												<label class="input-group-addon multi_lang">اسم الفئة</label>
												<input type="text" placeholder="اسم الفئة" class="form-control multi_lang" name="objname" id="objname" required="required">
											</div>
										</div>
										<div class="col-sm-6">
											<div class="input-group">
												<label class="input-group-addon multi_lang">الوصف</label>
												<input type="text" placeholder="الوصف" class="form-control multi_lang" name="category_description" id="category_description" required="required">
											</div>
										</div>
									</div>
								</div>
							</div>
					</div>
					<div class="modal-footer">
						<button type="submit" id="submit_add_cat_btn" 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="show_files" class="modal fade" >
			<div class="modal-dialog modal-lg" >

				<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">

								<div class="row" id="file_attach">

								</div>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-labeled btn-labeled-left heading-btn btn-primary"  data-dismiss="modal"> OK
						</button>
						<button type="button" class="btn btn-warning" data-dismiss="modal"> <span class="multi_lang">اغلاق</span>
						</button>
					</div>
				</div>

		</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">الصنف</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>
				        		<th class="multi_lang" width="15%">العمليات</th>
				      		</tr>
						</thead>
						<tbody>
							
						</tbody>
						<tfoot>
							<tr>
				                <td></td>
				                <td>username</td>
				                <td>full_name</td>
				                <td>EMail</td>
				                <td>Phone</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/product.js?random=<?php echo uniqid(); ?>"></script>