Your IP : 18.191.200.151


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

<?php
session_start();
include("lib/connect.inc.php");
$uid = $covis->Uid();
$email = userName($uid,'email');

$stage = $covis->stageCalc($uidx);
$lev = $covis->stageLevel($uidx);


function paywideDetails($email,$opt=1){     
$post = [
    'email' => $email
];
$ch = curl_init('https://paywideng.com/api/getpaywidedata');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

$result = curl_exec($ch);
curl_close($ch);  
return $result;
}



function paywideProcess($userid,$amount,$covuser,$covpass,$channel){     
$post = [
    'amount' => $amount,
    'covuser' => $covuser,
    'covpass' => $covpass,
    'channel' => $channel,
];
$ch = curl_init('https://paywideng.com/api/covisfund/'.$userid);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

$result = curl_exec($ch);
curl_close($ch);  
return $result;
}

if(array_key_exists('ProcessTransfer',$_POST)) {
extract($_POST);
$covuser = userName($uid,'user');
$res = paywideProcess($userid,$amount,$covuser,$covpass,$channel);
$m = json_decode($res);
if($m->status=='True'){
    $tno = $covis->win_hash(10);
    $charge = 0;//$_SESSION['pbal']-$s
    $db->query("INSERT INTO paywide (tno,id,amount,charge,channel) VALUES ('$tno','$uid','$amount','$charge','$channel')");
    $report = 'Transaction Successful';
}else{$report = $m->message; $count=1;}
}







