+ Add taux de partage

This commit is contained in:
Djery-Tom 2020-06-22 12:39:55 +01:00
parent df12737861
commit 898621f3bf
8 changed files with 652 additions and 4 deletions

View File

@ -313,6 +313,8 @@ class Hyperviseur_dash extends CI_Controller
if ($this->input->get('history')) {
$this->historique($id_network, $this->input->get('d'), $this->input->get('f'), $this->input->get('history'));
} elseif ($this->input->get('config')) {
$this->config_wallet($this->input->get('config'), $this->input->get('country'));
}else {
$data["commission"] = "";
@ -966,6 +968,84 @@ class Hyperviseur_dash extends CI_Controller
shuffle($temp_array);
return implode('', $temp_array);
}
private function config_wallet($config , $country)
{
// $data['configWallet'] = $this->user_model->getConfigWallet($network_id);
$data['active'] = "wallet";
$data['alert'] = "";
$data['firstname'] = $this->session->userdata('firstname');
$data['lastname'] = $this->session->userdata('lastname');
$data['email'] = $this->session->userdata('email');
$data['network'] = $this->session->userdata('network');
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
if (isset($country)) {
$data['country_id'] = $country;
$data['country'] = $this->user_model->getCountry($country)->first_row();
$res = $this->user_model->getActiveNetworks($country);
$data['networks'] = [];
if($res){
$result = $res->result();
foreach ($result as $network){
$res = $this->user_model->getSharingRate($network->id , $data['idConfig']);
if($res){
$network->rate = $res->first_row()->taux_partage;
}else{
$network->rate = null;
}
$data['networks'][] = $network;
}
}
$this->load->view('header_hyp', $data);
$this->load->view('gestion_wallet_ilink_config_paying_network');
$this->load->view('footer');
return;
}
$res = $this->user_model->getActiveCountries();
$data['countries'] = [];
if($res){
$result = $res->result();
foreach ($result as $country){
$res = $this->user_model->countPayingNetworks($country->id, $data['idConfig']);
if($res){
$country->total = $res->first_row()->total;
}else{
$country->total = null;
}
$data['countries'][] = $country;
}
}
$this->load->view('header_hyp', $data);
// if ($type == 'transaction')
// $this->load->view('historique_transactions');
// else
$this->load->view('gestion_wallet_ilink_config_paying_networks');
$this->load->view('footer');
}
public function config_sharing_rate(){
if ($this->isLogged()) {
if (isset($_POST)) {
$network_id = $_POST['network_id'];
$config_id = $_POST['config_id'];
$rate = $_POST['rate'];
$res = $this->user_model->setSharingRate($network_id,$config_id,$rate);
if ($res) {
echo json_encode("200");
} else {
echo json_encode("500");
}
}
}
}
}
class Operation

View File

@ -388,4 +388,12 @@ $lang['ilink_second_rule'] = 'The sum of the commission distributions on the wit
$lang['ilink_third_rule'] = 'The sum of the distribution of commission on cash deposit to card operation must be equal to 100%';
$lang['ilink_fourth_rule'] = 'The sum of the distribution of commission on withdrawal operation in the card must be equal to 100%';
$lang['ilink_fifth_rule'] = 'The sum of the distribution of commission on withdrawal operation in the card for iLink user must be equal to 100%';
$lang['edit_paying_networks'] = 'Configuration of paying networks';
$lang['configure'] = 'Configure';
$lang['configure_share_rate'] = 'Configure the sharing rate';
$lang['share_rate'] = 'Sharing rate';
$lang ['sharing_updated'] = 'Sharing rate updated';
$lang ['not_defined'] = 'Not defined';
$lang ['no_network'] = 'No network';
$lang ['activated_countries'] = 'Countries activated';
?>

View File

@ -400,4 +400,12 @@ $lang['ilink_second_rule'] = 'La somme des répartitions de commission sur opér
$lang['ilink_third_rule'] = 'La somme des répartitions de commission sur opération de depot cash vers carte doit etre égale à 100 %';
$lang['ilink_fourth_rule'] = 'La somme des répartitions de commission sur opération de retrait dans la carte doit etre égale à 100 %';
$lang['ilink_fifth_rule'] = 'La somme des répartitions de commission sur opération de retrait dans la carte pour utilisateur iLink doit etre égale à 100 %';
$lang['edit_paying_networks'] = 'Configuration des réseaux payeurs';
$lang['configure'] = 'Configurer';
$lang['configure_share_rate'] = 'Configurer le taux de partage';
$lang['share_rate'] = 'Taux de partage';
$lang['sharing_updated'] = 'Taux de partage mis à jour';
$lang['not_defined'] ='Non défini';
$lang['no_network'] = 'Aucun réseau';
$lang['activated_countries'] = 'Pays activés';
?>

View File

