
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
		<!-- Required meta tags -->
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

		<!-- Title -->
		@if(Route::currentRouteName() == "showDepartmentItem")
		<title>
		{{$app->app_name}}, SALE REPORT FOR <?php echo date("d/m/Y");?>
		</title>
		@else
		<title>Welcome ~ {{$app->app_name}} | POINT OF SALES SYSTEM</title>
		@endif

		<!-- Sweet Alert-->
		<link href="{{asset('vendor/libs/sweetalert2/sweetalert2.min.css')}} " rel="stylesheet" type="text/css" />
		<!-- Ajax Call -->
		<script src="{{asset('js/ajax.min.js')}}"></script>

		<link rel="icon" type="image/x-icon" href="/img/{{$app->app_logo}}">

		@include('inc.assets')
	
	</head>
	<body>
	@if($getDayClose->app_state == 0)
		<script>
			window.location.href = "/ceqa-dashboard/503/maintainance-mode"
		</script>
	@endif

		<!-- Loading wrapper start -->
		<!-- <div id="loading-wrapper">
			<div class="spinner-border"></div>
			Loading...
		</div> -->
		<!-- Loading wrapper end -->

		<!-- Page wrapper start -->
		<div class="page-wrapper">
			
			<!-- Sidebar wrapper start -->
			<nav class="sidebar-wrapper">

				<!-- Sidebar content start -->
				<div class="sidebar-tabs">

					<!-- Tabs nav start -->
					<div class="nav" role="tablist" aria-orientation="vertical">
						<a href="#" class="logo">
							<img src="/img/logofav.png" alt="Logo">
						</a>
						<a class="nav-link active" id="home-tab" data-bs-toggle="tab" href="#tab-home" role="tab" aria-controls="tab-home" aria-selected="true">
							<i class="icon-home2"></i>
							<span class="nav-link-text">Dashboards</span>
						</a>
						<a class="nav-link" id="product-tab" data-bs-toggle="tab" href="#tab-product" role="tab" aria-controls="tab-product" aria-selected="false">
							<i class="icon-layers2"></i>
							<span class="nav-link-text">Items</span>
						</a>
						<a class="nav-link" id="pages-tab" data-bs-toggle="tab" href="#tab-pages" role="tab" aria-controls="tab-pages" aria-selected="false">
							<i class="icon-book-open"></i>
							<span class="nav-link-text">Make Sales</span>
						</a>
						@can('create', App\Models\User::class)
						<a class="nav-link" id="authentication-tab" data-bs-toggle="tab" href="#tab-authentication" role="tab" aria-controls="tab-authentication" aria-selected="false">
							<i class="icon-unlock"></i>
							<span class="nav-link-text">Authentication</span>
						</a>
						@endcan
						<a class="nav-link settings" id="settings-tab" data-bs-toggle="tab" href="#tab-settings" role="tab" aria-controls="tab-authentication" aria-selected="false">
							<i class="icon-settings1"></i>
							<span class="nav-link-text">Settings</span>
						</a>
					</div>
					<!-- Tabs nav end -->

					<!-- Tabs content start -->
					<div class="tab-content">
								
						<!-- Chat tab -->
						<div class="tab-pane fade show active" id="tab-home" role="tabpanel" aria-labelledby="home-tab">

							<!-- Tab content header start -->
							<div class="tab-pane-header">
								Dashboards
							</div>
							<!-- Tab content header end -->

							<!-- Sidebar menu starts -->
							<div class="sidebarMenuScroll">
								<div class="sidebar-menu">
									<ul>
										<li>
											<a href="{{route('home')}}" class="{{ Route::currentRouteName() == "home" ? 'current-page' : "" }}">
												Dashboard
											</a>
										</li>
										@can('create', App\Models\User::class)
										<li>
											<a href="{{route('salesReport')}}" class="{{ Route::currentRouteName() == "salesReport" ? 'current-page' : "" }}">Sales Report</a>
										</li>

										<li>
											<a href="{{route('riderReport')}}" class="{{ Route::currentRouteName() == "riderReport" ? 'current-page' : "" }}">Rider Report</a>
										</li>

										<li>
											<a href="{{route('OnTheHouse')}}" class="{{ Route::currentRouteName() == "OnTheHouse" ? 'current-page' : "" }}">No Charge Report</a>
										</li>

										<li>
											<a href="{{route('review.index')}}" class="{{ Route::currentRouteName() == "review.index" ? 'current-page' : "" }}"">Cust. Reviews Summary</a>
										</li>
										@endcan
										<li>
											<a href="#" data-bs-toggle="modal" data-bs-target="#agency">Agency Report</a>
										</li>
										@if($bar == 0)
										@if(auth()->user()->role == "Administrator")
										<li>
											<a href="{{route('tableManagement')}}">Table Management</a>
										</li>
										@endif
										@else
										<li>
											<a href="{{route('tableManagement')}}">Table Management</a>
										</li>
										@endif
									
										@can('create', App\Models\User::class)
										@if($app->sales_target == 1)
										<li>
                                            <a href="#"  data-bs-toggle="modal" data-bs-target="#exampleModalCenteredTarget">Target & Sales Progress</a>
						
										</li>
										@endif
										@endcan
									</ul>
								
								</div>
							</div> 
							
							<!-- Sidebar menu ends -->

							
						</div>

						<!-- Pages tab -->
						<div class="tab-pane fade" id="tab-product" role="tabpanel" aria-labelledby="product-tab">
							
							<!-- Tab content header start -->
							<div class="tab-pane-header">
								Items
							</div>
							<!-- Tab content header end -->

							<!-- Sidebar menu starts -->
							<div class="sidebarMenuScroll">
								<div class="sidebar-menu">
									<ul>
										@if(auth()->user()->role == "Administrator")
										<li>
											<a href="{{route('index.agency')}}" class="{{ Route::currentRouteName() == "index.agency" ? 'current-page' : "" }}">Agency</a>
										</li>
										@endif
										<li>
											<a href="{{route('productList')}}" class="{{ Route::currentRouteName() == "productList" ? 'current-page' : "" }}">Product & Service</a>
										</li>
										@if(auth()->user()->role != "Administrator")
										<li>
											<a href="{{route('deliveryPricing')}}" class="{{ Route::currentRouteName() == "deliveryPricing" ? 'current-page' : "" }}">Delivery Prices</a>
										</li>
										@endif
										
										@can('create', App\Models\User::class)
										<li>
											<a href="{{route('categoryItem.index')}}" class="{{ Route::currentRouteName() == "categoryItem.index" ? 'current-page' : "" }}">Item Category</a>
										</li>
										<li>
											<a href="{{route('brand.index')}}" class="{{ Route::currentRouteName() == "brand.index" ? 'current-page' : "" }}">Item Brands</a>
										</li>
										@endcan
										@can('create', App\Models\User::class)
										<li>
											<a href="{{route('index.dispatchItem')}}" class="{{ Route::currentRouteName() == "index.dispatchItem" ? 'current-page' : "" }}">Delivery Prices</a>
										</li>
										<li>
											<a href="{{route('celebrity.index')}}" class="{{ Route::currentRouteName() == "celebrity.index" ? 'current-page' : "" }}">Coupons</a>
										</li>
										@endcan
										@can('create', App\Models\Branch::class)
										<li>
											<a href="{{route('index.branch')}}" class="{{ Route::currentRouteName() == "index.branch" ? 'current-page' : "" }}">Outlet</a>
										</li>
										@endcan
										@can('create', App\Models\User::class)
										<li>
											<a href="{{route('targets.index')}}" class="{{ Route::currentRouteName() == "targets.index" ? 'current-page' : "" }}">New Target</a>
										</li>
										@endif
										@can('create', App\Models\Dispatch::class)
										<li>
											<a href="{{route('index.rider')}}" class="{{ Route::currentRouteName() == "index.rider" ? 'current-page' : "" }}">Dispatch Rider</a>
										</li>
										@endcan
										<li>
											<a href="{{route('show.customer')}}" class="{{ Route::currentRouteName() == "show.customer" ? 'current-page' : "" }}">Customers</a>
										</li>
										@can('create', App\Models\User::class)
										<li>
											<a href="{{route('table.index')}}">New Bar-Table</a>
										</li>
										@endif
									</ul>
								</div>
							</div>
							<!-- Sidebar menu ends -->
						</div>

						<!-- Pages tab -->
						<div class="tab-pane fade" id="tab-pages" role="tabpanel" aria-labelledby="pages-tab">
							
							<!-- Tab content header start -->
							<div class="tab-pane-header">
								Make Sales
							</div>
							<!-- Tab content header end -->

							<!-- Sidebar menu starts -->
							<div class="sidebarMenuScroll">
								<div class="sidebar-menu">
									<ul>
										<li>
											<a href="{{route('pendingOrders')}}">Sales Channel</a>
										</li>
									
										@if(auth()->user()->role == "Dispatch Manager")
										<li>
											<a href="{{route('OnlineAgency')}}">Order Display</a>
										</li>
										@else
										<li>
											<a href="{{route('OnlineAgency')}}">Order Display</a>
										</li>
										@endif
										@if(auth()->user()->role != "Sales Person")
										@if(auth()->user()->role == "Call Center")
										<li>
											<a href="#" data-bs-toggle="modal" data-bs-target="#DeliveryModalGeneral">New Sale</a>
										</li>
										@endif
										@else
										
										<li>
											<a href="#" data-bs-toggle="modal" data-bs-target="#DeliveryModalGeneral">New Sale</a>
										</li>
									
										<li>
											<a href="{{route('viewDraft')}}">Draft Orders</a>
										</li>
										@endif
										@can('create', App\Models\User::class)
										<li>
											<a href="{{route('index.order')}}">View Invoices</a>
										</li>
										@endcan
										@can('create', App\Models\Dispatch::class)
										@if(auth()->user()->role == "Dispatch Manager")
										<li>
											<a href="{{route('index.dispatch')}}">Dispatch</a>
										</li>
										@endif
										@endcan

										
									</ul>
								</div>
							</div>
							<!-- Sidebar menu ends -->
						</div>

						@can('create', App\Models\User::class)
						<!-- Authentication tab -->
						<div class="tab-pane fade" id="tab-authentication" role="tabpanel" aria-labelledby="authentication-tab">
							
							<!-- Tab content header start -->
							<div class="tab-pane-header">
								Authentication
							</div>
							<!-- Tab content header end -->
							
							<!-- Sidebar menu starts -->
							<div class="sidebarMenuScroll">
								<div class="sidebar-menu">
									<ul>
										@if(auth()->user()->role == "Administrator")
										<li>
											<a href="{{route('allUSers')}}">Users</a>
										</li>
										<li>
											<a href="#" data-bs-toggle="modal" data-bs-target="#staticBackdropRegister">Add User</a>
										</li>
										@endif
										<li>
											<a href="{{route('index.account')}}">Settings</a>
										</li>
										@if(auth()->user()->role == "Administrator" || auth()->user()->role == "Branch Officer" || auth()->user()->sales_person_category == "Delivery")
										<li>
											<a href="#" data-bs-toggle="modal" data-bs-target="#switchModal">Switch Outlet</a>
										</li>
										@endif
									</ul>
								</div>
							</div>
							<!-- Sidebar menu ends -->

							@if(auth()->user()->role == "Administrator")
							<!-- Sidebar actions starts -->
							<div class="sidebar-actions">
								<div class="support-tile blue">
									<a href="{{route('inventory')}}" class="btn btn-light m-auto">Inventory</a>
								</div>
							</div>
							<!-- Sidebar actions ends -->
							@endif

						</div>
						@endcan
						
						<!-- Settings tab -->
						<div class="tab-pane fade" id="tab-settings" role="tabpanel" aria-labelledby="settings-tab">
							
							<!-- Tab content header start -->
							<div class="tab-pane-header">
								Settings
							</div>
							<!-- Tab content header end -->

							<!-- Settings start -->
							<div class="sidebarMenuScroll">
								<div class="sidebar-settings">
									<div class="accordion" id="settingsAccordion">
										<div class="accordion-item">
											<h2 class="accordion-header" id="genInfo">
												<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#genCollapse" aria-expanded="true" aria-controls="genCollapse">
													General Info
												</button>
											</h2>
											<div id="genCollapse" class="accordion-collapse collapse show" aria-labelledby="genInfo" data-bs-parent="#settingsAccordion">
											<form method="post" action="{{route('updateuser', auth()->user()->id)}}">
												@csrf
											<div class="accordion-body">
													<div class="field-wrapper">
														<input type="text" readonly name="username" value="{{auth()->user()->name}}" />
														<div class="field-placeholder">Full Name</div>
													</div>

													<div class="field-wrapper">
														<input type="email" name="useremail" value="{{auth()->user()->email}}" />
														<div class="field-placeholder">Email</div>
													</div>

													<div class="field-wrapper">
														<input type="text" name="userrole" readonly value="{{auth()->user()->role}}" />
														<div class="field-placeholder">Role</div>
													</div>
													<div class="field-wrapper m-0">
														<button type="submit" class="btn btn-primary stripes-btn">Save</button>
													</div>
												</div>
											</div>
											</form>
										</div>
										<div class="accordion-item">
											<h2 class="accordion-header" id="chngPwd">
												<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#chngPwdCollapse" aria-expanded="false" aria-controls="chngPwdCollapse">
													Change Password
												</button>
											</h2>
										<form action="{{route('changePassword', auth()->user()->id)}}" method="post">
                								@csrf
											<div id="chngPwdCollapse" class="accordion-collapse collapse" aria-labelledby="chngPwd" data-bs-parent="#settingsAccordion">
												<div class="accordion-body">
													<div class="field-wrapper">
														<input type="text" name="old_password" required>
														<div class="field-placeholder">Current Password</div>
													</div>
													<div class="field-wrapper">
														<input type="password" name="password" required>
														<div class="field-placeholder">New Password</div>
													</div>
													<div class="field-wrapper">
														<input type="password" name="password_confirmation" required>
														<div class="field-placeholder">Confirm Password</div>
													</div>
													<div class="field-wrapper m-0">
														<button class="btn btn-primary stripes-btn">Save</button>
													</div>

												</div>
											</div>
										</form>
										</div>
										@can('create', App\Models\User::class)
										<div class="accordion-item">
											<h2 class="accordion-header" id="sidebarNotifications">
												<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#notiCollapse" aria-expanded="false" aria-controls="notiCollapse">
													Simple Settings
												</button>
											</h2>
											<div id="notiCollapse" class="accordion-collapse collapse" aria-labelledby="sidebarNotifications" data-bs-parent="#settingsAccordion">
												<div class="accordion-body">
													<div class="list-group m-0">
														<div class="noti-container">
															<div class="noti-block">
																<div>Clear Cache</div>
																<div class="form-switch">
																	<input class="form-check-input" type="checkbox" id="showAlertss" onChange="clearCache()">
																	<label class="form-check-label" for="showAlertss"></label>
																</div>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
										@endcan
									</div>
								</div>
							</div>
							<!-- Settings end -->

							<!-- Sidebar actions starts -->
							<div class="sidebar-actions">
								<div class="support-tile blue">
									<a href="{{route('onlineOrders')}}" class="btn btn-light m-auto">Online Orders</a>
								</div>
							</div>
							<!-- Sidebar actions ends -->
						</div>

					</div>
					<!-- Tabs content end -->

				</div>
				<!-- Sidebar content end -->
				
			</nav>
			<!-- Sidebar wrapper end -->

			<!-- *************
				************ Main container start *************
			************* -->
			<div class="main-container">

				<!-- Page header starts -->
				<div class="page-header">
					
					<!-- Row start -->
					<div class="row gutters">
						<div class="col-xl-8 col-lg-8 col-md-8 col-sm-6 col-9">

							<!-- Search container start -->
							<div class="search-container">

								<!-- Toggle sidebar start -->
								<div class="toggle-sidebar" id="toggle-sidebar">
									<i class="icon-menu"></i>
								</div>
								<!-- Toggle sidebar end -->


								<!-- Search input group start -->
								<div class="ui fluid category search">
									<form action="{{route('searchOrder')}}">
										@csrf
									<!-- Field wrapper start -->
									<div class="field-wrapper">
										<div class="input-group">
											<input class="form-control" required placeholder="Search Receipt Number....." type="text" name="search">
											<span class="input-group-text">
											<button class="btn btn-default btn-sm"><i class="fa fa-search" aria-hidden="true"></i></button>
											</span>
										</div>
									</div>
									<!-- Field wrapper end -->
									</form>
								</div>
								<!-- Search input group end -->
								

							</div>
							<!-- Search container end -->

						</div>
						<div class="col-xl-4 col-lg-4 col-md-4 col-sm-6 col-3">

							<!-- Header actions start -->
							<ul class="header-actions">
								<li class="dropdown">
									<a href="#" id="notifications" data-toggle="dropdown" aria-haspopup="true">
										<i class="icon-check-square"></i> 
									</a>
								</li>
								<li class="dropdown">
									<a href="#" id="userSettings" class="user-settings" data-toggle="dropdown" aria-haspopup="true">
										<span class="avatar">
											<img src="/img/user.svg" alt="User Avatar">
											<span class="status busy"></span>
										</span>
									</a>
									<div class="dropdown-menu dropdown-menu-end md" aria-labelledby="userSettings">
										<div class="header-profile-actions">
											<a href="{{route('index.account')}}"><i class="icon-user1"></i>Profile</a>
											<a href="#"><i class="icon-settings1"></i>Settings</a>
											<a class="dropdown-item" href="{{ route('logout') }}"
                                      		 onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
													<i class="icon-log-out1"></i> Logout
													</a>
											<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
												@csrf
											</form>
										</div>
									</div>
								</li>
							</ul>
							<!-- Header actions end -->

						</div>
					</div>
					<!-- Row end -->					
					@include('inc.errorfile')
				</div>
				<!-- Page header ends -->
				@include('modal.target-report')
				@include('modal.agency-report')
				@include('modal.delivery-modal-pop')
				@include('modal.delivery-modal')
				
				<!-- Content wrapper scroll start -->
				<div class="content-wrapper-scroll">
               
				@yield('content')


                    <!-- App footer start -->
                    @include('inc.footer')
					@include('modal.switch-branch')
					
					<!-- App footer end -->

				</div>
				<!-- Content wrapper scroll end -->

			</div>
			<!-- *************
				************ Main container end *************
			************* -->

		</div>
		<!-- Page wrapper end -->

		@include('inc.new-user')

		<style>
			::placeholder{
				font-size:10px;
			}
		</style>

		<!-- <script>

			function clearCache(){
				window.location.assign("/clear-cache");
			}
			function clearConfig(){
				window.location.assign("/clear-config");
			}
			function clearView(){
				window.location.assign("/clear-view");
			}

		</script> -->


		<!-- *************
			************ Required JavaScript Files *************
		************* -->
		<!-- Required jQuery first, then Bootstrap Bundle JS -->
		<script src="{{asset('js/jquery.min.js')}}"></script>
		<script src="{{asset('js/bootstrap.bundle.min.js')}}"></script>
		<script src="{{asset('js/modernizr.js')}}"></script>
		<script src="{{asset('js/moment.js')}}"></script>

		<!-- *************
			************ Vendor Js Files *************
		************* -->


		<!-- Sweet Alerts js -->
		<script src="{{asset('vendor/libs/sweetalert2/sweetalert2.min.js')}}"></script>
		
		<!-- Megamenu JS -->
		<script src="{{asset('vendor/megamenu/js/megamenu.js')}}"></script>
		<script src="{{asset('vendor/megamenu/js/custom.js')}}"></script>
		<!-- Slimscroll JS -->
		<script src="{{asset('vendor/slimscroll/slimscroll.min.js')}}"></script>
		<script src="{{asset('vendor/slimscroll/custom-scrollbar.js')}}"></script>
		<!-- Search Filter JS -->
		<script src="{{asset('vendor/search-filter/search-filter.js')}}"></script>
		<script src="{{asset('vendor/search-filter/custom-search-filter.js')}}"></script>
		<!-- Apex Charts -->
		<script src="{{asset('vendor/apex/apexcharts.min.js')}}"></script>
		<script src="{{asset('vendor/apex/custom/home/salesGraph.js')}}"></script>
		<!-- Circleful Charts -->
		<script src="{{asset('vendor/circliful/circliful.min.js')}}"></script>
		<script src="{{asset('vendor/circliful/circliful.custom.js')}}"></script>
		<!-- Bootstrap Select JS -->
		<script src="{{asset('vendor/bs-select/bs-select.min.js')}}"></script>
		<script src="{{asset('vendor/bs-select/bs-select-custom.js')}}"></script>
		<!-- Data Tables -->
		<script src="{{asset('vendor/datatables/dataTables.min.js')}}"></script>
		<script src="{{asset('vendor/datatables/dataTables.bootstrap.min.js')}}"></script>
		<!-- Custom Data tables -->
		<script src="{{asset('vendor/datatables/custom/custom-datatables.js')}}"></script>
		<!-- Download / CSV / Copy / Print -->
		<script src="{{asset('vendor/datatables/buttons.min.js')}}"></script>
		<script src="{{asset('vendor/datatables/jszip.min.js')}}"></script>
		<script src="{{asset('vendor/datatables/pdfmake.min.js')}}"></script>
		<script src="{{asset('vendor/datatables/vfs_fonts.js')}}"></script>
		<script src="{{asset('vendor/datatables/html5.min.js')}}"></script>
		<script src="{{asset('vendor/datatables/buttons.print.min.js')}}"></script>
		<!-- Dropzone JS -->
		<script src="{{asset('vendor/dropzone/dropzone.min.js')}}"></script>
		<!-- Date Range JS -->
		<script src="{{asset('vendor/daterange/daterange.js')}}"></script>
		<script src="{{asset('vendor/daterange/custom-daterange.js')}}"></script>
		<!-- Main Js Required -->
		<script src="{{asset('js/main.js')}}"></script>

	</body>

</html>