?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="treant/examples/tree/basic-example2.css">
    <!-- Neptune CSS -->
    <link rel="stylesheet" href="css/core.css">
    <title>Paywide Transfer</title>
    <link rel="shortcut icon" href="img/fav.png" />
    <link rel="stylesheet" href="treant/Treant.css">
    <link rel="stylesheet" href="treant/examples/tree/basic-example2.css">
    <!-- Neptune CSS -->
    <link rel="stylesheet" href="css/core.css">

    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Vendor CSS -->
    <link rel="stylesheet" href="../vendor/bootstrap4/css/bootstrap.min.css">
    <link rel="stylesheet" href="../vendor/themify-icons/themify-icons.css">
    <link rel="stylesheet" href="../vendor/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../vendor/animate.css/animate.min.css">
    <link rel="stylesheet" href="../vendor/jscrollpane/jquery.jscrollpane.css">
    <link rel="stylesheet" href="../vendor/waves/waves.min.css">
    <link rel="stylesheet" href="../vendor/switchery/dist/switchery.min.css">
    <link rel="stylesheet" href="../vendor/morris/morris.css">
    <link rel="stylesheet" href="../vendor/jvectormap/jquery-jvectormap-2.0.3.css">
    <!-- Font Awesome -->
    <!-- datatables-->
  <link rel="stylesheet" href="../plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="../plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
    <?php include('head.php'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

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

    
    <!-- Content Header (Page header) -->
    

            <!-- 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>CCI/PAYWIDE TRANSFERS</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">Transfers</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
                <div id="refresh"><?php if(isset($report)){$covis->Alert(); } ?></div>

                <div class="content">
                    <div class="container-fluid">
                        <div class="row">
                        <div class="col-md-4">
                            <div class="card ">
                           <div class="card-header text-white bg-dark">
                                    <h5>Transfer Funds</h5>
                                    </div>
                                 
                                    <div class="card-body">
                                        <p>You can transfer funds from your CCI account to your paywide account and vice versa</p>
                                        <?php $r= paywideDetails($email);
                                        $x = json_decode($r);
                                       // echo $res??'';
                                        if($x->status=='True'){
                                            $_SESSION['pbal'] = $pbal = $x->message[0]->walletamount;
                                         ?>
                                        
                                  
                                    <?php $max = $covis->totalEarnings($uidx,$stage,$lev); ?>
                                    <p>CCI Balance: $<?php echo $max; ?></p>
                                    <p>Paywide Balance: NGN<?php echo number_format($pbal) ?></p>
                                    <form class="form-group" method="post">
                                        Amount (NGN)
                                        <input type="number" min="1" max="1000000" class="form-control" name="amount" placeholder="Amount in Naira" required/> <br/>
                                        Transfer Option
                                        <select class="form-control" name="channel" required>
                                            <option value="">Select Option...</option>
                                            <!--<option value="Covis">CCI to Paywide</option>-->
                                            <option value="Onepay">Paywide to CCI</option>
                                        </select>
                                        <input type="hidden" name="userid" value="<?= $x->message[0]->userid ?>">
                                        <br/>
                                        <input type="password" class="form-control" name="covpass" placeholder="Enter Password" required/>
                                        <br/>

                                        <button class="btn btn-success btn-block float-md-right" name="ProcessTransfer">Process Transfer</button>
                                        <br/>
                                    </form>
                                <?php }else{ ?>
Cannot verify your accout with Paywide. Create a new account with Paywide using your CCI account E-mail: <?= $email ?>

                                <?php } ?>
                             
                                </div>

                            </div>
                           
                        </div>
                        <div class="col-md-8">
                            <div class="col-md-12">
                               <div class="card ">
                               <div class="card-header text-white bg-dark">
                                    <h5>Transfer History: CCI to Paywide Account</h5>
                                </div>
                                    <br/>
                                    <div class="card-body">
                                        <table class="table table-bordered table-hover dataTable" id="example1">
                                        <tr>
                                            <th>S/N</th>
                                            <th>Transaction ID</th>
                                            <th>Amount($)</th>
                                            <th>Status</th>
                                            <th>Date</th>
                                        </tr>
                                        <?php $sql = $db->query("SELECT * FROM paywide WHERE id='$uid' AND channel='Covis' ORDER BY created DESC"); $i = 0; $sum = 0;
                                        while($row = $sql->fetch_assoc()){ $i +=1; $sum += $row['amount'];
                                            ?>
                                            <tr>
                                                <th><?php echo $i  ?></th>
                                                <th><?php echo $row['tno']  ?></th>
                                                <th>NGN<?php echo number_format($row['amount'])  ?></th>
                                               
                                                <th>Successful</th>
                                                <th><?php echo date("jS M, Y H:i",strtotime($row['created']))  ?></th>
                                            </tr>
                                        <?php } ?>
                                        <tr>
                                            <th colspan="2">TOTAL</th>
                                          <th colspan="3">NGN<?php echo number_format($sum) ?></th>
                                        </tr>
                                    </table>
                                </div>
                            </div> 
                            </div>
                            

                            <div class="col-md-12">
                                <div class="card">
                                    <div class="card-header text-white bg-dark">
                                    <h5>Transfer History: Paywide to CCI</h5>
                                    </div>
                                    <br/>
                                    <div class="card-body">
                                    <table class="table table-bordered table-hover dataTable" id="example2">
                                         <tr>
                                            <th>S/N</th>
                                            <th>Transaction ID</th>
                                            <th>Amount($)</th>
                                            <th>Status</th>
                                            <th>Date</th>
                                        </tr>
                                        <?php $sql = $db->query("SELECT * FROM paywide WHERE id='$uid' AND channel='Onepay' ORDER BY created DESC"); $i = 0; $sum = 0;
                                        while($row = $sql->fetch_assoc()){ $i +=1; $sum += $row['amount'];
                                            ?>
                                            <tr>
                                                <th><?php echo $i  ?></th>
                                                <th><?php echo $row['tno']  ?></th>
                                                <th>NGN<?php echo number_format($row['amount'])  ?></th>
                                               
                                                <th>Successful</th>
                                                <th><?php echo date("jS M, Y H:i",strtotime($row['created']))  ?></th>
                                            </tr>
                                        <?php } ?>
                                        <tr>
                                            <th colspan="2">TOTAL</th>
                                          <th colspan="3">NGN<?php echo number_format($sum) ?></th>
                                        </tr>
                                    </table>
                                    </div>
                                    </div>
                            </div>
                        </div>

                        </div>
                    </div>

            <!-- /.card-body -->

            <!-- /.card -->

            <!-- right col -->
        </div>
        <!-- /.row (main row) -->
    </div><!-- /.container-fluid -->

    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include('foot.php'); ?>

<!-- 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>


<!-- page script -->
       <script type="text/javascript">
            $(function(){
                $("#username").keyup(function(){
                var v = $(this).val();
            
            $.ajax({
                type: 'get',
                url : 'js/username.php?val='+v
            }).done(function(data){
                
                if(data == 0){
                    $("#output").html('');
                }
                else if(data == 1){
                    $("#output").html('Username Does Not Exist');
                }
                else {
                    $("#output").html(data);
                }
            })
        })
            })
    </script>
</body>
</html>

?>