@ -1440,6 +1440,15 @@ class User_model extends CI_Model
}
}
public function getActiveNetworks($country_id){
$query = $this->db->query("SELECT id,name FROM networks WHERE country_id ='".$country_id."' AND status = 1");
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
public function get_current_page_records($limit, $start,$pays,$hyper,$ville)
{
$query = $this->db->query("SELECT child.adresse AS adresse,child.category AS childcat,child.lastname AS lastname,
@ -2364,6 +2373,28 @@ class User_model extends CI_Model
}
}
public function getActiveCountries(){
$sql= "SELECT id , name FROM countries WHERE id IN (
SELECT distinct n.country_id FROM networks n WHERE n.status = 1
);";
$query = $this->db->query($sql);
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
public function getCountry($id){
$sql= "SELECT name FROM countries WHERE id = $id";
$query = $this->db->query($sql);
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
public function cancelCreditRequest($id_demand){
$sql = "SELECT * FROM `info_demandeCredits` WHERE `demande_id` = ?;";
$query = $this->db->query($sql , array($id_demand));
@ -2410,4 +2441,39 @@ class User_model extends CI_Model
return false;
}
}
public function setSharingRate($network_id,$config_id,$rate){
$sql = "SELECT * FROM `paying_networks` WHERE `id_network` = ? AND id_configWallet = ? ;";
$query = $this->db->query($sql , array($network_id,$config_id));
if($query->num_rows()>0){
$sql = "UPDATE `paying_networks` SET `taux_partage` = ? WHERE `id_network` = ? AND id_configWallet = ? ;";
$this->db->query($sql , array($rate,$network_id,$config_id));
}else{
$sql = "INSERT INTO `paying_networks` (`id_network`, `taux_partage`, `id_configWallet`) VALUES ( ?, ? ,?); ;";
$this->db->query($sql , array($network_id,$rate,$config_id));
}
return true;
}
public function getSharingRate($id_network ,$idConfig){
$sql = "SELECT taux_partage FROM `paying_networks` WHERE `id_network` = ? AND id_configWallet = ? ;";
$query = $this->db->query($sql , array($id_network,$idConfig));
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
public function countPayingNetworks($id_country ,$idConfig){
$sql = "SELECT count(id) as total FROM `paying_networks` WHERE `id_network` IN (SELECT distinct n.id FROM countries c INNER JOIN
networks n ON n.country_id = c.id WHERE n.status = 1 AND c.id = ?
) AND id_configWallet = ? ;";
$query = $this->db->query($sql , array($id_country, $idConfig));
if($query->num_rows()>0){
return $query;
}else{
return false;
}
}
}

View File

