<?php
if(Auth::check()){
	    if(Auth::user()->user_type == 'organization_user')
	    {
	        if(Auth::user()->cust_status == 1)
    		{
    			if(Auth::user()->cust_otp_status==0){
    			    
    				echo '<script>window.location = "customeruser/otp";</script>';
    			}
    		}
	    }
	}
	else
	{
		echo '<script>window.location = "/home";</script>';
	}

?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<title>Bulk MPESA Payments</title>
	<meta content='width=device-width, initial-scale=1.0, shrink-to-fit=no' name='viewport' />
	<link rel="icon" href="{{ asset('assets/img/icon.ico')}}" type="image/x-icon"/>

	<!-- Fonts and icons -->
	<script src="{{ asset('assets/js/plugin/webfont/webfont.min.js')}}"></script>
	<script>
		WebFont.load({
			google: {"families":["Lato:300,400,700,900"]},
			custom: {"families":["Flaticon", "Font Awesome 5 Solid", "Font Awesome 5 Regular", "Font Awesome 5 Brands", "simple-line-icons"], urls: ['{{ asset('assets/css/fonts.min.css')}}']},
			active: function() {
				sessionStorage.fonts = true;
			}
		});
	</script>
	<!-- CSS Just for demo purpose, don't include it in your project -->
	<link rel="stylesheet" href="{{ asset('assets/css/demo.css')}}">
	<!-- CSS Files -->
	<link rel="stylesheet" href="{{ asset('assets/css/bootstrap.min.css')}}">
	<link rel="stylesheet" href="{{ asset('assets/css/atlantis.min.css')}}">

	<!-- CSS Just for demo purpose, don't include it in your project -->
	<link rel="stylesheet" href="{{ asset('assets/css/demo.css')}}">
	<link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.1/css/buttons.dataTables.min.css">
</head>
<body>
	<div class="wrapper">
        <!--navbar header-->
        <div class="main-header">
	<!-- Logo Header -->
	<div class="logo-header" style="background:#f27200;">
		
		<a href="" class="logo text-white">
			<img src="{{ asset('assets/img/mobi.jpg')}}" alt="Bulk MPESA" class="navbar-brand">
		</a>
		<button class="navbar-toggler sidenav-toggler ml-auto" type="button" data-toggle="collapse" data-target="collapse" aria-expanded="false" aria-label="Toggle navigation">
			<span class="navbar-toggler-icon">
				<i class="icon-menu"></i>
			</span>
		</button>
		<button class="topbar-toggler more"><i class="icon-options-vertical"></i></button>
		<div class="nav-toggle">
			<button class="btn btn-toggle toggle-sidebar">
				<i class="icon-menu"></i>
			</button>
		</div>
	</div>
	<!-- End Logo Header -->

	<!-- Navbar Header -->
	<nav class="navbar navbar-header navbar-expand-lg" style="background:#f27200;">
		
		<div class="container-fluid">
			<div class="collapse" id="search-nav">
			<!--	<form class="navbar-left navbar-form nav-search mr-md-3">
					<div class="input-group">
						<div class="input-group-prepend">
							<button type="submit" class="btn btn-search pr-1">
								<i class="fa fa-search search-icon"></i>
							</button>
						</div>
						<input type="text" placeholder="Search ..." class="form-control">
					</div>
				</form>-->
			</div>


			<ul class="navbar-nav topbar-nav ml-md-auto align-items-center">
			<!--	<li class="nav-item toggle-nav-search hidden-caret">
					<a class="nav-link" data-toggle="collapse" href="#search-nav" role="button" aria-expanded="false" aria-controls="search-nav">
						<i class="fa fa-search"></i>
					</a>
				</li>-->
				<li class="nav-item dropdown hidden-caret">
				<!--	<a class="nav-link dropdown-toggle" href="#" id="messageDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
						<i class="fa fa-envelope"></i>
					</a>-->
				<!--	<ul class="dropdown-menu messages-notif-box animated fadeIn" aria-labelledby="messageDropdown">
						<li>
							<div class="dropdown-title d-flex justify-content-between align-items-center">
								Messages 									
								<a href="#" class="small">Mark all as read</a>
							</div>
						</li>
						<li>
							<div class="message-notif-scroll scrollbar-outer">
								<div class="notif-center">
									<a href="#">
										<div class="notif-img"> 
											<img src="../assets/img/jm_denis.jpg" alt="Img Profile">
										</div>
										<div class="notif-content">
											<span class="subject">Jimmy Denis</span>
											<span class="block">
												How are you ?
											</span>
											<span class="time">5 minutes ago</span> 
										</div>
									</a>
									<a href="#">
										<div class="notif-img"> 
											<img src="../assets/img/chadengle.jpg" alt="Img Profile">
										</div>
										<div class="notif-content">
											<span class="subject">Chad</span>
											<span class="block">
												Ok, Thanks !
											</span>
											<span class="time">12 minutes ago</span> 
										</div>
									</a>
									<a href="#">
										<div class="notif-img"> 
											<img src="../assets/img/mlane.jpg" alt="Img Profile">
										</div>
										<div class="notif-content">
											<span class="subject">Jhon Doe</span>
											<span class="block">
												Ready for the meeting today...
											</span>
											<span class="time">12 minutes ago</span> 
										</div>
									</a>
									<a href="#">
										<div class="notif-img"> 
											<img src="../assets/img/talha.jpg" alt="Img Profile">
										</div>
										<div class="notif-content">
											<span class="subject">Talha</span>
											<span class="block">
												Hi, Apa Kabar ?
											</span>
											<span class="time">17 minutes ago</span> 
										</div>
									</a>
								</div>
							</div>
						</li>
						<li>
							<a class="see-all" href="javascript:void(0);">See all messages<i class="fa fa-angle-right"></i> </a>
						</li>
					</ul>
				</li>

