<?php
session_start();
include("jdf.php");
 
 include("db.php");
 $customerID=$_GET['customerId'];
 
 if(isset($customerID)){
	 $customar_id=$customerID ;
	 
 }
 else{
	 $customar_id=$_SESSION['customar_code'];
 }
 
  //=======================================
  $customerSpecificationSql="select * from customers where id='$customar_id'";
  $customerSpecificationQuery= $db ->query($customerSpecificationSql);
  $customerSpecificationRow=$customerSpecificationQuery ->fetch_array();
  $customerName=$customerSpecificationRow['name'];
  $_SESSION['customerName']=$customerName;
  $_SESSION['customerName']=$customerName;
  $customerPhone=$customerSpecificationRow['phone'];
  $customerAddress=$customerSpecificationRow['address'];
  //=======================================
  //================customer account===============
   $totalCustomerAccountSql="select sum(dollarAmount) from customerbalance where customerId='$customar_id'";
   $totalCustomerAccountQuery= $db ->query($totalCustomerAccountSql);
   $totalCustomerAccountRow=$totalCustomerAccountQuery ->fetch_array();
   $totalCustomerAccount=$totalCustomerAccountRow['sum(dollarAmount)'];
  //================customer account===============
   
$page_title = "حسابات مشتری";
 

if (isset($_SESSION['username']) && isset($_SESSION['password'])) {

  
?>

<!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 -->
<style>
 
#information{
  border: 0px solid blue;
  
  float: right;
   
  }
  
  table.testgrid  {
  border-collapse: collapse;  
  border: 1px solid #CCB;
  
}
table.testgrid>tbody tr:hover {
	background-color:#C5D5D5;
	color: green;
}
table.testgrid th {
     
	min-width: 100px; 
	border: 1px solid #D5D5D5;    
	color: #000;                 
	text-align: center;           
	padding-left: 20px;            
	padding: 3px;
	padding-right: 0px;               
	
}
 .testgrid td{
   min-width: 150px; 
 }
</style>
<head>
  
