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

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

	.dataTable {
        font-size: 11.5px;
	}

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

.input-group input {
	text-align: center;
}

</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">
							<button type="button" id="btn_template_prices" class="btn btn-primary btn-labeled btn-labeled-left">
							  <span class="multi_lang">انشاء حقول الاسعار</span>	 <b><i class="icon-magic-wand"></i></b>
							</button>
						</div>

						<div class="form-group">


							<div class="form-group has-feedback has-feedback-left  col-sm-2">
								<label class="control-label multi_lang">اختيار ملف السعر</label>
								
								<select class="form-control multi_lang" name="price_profile_id_fk" id="price_profile_id_fk" data-width="100%" placeholder="اختيار ملف السعر" required="required">

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


							<div class="form-group has-feedback has-feedback-left  col-sm-2">
								<label class="control-label multi_lang">الطريقة</label>
								
								<select class="form-control multi_lang" name="create_type" id="create_type" data-width="100%" placeholder="الرطيقة" >
									<option class="multi_lang" value="" selected="selected">اختيار الطريقة</option>
									
									<option class="multi_lang" value="1">نسخ من ملف سعر</option>

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

							<div class="form-group has-feedback has-feedback-left  col-sm-2">
								<label class="control-label multi_lang">ملف الاسعار المراد النسخ منه</label>
								
								<select class="form-control multi_lang" name="price_profile_id_fk_copy" id="price_profile_id_fk_copy" data-width="100%" placeholder="ملف الاسعار المراد النسخ منه">

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


							<div class="form-group has-feedback has-feedback-left  col-sm-2">
								<label class="control-label multi_lang">عملية النسخ</label>
								
								<select class="form-control multi_lang" name="increase_decrease" id="increase_decrease" data-width="100%" placeholder="عملية النسخ" required="required">
									<option class="multi_lang" value="" selected="selected">اختيار العملية</option>
									
									<option class="multi_lang" value="0">زيادة سعر</option>
									<option class="multi_lang" value="1">تخفيض سعر</option>

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

							<div class="form-group has-feedback has-feedback-left  col-sm-2">
								<label class="control-label multi_lang">نوع الزيادة/التخفيض</label>
								
								<select class="form-control multi_lang" name="abs_percent" id="abs_percent" data-width="100%" placeholder="نوع الزيادة/التخفيض" required="required">
									<option class="multi_lang" value="" selected="selected">اختيار العملية</option>
									
									<option class="multi_lang" value="0">قيمة مطلقة</option>
									<option class="multi_lang" value="1">نسبة مؤية</option>

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

							<div class="form-group has-feedback has-feedback-left form-group-material col-sm-2">
								<label class="control-label animate multi_lang"> المبلغ </label>
								<input type="text" id="price" name="price" class="form-control multi_lang" placeholder=" المبلغ " required="required">
								<div class="form-control-feedback">
									<i class="icon-cash text-muted"></i>
								</div>
							</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 has-feedback has-feedback-left form-group-material col-sm-6">
											<label class="control-label animate multi_lang"> اسم الملف </label>
											<input type="text" id="edit_profile_name" name="edit_profile_name" class="form-control multi_lang" placeholder=" اسم الملف " 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-6">
											<label class="control-label multi_lang">الوصف</label>
											<input type="text" id="edit_profile_description" name="edit_profile_description" class="form-control multi_lang" placeholder=" الوصف " >
											<div class="form-control-feedback">
												<i class="icon-pencil4 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>

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

				<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="group_description" id="group_description" >
											</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>

	



				<!-- 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">Barcode</th>
								<th class="multi_lang">ملف السعر</th>
								<th class="multi_lang">سعر البيع</th>
								<th class="multi_lang">صنف المادة</th>
				        		<th class="multi_lang" width="8%">العمليات</th>
				      		</tr>
						</thead>
						<tbody>
							
						</tbody>
						<tfoot>
							<tr>
	                <td></td>
	                <td>username</td>
	                <td>full_name</td>
	                <td>EMail</td>
	                <td>EMail</td>
	                <td></td>
	                <td></td>
	                <td></td>
	            </tr>
						</tfoot>
					</table>
				</div>
				<!-- /individual column searching (text inputs) -->



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