-->
				
		<!--		<li class="nav-item dropdown hidden-caret">
					<a class="nav-link dropdown-toggle" href="#" id="notifDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
						<i class="fa fa-bell"></i>
						<span class="notification">4</span>
					</a>
					<ul class="dropdown-menu notif-box animated fadeIn" aria-labelledby="notifDropdown">
						<li>
							<div class="dropdown-title">You have 4 new notification</div>
						</li>
						<li>
							<div class="notif-scroll scrollbar-outer">
								<div class="notif-center">
									<a href="#">
										<div class="notif-icon notif-primary"> <i class="fa fa-user-plus"></i> </div>
										<div class="notif-content">
											<span class="block">
												New user registered
											</span>
											<span class="time">5 minutes ago</span> 
										</div>
									</a>
									<a href="#">
										<div class="notif-icon notif-success"> <i class="fa fa-comment"></i> </div>
										<div class="notif-content">
											<span class="block">
												Rahmad commented on Admin
											</span>
											<span class="time">12 minutes ago</span> 
										</div>
									</a>
									<a href="#">
										<div class="notif-img"> 
											<img src="../assets/img/profile2.jpg" alt="Img Profile">
										</div>
										<div class="notif-content">
											<span class="block">
												Reza send messages to you
											</span>
											<span class="time">12 minutes ago</span> 
										</div>
									</a>
									<a href="#">
										<div class="notif-icon notif-danger"> <i class="fa fa-heart"></i> </div>
										<div class="notif-content">
											<span class="block">
												Farrah liked Admin
											</span>
											<span class="time">17 minutes ago</span> 
										</div>
									</a>
								</div>
							</div>
						</li>
						<li>
							<a class="see-all" href="javascript:void(0);">See all notifications<i class="fa fa-angle-right"></i> </a>
						</li>
					</ul>
				</li>-->
			<!--	<li class="nav-item dropdown hidden-caret">
					<a class="nav-link" data-toggle="dropdown" href="#" aria-expanded="false">
						<i class="fas fa-layer-group"></i>
					</a>
					<div class="dropdown-menu quick-actions quick-actions-info animated fadeIn">
						<div class="quick-actions-header">
							<span class="title mb-1">Quick Actions</span>
							<span class="subtitle op-8">Shortcuts</span>
						</div>
						<div class="quick-actions-scroll scrollbar-outer">
							<div class="quick-actions-items">
								<div class="row m-0">
									<a class="col-6 col-md-4 p-0" href="#">
										<div class="quick-actions-item">
											<i class="flaticon-file-1"></i>
											<span class="text">Generated Report</span>
										</div>
									</a>
									<a class="col-6 col-md-4 p-0" href="#">
										<div class="quick-actions-item">
											<i class="flaticon-database"></i>
											<span class="text">Create New Database</span>
										</div>
									</a>
									<a class="col-6 col-md-4 p-0" href="#">
										<div class="quick-actions-item">
											<i class="flaticon-pen"></i>
											<span class="text">Create New Post</span>
										</div>
									</a>
									<a class="col-6 col-md-4 p-0" href="#">
										<div class="quick-actions-item">
											<i class="flaticon-interface-1"></i>
											<span class="text">Create New Task</span>
										</div>
									</a>
									<a class="col-6 col-md-4 p-0" href="#">
										<div class="quick-actions-item">
											<i class="flaticon-list"></i>
											<span class="text">Completed Tasks</span>
										</div>
									</a>
									<a class="col-6 col-md-4 p-0" href="#">
										<div class="quick-actions-item">
											<i class="flaticon-file"></i>
											<span class="text">Create New Invoice</span>
										</div>
									</a>
								</div>
							</div>
						</div>
					</div>
				</li>-->
				<li class="nav-item dropdown hidden-caret">
					<a class="dropdown-toggle profile-pic" data-toggle="dropdown" href="#" aria-expanded="false">
						<div class="avatar-sm">
							<img src="../assets/img/profile.png" alt="..." class="avatar-img rounded-circle">
						</div>
					</a>
					<ul class="dropdown-menu dropdown-user animated fadeIn">
						<div class="dropdown-user-scroll scrollbar-outer">
							<li>
								<div class="user-box">
									<div class="avatar-lg"><img src="../assets/img/profile.png" alt="image profile" class="avatar-img rounded"></div>
									<div class="u-text">
										<h4>{{ ucfirst(Auth::user()->cust_user_surname) }}</h4>
										<p class="text-muted">{{ ucfirst(Auth::user()->cust_user_email) }}</p><a href="profile.html" class="btn btn-xs btn-secondary btn-sm">View Profile</a>
									</div>
								</div>
							</li>
							<li>
								<div class="dropdown-divider"></div>
								<a class="dropdown-item" href="#">My Profile</a>
								<div class="dropdown-divider"></div>
								<a href="#" class="dropdown-item" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">Logout</a>

								<form id="logout-form" action="/logout" method="POST" style="display: none;">{{ csrf_field() }}</form>
							</li>
						</div>
					</ul>
				</li>
			</ul>
		</div>
	</nav>
	<!-- End Navbar -->
