<?php
$permission  = explode(',',$_SESSION['permission_id']);
if(!in_array(27,$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;
}

</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 animate multi_lang">اسم المالك</label>
								
								<select name="amount_owner_staff_id_fk" id="amount_owner_staff_id_fk" class="form-control" required="required">
								

								</select>
								<div class="form-control-feedback">
									<i class="icon-user-tie 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="capital_amount" name="capital_amount" class="form-control multi_lang" placeholder=" المبلغ " required="required">
								<div class="form-control-feedback">
									<i class="icon-wallet 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="date_of_add" name="date_of_add" class="form-control daterange-single multi_lang" placeholder="التاريخ" required="required">
								<div class="form-control-feedback">
									<i class="icon-calendar52 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="capital_note" name="capital_note" class="form-control multi_lang" placeholder="الملاحظات" >
								<div class="form-control-feedback">
									<i class="icon-info22 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>
								<select name="expenses_currency" id="expenses_currency" class="form-control" required="required">
										<option class="multi_lang" value="" selected="selected">نوع العملة</option>
										<option class="multi_lang"  value="1" >دولار</option>
										<option class="multi_lang"  value="0" >عراقي</option>
								</select>
								<div class="form-control-feedback">
									<i class="icon-coin-dollar 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 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>
										
										<select name="edit_amount_owner_staff_id_fk" id="edit_amount_owner_staff_id_fk" class="form-control" required="required">
										

										</select>
										<div class="form-control-feedback">
											<i class="icon-user-tie 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_capital_amount" name="edit_capital_amount" class="form-control multi_lang" placeholder=" المبلغ " required="required">
										<div class="form-control-feedback">
											<i class="icon-wallet 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="edit_date_of_add" name="edit_date_of_add" class="form-control daterange-single multi_lang" placeholder="التاريخ" required="required">
										<div class="form-control-feedback">
											<i class="icon-calendar52 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_capital_note" name="edit_capital_note" class="form-control multi_lang" placeholder="الملاحظات" >
										<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="show_bills_modal" class="modal fade" style="display: none;">
		<div class="modal-dialog modal-lg">
			<form class="form-horizontal"  name="show_bills_form" method="post" id="show_bills_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 id="invoce_html_pay">
						<div class="modal-body" >
								<input type="hidden" name="bill_id" id="bill_id">
								<div id="bills_show">
									<!-- Borderless table -->


									<!-- /borderless table -->
								</div>
						</div>
					</div>
					<div class="modal-footer">
						<div id="link_pdf_pay"></div>
						<button type="submit" class="btn btn-labeled btn-labeled-left heading-btn btn-primary" id="pdf_pay"> <span class="multi_lang">توليد  PDF</span>  <b><i class="icon-file-pdf"></i></b>
						</button>
						<button type="submit" class="btn btn-labeled btn-labeled-left heading-btn btn-success" id="print_pay"><span class="multi_lang">طباعة</span>  <b><i class=" icon-printer2"></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="transfer_form_cont" class="modal fade" style="display: none;">
		<div class="modal-dialog modal-lg" style="width: 80%;"">
			<form class="form-horizontal"  name="transfer_form" method="post" id="transfer_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 class="col-sm-12">

								<div class="form-group">

									<div class="form-group has-feedback has-feedback-left  col-sm-3">
										<label class="control-label animate multi_lang">اسم مقدم الطلب</label>
										
										<select name="staff_name" id="staff_name" class="form-control" required="required">
										

										</select>
										<div class="form-control-feedback">
											<i class="icon-user-tie text-muted"></i>
										</div>
									</div>
									
									
									<div class="form-group has-feedback has-feedback-left form-group-material col-sm-3">
										<label class="control-label multi_lang">المبلغ المطلوب</label>
										<input type="text" id="transfer_amount" name="transfer_amount" class="form-control multi_lang" placeholder="المبلغ المطلوب" data-value="" required="required" >
										<div class="form-control-feedback">
											<i class="icon-wallet text-muted"></i>
										</div>
									</div>

									<div class="form-group has-feedback has-feedback-left form-group-material col-sm-3">
										<label class="control-label multi_lang">التاريخ</label>
										
										<input type="text" id="factory_date_of_add" name="factory_date_of_add" class="form-control daterange-single multi_lang" placeholder="التاريخ" required="required">
										<div class="form-control-feedback">
											<i class="icon-calendar52 text-muted"></i>
										</div>
									</div>
																	

									<div class="form-group has-feedback has-feedback-left form-group-material col-sm-3">
										<label class="control-label multi_lang">الملاحظات</label>
										<input type="text" id="transfer_note" name="transfer_note" class="form-control multi_lang" placeholder="الملاحظات" >
										<div class="form-control-feedback">
											<i class="icon-info22 text-muted"></i>
										</div>
									</div>

									


								</div>


							</div>
					</div>
					<div class="modal-footer">
						<button type="submit" id="transfer_form_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 class="row">
					<div class="col-sm-6 col-md-4">
						<div class="panel panel-body panel-body-accent">
							<div class="media no-margin">
								<div class="media-left media-middle">
									<i class="icon-safe icon-3x text-purple-400"></i>
								</div>

								<div class="media-body text-right">
									<h3 class="no-margin text-semibold" id="total_amount">0 $</h3>
									<span class="text-uppercase text-size-mini text-muted multi_lang">المبلغ الكلي</span>
								</div>
							</div>
						</div>
					</div>

					<div class="col-sm-6 col-md-4">
						<div class="panel panel-body">
							<div class="media no-margin">
								<div class="media-left media-middle">
									<i class="icon-shield-check icon-3x text-success-400"></i>
								</div>

								<div class="media-body text-right">
									<h3 class="no-margin text-semibold" id="total_withdraw">0 $</h3>
									<span class="text-uppercase text-size-mini text-muted multi_lang">المبلغ المستلم</span>
								</div>
							</div>
						</div>
					</div>

					<div class="col-sm-6 col-md-4">
						<div class="panel panel-body">
							<div class="media no-margin">
								<div class="media-body">
									<h3 class="no-margin text-semibold" id="total_expenses">0 $</h3>
									<span class="text-uppercase text-size-mini text-muted multi_lang">غير المؤكد</span>
								</div>

								<div class="media-right media-middle">
									<i class="icon-shield-notice icon-3x text-danger-400"></i>
								</div>
							</div>
						</div>
					</div>

					<!-- <div class="col-sm-6 col-md-3">
						<div class="panel panel-body">
							<div class="media no-margin">
								<div class="media-body">
									<h3 class="no-margin text-semibold" id="total_remain">0 $</h3>
									<span class="text-uppercase text-size-mini text-muted multi_lang">المبلغ المتبقي بعد القروض و المصاريف</span>
								</div>

								<div class="media-right media-middle">
									<i class="icon-wallet icon-3x text-blue-400"></i>
								</div>
							</div>
						</div>
					</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>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="8%">العمليات</th>
				      </tr>
						</thead>
						<tbody>
							
						</tbody>
						<tfoot>
							<tr>
				                <td></td>
				                <td></td>
				                <td>username</td>
				                <td>full_name</td>
				                <td>EMail</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/capital_factory.js?random=<?php echo uniqid(); ?>"></script>