Develop realisasi belanja dbh
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Tropd;
|
||||
use App\Models\Program;
|
||||
use App\Models\Kegiatan;
|
||||
use App\Models\SubKegiatan;
|
||||
use App\Models\Rsk;
|
||||
use App\Models\Sps_pendapatan;
|
||||
use App\Models\Siesetpembayaran;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -21,15 +25,57 @@ class ItemSearchController extends Controller
|
||||
//
|
||||
}
|
||||
|
||||
public function skpd(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("C_OPD AS ID,C_OPD||' | '||N_OPD as name");
|
||||
$tropd = Tropd::select($select)
|
||||
->where('N_OPD', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function prog(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("C_PROGRAM AS ID,C_PROGRAM||' | '||N_PROGRAM as name");
|
||||
$tropd = Program::select($select)
|
||||
->where('N_PROGRAM', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function keg(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("C_GIAT AS ID,C_GIAT||' | '||N_GIAT as name");
|
||||
$tropd = Kegiatan::select($select)
|
||||
->where('N_GIAT', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function sk(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$tropd = SubKegiatan::select(["SUBKEG_KODE as id","SUBKEG_NAMA as name"])
|
||||
->where('SUBKEG_NAMA', 'LIKE', "%$search%")
|
||||
->distinct()
|
||||
$select = DB::raw("C_SUBGIAT AS ID,C_SUBGIAT||' | '||N_SUBGIAT as name");
|
||||
$tropd = SubKegiatan::select($select)
|
||||
->where('N_SUBGIAT', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
@@ -41,8 +87,9 @@ class ItemSearchController extends Controller
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$tropd = Tropd::select(["I_ID as id","N_OPD as name"])
|
||||
->where('N_OPD', 'LIKE', "%$search%")
|
||||
$select = DB::raw("I_ID AS ID,I_ID||' | '||N_RSK as name");
|
||||
$tropd = Rsk::select($select)
|
||||
->where('N_RSK', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
|
||||
Reference in New Issue
Block a user