latest
This commit is contained in:
@@ -9,6 +9,14 @@ use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\User;
|
||||
use PDF;
|
||||
use App\Models\Cawangan;
|
||||
use App\Models\Simulasi;
|
||||
use App\Models\SimulasiBid;
|
||||
use App\Models\SimulasiBidMarhun;
|
||||
use App\Models\SimKarat;
|
||||
use App\Models\SimKarat_temp;
|
||||
use App\Models\CawanganSimulasi;
|
||||
use App\Models\JenisEmas;
|
||||
use App\Models\JenisKarat;
|
||||
|
||||
class SimulasiController extends Controller
|
||||
{
|
||||
@@ -33,5 +41,220 @@ class SimulasiController extends Controller
|
||||
return view('simulasi.janasimulasi',compact('caw'));
|
||||
}
|
||||
|
||||
public function janadata(Request $request)
|
||||
{
|
||||
|
||||
$cawangan = Cawangan::all();
|
||||
|
||||
//create simulasi
|
||||
$simulasi = new Simulasi;
|
||||
$simulasi->tarikh_lelong = $request->tarikh_lelong;
|
||||
$simulasi->harga_emas_asas = $request->hargaasas;
|
||||
$simulasi->jbg = $request->jbg;
|
||||
$simulasi->cajlelong = $request->cajlelong;
|
||||
$simulasi->save();
|
||||
|
||||
//create harga asas berdasarkan input harga asas
|
||||
$karat = JenisKarat::all();
|
||||
$hargaasas = $request->hargaasas; //rial
|
||||
foreach($karat as $item)
|
||||
{
|
||||
$simkarat = new SimKarat;
|
||||
$simkarat->simulasi_id = $simulasi->id;
|
||||
$simkarat->karat = $item->karat;
|
||||
$simkarat->keterangan = $item->keterangan;
|
||||
$simkarat->harga = ($hargaasas + ($item->dariharga916))/2.72; //gram
|
||||
$simkarat->harga2 = $hargaasas + ($item->dariharga916); //rial
|
||||
$simkarat->save();
|
||||
}
|
||||
|
||||
|
||||
// join cawangan yang terlibat dengan simulasi
|
||||
if($request->caw && $request->caw == 'all')
|
||||
{
|
||||
foreach($cawangan as $key=>$caw)
|
||||
{
|
||||
|
||||
$caw_simulasi = new CawanganSimulasi;
|
||||
$caw_simulasi->simulasi_id = $simulasi->id;
|
||||
$caw_simulasi->caw_id = $caw->id;
|
||||
$caw_simulasi->online = 'Online';
|
||||
$caw_simulasi->lokasi = $caw->lokasi;
|
||||
$caw_simulasi->save();
|
||||
|
||||
$simulasibid = SimulasiBid::where('caw_id','=',$caw->id)->get();
|
||||
foreach($simulasibid as $data)
|
||||
{
|
||||
|
||||
$sumhargaasas = 0;
|
||||
$berat = 0;
|
||||
$simulasibidmarhun = SimulasiBidMarhun::where('simulasibid_id','=',$data->id)->get();
|
||||
foreach($simulasibidmarhun as $marhun)
|
||||
{
|
||||
$simkarat = SimKarat::where('simulasi_id','=',$simulasi->id)->get();
|
||||
// dd($simkarat);
|
||||
foreach($simkarat as $karat)
|
||||
{
|
||||
|
||||
if($karat->karat == $marhun->karat)
|
||||
{
|
||||
// dd($karat);
|
||||
$val = round($marhun->berat * $karat->harga);
|
||||
$sumhargaasas = $sumhargaasas + $val;
|
||||
$berat = $berat + $marhun->berat;
|
||||
|
||||
$marhun->harga = $karat->harga;
|
||||
$marhun->n_marhun = $marhun->berat * $karat->harga;
|
||||
$marhun->hargaasas = floatval(number_format($val,2));
|
||||
$marhun->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$calcaj = ($request->cajlelong/100)*$sumhargaasas;
|
||||
$data->hargaasas = $sumhargaasas;
|
||||
$data->cajlelong = $calcaj;
|
||||
$data->baki = $sumhargaasas-$data->pinjaman - $data->bakiupah - $calcaj;
|
||||
$data->berat = $berat;
|
||||
$data->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($request->caw && $request->caw != 'all')
|
||||
{
|
||||
$caw_simulasi = new CawanganSimulasi;
|
||||
$caw_simulasi->simulasi_id = $simulasi->id;
|
||||
$caw_simulasi->caw_id = $request->caw;
|
||||
$caw_simulasi->online = 'Online';
|
||||
$caw_simulasi->lokasi = $caw->lokasi;
|
||||
$caw_simulasi->save();
|
||||
|
||||
$simulasibid = SimulasiBid::where('caw_id','=',$request->caw)->get();
|
||||
foreach($simulasibid as $data)
|
||||
{
|
||||
|
||||
$sumhargaasas = 0;
|
||||
$berat = 0;
|
||||
$simulasibidmarhun = SimulasiBidMarhun::where('simulasibid_id','=',$data->id)->get();
|
||||
foreach($simulasibidmarhun as $marhun)
|
||||
{
|
||||
$simkarat = SimKarat::where('simulasi_id','=',$simulasi->id)->get();
|
||||
// dd($simkarat);
|
||||
foreach($simkarat as $karat)
|
||||
{
|
||||
|
||||
if($karat->karat == $marhun->karat)
|
||||
{
|
||||
// dd($karat);
|
||||
$val = round($marhun->berat * $karat->harga);
|
||||
$sumhargaasas = $sumhargaasas + $val;
|
||||
$berat = $berat + $marhun->berat;
|
||||
|
||||
$marhun->harga = $karat->harga;
|
||||
$marhun->n_marhun = $marhun->berat * $karat->harga;
|
||||
$marhun->hargaasas = floatval(number_format($val,2));
|
||||
$marhun->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$calcaj = ($request->cajlelong/100)*$sumhargaasas;
|
||||
$data->hargaasas = $sumhargaasas;
|
||||
$data->cajlelong = $calcaj;
|
||||
$data->baki = $sumhargaasas-$data->pinjaman - $data->bakiupah - $calcaj;
|
||||
$data->berat = $berat;
|
||||
$data->save();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dd('error');
|
||||
}
|
||||
|
||||
|
||||
|
||||
return redirect()->route('analisa.showsimulasi',$simulasi->id);
|
||||
}
|
||||
|
||||
public function senaraisimulasi()
|
||||
{
|
||||
$simulasi = Simulasi::all();
|
||||
|
||||
return view('simulasi.senaraisimulasi',compact('simulasi'));
|
||||
}
|
||||
|
||||
public function showsimulasi($id)
|
||||
{
|
||||
$simulasi = Simulasi::where('id','=',$id)->first();
|
||||
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
|
||||
|
||||
$arraydata = [];
|
||||
$arraycaw = [];
|
||||
foreach($cawangansim as $cawsim)
|
||||
{
|
||||
$cawangan = Cawangan::where('id','=',$cawsim->caw_id)->first();
|
||||
$databid = SimulasiBid::where('caw_id','=',$cawsim->caw_id)->get();
|
||||
|
||||
$packet = 0;
|
||||
$berat = 0;
|
||||
$nilai_marhun = 0;
|
||||
$pinjaman =0;
|
||||
$upah = 0;
|
||||
$hargaasas = 0;
|
||||
$cajlelong = 0;
|
||||
$rugilelong = 0;
|
||||
$bakilelong = 0;
|
||||
|
||||
foreach($databid as $bid)
|
||||
{
|
||||
$marhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)->get();
|
||||
$packet = $packet + count($marhun);
|
||||
$berat = $berat + $bid->berat;
|
||||
$nilai_marhun = $nilai_marhun + ($marhun->sum('n_marhun'));
|
||||
$pinjaman =$pinjaman + $bid->pinjaman;
|
||||
// $upah = $upah + $bid->upah;
|
||||
$hargaasas = $hargaasas + $bid->hargaasas;
|
||||
$cajlelong = $cajlelong + $bid->cajlelong;
|
||||
// $rugilelong = $berat + $bid->berat;
|
||||
$bakilelong = $bakilelong + $bid->baki;
|
||||
}
|
||||
|
||||
|
||||
array_push($arraycaw,[
|
||||
'cawangan'=>$cawangan->caw_name,
|
||||
't_lelong'=>$simulasi->tarikh_lelong,
|
||||
'bil_marhun'=>$packet,
|
||||
'berat'=>$berat,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
'pinjaman'=>$pinjaman,
|
||||
'upah'=>0,
|
||||
'hargaasas'=>$hargaasas,
|
||||
'cajlelong'=>$cajlelong,
|
||||
'rugilelong'=>0,
|
||||
'bakilelong'=>$bakilelong,
|
||||
]);
|
||||
// dd($arraycaw);
|
||||
// array_push($arraydata, $arraycaw);
|
||||
}
|
||||
|
||||
// dd($arraycaw);
|
||||
// ->where('id','=',$id)-
|
||||
|
||||
return view('simulasi.showsimulasi',compact('arraycaw'));
|
||||
}
|
||||
|
||||
public function deletesim($id)
|
||||
{
|
||||
$role = Simulasi::where('id','=',$id)->first();
|
||||
// dd($role);
|
||||
$role->delete();
|
||||
return redirect()->route('analisa.senaraisimulasi')
|
||||
->with('success','Padam Simulasi Berjaya');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CawanganLelong extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'cawangan_lelong';
|
||||
|
||||
protected $fillable = [
|
||||
'lelong_id',
|
||||
'caw_id',
|
||||
'online',
|
||||
'export_data_sts',
|
||||
'import_data_sts',
|
||||
'export_data_stsdate',
|
||||
'import_data_stsdate',
|
||||
'lokasi'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CawanganSimulasi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'cawangan_simulasi';
|
||||
|
||||
protected $fillable = [
|
||||
'simulasi_id',
|
||||
'caw_id',
|
||||
'online',
|
||||
'export_data_sts',
|
||||
'import_data_sts',
|
||||
'export_data_stsdate',
|
||||
'import_data_stsdate',
|
||||
'lokasi'
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class JenisEmas extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenisemas';
|
||||
|
||||
protected $fillable = [
|
||||
'marhun',
|
||||
'descpt',
|
||||
'ordernum',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class JenisKarat extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jeniskarat';
|
||||
|
||||
protected $fillable = [
|
||||
'karat',
|
||||
'keterangan',
|
||||
'dariharga916',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LelKarat extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lelkarat';
|
||||
|
||||
protected $fillable = [
|
||||
'karat',
|
||||
'karat2',
|
||||
'keterangan',
|
||||
'harga',
|
||||
'harga2'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LelKarat_temp extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lelkarat_temp';
|
||||
|
||||
protected $fillable = [
|
||||
'karat',
|
||||
'karat2',
|
||||
'keterangan',
|
||||
'harga',
|
||||
'harga2',
|
||||
't_harga'
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Lelong extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lelong';
|
||||
|
||||
protected $fillable = [
|
||||
'tarikh_lelong',
|
||||
'masatamat_lelong',
|
||||
'kali',
|
||||
'harga_emas_asas',
|
||||
'jbg',
|
||||
'cajlelong',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LelongBid extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lelongbid';
|
||||
|
||||
protected $fillable = [
|
||||
'caw_id',
|
||||
'norujukan',
|
||||
't_lelong',
|
||||
'hargaasas',
|
||||
'hargajual',
|
||||
't_jual',
|
||||
'nopembeli',
|
||||
'jbg',
|
||||
'kadarupdah',
|
||||
'upahsimpan',
|
||||
'ansuran',
|
||||
'nilaimarhun',
|
||||
'pinjaman',
|
||||
'bakiupah',
|
||||
'cajlain',
|
||||
'cajlelong',
|
||||
'baki',
|
||||
'berat',
|
||||
'marhun',
|
||||
'gst_hj',
|
||||
'gst_cl',
|
||||
'percent',
|
||||
'status_jual',
|
||||
'status_payment',
|
||||
'mora_upah',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LelongBidMarhun extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lelongbidmarhun';
|
||||
|
||||
protected $fillable = [
|
||||
'lelongbid_id',
|
||||
'bil',
|
||||
'marhun',
|
||||
'nota',
|
||||
'karat',
|
||||
'berat',
|
||||
'harga',
|
||||
'n_marhun',
|
||||
'hargaasas',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SimKarat extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'simkarat';
|
||||
|
||||
protected $fillable = [
|
||||
'karat',
|
||||
'karat2',
|
||||
'keterangan',
|
||||
'harga',
|
||||
'harga2'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SimKarat_temp extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'simkarat_temp';
|
||||
|
||||
protected $fillable = [
|
||||
'karat',
|
||||
'karat2',
|
||||
'keterangan',
|
||||
'harga',
|
||||
'harga2',
|
||||
't_harga'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Simulasi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'simulasi';
|
||||
|
||||
protected $fillable = [
|
||||
'tarikh_lelong',
|
||||
'masatamat_lelong',
|
||||
'kali',
|
||||
'harga_emas_asas',
|
||||
'jbg',
|
||||
'cajlelong',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SimulasiBid extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'simulasibid';
|
||||
|
||||
protected $fillable = [
|
||||
'caw_id',
|
||||
'norujukan',
|
||||
't_lelong',
|
||||
'hargaasas',
|
||||
'hargajual',
|
||||
't_jual',
|
||||
'nopembeli',
|
||||
'jbg',
|
||||
'kadarupdah',
|
||||
'upahsimpan',
|
||||
'ansuran',
|
||||
'nilaimarhun',
|
||||
'pinjaman',
|
||||
'bakiupah',
|
||||
'cajlain',
|
||||
'cajlelong',
|
||||
'baki',
|
||||
'berat',
|
||||
'marhun',
|
||||
'gst_hj',
|
||||
'gst_cl',
|
||||
'percent',
|
||||
'status_jual',
|
||||
'status_payment',
|
||||
'mora_upah',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SimulasiBidMarhun extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'simulasibidmarhun';
|
||||
|
||||
protected $fillable = [
|
||||
'simulasibid_id',
|
||||
'bil',
|
||||
'marhun',
|
||||
'nota',
|
||||
'karat',
|
||||
'berat',
|
||||
'harga',
|
||||
'n_marhun',
|
||||
'hargaasas',
|
||||
];
|
||||
}
|
||||
@@ -63,6 +63,26 @@ return [
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'mysql2' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => '127.0.0.1',
|
||||
'port' => '3306',
|
||||
'database' => 'name',
|
||||
'username' => 'username',
|
||||
'password' => "password",
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSimulasisTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('simulasi', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('tarikh_lelong');
|
||||
$table->time('masatamat_lelong')->nullable();
|
||||
$table->string('kali')->nullable();
|
||||
$table->string('harga_emas_asas');
|
||||
$table->string('jbg');
|
||||
$table->integer('cajlelong');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('cawangan_simulasi', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('simulasi_id')->unsigned();
|
||||
$table->unsignedBigInteger('caw_id')->unsigned();
|
||||
$table->string('online');
|
||||
$table->string('export_data_sts')->nullable();
|
||||
$table->string('import_data_sts')->nullable();
|
||||
$table->date('export_data_stsdate')->nullable();
|
||||
$table->date('import_data_sts_date')->nullable();
|
||||
$table->string('lokasi');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('caw_id')
|
||||
->references('id')->on('cawangan')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('simulasi_id')
|
||||
->references('id')->on('simulasi')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('simulasibid', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('caw_id')->unsigned();
|
||||
$table->string('kodcaw');
|
||||
$table->string('norujukan');
|
||||
$table->date('t_lelong');
|
||||
$table->decimal('hargaasas', $precision = 9, $scale = 2);
|
||||
$table->decimal('hargajual', $precision = 9, $scale = 2);
|
||||
$table->date('t_jual');
|
||||
$table->integer('nopembeli');
|
||||
$table->decimal('jbg', $precision = 7, $scale = 2);
|
||||
$table->decimal('kadarupah', $precision = 5, $scale = 2);
|
||||
$table->decimal('upahsimpan', $precision = 11, $scale = 2);
|
||||
$table->decimal('ansuran', $precision = 11, $scale = 2);
|
||||
$table->decimal('nilaimarhun', $precision = 9, $scale = 2);
|
||||
$table->decimal('pinjaman', $precision = 9, $scale = 2);
|
||||
$table->decimal('bakiupah', $precision = 7, $scale = 2);
|
||||
$table->decimal('cajlain', $precision = 7, $scale = 2);
|
||||
$table->decimal('cajlelong', $precision = 7, $scale = 2);
|
||||
$table->decimal('baki', $precision = 9, $scale = 2);
|
||||
$table->decimal('berat', $precision = 7, $scale = 2);
|
||||
$table->string('marhun');
|
||||
$table->decimal('gst_hj', $precision = 7, $scale = 2);
|
||||
$table->decimal('gst_cl', $precision = 7, $scale = 2);
|
||||
$table->decimal('percent', $precision = 7, $scale = 2);
|
||||
$table->integer('status_jual');
|
||||
$table->integer('status_payment');
|
||||
$table->integer('mora_upah');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('caw_id')
|
||||
->references('id')->on('cawangan')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('simulasibidmarhun', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('simulasibid_id')->unsigned();
|
||||
$table->decimal('bil', $precision = 3, $scale = 0);
|
||||
$table->string('marhun');
|
||||
$table->string('nota');
|
||||
$table->string('karat');
|
||||
$table->decimal('berat', $precision = 7, $scale = 2);
|
||||
$table->decimal('harga', $precision = 5, $scale = 2);
|
||||
$table->decimal('n_marhun', $precision = 9, $scale = 2);
|
||||
$table->decimal('hargaasas', $precision = 11, $scale = 2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('simulasibid_id')
|
||||
->references('id')->on('simulasibid')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('simkarat', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('simulasi_id')->unsigned();
|
||||
$table->string('karat');
|
||||
$table->string('keterangan');
|
||||
$table->decimal('harga', $precision = 5, $scale = 2)->nullable();
|
||||
$table->decimal('harga2', $precision = 5, $scale = 2)->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('simulasi_id')
|
||||
->references('id')->on('simulasi')
|
||||
->onDelete('cascade');
|
||||
|
||||
});
|
||||
|
||||
Schema::create('simkarat_temp', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('simulasi_id')->unsigned();
|
||||
$table->string('karat');
|
||||
$table->string('keterangan');
|
||||
$table->decimal('harga', $precision = 5, $scale = 2);
|
||||
$table->decimal('harga2', $precision = 5, $scale = 2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('simulasi_id')
|
||||
->references('id')->on('simulasi')
|
||||
->onDelete('cascade');
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('simulasi');
|
||||
Schema::dropIfExists('cawangan_simulasi');
|
||||
Schema::dropIfExists('simulasibid');
|
||||
Schema::dropIfExists('simulasibidmarhun');
|
||||
Schema::dropIfExists('simkarat');
|
||||
Schema::dropIfExists('simkarat_temp');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLelongsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('lelong', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('tarikh_lelong');
|
||||
$table->time('masatamat_lelong')->nullable();
|
||||
$table->string('kali')->nullable();
|
||||
$table->string('harga_emas_asas');
|
||||
$table->string('jbg');
|
||||
$table->integer('cajlelong');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('cawangan_lelong', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('lelong_id')->unsigned();
|
||||
$table->unsignedBigInteger('caw_id')->unsigned();
|
||||
$table->string('online');
|
||||
$table->string('export_data_sts')->nullable();
|
||||
$table->string('import_data_sts')->nullable();
|
||||
$table->date('export_data_stsdate')->nullable();
|
||||
$table->date('import_data_sts_date')->nullable();
|
||||
$table->string('lokasi');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('caw_id')
|
||||
->references('id')->on('cawangan')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('lelong_id')
|
||||
->references('id')->on('lelong')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('lelongbid', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('caw_id')->unsigned();
|
||||
$table->string('kodcaw');
|
||||
$table->string('norujukan');
|
||||
$table->date('t_lelong');
|
||||
$table->decimal('hargaasas', $precision = 9, $scale = 2);
|
||||
$table->decimal('hargajual', $precision = 9, $scale = 2);
|
||||
$table->date('t_jual');
|
||||
$table->integer('nopembeli');
|
||||
$table->decimal('jbg', $precision = 7, $scale = 2);
|
||||
$table->decimal('kadarupah', $precision = 5, $scale = 2);
|
||||
$table->decimal('upahsimpan', $precision = 11, $scale = 2);
|
||||
$table->decimal('ansuran', $precision = 11, $scale = 2);
|
||||
$table->decimal('nilaimarhun', $precision = 9, $scale = 2);
|
||||
$table->decimal('pinjaman', $precision = 9, $scale = 2);
|
||||
$table->decimal('bakiupah', $precision = 7, $scale = 2);
|
||||
$table->decimal('cajlain', $precision = 7, $scale = 2);
|
||||
$table->decimal('cajlelong', $precision = 7, $scale = 2);
|
||||
$table->decimal('baki', $precision = 9, $scale = 2);
|
||||
$table->decimal('berat', $precision = 7, $scale = 2);
|
||||
$table->string('marhun');
|
||||
$table->decimal('gst_hj', $precision = 7, $scale = 2);
|
||||
$table->decimal('gst_cl', $precision = 7, $scale = 2);
|
||||
$table->decimal('percent', $precision = 7, $scale = 2);
|
||||
$table->string('status_jual');
|
||||
$table->string('status_payment');
|
||||
$table->string('mora_upah');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('caw_id')
|
||||
->references('id')->on('cawangan')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('lelongbidmarhun', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('lelongbid_id')->unsigned();
|
||||
$table->decimal('bil', $precision = 3, $scale = 0);
|
||||
$table->string('marhun');
|
||||
$table->string('nota');
|
||||
$table->string('karat');
|
||||
$table->decimal('berat', $precision = 7, $scale = 2);
|
||||
$table->decimal('harga', $precision = 5, $scale = 2);
|
||||
$table->decimal('n_marhun', $precision = 9, $scale = 2);
|
||||
$table->decimal('hargaasas', $precision = 11, $scale = 2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('lelongbid_id')
|
||||
->references('id')->on('lelongbid')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('lelkarat', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('lelong_id')->unsigned();
|
||||
$table->string('karat');
|
||||
$table->string('keterangan');
|
||||
$table->decimal('harga', $precision = 5, $scale = 2)->nullable();
|
||||
$table->decimal('harga2', $precision = 5, $scale = 2)->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('lelong_id')
|
||||
->references('id')->on('lelong')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('lelkarat_temp', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('lelong_id')->unsigned();
|
||||
$table->string('karat');
|
||||
$table->string('keterangan');
|
||||
$table->decimal('harga', $precision = 5, $scale = 2);
|
||||
$table->decimal('harga2', $precision = 5, $scale = 2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('lelong_id')
|
||||
->references('id')->on('lelong')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('lelong');
|
||||
Schema::dropIfExists('cawangan_lelong');
|
||||
Schema::dropIfExists('lelongbid');
|
||||
Schema::dropIfExists('lelongbidmarhun');
|
||||
Schema::dropIfExists('lelkarat');
|
||||
Schema::dropIfExists('lelkarat_temp');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJenisEmasTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('jenisemas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('marhun');
|
||||
$table->string('descpt');
|
||||
$table->integer('ordernum');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('jeniskarat', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('karat');
|
||||
$table->string('keterangan');
|
||||
$table->decimal('dariharga916', $precision = 5, $scale = 2);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('jenisemas');
|
||||
Schema::dropIfExists('jeniskarat');
|
||||
}
|
||||
}
|
||||
@@ -14,5 +14,7 @@ class DatabaseSeeder extends Seeder
|
||||
public function run()
|
||||
{
|
||||
$this->call(RolesSeeder::class);
|
||||
$this->call(JenisEmasSeeder::class);
|
||||
$this->call(KaratSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\JenisEmas;
|
||||
|
||||
class JenisEmasSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
JenisEmas::create([
|
||||
'marhun' => 'G/T',
|
||||
'descpt' => 'Gelang Tangan',
|
||||
'ordernum' => 1,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'R/T',
|
||||
'descpt' => 'Rantai Tangan',
|
||||
'ordernum' => 2,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'R/L',
|
||||
'descpt' => 'Rantai Leher',
|
||||
'ordernum' => 3,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'R/K',
|
||||
'descpt' => 'Rantai Kaki',
|
||||
'ordernum' => 4,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'CIN',
|
||||
'descpt' => 'Cincin',
|
||||
'ordernum' => 5,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'SBG',
|
||||
'descpt' => 'Subang',
|
||||
'ordernum' => 6,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'L/L',
|
||||
'descpt' => 'Lain-lain',
|
||||
'ordernum' => 7,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'LKT',
|
||||
'descpt' => 'Loket',
|
||||
'ordernum' => 8,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'K/B',
|
||||
'descpt' => 'Kacing Baju',
|
||||
'ordernum' => 9,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'DNR',
|
||||
'descpt' => 'Dinar',
|
||||
'ordernum' => 10,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'SYE',
|
||||
'descpt' => 'Syiling Emas',
|
||||
'ordernum' => 11,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'WFR',
|
||||
'descpt' => 'Wafer Emas',
|
||||
'ordernum' => 12,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'G/B',
|
||||
'descpt' => 'Gold Bar',
|
||||
'ordernum' => 13,
|
||||
]);
|
||||
|
||||
JenisEmas::create([
|
||||
'marhun' => 'SPE',
|
||||
'descpt' => 'Serpihan Emas',
|
||||
'ordernum' => 14,
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\JenisKarat;
|
||||
|
||||
class KaratSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
JenisKarat::create([
|
||||
'karat' => '24.0Kgb',
|
||||
'keterangan' => '999.00 Gold Bar',
|
||||
'dariharga916' => 35
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '24.0K',
|
||||
'keterangan' => '999.00',
|
||||
'dariharga916' => 30
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '23.0K',
|
||||
'keterangan' => '950.00',
|
||||
'dariharga916' => 3
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '22.0K',
|
||||
'keterangan' => '916.00',
|
||||
'dariharga916' => 0
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '21.0K',
|
||||
'keterangan' => '900.00',
|
||||
'dariharga916' => -25
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '20.0K',
|
||||
'keterangan' => '835.00',
|
||||
'dariharga916' => -60
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '18.0Kp',
|
||||
'keterangan' => '750.00 putih',
|
||||
'dariharga916' => -125
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '18.0K',
|
||||
'keterangan' => '750.00',
|
||||
'dariharga916' => -125
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '14.0Kp',
|
||||
'keterangan' => '585.00 putih',
|
||||
'dariharga916' => -252
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '14.0K',
|
||||
'keterangan' => '585.00',
|
||||
'dariharga916' => -252
|
||||
]);
|
||||
|
||||
JenisKarat::create([
|
||||
'karat' => '9.0K',
|
||||
'keterangan' => '375.00',
|
||||
'dariharga916' => -380
|
||||
]);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -141,6 +141,7 @@ class RolesSeeder extends Seeder
|
||||
$role5->givePermissionTo('pendaftaranbatch');
|
||||
$role6->givePermissionTo('report');
|
||||
$role6->givePermissionTo('tangguhan');
|
||||
$role6->givePermissionTo('analisa');
|
||||
|
||||
$role7 = Role::create(['name' => 'account']);
|
||||
$role7->givePermissionTo('pengesahanbayaran');
|
||||
|
||||
@@ -63,10 +63,13 @@
|
||||
@endhasrole
|
||||
@hasrole('operasi')
|
||||
<li class="{{ (request()->is('analisa/*')) ? 'active' : '' }}">
|
||||
<a href="#analisaSubmenu" data-toggle="collapse" aria-expanded="false" style="">Analisa</a>
|
||||
<a href="#analisaSubmenu" data-toggle="collapse" aria-expanded="false" style="">Simulasi</a>
|
||||
<ul class="list-unstyled collapse {{ (request()->is('analisa/*')) ? 'show' : '' }}" id="analisaSubmenu" >
|
||||
<li class="{{ (request()->is('analisa/janasimulasi/*') || request()->is('analisa/janasimulasi') ) ? 'active' : '' }}">
|
||||
<a href="{{url('analisa/janasimulasi')}}">Jana Analisa</a>
|
||||
<a href="{{url('analisa/janasimulasi')}}">Jana Simulasi</a>
|
||||
</li>
|
||||
<li class="{{ (request()->is('analisa/senaraisimulasi/*') || request()->is('analisa/senaraisimulasi') ) ? 'active' : '' }}">
|
||||
<a href="{{url('analisa/senaraisimulasi')}}">Senarai Simulasi</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
@endif
|
||||
<form id="exportform" action="{{route('sistem.export')}}" method="POST">
|
||||
<table class="table table-striped" id="roles">
|
||||
<table class="table table-striped" id="cawangan">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
|
||||
@@ -178,14 +178,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
var tablerole = $('#roles').DataTable({
|
||||
var tablecawangan = $('#cawangan').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 2,
|
||||
"targets": 8,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
@@ -196,9 +196,9 @@
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
className: 'btn btn-outline-success pl-4 pr-4 btn-sm adduser',
|
||||
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
|
||||
text: '<i class="fas fa-plus" id="test"></i>',
|
||||
titleAttr: 'Tambah Role',
|
||||
titleAttr: 'Tambah Cawangan',
|
||||
action: function ( e, dt, node, config ) {
|
||||
// alert( 'Button activated' );
|
||||
// console.log('hye');
|
||||
@@ -220,15 +220,15 @@
|
||||
]
|
||||
});
|
||||
|
||||
$('.adduser').tooltip();
|
||||
$('.addcaw').tooltip();
|
||||
$('.export').tooltip();
|
||||
// $( '.dt-buttons').addClass('btn-group');
|
||||
$( '.adduser').removeClass('dt-button');
|
||||
$( '.addcaw').removeClass('dt-button');
|
||||
$( '.export').removeClass('dt-button');
|
||||
|
||||
|
||||
function selectall(cb) {
|
||||
tablerole.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
|
||||
tablecawangan.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
|
||||
$(this).prop('checked', cb.checked);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -47,13 +47,8 @@
|
||||
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<form action="{{ route('pengguna.delete',$user->id) }}" method="POST" id="formdelpengguna-{{$user->id}}">
|
||||
@csrf
|
||||
{{-- <input type="userid" value="{{$user->id}}"> --}}
|
||||
<a href="{{ route('pengguna.show',$user->id) }}"><i class="far fa-edit"></i></a>
|
||||
{{-- <a href="{{ route('pengguna.show',$user->id) }}"><i class="far fa-eye"></i></a> --}}
|
||||
<a onclick="confirm({{$user->id}})"><i class="far fa-trash-alt"></i></a>
|
||||
</form>
|
||||
<a class="confirmdel" href="{{ route('pengguna.delete',$user->id) }}"><i class="far fa-trash-alt"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -66,9 +61,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function confirm(id) {
|
||||
// console.log(id);
|
||||
$.confirm({
|
||||
$('a.confirmdel').confirm({
|
||||
title: 'Confirmation',
|
||||
content: 'Anda pasti?',
|
||||
type: 'orange',
|
||||
@@ -77,7 +70,7 @@
|
||||
Delete: {
|
||||
btnClass: 'btn-warning',
|
||||
action: function () {
|
||||
$("#formdelpengguna-"+id).submit();
|
||||
location.href = this.$target.attr('href');
|
||||
}
|
||||
},
|
||||
Batal: {
|
||||
@@ -86,7 +79,6 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var tablepengguna = $('#pengguna').DataTable( {
|
||||
|
||||
@@ -27,14 +27,8 @@
|
||||
<td>{{ $role->name }}</td>
|
||||
<td>{{ $role->description }}</td>
|
||||
<td class="text-center">
|
||||
<form action="{{ route('pengguna.deleterole',$role->id) }}" method="POST" id="formdelrole-{{$role->id}}">
|
||||
@csrf
|
||||
<a href="{{ route('pengguna.showrole',$role->id) }}"><i class="far fa-edit"></i></a>
|
||||
{{-- <a href="{{ route('pengguna.showrole',$role->id) }}"><i class="far fa-eye"></i></a> --}}
|
||||
<a onclick="confirm({{$role->id}})"><i class="far fa-trash-alt"></i></a>
|
||||
</form>
|
||||
{{-- <a class="btn btn-info" href="{{ route('pengguna.showtaraf',$role->id) }}">Edit</a> --}}
|
||||
|
||||
<a class="confirmdel" href="{{ route('pengguna.deleterole',$role->id) }}"><i class="far fa-trash-alt"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -82,9 +76,7 @@
|
||||
function newrole() {
|
||||
$("#formnewrole").submit();
|
||||
}
|
||||
function confirm(id) {
|
||||
// console.log(id);
|
||||
$.confirm({
|
||||
$('a.confirmdel').confirm({
|
||||
title: 'Confirmation',
|
||||
content: 'Anda pasti?',
|
||||
type: 'orange',
|
||||
@@ -93,7 +85,7 @@
|
||||
Delete: {
|
||||
btnClass: 'btn-warning',
|
||||
action: function () {
|
||||
$("#formdelrole-"+id).submit();
|
||||
location.href = this.$target.attr('href');
|
||||
}
|
||||
},
|
||||
Batal: {
|
||||
@@ -102,7 +94,6 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var tablerole = $('#roles').DataTable({
|
||||
"columnDefs": [
|
||||
|
||||
@@ -32,12 +32,8 @@
|
||||
@endforeach
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<form action="{{ route('pengguna.deletetaraf',$role->id) }}" method="POST" id="checkboxdata">
|
||||
@csrf
|
||||
<a href="{{ route('pengguna.showtaraf',$role->id) }}"><i class="far fa-edit"></i></a>
|
||||
{{-- <a href="{{ route('pengguna.showtaraf',$role->id) }}"><i class="far fa-eye"></i></a> --}}
|
||||
<a onclick="confirm({{$role->id}})"><i class="far fa-trash-alt"></i></a>
|
||||
</form>
|
||||
<a class="confirmdel" href="{{ route('pengguna.deletetaraf',$role->id) }}"><i class="far fa-trash-alt"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -50,9 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function confirm(id) {
|
||||
// console.log(id);
|
||||
$.confirm({
|
||||
$('a.confirmdel').confirm({
|
||||
title: 'Confirmation',
|
||||
content: 'Anda pasti?',
|
||||
type: 'orange',
|
||||
@@ -61,7 +55,7 @@
|
||||
Delete: {
|
||||
btnClass: 'btn-warning',
|
||||
action: function () {
|
||||
$("#formdeltaraf-"+id).submit();
|
||||
location.href = this.$target.attr('href');
|
||||
}
|
||||
},
|
||||
Batal: {
|
||||
@@ -70,7 +64,6 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var tabletaraf = $('#taraf').DataTable({
|
||||
"columnDefs": [
|
||||
|
||||
@@ -5,23 +5,24 @@
|
||||
<div class="row ">
|
||||
<div class="col-md-12 mx-auto card">
|
||||
<h3 class="pt-3">Simulasi</h3>
|
||||
<form action="" method="POST">
|
||||
<form action="{{route('analisa.janadata')}}" method="POST">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label for="inputEmail3" class="col-sm-1 col-form-label">Tarikh</label>
|
||||
<label for="tarikh_lelong" class="col-sm-1 col-form-label">Tarikh</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="date" class="form-control" id="inputEmail3" placeholder="Tarikh">
|
||||
<input type="date" class="form-control" id="tarikh_lelong" name="tarikh_lelong" placeholder="Tarikh">
|
||||
</div>
|
||||
<label for="inputEmail3" class="col-sm-1 col-form-label">Harga Emas Asas</label>
|
||||
<label for="hargaasas" class="col-sm-1 col-form-label">Harga Emas Asas</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="inputEmail3" placeholder="RM">
|
||||
<input type="text" class="form-control" id="hargaasas" name="hargaasas" placeholder="RM">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputPassword3" class="col-sm-1 col-form-label">JBG</label>
|
||||
<label for="jbg" class="col-sm-1 col-form-label">JBG</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="inputPassword3" placeholder="JBG">
|
||||
<input type="text" class="form-control" id="jbg" name="jbg" placeholder="JBG">
|
||||
</div>
|
||||
<label for="inputEmail3" class="col-sm-1 col-form-label">Cawangan</label>
|
||||
<label for="caw" class="col-sm-1 col-form-label">Cawangan</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="custom-select" name="caw" id="caw">
|
||||
<option value="">Please select</option>
|
||||
@@ -34,14 +35,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputPassword3" class="col-sm-1 col-form-label">Caj Lelong</label>
|
||||
<label for="cajlelong" class="col-sm-1 col-form-label">Caj Lelong</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="inputPassword3" placeholder="Caj Lelong">
|
||||
<input type="text" class="form-control" id="cajlelong" name="cajlelong" placeholder="%">
|
||||
</div>
|
||||
<label for="inputEmail3" class="col-sm-1 col-form-label">Upah</label>
|
||||
{{-- <label for="inputEmail3" class="col-sm-1 col-form-label">Upah</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" id="inputEmail3" placeholder="Upah">
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form id="exportform" action="" method="POST">
|
||||
<input type="hidden" name="type" value="User">
|
||||
<table class="table table-striped table-xl" id="simulasi" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Harga Emas Asas</th>
|
||||
<th>JBG</th>
|
||||
<th>Caj Lelong</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($simulasi as $sim)
|
||||
<tr>
|
||||
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $sim->id }}"></td>
|
||||
<td>{{ $sim->tarikh_lelong }}</td>
|
||||
<td>{{ $sim->harga_emas_asas }}</td>
|
||||
<td>{{ $sim->jbg }}</td>
|
||||
<td>{{ $sim->cajlelong }}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ route('analisa.showsimulasi',$sim->id) }}"><i class="far fa-edit"></i></a>
|
||||
{{-- <a href="{{ route('sistem.showConn',$data->id) }}"><i class="far fa-eye"></i></a> --}}
|
||||
<a class="confirmdel" href="{{ route('analisa.deletesimulasi',$sim->id) }}"><i class="far fa-trash-alt"></i></a>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('a.confirmdel').confirm({
|
||||
title: 'Confirmation',
|
||||
content: 'Anda pasti?',
|
||||
type: 'orange',
|
||||
typeAnimated: true,
|
||||
buttons: {
|
||||
Delete: {
|
||||
btnClass: 'btn-warning',
|
||||
action: function () {
|
||||
location.href = this.$target.attr('href');
|
||||
}
|
||||
},
|
||||
Batal: {
|
||||
btnClass: 'btn-default',
|
||||
action: function () {}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var tablesimulasi = $('#simulasi').DataTable( {
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 5,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
// "ordering": false,
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
// 'copy', 'excel', 'pdf'
|
||||
// { text: 'copy', className: 'btn btn-primary' },
|
||||
{
|
||||
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
|
||||
text: '<i class="fas fa-plus" id="test"></i>',
|
||||
titleAttr: 'Tambah Simulasi',
|
||||
action: function ( e, dt, node, config ) {
|
||||
alert( 'Button activated' );
|
||||
}
|
||||
},
|
||||
{
|
||||
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
titleAttr: 'Export to CSV',
|
||||
text: '<i class="fas fa-download"></i>',
|
||||
action: function ( e, dt, node, config ) {
|
||||
$("#exportform").submit();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('.addsim').tooltip();
|
||||
$('.export').tooltip();
|
||||
// $( '.dt-buttons').addClass('btn-group');
|
||||
$( '.addsim').removeClass('dt-button');
|
||||
$( '.export').removeClass('dt-button');
|
||||
|
||||
|
||||
function selectall(cb) {
|
||||
tablesimulasi.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
|
||||
$(this).prop('checked', cb.checked);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,130 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
{{$arraycaw[0]->cawangan }}
|
||||
<form id="exportform" action="" method="POST">
|
||||
<input type="hidden" name="type" value="User">
|
||||
<table class="table table-striped table-xl" id="simulasi" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>Cawangan</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Bil Marhun (Paket)</th>
|
||||
<th>Berat (gm)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Pinjaman (RM)</th>
|
||||
<th>Upah (RM)</th>
|
||||
<th>Harga Asas (RM)</th>
|
||||
<th>Caj Lelong (RM)</th>
|
||||
<th>Rugi Lelong (RM)</th>
|
||||
<th>Baki Lelong (RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($arraycaw as $caw)
|
||||
<tr>
|
||||
<td>{{ $caw->cawangan }}</td>
|
||||
<td>{{ $caw->t_lelong }}</td>
|
||||
<td>{{ $caw->bil_marhun }}</td>
|
||||
<td>{{ $caw->berat }}</td>
|
||||
<td>{{ $caw->n_marhun }}</td>
|
||||
<td>{{ $caw->pinjaman }}</td>
|
||||
<td>{{ $caw->upah }}</td>
|
||||
<td>{{ $caw->hargaasas }}</td>
|
||||
<td>{{ $caw->cajlelong }}</td>
|
||||
<td>{{ $caw->rugilelong }}</td>
|
||||
<td>{{ $caw->bakilelong }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('a.confirmdel').confirm({
|
||||
title: 'Confirmation',
|
||||
content: 'Anda pasti?',
|
||||
type: 'orange',
|
||||
typeAnimated: true,
|
||||
buttons: {
|
||||
Delete: {
|
||||
btnClass: 'btn-warning',
|
||||
action: function () {
|
||||
location.href = this.$target.attr('href');
|
||||
}
|
||||
},
|
||||
Batal: {
|
||||
btnClass: 'btn-default',
|
||||
action: function () {}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var tablesimulasi = $('#simulasi').DataTable( {
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 5,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
// "ordering": false,
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
// 'copy', 'excel', 'pdf'
|
||||
// { text: 'copy', className: 'btn btn-primary' },
|
||||
{
|
||||
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
|
||||
text: '<i class="fas fa-plus" id="test"></i>',
|
||||
titleAttr: 'Tambah Simulasi',
|
||||
action: function ( e, dt, node, config ) {
|
||||
alert( 'Button activated' );
|
||||
}
|
||||
},
|
||||
{
|
||||
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
titleAttr: 'Export to CSV',
|
||||
text: '<i class="fas fa-download"></i>',
|
||||
action: function ( e, dt, node, config ) {
|
||||
$("#exportform").submit();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('.addsim').tooltip();
|
||||
$('.export').tooltip();
|
||||
// $( '.dt-buttons').addClass('btn-group');
|
||||
$( '.addsim').removeClass('dt-button');
|
||||
$( '.export').removeClass('dt-button');
|
||||
|
||||
|
||||
function selectall(cb) {
|
||||
tablesimulasi.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
|
||||
$(this).prop('checked', cb.checked);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
+8
-4
@@ -29,25 +29,29 @@ Route::group(['middleware' => ['permission:pengguna'],'prefix'=>'pengguna'], fun
|
||||
Route::get('/listpengguna',['as'=>'pengguna.index','uses'=>'PenggunaController@index']);
|
||||
Route::get('/listpengguna/{userid}',['as'=>'pengguna.show','uses'=>'PenggunaController@show']);
|
||||
Route::post('/store',['as'=>'pengguna.store','uses'=>'PenggunaController@store']);
|
||||
Route::post('/delete/{userid}',['as'=>'pengguna.delete','uses'=>'PenggunaController@delete']);
|
||||
Route::get('/delete/{userid}',['as'=>'pengguna.delete','uses'=>'PenggunaController@delete']);
|
||||
|
||||
Route::get('/taraf',['as'=>'pengguna.taraf','uses'=>'PenggunaController@taraf']);
|
||||
Route::get('/taraf/{tarafid}',['as'=>'pengguna.showtaraf','uses'=>'PenggunaController@showtaraf']);
|
||||
Route::post('/storetaraf',['as'=>'pengguna.storetaraf','uses'=>'PenggunaController@storetaraf']);
|
||||
Route::post('/deletetaraf/{tarafid}',['as'=>'pengguna.deletetaraf','uses'=>'PenggunaController@deletetaraf']);
|
||||
Route::get('/deletetaraf/{tarafid}',['as'=>'pengguna.deletetaraf','uses'=>'PenggunaController@deletetaraf']);
|
||||
|
||||
// Route::get('/roles','PenggunaController@roles');
|
||||
Route::get('/roles',['as'=>'pengguna.roles','uses'=>'PenggunaController@roles']);
|
||||
Route::get('/roles/{roleid}',['as'=>'pengguna.showrole','uses'=>'PenggunaController@showrole']);
|
||||
Route::post('/newrole',['as'=>'pengguna.newrole','uses'=>'PenggunaController@newrole']);
|
||||
Route::post('/storerole',['as'=>'pengguna.storerole','uses'=>'PenggunaController@storerole']);
|
||||
Route::post('/deleterole/{roleid}',['as'=>'pengguna.deleterole','uses'=>'PenggunaController@deleterole']);
|
||||
Route::get('/deleterole/{roleid}',['as'=>'pengguna.deleterole','uses'=>'PenggunaController@deleterole']);
|
||||
|
||||
Route::post('/export',['as'=>'pengguna.export','uses'=>'PenggunaController@export']);
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['permission:analisa'],'prefix'=>'analisa'], function () {
|
||||
Route::get('/janasimulasi',['as'=>'analisa.janasimulasi','uses'=>'SimulasiController@index']);
|
||||
Route::post('/janadata',['as'=>'analisa.janadata','uses'=>'SimulasiController@janadata']);
|
||||
Route::get('/senaraisimulasi',['as'=>'analisa.senaraisimulasi','uses'=>'SimulasiController@senaraisimulasi']);
|
||||
Route::get('/showsimulasi/{id}',['as'=>'analisa.showsimulasi','uses'=>'SimulasiController@showsimulasi']);
|
||||
Route::get('/deletesimulasi/{id}',['as'=>'analisa.deletesimulasi','uses'=>'SimulasiController@deletesim']);
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], function () {
|
||||
@@ -55,7 +59,7 @@ Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], functio
|
||||
Route::get('/showConn/{id}',['as'=>'sistem.showConn','uses'=>'DatabaseController@showConn']);
|
||||
Route::post('/newConn',['as'=>'sistem.newConn','uses'=>'DatabaseController@newConn']);
|
||||
Route::post('/storeConn',['as'=>'sistem.storeConn','uses'=>'DatabaseController@storeConn']);
|
||||
Route::post('/deleteConn/{id}',['as'=>'sistem.deleteConn','uses'=>'DatabaseController@deleteConn']);
|
||||
Route::get('/deleteConn/{id}',['as'=>'sistem.deleteConn','uses'=>'DatabaseController@deleteConn']);
|
||||
|
||||
Route::post('/export',['as'=>'sistem.export','uses'=>'DatabaseController@export']);
|
||||
});
|
||||
Reference in New Issue
Block a user