@ -0,0 +1,217 @@
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('edit_paying_networks') . ' - ' . $country->name; ?>
</h1>
<?php
$site_url = base_url();
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Réseaux activés'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<?php
$sql2 = $networks;
if ($sql2 != false) {
$numrows = sizeof($sql2);
$num = 0;
if ($numrows > 0) {
?>
<table id="validated" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Nom'); ?></th>
<th align='center'> <?php echo $this->lang->line('share_rate')?></th>
<th align='center'> Action</th>
</tr>
</thead>
<tbody>
<?php
foreach ($sql2 as $row) {
$num++;
//$member_code = randomString1(10);
echo "<tr>
<td align='center'>$num</td>
<td >$row->name</td>";
?>
<?php
if ($row->rate != null ) {
?>
<td>
<span class="label label-success" style="font-size: 1.1em;"><?= $row->rate . ' %'?></span>
</td>
<?php
} else {
?>
<td>
<span class="label label-danger" style="font-size: 1em;" ><?php echo $this->lang->line('not_defined'); ?></span>
</td>
<?php
}
?>
<td>
<button type="button" data-network-id="<?php echo $row->id ?>" data-config-id="<?=$idConfig?>"
data-toggle="modal" data-target="#configureRate"
class="btn btn-primary btn-block openModal">
<b><?php echo $this->lang->line('configure_share_rate'); ?></b>
</button>
</td>
<?php
}
?>
</tbody>
</table>
<?php
} else {
echo $this->lang->line('Aucun réseau');
}
} else {
echo $this->lang->line('Aucun réseau');
}
?>
</div>
</div>
</div>
</div>
<div class="modal fade" id="configureRate" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('configure_share_rate'); ?></h3>
</div>
<div class="modal-body">
<form id="rateForm">
<div class="form-group">
<label for="rate"
class="col-form-label"><?php echo $this->lang->line('share_rate') . ' (%)'; ?></label>
<input type="number" min="0" step=".01" max="100" required class="form-control"
name="rate" id="rate" value="0">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-primary"
id="enableRate"> <?php echo $this->lang->line('Valider'); ?></button>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
$(function () {
$('#validated').DataTable();
})
</script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
var network_id = null;
var config_id = null;
$(document).on("click", ".openModal", function () {
network_id = $(this).data('network-id');
config_id = $(this).data('config-id');
})
$(document).on("click", "#enableRate", function () {
// const network_id = $(this).data('network-id');
if ($('#rateForm')[0].checkValidity()) {
const rate = parseFloat($('#rate').val());
$.ajax({
url: '<?php echo base_url('index.php/Hyperviseur_dash/config_sharing_rate')?>',
type: 'POST',
dataType: 'json',
data: {"network_id": network_id, "rate": rate , "config_id" : config_id},
success: function (data) {
if (data == '200') {
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('sharing_updated')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
} else {
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
}
});
} else {
$('#rateForm')[0].reportValidity();
};
});
</script>

View File

@ -0,0 +1,264 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('edit_paying_networks'); ?>
</h1>
<?php
$site_url = base_url();
if($alert=="ok") {
if(!$success=="ok"){
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('activated_countries'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<?php
$sql2 = $countries;
if($sql2!=false){
$numrows= sizeof($sql2);
$num = 0;
if ($numrows > 0) {
?>
<table id="validated" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'></th>
<th><?php echo $this->lang->line('Nom'); ?></th>
<th align='center'> Status </th>
<th align='center'> Action </th>
</tr>
</thead>
<tbody>
<?php
foreach($sql2 as $row) {
$num ++;
//$member_code = randomString1(10);
echo "<tr>
<td align='center'>$num</td>
<td >$row->name</td>";
?>
<?php
if($row->total > 0){
?>
<td><span class="label label-success" style="font-size: 1em;"><?= $row->total.' réseaux' ?></span></td>
<?php
}else{
?>
<td><span class="label label-danger" style="font-size: 1em;" ><?php echo $this->lang->line('no_network'); ?></span></td>
<?php
}
?>
<td>
<a href="<?php echo current_url().('?config=paying_networks&country='.$row->id)?>" class="btn btn-primary btn-block" >
<b><?php echo $this->lang->line('Voir plus...'); ?></b>
</a>
</td>
<?php
}
?>
</tbody>
</table>
<?php
}
else {
echo $this->lang->line('Aucun réseau');
}
}else {
echo $this->lang->line('Aucun réseau');
}
?>
</div>
</div>
</div>
</div>
<div class="modal fade" id="disableWallet" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('Suppression du wallet'); ?></h3>
</div>
<div class="modal-body">
<h4> Etes vous certain de vouloir ?</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<button type="button" class="btn btn-primary" id="deleteWallet" > <?php echo $this->lang->line('Valider'); ?></button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="enableWallet" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('choose_wallet_type'); ?></h3>
</div>
<div class="modal-body">
<div class="login-box">
<div class="login-box-body">
<button type="button" class="btn btn-primary enableWallet" style="width: 100% ; margin-bottom: 15px" value="visa" data-dismiss="modal">VISA</button>
<button type="button" class="btn btn-primary enableWallet" value="ilink" style="width: 100%" data-dismiss="modal">ILINK WORLD</button>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
</div>
</div>
</div>
</div>
<!-- <div class="alert alert-info alert-dismissible" aria-hidden="true">-->
<!-- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>-->
<!-- <h4><i class="icon fa fa-info"></i>Info!</h4>-->
<!-- Data is Saved-->
<!-- </div>-->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
$(function() {
$('#validated').DataTable();
})
</script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
var network_id = null;
$(document).on("click", ".openModal", function () {
network_id = $(this).data('network-id');
})
$(document).on("click", ".enableWallet", function () {
// const network_id = $(this).data('network-id');
const type = $(this).val();
$.ajax({
url : '<?php echo base_url('index.php/Gestion/config_wallet/create')?>',
type : 'POST',
dataType : 'json',
data: {"network_id": network_id , "type" : type},
success : function(data){
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('wallet_created')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
},
error : function(resultat, statut, error){
console.log(resultat+" "+error );
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
}).done(function () {
$.ajax({
url : '<?php echo base_url('index.php/Gestion/generateAllWallets')?>',
type : 'POST',
dataType : 'json',
data : {"network_id": network_id},
async : true ,
timeout : 0,
success : function () {
console.log("All wallets are generated");
}
});
});
});
$('#deleteWallet').click(function(){
$.ajax({
url : '<?php echo base_url('index.php/Gestion/delete_config_wallet')?>',
type : 'POST',
dataType : 'json',
data: {"network_id": network_id },
success : function(data, statut){
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('wallet_deleted')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
},
error : function(resultat, statut, erreur){
console.log(resultat+" "+erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
});
});
</script>

View File

@ -295,18 +295,24 @@
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="col-lg-4">
<div class="margin">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update"
style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
</div>
</div>
<div class="col-lg-6">
<div class="col-lg-4">
<div class="margin">
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#modal-tax"
style="width: 100%"><?php echo $this->lang->line('edit_tax') ?></button>
</div>
</div>
<div class="col-lg-4">
<div class="margin">
<a href="<?php echo current_url().($network_id ? '?config=paying_networks' : '')?>" class="btn btn-success"
style="width: 100%"><?php echo $this->lang->line('edit_paying_networks') ?></a>
</div>
</div>
</div>
<div class="row centered">
<div class="col-lg-2 col-xs-6">

View File

@ -7,7 +7,6 @@
<h1>
<?php echo $this->lang->line('Gestion des wallets'); ?>
<input type="button" class="btn btn-primary pull-right" id="Bactiver" value="Activer/Désactiver le(s) réseau(x)" style="display: none;" />
</h1>
<?php
$site_url = base_url();