Your IP : 18.226.28.97


Current Path : /home/lentoinv/covisclubinternational.com/profile/
Upload File :
Current File : /home/lentoinv/covisclubinternational.com/profile/mydonations.php

<?php
session_start();
include("lib/connect.inc.php");


function getDonation($ref,$opt='title'){
    global $db;

    $sql = $db->query("SELECT * FROM donation WHERE tno='$ref' ");
    $row = $sql->fetch_assoc();
    return $row[$opt];
}


?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Donations</title>
    <link rel="shortcut icon" href="img/fav.png" />
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Font Awesome -->
    <?php include('head.php'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

    <?php include('nav.php'); ?>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>Donations</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="index.php">Home</a></li>
                            <li class="breadcrumb-item active">Donations</li>
                        </ol>
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>
        <!-- Content Header (Page header) -->
        <div class="content">
            <div class="container-fluid">

                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header text-white bg-dark">
                                <h5>Free Will Donations</h5>
                            </div>
                            <div class="card-body">
                            <?php if(isset($_GET['donation'])){ $ref = $_GET['donation'];
                            $sql = $db->query("SELECT * FROM donation WHERE tno='$ref' "); $i = 0;
                            $row = $sql->fetch_assoc(); $i +=1;  $status = ($row['status']==0)?'Pending':'Approved';
                            $link = '<img src="news/'.$row['link'].'" width="100%">' ;
                            ?>
                            <div class="row">

                                <div class="col-md-7">
                                    <div class="box bg-white ">
                                        <div class="box-block">
                                            <h5 align="">PROJECT: <?php echo strtoupper($row['title']) ?> </h5>
                                            <i><?php echo $row['note'] ?></i>
                                            <br/><br/>
                                            <?php echo $link ?><br><br>

                                            <h5>Donate From Wallet</h5> <hr>





                                            <form method="post">
                                                <h6> Enter the amount you want to willingly donate</h6>
                                                <table width="100%"><tr><td>
                                                            <input type="number" class="form-control " name="amount" placeholder="Amount in USD" min="1" max="2000" ></td><td>
                                                            <button class="btn btn-success" name="PayDonation" style="width: 100%">Donate</button></td></tr></table>
                                            </form>
                                        </div>
                                    </div>


                                </div>


                                <div class="col-md-5">
                                    <div class="box bg-white ">
                                        <div class="box-block">
                                            <h5 align="">My Donation History</h5>

                                            <table class="table  table-hover">
                                                <tr>
                                                    <th>Date</th>
                                                    <th>Amount</th>
                                                    <th>Project</th>


                                                </tr>
                                                <?php $sq = $db->query("SELECT * FROM donate WHERE id='$uid' ORDER BY sn DESC "); $i = 1; $sum=0;
                                                while($ro = $sq->fetch_assoc()){ $e=$i++ ; $sum += $ro['amount']; ?>
                                                    <tr>
                                                        <td><?php echo substr($ro['created'], 0,10)  ?></th>
                                                        <td>$<?php echo number_format($ro['amount'],2) ?></th>
                                                        <td><?php echo getDonation($ro['dsn']) ?></th>
                                                    </tr>
                                                <?php } ?>
                                                <tr><th >TOTAL</th><th colspan="2">$<?php echo number_format($sum,2) ?></th></tr>



                                            </table>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        <?php  } ?>


                    </div>

                </div>
            </div>

        </div></div>

</div>
</div>



        <!-- /.content-wrapper -->
        <?php include('foot.php'); ?>
            </div>      <!-- Control Sidebar -->
        <aside class="control-sidebar control-sidebar-dark">
            <!-- Control sidebar content goes here -->
        </aside>
        <!-- /.control-sidebar -->
    </div>
    <!-- ./wrapper -->

    <!-- jQuery -->
    <script src="../plugins/jquery/jquery.min.js"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="../plugins/jquery-ui/jquery-ui.min.js"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
        $.widget.bridge('uibutton', $.ui.button)
    </script>
    <!-- Bootstrap 4 -->
    <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- ChartJS -->
    <script src="../plugins/chart.js/Chart.min.js"></script>
    <!-- Sparkline -->
    <script src="../plugins/sparklines/sparkline.js"></script>
    <!-- JQVMap -->
    <script src="../plugins/jqvmap/jquery.vmap.min.js"></script>
    <script src="../plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
    <!-- jQuery Knob Chart -->
    <script src="../plugins/jquery-knob/jquery.knob.min.js"></script>
    <!-- daterangepicker -->
    <script src="../plugins/moment/moment.min.js"></script>
    <script src="../plugins/daterangepicker/daterangepicker.js"></script>
    <!-- Tempusdominus Bootstrap 4 -->
    <script src="../plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
    <!-- Summernote -->
    <script src="../plugins/summernote/summernote-bs4.min.js"></script>
    <!-- overlayScrollbars -->
    <script src="../plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
    <!-- AdminLTE App -->
    <script src="../dist/js/adminlte.js"></script>
    <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
    <script src="../dist/js/pages/dashboard.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="../dist/js/demo.js"></script>
    <!-- DataTables -->
    <script src="../plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="../plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
    <script src="../plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
    <script src="../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>


    <!-- page script -->
    <script>
        $(function () {
            $("#example1").DataTable({
                "responsive": true,
                "autoWidth": false,
            });
            $('#example2').DataTable({
                "paging": true,
                "lengthChange": false,
                "searching": false,
                "ordering": true,
                "info": true,
                "autoWidth": false,
                "responsive": true,
            });
        });
    </script>
</body>
</html>

?>