</div>
        <!--/navbar header-->

		<!-- Sidebar -->
		@include('bmviews.partials.user-side')
		<!-- /End Sidebar -->

            <!-- main panel-->
            @yield('content')
			<!-- /end main panel-->

			<!-- footer -->
			<footer class="footer">
				<div class="container-fluid">
				<!--	<nav class="pull-left">
						<ul class="nav">
							<li class="nav-item">
								<a class="nav-link" href="">
									Mobisky
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="#">
									Help
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="#">
									Licenses
								</a>
							</li>
						</ul>
					</nav>-->
					<div class="copyright ml-auto">
						2020&copy; by <a href="">Mobisky Innovations Ltd.</a>
					</div>				
				</div>
			</footer>
		</div>
	</div>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js" charset="utf-8"></script>

	@if(isset($chart))
		{!! $chart->script() !!}
		@endif
	<script type="text/javascript" src="../../../js/app.js"></script>
	<!-- Bootstrap Toggle -->
	<script src="{{ ('assets/js/plugin/bootstrap-toggle/bootstrap-toggle.min.js')}}"></script>
	<!-- Bootstrap Tagsinput -->
	<script src="{{ ('assets/js/plugin/bootstrap-tagsinput/bootstrap-tagsinput.min.js')}}"></script>
	<!-- Atlantis DEMO methods, don't include it in your project! -->
	<script src="{{ asset('assets/js/setting-demo2.js')}}"></script>
	<!--   Core JS Files   -->
	<script src="{{ asset('assets/js/core/jquery.3.2.1.min.js')}}"></script>
	<script src="{{ asset('assets/js/core/popper.min.js')}}"></script>
	<script src="{{ asset('assets/js/core/bootstrap.min.js')}}"></script>

	<!-- jQuery UI -->
	<script src="{{ asset('assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js')}}"></script>
	<script src="{{ asset('assets/js/plugin/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js')}}"></script>

	<!-- jQuery Scrollbar -->
	<script src="{{ asset('assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js')}}"></script>


	<!-- Chart JS -->
	<script src="{{ asset('assets/js/plugin/chart.js/chart.min.js')}}"></script>

	<!-- jQuery Sparkline -->
	<script src="{{ asset('assets/js/plugin/jquery.sparkline/jquery.sparkline.min.js')}}"></script>

	<!-- Chart Circle -->
	<script src="{{ asset('assets/js/plugin/chart-circle/circles.min.js')}}"></script>

	<!-- Datatables -->
	<script src="{{ asset('assets/js/plugin/datatables/datatables.min.js')}}"></script>

	<!-- Bootstrap Notify -->
	<script src="{{ asset('assets/js/plugin/bootstrap-notify/bootstrap-notify.min.js')}}"></script>

	<!-- jQuery Vector Maps -->
	<script src="{{ asset('assets/js/plugin/jqvmap/jquery.vmap.min.js')}}"></script>
	<script src="{{ asset('assets/js/plugin/jqvmap/maps/jquery.vmap.world.js')}}"></script>
	<!-- Select2 -->
	<script src="{{ asset('assets/js/plugin/select2/select2.full.min.js')}}"></script>
	<!-- Sweet Alert -->
	<script src="{{ asset('assets/js/plugin/sweetalert/sweetalert.min.js')}}"></script>

	<!-- Atlantis JS -->
	<script src="{{ asset('assets/js/atlantis.min.js')}}"></script>
	<!-- jQuery Knob -->
