<?php
include ('include/header.php');
?>
        <!-- BEGIN PAGE LEVEL PLUGINS -->
        <link href="assets/global/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css" rel="stylesheet" type="text/css" />
        <link href="assets/global/plugins/bootstrap-summernote/summernote.css" rel="stylesheet" type="text/css" />
        <!-- END PAGE LEVEL PLUGINS -->


</head>
<body class="page-header-fixed page-sidebar-closed-hide-logo">


<?php
include ('include/sidebar.php');
?>

 

		
            <!-- BEGIN CONTENT -->
            <div class="page-content-wrapper">
                <!-- BEGIN CONTENT BODY -->
                <div class="page-content">
                    <!-- BEGIN PAGE HEADER-->
                   
                    <!-- BEGIN PAGE TITLE-->
                    <h3 class="page-title"> View Client Transaction
                        <small></small>
                    </h3>
                    <!-- END PAGE TITLE-->

					<hr>

					
					
					
					
					
			<div class="row">
			<div class="col-md-12">
                            <!-- BEGIN SAMPLE FORM PORTLET-->
                            <div class="portlet light bordered">
                                
                                <div class="portlet-body form">
                                    <form class="form-horizontal" action="" method="post" role="form">
                                        <div class="form-body">

		   
<?php

if($_POST)
{


$ref1 = mysql_real_escape_string($_POST["ref"]);


//$err1=0;
//$err2=0;

$exist = mysql_fetch_array(mysql_query("SELECT ref FROM transaction WHERE ref='".$ref1."'"));

//if($exist[0]!=1)
//      {
//$err1=1;
//}

///if($amount<=0){
    ///$err2=1;
///}



//$error = $err1;


if ($exist[0] == $ref1){


$refff = mysql_fetch_array(mysql_query("SELECT accountnumber, date, amount, prebalance, postbalance, status, description, sig, time FROM transaction WHERE ref='".$ref1."'"));

if($refff[7]=="-"){
$type = "<b style=\"color: red;\"> Debit Transaction</b>";
}

if($refff[7]=="+"){
$type = "<b style=\"color: green;\"> Credit Transaction</b>";
}


echo "<div class=\"alert alert-success alert-dismissable\">
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>	

AccountNumber : $refff[0]
<br>
FirstName : $firstname
<br>
LastName : $lastname
<br>
TransactionType : $type
<br>
Description : $refff[6]
<br>
Status : $refff[5]
<br>
Amount : $refff[2]
<br>
Prebalance : $refff[3]
<br>
Postbalance : $refff[4]
<br>
Time : $refff[8]
<br>
Date : $refff[1]
<br>


 
</div>";


} else {
	

echo "<div class=\"alert alert-danger alert-dismissable\">
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>    

 TRANSACTION ID NOT FOUND !!!

</div>";
}       
    

}
?>										
										
                    <div class="form-group">
                    <label class="col-md-3 control-label"><strong>Transaction Ref</strong></label>
                    <div class="col-md-6">
                     <input class="form-control input-lg" name="ref" placeholder="" type="text">
                    </div>
                    </div>

					 
                                            <div class="row">
                                                <div class="col-md-offset-3 col-md-6">
                                                    <button type="submit" class="btn blue btn-block">Submit</button>
                                                </div>
                                            </div>
											
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>		
                        </div><!---ROW-->		
					
					
					
					
					
					
			
					
					
					
					
					
					
                </div>
                <!-- END CONTENT BODY -->
            </div>
            <!-- END CONTENT -->
            
			


<?php
 include ('include/footer.php');
 ?>

        <!-- BEGIN PAGE LEVEL PLUGINS -->
        <script src="assets/global/plugins/bootstrap-wysihtml5/wysihtml5-0.3.0.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-markdown/lib/markdown.js" type="text/javascript"></script>
        <script src="./assets/global/plugins/bootstrap-markdown/js/bootstrap-markdown.js" type="text/javascript"></script>
        <script src="assets/global/plugins/bootstrap-summernote/summernote.min.js" type="text/javascript"></script>
        <!-- END PAGE LEVEL PLUGINS -->
        <script>
        
    
        
        </script>
        
        <!-- BEGIN PAGE LEVEL SCRIPTS -->
        <script src="assets/pages/scripts/components-editors.min.js" type="text/javascript"></script>
        <!-- END PAGE LEVEL SCRIPTS -->

</body>
</html>