<?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"> Update Transaction Status
                        <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">
                                   
                                        <div class="form-body">

		   
<?php


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

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

if(isset($_POST['statuss'])){

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

$res = mysql_query("UPDATE transaction SET status='".$status1."' WHERE ref='".$ref1."'");

if($res){	
	
$msg =  "<div class=\"alert alert-success alert-dismissable\">
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>	

Transaction Status Has Been Successfully Updated To $status1

</div>";

}
}else{
	$msg =  "<div class=\"alert alert-danger alert-dismissable\">
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>	

 TRANSACTION REF NOT FOUND !!!

</div>";
}
	
}


?>										
										
							 <?php echo $msg ?>	
							 
							 
				 <form class="form-horizontal" action="" method="post" role="form">						
					<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" required="required">
                   


                    </div>
                    </div>					
										
                                        
                    <div class="form-group">
                    <label class="col-md-3 control-label"><strong>Status</strong></label>
                    <div class="col-md-6">
                     <textarea name="status" rows="8" cols="30" required="required"></textarea>
                    </div>
                    </div>

                     <div class="row">
                        <div class="col-md-offset-3 col-md-6">
                            
                            <button type="submit" name="statuss" class="btn blue">Update Status</button>
                        </div>
                    </div>
                </form>
                    
                    <br>
                    <hr>
					
					<br>
			
                                </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>