<?PHP

session_start();

include 'connect.php';

if(isset($_SESSION['adminemail']))

{

$user=$_SESSION['adminemail'];



$gtp=mysql_query("select * from admin where username='$user'");

$gtp1=mysql_fetch_array($gtp);



include 'top.php';

?>







			<div class="main-content">

				<div class="main-content-inner">

					<div class="breadcrumbs ace-save-state" id="breadcrumbs">

						<ul class="breadcrumb">

							<li>

								<i class="ace-icon fa fa-home home-icon"></i>

								<a href="#">Home</a>

							</li>

							<li class="active">Expense</li>

						</ul><!-- /.breadcrumb -->

					</div>



					<div class="page-content">

			



						<div class="page-header">

							<h1>

								Expense			

							</h1>

						</div><!-- /.page-header -->



						<div class="row">

							<div class="col-xs-12">

                            

								<!-- PAGE CONTENT BEGINS -->









<?php



if(isset($_GET['id']))

{

$id=$_GET['id'];

	

$sel=mysql_query("select * from expense where ID='$id'");

$sel1=mysql_fetch_array($sel);



$fac=mysql_query("select * from factory where ID='$sel1[factory]'");

$fac1=mysql_fetch_array($fac);



echo"<br /><table style='margin:auto;'>



<tr><td><b>Expense No</b></td><td style='padding:0 11px 0 11px;'>:</td><td>".$id."</td><td style='width:350px;'></td><td><b>Date</b></td><td style='padding:0 11px 0 11px;'>:</td><td>".date('d-m-Y',strtotime($sel1['date']))."</td></tr>



<tr><td><b>Name</b></td><td style='padding:0 11px 0 11px;'>:</td><td>".$sel1['name']."</td><td style='width:350px;'></td><td><b>Factory</b></td><td style='padding:0 11px 0 11px;'>:</td><td>".$fac1['factory']."</td></tr>



</table><br /><br />";





echo"<table class='table table-striped table-bordered table-condensed' style='width:65%; margin:auto;'>

<thead><tr><th>Description</th><th>Amount</th></tr></thead>



<tr><td>".$sel1['description']."</td><td style='text-align:right;'>".$sel1['amount']."</td></tr>



</table><br />





<table style='margin:auto;'>





<tr><td><b>Payment Mode</b></td><td style='padding:0 7px;'>:</td><td>".$sel1['paymentmode']."</td></tr>";





if($sel1['type']=='Bank')

{



$sl=mysql_query("select * from bank where ID='$sel1[account]'");

$sl1=mysql_fetch_array($sl);



echo"<tr><td>Bank</td><td>:</td><td>".$sl1['bank']."</td></tr>

<tr><td>Account Name</td><td>:</td><td>".$sl1['accountname']."</td></tr>";



if($sel1['chequeno']!='')

{



echo"<tr><td>Cheque No.</td><td>:</td><td>".$sel1['chequeno']."</td></tr>";



}



if($sel1['chequedate']!='0000-00-00')

{



echo"<tr><td>Cheque Date</td><td>:</td><td>".date('d-m-Y',strtotime($sel1['chequedate']))."</td></tr>";



}



}



echo"</table>";



?>





<!-- <script type="text/javascript">

// Popup window code

function newPopup(url) {

	popupWindow = window.open(

		url,'popUpWindow','height=700,width=1000,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,onscreendisplay=yes,menubar=no,location=no,directories=no,status=yes')

}

</script>



<br /><br /><center><a href="JavaScript:newPopup('printpayment.php?id=');"><img src="img/print.gif" style="margin-top:-3px;" /></a></center> -->



<?php



echo"<br /><br /><center><a href='viewexpense.php'>Back</a></center>";



}

	

?>









										<!-- PAGE CONTENT ENDS -->

									</div><!-- /.col -->

								</div><!-- /.row -->

							</div><!-- /.page-content -->

						</div>

					</div><!-- /.main-content -->





<?php

include 'bottom.php';

}

else

{



 header("location:login.php");

}

?>