Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <? php
- namespace App \ Http \ Controllers;
- gunakan App \ Repository \ Eloquent \ DetailAdditionalOrderRepository;
- gunakan App \ Repository \ Eloquent \ MasterAdditionalOrderRepository;
- gunakan Illuminate \ Support \ Facades \ Cache;
- gunakan Yajra \ Datatables \ Datatables;
- gunakan App \ Models \ Cache sebagai CacheModel;
- kelas TambahanOrderDatatablesController meluaskan Pengawal
- {
- fungsi awam tambahanOrderJsonDraft (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
- {
- $ idUser = session () -> get ('user') ['id_user'];
- $ idDealer = session () -> get ('user') ['id_dealer'];
- $ cache_name = 'datatable-extraOrderJsonDraft-idUser -'. $ idUser;
- $ datas = Cache :: ingat ($ cache_name, 10,
- fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
- CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
- pulangkan $ masterAdditionalOrderRepository-> getDraft ($ idDealer);
- });
- mengembalikan Datatables :: of ($ datas)
- -> addColumn ('action', function ($ data) {
- kembali '<input type = "checkbox" class = "new-control-input checkId"
- onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
- id = "'. $ data-> id_master_additional_order_unit.'"
- nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
- })
- -> addColumn ('details_url', fungsi ($ data) {
- kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
- })
- -> buat (benar);
- }
- fungsi awam tambahanOrderJsonWaitingApprovalDealerPrinciple (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
- {
- $ idUser = session () -> get ('user') ['id_user'];
- $ idDealer = session () -> get ('user') ['id_dealer'];
- $ cache_name = 'datatable-extraOrderJsonWaitingApprovalDealerPrinciple-idUser -'. $ idUser;
- $ datas = Cache :: ingat ($ cache_name, 10,
- fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
- CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
- pulangkan $ masterAdditionalOrderRepository-> getWaitingApprovalDealerPrinciple ($ idDealer);
- });
- mengembalikan Datatables :: of ($ datas)
- -> addColumn ('action', function ($ data) {
- kembali '<input type = "checkbox" class = "new-control-input checkId"
- onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
- id = "'. $ data-> id_master_additional_order_unit.'"
- nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
- })
- -> addColumn ('details_url', fungsi ($ data) {
- kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
- })
- -> buat (benar);
- }
- fungsi awam tambahanOrderJsonApprovalDealerPrinciple (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
- {
- $ idUser = session () -> get ('user') ['id_user'];
- $ idDealer = session () -> get ('user') ['id_dealer'];
- $ cache_name = 'datatable-extraOrderJsonApprovalDealerPrinciple-idUser -'. $ idUser;
- $ datas = Cache :: ingat ($ cache_name, 10,
- fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
- CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
- pulangkan $ masterAdditionalOrderRepository-> getApprovalDealerPrinciple ($ idDealer);
- });
- mengembalikan Datatables :: of ($ datas)
- -> addColumn ('action', function ($ data) {
- kembali '<input type = "checkbox" class = "new-control-input checkId"
- onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
- id = "'. $ data-> id_master_additional_order_unit.'"
- nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
- })
- -> addColumn ('details_url', fungsi ($ data) {
- kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
- })
- -> buat (benar);
- }
- fungsi awam tambahanOrderJsonSubmittedATPM (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
- {
- $ idUser = session () -> get ('user') ['id_user'];
- $ idDealer = session () -> get ('user') ['id_dealer'];
- $ cache_name = 'datatable-extraOrderJsonSubmittedATPM-idUser -'. $ idUser;
- $ datas = Cache :: ingat ($ cache_name, 10,
- fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
- CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
- pulangkan $ masterAdditionalOrderRepository-> getSubmittedATPM ($ idDealer);
- });
- mengembalikan Datatables :: of ($ datas)
- -> addColumn ('action', function ($ data) {
- kembali '<input type = "checkbox" class = "new-control-input checkId"
- onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
- id = "'. $ data-> id_master_additional_order_unit.'"
- nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
- })
- -> addColumn ('details_url', fungsi ($ data) {
- kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
- })
- -> buat (benar);
- }
- fungsi awam tambahanOrderJsonATPMAllocation (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
- {
- $ idUser = session () -> get ('user') ['id_user'];
- $ idDealer = session () -> get ('user') ['id_dealer'];
- $ cache_name = 'datatable-extraOrderJsonATPMAllocation-idUser -'. $ idUser;
- $ datas = Cache :: ingat ($ cache_name, 10,
- fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
- CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
- pulangkan $ masterAdditionalOrderRepository-> getATPMAllocation ($ idDealer);
- });
- mengembalikan Datatables :: of ($ datas)
- -> addColumn ('action', function ($ data) {
- kembali '<input type = "checkbox" class = "new-control-input checkId"
- onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
- id = "'. $ data-> id_master_additional_order_unit.'"
- nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
- })
- -> addColumn ('details_url', fungsi ($ data) {
- kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
- })
- -> buat (benar);
- }
- fungsi awam tambahanOrderJsonCanceled (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
- {
- $ idUser = session () -> get ('user') ['id_user'];
- $ idDealer = session () -> get ('user') ['id_dealer'];
- $ cache_name = 'datatable-extraOrderJsonCanceled-idUser -'. $ idUser;
- $ datas = Cache :: ingat ($ cache_name, 10,
- fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
- CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
- pulangkan $ masterAdditionalOrderRepository-> getCanceledAdditionalOrder ($ idDealer);
- });
- mengembalikan Datatables :: of ($ datas)
- -> addColumn ('action', function ($ data) {
- kembali '<input type = "checkbox" class = "new-control-input checkId"
- onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
- id = "'. $ data-> id_master_additional_order_unit.'"
- nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
- })
- -> addColumn ('details_url', fungsi ($ data) {
- kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
- })
- -> buat (benar);
- }
- perincian fungsi awamAdditionalOrderJson ($ id, DetailAdditionalOrderRepository $ detailAdditionalOrderRepository)
- {
- $ cache_name = 'datatable-detail-extraOrderJson-id -'. $ id;
- $ data = Cache :: ingat ($ cache_name, 10, fungsi () gunakan ($ detailAdditionalOrderRepository, $ id, $ cache_name) {
- CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => sesi () -> get ('user') ['id_user']]);
- pulangkan $ detailAdditionalOrderRepository-> getByIdMaster ($ id);
- });
- mengembalikan Datatables :: of ($ data) -> make (true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement