<?php
session_start();
 include("checking_word.php");
$page_title = "حساب اختتامیه";	
include("db.php");		
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
 
<title><?php echo $page_title;?></title>
<script>
   
function myconfirm()
{
    if(confirm('آیا  مطمین هستید حسابات فعلی را بسته کنید؟'))
        return true;
    return false;
}
      
	  function showUserPass(){
		  
		  $("#attention").hide();
		  $("#userpassword").show().fadeIn(100);
		  
	  }
	  
	function checkPassword(){
		var password = $("#password").val();
		var username = $("#username").val();
		
		

    		$.post("closing_check_password.php",{
			  password:password,username:username
		  },
		  function (output){
			   if(output=="ok"){
				   $("#showOptions").show().fadeIn(100);
				    $("#userpassword").hide();
				   $("#error").html("");
			   }
			   else{
				   $("#error").html(output);
				   $("#showOptions").hide();
			   }
		  }
		  
		  
		  );
	}
  function showLoader(){
	  $("#loader").show();
	  $("#userpassword").hide();
  }	
  
	 </script>
<!--=========================================================-->
     <script src="js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>
	 <script src="js/validation.js"></script>
     <script src="dist/sweetalert-dev.js"></script>
     <link rel="stylesheet" href="dist/sweetalert.css">
     <link rel="stylesheet" href="css/screen.css" type="text/css"   />
<!--=========================================================-->
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="../../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/global/plugins/bootstrap/css/bootstrap-rtl.min.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/global/plugins/bootstrap-switch/css/bootstrap-switch-rtl.min.css" rel="stylesheet" type="text/css"/>
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
<link href="../../assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
<!-- END PAGE LEVEL PLUGIN STYLES -->
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
<link rel="stylesheet" type="text/css" href="../../assets/global/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="../../assets/global/plugins/datatables/extensions/Scroller/css/dataTables.scroller.min.css"/>
<link rel="stylesheet" type="text/css" href="../../assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css"/>
<link rel="stylesheet" type="text/css" href="../../assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap-rtl.css"/>
<link href="../../assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
<!-- END PAGE LEVEL PLUGIN STYLES -->
<!-- BEGIN PAGE LEVEL STYLES -->
<link rel="stylesheet" type="text/css" href="../../assets/global/plugins/select2/select2.css"/>
<!-- END PAGE LEVEL SCRIPTS -->
<!-- BEGIN THEME STYLES -->
<link href="../../assets/global/css/components-md-rtl.css" id="style_components" rel="stylesheet" type="text/css"/>
<link href="../../assets/global/css/plugins-md-rtl.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/admin/layout/css/layout-rtl.css" rel="stylesheet" type="text/css"/>
<link id="style_color" href="../../assets/admin/layout/css/themes/darkblue-rtl.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/admin/layout/css/custom-rtl.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-md page-header-fixed page-quick-sidebar-over-content">

<?php require_once('header.php');?>

<div class="clearfix">
</div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<?php
	$menu_selected="money";
	require_once('sidebar.php');?>
	
	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN PAGE CONTENT-->
			<!--BEGIN PAGE HEADER-->
			<div class="page-bar">
				<ul class="page-breadcrumb">
					<li>
						<i class="fa fa-home"></i>
						<a href="index.php">صفحه اصلی</a>
						<i class="fa fa-angle-left"></i>
					</li>
					<li>
						<a href="add_language.php">حساب اختتامیه</a>
					</li>
				</ul>
			</div>
			<!-- END PAGE HEADER-->
			<div class="row">
				<div class="col-md-12">
					<div class="portlet box blue" id="form_wizard_1">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-user"></i>حساب اختتامیه<span class="step-title"></span>
							</div>
							<div class="tools hidden-xs">
								<a href="javascript:;" class="collapse">
								</a>
							</div>
						</div>
						<div class="portlet-body form">
							<form action="" class="form-horizontal"  name="form" id="submit_form" method="POST">
								<div class="form-wizard">
									<div class="form-body">
										<div class="tab-content">
										
							<div class="form-wizard"  id="attention" style="width:50%;margin:auto;margin-right:70px;border:1px solid #89c4f4;">
								
								 <h1 class="text-info" style ="border-bottom:1px solid #89c4f4;width:520px;margin-right:10px"  >لطفا قبل از بستن حساب به نکات زیر توجه کنید</h1>
								 
								
									 <div class='text-info' style="margin-right:30px;margin-top:20px;" >
									 
										 <h3>1. دتابیس فعلی شما به دیتابیس جدید تغییر خواهد کرد</h3>
										 <h3>2.شما  می توانید به دوره های قبلی برگردید</h3>
										 <h3><span>4.لیست تمام مشتریان به دتابیس جدید ثبت خواهد شد<span></h3>
										 <h3><span>5.دارایی نقدی و حسابات مشتری به دوره بعدی انتقال پیدا خواهد کرد<span></h3>
										 
									 </div>
									
									
									 <a class='btn btn-info' style="margin-right:300px"  onclick="showUserPass();" > &nbsp;&nbsp;&nbsp;ادامه<i class="fa fa-arrow-left" ></i>&nbsp;&nbsp;&nbsp;</a>
									
									 <br>
									 <br>
								</div>
								<!------------------------------->
                                <div id="loader" style="display:none;"><img src="img/loader.gif" width="100" height="100"><span style="font-size:30px">درحال انتقال...</span></div>								
                                 									
											 
								       <div class="tab-pane active" id="userpassword" style="display:none;" >
													<h3 class="block">لطفا نام کاربری و پسورد  تان را وارید کنید </h3>
													<div class="form-group">
														<label class="control-label col-md-2">نام کاربری<span class="required">
														</span>
														</label>
														<div class="col-md-4">
															<input type="text" placeholder="" class="filed" id="username" name="username"/>
															<span class="help-block">
															</span>
														</div>
													</div>
												   
												   <div class="form-group">
														<label class="control-label col-md-2">پسورد<span class="required">
														</span>
														</label>
														<div class="col-md-4">
															<input type="password" placeholder="" class="filed" id="password" name="password"/>
															<span class="help-block">
															</span>
														</div>
													</div>
													 
												<div class="button_wrapper">
											<div class="row">
												<div class="col-md-offset-3 col-md-4">
												<a class="btn btn-info" onclick="checkPassword()">جستجو</a>
												</div>
											</div>
										</div>
										</div>
									</div>
										
								</div>
							</form>
							<span id ='error' style="color:red"></span>
                        </div>
					</div>
					
					<div class="portlet-body form" style="display:none" id="showOptions" >
						
							<form action="closedAccounts.php" class="form-horizontal"  name="form" id="submit_form" method="POST">
								<div class="form-wizard">
									<div class="form-body">
										<div class="tab-content">
											 
											 <div class="tab-pane active" id="tab1">
												<h3 class="block">انتخاب سال مالی جدید</h3>
												<div class="form-group">
													<label class="control-label col-md-2">انتخاب سال مالی<span class="required">
													</span>
													</label>
													<div class="col-md-4">
													 <?php
																
													          $sql1 = "select * from exchangecurrency1396.database_name order by id desc limit 1 ";
															   $selectLastYear = $db->query($sql1);
																$row = $selectLastYear->fetch_array();
																$a = $row['year'];
																if($a==""){
																	$a="1396";
																}
													 ?>
                                                       <select name="year"  required id='year'  style="width:300px;height:30px">
												            <option>یک سال مالی انتخاب کنید</option>
																<?php
																
																	for($i=$a+1;$i<1410;$i++){
																		echo "<option value=$i>$i</option>";
																	}
																?>
														       </select>
														<span class="help-block">
														</span>
													</div>
												</div>
										</div>
									</div>
									<div class="button_wrapper">
										<div class="row">
											<div class="col-md-offset-3 col-md-4">
												 <button  onclick="showLoader()"  class="btn btn-info" > انتقال</button>
												 <a class="btn btn-info" href="generalReport.php" > بازگشت</a>

											</div>
										</div>
									</div>	
								</div>
							</form>
							<br>
							<br>
							<br>
                            <!-- BEGIN PAGE CONTENT-->
					</div>
					
				</div>
			</div>
			<!-- END PAGE CONTENT-->
		</div>
	</div>
<!-- BEGIN FOOTER -->
<?php
	require_once('footer.php');

?>
<!-- END FOOTER -->
</div>

<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="../../assets/global/plugins/respond.min.js"></script>
<script src="../../assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
<script src="../../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script src="../../assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script type="text/javascript" src="../../assets/global/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="../../assets/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../../assets/global/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.min.js"></script>
<script type="text/javascript" src="../../assets/global/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js"></script>
<script type="text/javascript" src="../../assets/global/plugins/datatables/extensions/Scroller/js/dataTables.scroller.min.js"></script>
<script type="text/javascript" src="../../assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script type="text/javascript" src="../../assets/global/plugins/jquery-validation/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="../../assets/global/plugins/jquery-validation/js/additional-methods.min.js"></script>
<script type="text/javascript" src="../../assets/global/plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script type="text/javascript" src="../../assets/global/plugins/select2/select2.min.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="../../assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="../../assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
<script src="../../assets/admin/layout/scripts/demo.js" type="text/javascript"></script>
<script src="../../assets/admin/pages/scripts/table-advanced.js"></script>
<script src="../../assets/admin/pages/scripts/form-wizard.js"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
jQuery(document).ready(function() { 
    
    $('#totalUSD').hide(); $('#currency').hide();
    var b = $('#balance');
    b.blur(function(){
       if(b.val() != "0"){
            $('#totalUSD').show(); $('#currency').show();
       } 
    });
    
   // initiate layout and plugins
   Metronic.init(); // init metronic core components
   Layout.init(); // init current layout
   Demo.init(); // init demo features
   TableAdvanced.init();
   FormWizard.init(); 
});
</script>

<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>
<?php
/* }
else{
	header("Location: login.php");
} */
?>