Your IP : 3.138.174.45
<?php
session_start(); ob_start();
?>
<!doctype html>
<html lang="en" dir="ltr">
<head>
<!-- META DATA -->
<meta charset="UTF-8">
<meta name='viewport' content='width=device-width, initial-scale=1.0, user-scalable=0'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Fination Global Services">
<meta name="author" content="Fination Global Services">
<meta name="keywords" content="">
<!-- FAVICON -->
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/brand/favicon.ico" />
<!-- TITLE -->
<title>Dashboard</title>
<!-- BOOTSTRAP CSS -->
<link id="style" href="../assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<!-- STYLE CSS -->
<link href="../assets/css/style.css" rel="stylesheet" />
<link href="../assets/css/plugins.css" rel="stylesheet" />
<!--- FONT-ICONS CSS -->
<link href="../assets/css/icons.css" rel="stylesheet" />
</head>
<body class="app sidebar-mini ltr light-mode">
<!-- GLOBAL-LOADER
<div id="global-loader">
<img src="../assets/images/loader.svg" class="loader-img" alt="Loader">
</div>-->
<!-- /GLOBAL-LOADER -->
<!-- PAGE -->
<div class="page">
<div class="page-main">
<!-- app-Header -->
<?php include('header.php');
$pro->adminAccess();
?>
<!--/APP-SIDEBAR-->
<!--app-content open-->
<div class="main-content app-content mt-0">
<div class="side-app">
<!-- CONTAINER -->
<div class="main-container container-fluid">
<!-- PAGE-HEADER -->
<div class="page-header">
<div>
<h1 class="page-title">Manage Incentives</h1>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Manage Incentives</li>
</ol>
</div>
<div class="ms-auto pageheader-btn">
<a class="btn btn-primary mb-2 createnew" href="javascript:;">Create New Incentive</a>
</div>
</div>
<!-- PAGE-HEADER END -->
<!-- ROW -->
<div class="row">
<div style="float: left;"><h3 class="">Available Incentives</h3></div>
<?php
$i=1;
$sql = $db->query("SELECT * FROM incent ");
while($row = $sql->fetch_assoc()) { $e = $i++;
?>
<div class="col-lg-3">
<div class="card p-2">
<img src="<?=$row['photo']?>"><br>
<h5><?php echo $row['title'] ?> </h5>
<p><?php echo $row['note']; ?></p>
<p>Required Points: <?php echo number_format($row['amount'],2) ?></p>
<p>
<a class="btn btn-success openfunding" href="javascript:;" data-amount="<?= $row['amount'] ?>" data-title="<?= $row['title'] ?>" data-note="<?= $row['note'] ?>" data-ref="<?= $row['sn'] ?>" style="width: 100%;">Update</a></p>
</div>
</div>
<?php } ?>
<div class="card">
<div class="card-body">
<div class="card-title">
<h5 class="mb-0">Incentive Requests</h5>
</div>
<div class="table-responsive mt-3">
<table id="example" class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th>S/N </th>
<th>User</th>
<th>Item</th>
<th>Description</th>
<th>Item Points</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
$sql = $db->query("SELECT * FROM incentreq ");
while($row = $sql->fetch_assoc()) { $e = $i++;
?>
<tr>
<td><?php echo $e; ?></td>
<td><?php echo userName($row['id']) ?> [<?php echo userName($row['id'],'user') ?>] </td>
<td><?php echo $row['title'] ?> </td>
<td><?php echo $row['note']; ?></td>
<td><?php echo number_format($row['amount'],2) ?></td>
<td><?=$pro->incentStatus($row['status'])?></td>
<td><form method="post">
<?php if($row['status']==1){ ?>
<button type="submit" class="btn btn-danger" value="<?=$row['sn']?>" name="ApproveIncentive">Approve</button></td>
<?php } ?>
</form>
</td></tr>
<?php } ?>
</tbody>
</table>
</div>
</div><!--end row-->
</div>
<!-- ROW-5 END -->
</div>
<!-- CONTAINER END -->
</div>
</div>
<!--app-content end-->
</div>
<!-- FOOTER -->
<?php include('footer.php'); ?>
<!-- FOOTER END -->
<form method="post" enctype="multipart/form-data">
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Update Incentive</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p><label>Title</label>
<input type="text" name="title" id="title" class="form-control" placeholder="Enter Title"></p>
<p><label>Description</label>
<input type="text" name="note" id="note" class="form-control" placeholder="Enter Description"></p>
<p><label>Number of Points</label>
<input type="number" name="amount" id="amount" class="form-control" placeholder="Enter Points"></p>
<input type="hidden" name="sn" id="sn">
</div>
<div class="modal-footer">
<button type="submit" name="UpdateIncentive" class="btn btn-primary">Update Incentive</button>
</div>
<div class="modal-footer">
<input type="file" name="photo" class="form-control">
<button type="submit" name="UpdateIncentive2" class="btn btn-primary">Upload Incentive Image</button>
</div>
</div>
</div>
</div>
</form>
<form method="post" >
<div class="modal fade" id="exampleModal2" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Create New Incentive</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p><label>Title</label>
<input type="text" name="title" class="form-control" placeholder="Enter Title"></p>
<p><label>Description</label>
<input type="text" name="note" class="form-control" placeholder="Enter Description"></p>
<p><label>Number of Points</label>
<input type="number" name="amount" class="form-control" placeholder="Enter Points"></p>
</div>
<div class="modal-footer">
<button type="submit" name="CreateIncentive" class="btn btn-primary">Create Incentive</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- BACK-TO-TOP -->
<a href="#top" id="back-to-top"><i class="fa fa-angle-up"></i></a>
<!-- JQUERY JS -->
<script src="../assets/js/jquery.min.js"></script>
<!-- BOOTSTRAP JS -->
<script src="../assets/plugins/bootstrap/js/popper.min.js"></script>
<script src="../assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!-- SPARKLINE JS-->
<script src="../assets/js/jquery.sparkline.min.js"></script>
<!-- CHART-CIRCLE JS-->
<script src="../assets/js/circle-progress.min.js"></script>
<!-- CHARTJS CHART JS-->
<script src="../assets/plugins/chart/Chart.bundle.js"></script>
<script src="../assets/plugins/chart/utils.js"></script>
<!-- PIETY CHART JS-->
<script src="../assets/plugins/peitychart/jquery.peity.min.js"></script>
<script src="../assets/plugins/peitychart/peitychart.init.js"></script>
<!-- INTERNAL SELECT2 JS -->
<script src="../assets/plugins/select2/select2.full.min.js"></script>
<!-- INTERNAL Data tables js-->
<script src="../assets/plugins/datatable/js/jquery.dataTables.min.js"></script>
<script src="../assets/plugins/datatable/js/dataTables.bootstrap5.js"></script>
<script src="../assets/plugins/datatable/dataTables.responsive.min.js"></script>
<!-- ECHART JS-->
<script src="../assets/plugins/echarts/echarts.js"></script>
<!-- SIDE-MENU JS-->
<script src="../assets/plugins/sidemenu/sidemenu.js"></script>
<!-- Sticky js -->
<script src="../assets/js/sticky.js"></script>
<!-- SIDEBAR JS -->
<script src="../assets/plugins/sidebar/sidebar.js"></script>
<!-- Perfect SCROLLBAR JS-->
<script src="../assets/plugins/p-scroll/perfect-scrollbar.js"></script>
<script src="../assets/plugins/p-scroll/pscroll.js"></script>
<script src="../assets/plugins/p-scroll/pscroll-1.js"></script>
<!-- APEXCHART JS -->
<script src="../assets/js/apexcharts.js"></script>
<!-- INDEX JS -->
<script src="../assets/js/index1.js"></script>
<!-- Color Theme js -->
<script src="../assets/js/themeColors.js"></script>
<!-- swither styles js -->
<script src="../assets/js/swither-styles.js"></script>
<!-- CUSTOM JS -->
<script src="../assets/js/custom.js"></script>
<script type="text/javascript">
$(function() {
$('.openfunding').on('click', function() {
amount = $(this).data('amount');
note = $(this).data('note');
title = $(this).data('title');
ref = $(this).data('ref');
modal = $('#exampleModal');
modal.modal('show');
$(modal).find('input[name="amount"]').val(amount)
$(modal).find('input[name="title"]').val(title)
$(modal).find('input[name="note"]').val(note)
$(modal).find('input[name="sn"]').val(ref)
// $('#amount').html(amount);
// $('#title').html(title);
// $('#note').html(note);
// $('#sn').html(ref);
// alert(ref)
})
})
$('.createnew').on('click', function() {
modal = $('#exampleModal2');
modal.modal('show');
})
function com(v){
return (v).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
}
</script>
</body>
</html>