Skip to content
This repository has been archived by the owner on Jan 2, 2022. It is now read-only.

Commit

Permalink
finish
Browse files Browse the repository at this point in the history
  • Loading branch information
adyatma-project committed Dec 18, 2021
1 parent 67617ea commit 00eb3aa
Show file tree
Hide file tree
Showing 119 changed files with 419 additions and 219 deletions.
14 changes: 11 additions & 3 deletions app/Controllers/Beranda.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@

class Beranda extends BaseController
{
public function __construct()
{

function __construct(){
$this->beranda_model = new beranda_model();
}

public function index()
{
return view('Beranda/index');
$model = new beranda_model();


$data["title"] = "Grafik Siswa Lulus Per Tahun";
$data["chartSiswa"] = $model->siswaPertahun();
echo view('Beranda/index', $data);

}
}


4 changes: 3 additions & 1 deletion app/Controllers/OrderTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ public function tampilmenurut()
{
$bulan = $_POST['bulan'];
$tahun = $_POST['tahun'];
return view("ordertransaction/tampilmenurut", $bulan, $tahun);
$data['bln']= $bulan;
$data['thn']= $tahun;
return view("ordertransaction/tampilmenurut", $data);
}


Expand Down
16 changes: 6 additions & 10 deletions app/Models/beranda_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ class beranda_model extends Model
{
protected $table = 'master_order';

// hitung total data pada transaction

function Jum_mahasiswa_perjurusan()
public function siswaPertahun()
{
$db = \Config\Database::connect();
$builder = $db->table('master_order');
// $builder->like('nama_outlet', 'ADYATMA');
// $builder->where('order_55 >', 0);
$builder->where('konfirmasi =', 'YA');
$builder->selectSum('order_12');
return $builder->get()->getResult();
$query = "SELECT tahun AS TAHUN, COUNT(*) AS order_12 FROM master_order
GROUP BY tahun";
$result = $this->db->query($query)->getresult();
return $result;
}

}
232 changes: 188 additions & 44 deletions app/Views/Beranda/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,172 @@
<?= $this->include('templates/sidebar'); ?>
<?= $this->include('templates/topbar'); ?>

<div class="container-fluid">




<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Beranda</h1>
<div class="d-sm-flex align-items-center justify-content-between mb-4" style="margin: 5px;">
<h1 class="h3 mb-0 text-gray-800"> Beranda</h1>
</div>

<div class="row">
<div class="row" style="margin: 5px;">

<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
Menunggu Konfirmasi (5,5 Kg)</div>
<div class="h5 mb-0 font-weight-bold text-black-800">
<?php
$db = \Config\Database::connect();
$builder = $db->table('master_order');
// $builder->like('nama_outlet', 'ADYATMA');
// $builder->where('order_55 >', 0);
$builder->where('konfirmasi =', 'TIDAK');
$builder->selectSum('order_55');
$query = $builder->get();

foreach ($query->getResult() as $row) {
$a55 = $row->order_55;
$b55 = $a55 - 0;
echo $b55;
}
?> Tabung</div>
<a href="<?php echo base_url('ordertransaction/five'); ?>" class="btn btn-info btn-sm mt-3">
<i class="fas fa-eye"></i>
Tampilkan Order </a>
</div>

<div class="col-auto">

<i class="fas fa-cart-arrow-down fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>

<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Menunggu Konfirmasi (12 Kg)</div>
<div class="h5 mb-0 font-weight-bold text-black-800">
<?php
$db = \Config\Database::connect();
$builder = $db->table('master_order');
// $builder->like('nama_outlet', 'ADYATMA');
// $builder->where('order_55 >', 0);
$builder->selectSum('order_12');
$builder->where('konfirmasi =', 'TIDAK');
$query = $builder->get();
foreach ($query->getResult() as $row) {
$a12 = $row->order_12;
$b12 = $a12 - 0;
echo $b12;
}
?> Tabung
</div>
<a href="<?php echo base_url('ordertransaction/twelve'); ?>" class="btn btn-info btn-sm mt-3"> <i class="fas fa-eye"></i> Tampilkan Order</a>
</div>

<div class="col-auto">
<i class="fas fa-cart-arrow-down fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>



</div>


<div class="row" style="margin: 5px;">

<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
Order Belum Diantar (5,5 Kg)</div>
<div class="h5 mb-0 font-weight-bold text-black-800">
<?php
$db = \Config\Database::connect();
$builder = $db->table('master_order');
// $builder->like('nama_outlet', 'ADYATMA');
// $builder->where('order_55 >', 0);
$builder->selectSum('order_55');
$builder->where('konfirmasi =', 'PROSES');
$query = $builder->get();
foreach ($query->getResult() as $row) {
$a12 = $row->order_55;
$b12 = $a12 - 0;
echo $b12;
}
?> Tabung
</div>
<a href="<?php echo base_url('ordertransaction/fivedrive'); ?>" class="btn btn-info btn-sm mt-3"> <i class="fas fa-eye"></i> Tampilkan Order</a>
</div>

<div class="col-auto">
<i class="fas fa-truck fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Order Belum Diantar (12 Kg)</div>
<div class="h5 mb-0 font-weight-bold text-black-800">
<?php
$db = \Config\Database::connect();
$builder = $db->table('master_order');
// $builder->like('nama_outlet', 'ADYATMA');
// $builder->where('order_55 >', 0);
$builder->selectSum('order_12');
$builder->where('konfirmasi =', 'PROSES');
$query = $builder->get();
foreach ($query->getResult() as $row) {
$a12 = $row->order_12;
$b12 = $a12 - 0;
echo $b12;
}
?> Tabung
</div>
<a href="<?php echo base_url('ordertransaction/twelvedrive'); ?>" class="btn btn-info btn-sm mt-3"> <i class="fas fa-eye"></i> Tampilkan Order</a>
</div>

<div class="col-auto">
<i class="fas fa-truck fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="row" style="margin: 5px;">

<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-lg font-weight-bold text-primary text-uppercase mb-1">Jumlah Transaksi
<div class="text-lg font-weight-bold text-primary text-uppercase mb-1">Total Transaksi
5,5
Kg</div>
<div class="h2 mb-0 font-weight-bold text-gray-800">
Expand Down Expand Up @@ -46,7 +197,7 @@
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-lg font-weight-bold text-success text-uppercase mb-1">Jumlah Transaksi
<div class="text-lg font-weight-bold text-success text-uppercase mb-1">Total Transaksi
12 Kg
</div>
<div class="h2 mb-0 font-weight-bold text-gray-800">
Expand All @@ -70,63 +221,56 @@
</div>
</div>
</div>
<!-- <div class="row">

</div>

<div class="col-lg-6">

<div class="row" style="margin: 5px;">
<div class="col-lg-12" >

<div class="card mb-4">

<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">chart transaction</h6>
<h6 class="m-0 font-weight-bold text-primary">Grafik Transaksi Bright Gas 5,5 Kg Tahun <?php $thn = date('Y'); echo $thn; ?></h6>
</div>
<div class="card-body">
<div class="chart-bar">
<canvas id="chart5"></canvas>
</div>

<canvas id="chart5" ></canvas>



</div>
</div>
</div>
</div>
</div>
</div>



<div class="col-lg-12">


<div class="card mb-4">

<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Bar Chart</h6>
</div>
<div class="card-body">
<div class="chart-bar">
<canvas id="myBarChart"></canvas>
</div>


</div>
</div>
</div>


<div class="col-lg-12">

<div class="card mb-4">

<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Grafik Transaksi Bright Gas 12 Kg Tahun <?php $thn = date('Y'); echo $thn; ?></h6>
</div>
</div> -->
<div class="card-body">


<canvas id="chart12"></canvas>
</div>
</div>
</div>
<?php
$db = \Config\Database::connect();
$builder = $db->table('master_order');

for ($i = 1; $i < 13; $i++) {
$builder->where('bulan =', $i);
// $builder->where('id_outlet =', 53);
$builder->where('tahun =', 2019);
$builder->selectSum('order_55');
$query = $builder->get();
foreach ($query->getResultArray() as $row) {
$data = $row['order_55'];
// echo $data . ',';
}
}
?>
</div>



<?= $this->include('templates/footer'); ?>
Loading

0 comments on commit 00eb3aa

Please sign in to comment.