<script src="{{ asset('assets/jquery-knob/js/jquery.knob.js')}}"></script>
<!-- table buttons -->
    <script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.6.1/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.6.1/js/buttons.flash.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.6.1/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.6.1/js/buttons.print.min.js"></script>
<script >
$(function () {
/* jQueryKnob */

$(".knob").knob({
  /*change : function (value) {
   //console.log("change : " + value);
   },
   release : function (value) {
   console.log("release : " + value);
   },
   cancel : function () {
   console.log("cancel : " + this.value);
   },*/
  draw: function () {

	// "tron" case
	if (this.$.data('skin') == 'tron') {

	  var a = this.angle(this.cv)  // Angle
		  , sa = this.startAngle          // Previous start angle
		  , sat = this.startAngle         // Start angle
		  , ea                            // Previous end angle
		  , eat = sat + a                 // End angle
		  , r = true;

	  this.g.lineWidth = this.lineWidth;

	  this.o.cursor
	  && (sat = eat - 0.3)
	  && (eat = eat + 0.3);

	  if (this.o.displayPrevious) {
		ea = this.startAngle + this.angle(this.value);
		this.o.cursor
		&& (sa = ea - 0.3)
		&& (ea = ea + 0.3);
		this.g.beginPath();
		this.g.strokeStyle = this.previousColor;
		this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sa, ea, false);
		this.g.stroke();
	  }

	  this.g.beginPath();
	  this.g.strokeStyle = r ? this.o.fgColor : this.fgColor;
	  this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sat, eat, false);
	  this.g.stroke();

	  this.g.lineWidth = 2;
	  this.g.beginPath();
	  this.g.strokeStyle = this.o.fgColor;
	  this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
	  this.g.stroke();

	  return false;
	}
  }
});
/* END JQUERY KNOB */
});
		$(document).ready(function() {
			$.fn.dataTable.ext.classes.sPageButton = 'btn btn-primary btn-border btn-round btn-sm'; // Change Pagination Button Class
			$('table.display').DataTable({
				"order": [],//[ 0, "desc" ]
				"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
				dom: 'Bfrtip',
				buttons: [
					{ extend: 'excel', className: 'btn btn-success btn-border btn-round btn-sm',
						exportOptions: {
										columns: ':not(:last-child)',
										}
										},
					{ extend: 'pdf', className: 'btn btn-danger btn-border btn-round btn-sm',
						exportOptions: {
										columns: ':not(:last-child)',
										}
										},
					{ extend: 'pageLength', className: 'btn btn-default btn-border btn-sm' },
				],
			});

			$('#multi-filter-select').DataTable( {
				"pageLength": 5,
				initComplete: function () {
					this.api().columns().every( function () {
						var column = this;
						var select = $('<select class="form-control"><option value=""></option></select>')
						.appendTo( $(column.footer()).empty() )
						.on( 'change', function () {
							var val = $.fn.dataTable.util.escapeRegex(
								$(this).val()
								);

							column
							.search( val ? '^'+val+'$' : '', true, false )
							.draw();
						} );

						column.data().unique().sort().each( function ( d, j ) {
							select.append( '<option value="'+d+'">'+d+'</option>' )
						} );
					} );
				}
			});

			// Add Row
			$('#add-row').DataTable({
				"pageLength": 5,
			});

			var action = '<td> <div class="form-button-action"> <button type="button" data-toggle="tooltip" title="" class="btn btn-link btn-primary btn-lg" data-original-title="Edit Task"> <i class="fa fa-edit"></i> </button> <button type="button" data-toggle="tooltip" title="" class="btn btn-link btn-danger" data-original-title="Remove"> <i class="fa fa-times"></i> </button> </div> </td>';

			$('#addRowButton').click(function() {
				$('#add-row').dataTable().fnAddData([
					$("#addName").val(),
					$("#addPosition").val(),
					$("#addOffice").val(),
					action
					]);
				$('#addRowModal').modal('hide');

			});
		});
	</script>
	<script>
		Circles.create({
			id:'circles-1',
			radius:45,
			value:60,
			maxValue:100,
			width:7,
			text: 5,
			colors:['#f1f1f1', '#FF9E27'],
			duration:400,
			wrpClass:'circles-wrp',
			textClass:'circles-text',
			styleWrapper:true,
			styleText:true
		})

		Circles.create({
			id:'circles-2',
			radius:45,
			value:70,
			maxValue:100,
			width:7,
			text: 36,
			colors:['#f1f1f1', '#2BB930'],
			duration:400,
			wrpClass:'circles-wrp',
			textClass:'circles-text',
			styleWrapper:true,
			styleText:true
		})

		Circles.create({
			id:'circles-3',
			radius:45,
			value:40,
			maxValue:100,
			width:7,
			text: 12,
			colors:['#f1f1f1', '#F25961'],
			duration:400,
			wrpClass:'circles-wrp',
			textClass:'circles-text',
			styleWrapper:true,
			styleText:true
		})

		var totalIncomeChart = document.getElementById('totalIncomeChart').getContext('2d');

		var mytotalIncomeChart = new Chart(totalIncomeChart, {
			type: 'bar',
			data: {
				labels: ["S", "M", "T", "W", "T", "F", "S", "S", "M", "T"],
				datasets : [{
					label: "Total Income",
					backgroundColor: '#ff9e27',
					borderColor: 'rgb(23, 125, 255)',
					data: [6, 4, 9, 5, 4, 6, 4, 3, 8, 10],
				}],
			},
			options: {
				responsive: true,
				maintainAspectRatio: false,
				legend: {
					display: false,
				},
				scales: {
					yAxes: [{
						ticks: {
							display: false //this will remove only the label
						},
						gridLines : {
							drawBorder: false,
							display : false
						}
					}],
					xAxes : [ {
						gridLines : {
							drawBorder: false,
							display : false
						}
					}]
				},
			}
		});

		$('#lineChart').sparkline([105,103,123,100,95,105,115], {
			type: 'line',
			height: '70',
			width: '100%',
			lineWidth: '2',
			lineColor: '#ffa534',
			fillColor: 'rgba(255, 165, 52, .14)'
		});
	</script>
</body>
</html>