<meta charset="utf-8"/>
<title><?php echo $page_title;?></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="" name="description"/>
<meta content="" name="author"/>
<!-- 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" style="border: 0px solid red;margin-top: -100px;background: #3598dc;">
	<!-- BEGIN SIDEBAR -->
	<?php
	$menu_selected="customers";
	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="customerAccount.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="stemite.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">
													 
													 
												</div>
												<div class="form-group">
													 
													<div class="col-md-4" style="border: 0px solid red;width: 98%;margin-right: 1%;margin-left: 1%">
													  
													    
													   <div id="information">
													            <div style="width: 800px;height: 180px">
													            <table border='1' style="min-width: 250px" dir="rtl" align="right" cellpadding="0" cellspacing="0" class="testgrid">
																<tr>
																	<th colspan="2" style="background: silver;padding:6px">مشخصات کلی مشتری</th>
																<tr>
																	<th>کد مشتری</th>
																	<th > <?php echo $customar_id;  ?> </th>
																</tr>
																
																<tr>
																	<th>نام مشتری</th>
																	<th> <?php echo $customerName;  ?> </th>
																</tr>
																<tr>
																	<th>شماره تلفن</th>
																	<th> <?php echo $customerPhone;  ?> </th>
																</tr>
																 <tr>
																	<th>آدرس</th>
																	<th><?php echo $customerAddress;  ?> </th>
																</tr>
																<!--<tr>
																 
																	<th style="background: #000;color: #FFF">حساب کنونی به دلار</th>
																	<th style="background: #000;color: #FFF"> <?php echo number_format($totalCustomerAccount,2);  ?> </th>
																</tr>--> 										
																
															</table>
															</div>
				                          </div> <!-- End of Information DIV-->
													   
													   
													   
													  <div id="details" >
													   <div style="width: 900px">
															  <table border="0" style="margin: auto;background:#CCCCCC;">
															  <tr>
																  <td colspan="12" style="padding: 8px; background: #666666;text-align: center;color: #fff">
																   
																   جـزئیــات معـامـلات مشتــری
																  </td>  
															  <tr>
																  <td>&nbsp;&nbsp;</td>														  
																  <td> <a href="report/customerReciveReport.php?customerID=<?php  echo $customerID?>" target="_link"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="راپور بردگیها"  /></a></td>
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
															      <td> <a href="report/customerPaymentReport.php?customerID=<?php  echo $customerID?>" target="_link"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="راپور رسیدگیها"  /></a></td>
															      <td>&nbsp;&nbsp;</td>
																 <td> <a href="customerPayment.php?customerID=<?php  echo $customerID?>" target=""><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="معاملات پـولی"  /></a></td>
																 <td>&nbsp;&nbsp;</td>
                                                               </tr>
															   <tr>
																  <td>&nbsp;&nbsp;</td>														  
																  <td> <a href="customerBuySell.php?customerID=<?php  echo $customerID?>" target="_blank"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="خرید و فروش مشتری"  /></a></td>
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
															      <td> <a href="report/customerSealsCreport.php?customerID=<?php  echo $customerID?>" target="_link"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="راپور خریدو فروش مشتری"  /></a></td>
															      <td>&nbsp;&nbsp;</td>
																 <td> <a href="report/customerSealsgeneralreport.php?customerID=<?php  echo $customerID?>"  target="_link"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="جزئیات خرید و فروش مشتری"  /></a></td>
																 <td>&nbsp;&nbsp;</td>
                                                               </tr> 
															   <tr>
																  <td>&nbsp;&nbsp;</td>														  
																  <td> <a href="report/customerAcountDetails.php?customerID=<?php  echo $customerID?>" target="_blank"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="جزئیات حساب مشتـریــان"  /></a></td>
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
															       <td> <a href="report/customerAcountDetailscustomer.php?customerID=<?php  echo $customerID?>" target="_blank"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="راپور حساب مشتریان"  /></a></td>
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
																  <td> <a href="openingBalance.php?customerID=<?php  echo $customerID?>" target="_blank"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value=" ثبت بلانس افتتاحیه"  /></a></td>
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
															       
                                                               </tr>
															   
															    <tr>
																  <td>&nbsp;&nbsp;</td>														  
																  <td> <a href="customer_select_currencyh.php?customerID=<?php  echo $customerID?>" target="_blank"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="صورت حساب مشتری"  /></a></td>
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
																  <td> <a href="customer_hesabi.php?customerID=<?php  echo $customerID?>" target="_blank"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="راپور حسابی با مشتری"  /></a></td>
																  
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
																  <td> <a href="date_CustomerAccounting.php?customerID=<?php  echo $customerID?>" target="_blank"><input name="button" type="button"  style=" padding:6px;width:180px;margin-top: 8px"  value="صورت حساب تاریخ وار مشتری"  /></a></td>
																  
																  <td style="background: #CCCCCC">&nbsp;&nbsp;</td>
															       
                                                               </tr>
															   
																  <tr>
																	 <td colspan="11" style="padding: 18px;background: #CCCCCC;"></td>
																	 <td>&nbsp;&nbsp;</td>
																 </tr>
															  </tr>
															  
															  </table>
													  </div>
													  
													  
													  
													  </div>
													</div>
												</div>
											 
												 
												 
												 
												  
												 
											</div>
										</div>
									</div>
									<div class="button_wrapper">
										<div class="row">
											 
										</div>
									</div>	
								</div>
							</form>
							<!-- BEGIN PAGE CONTENT-->
							<div class="row">
								<div class="col-md-12">
									<!-- BEGIN EXAMPLE TABLE PORTLET-->
									<div class="table-wrapper">
										<hr class="horizontal-line" />
										<div class="portlet-body">
											 
									</div>
								</div>
							</div>
						</div>
					</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/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 -->
<!-- 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() { 
   // 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");
}
?>