Advertisement
Hafixie93

Additional data collaboration

Dec 10th, 2020 (edited)
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 8.84 KB | None | 0 0
  1. <? php
  2.  
  3. namespace App \ Http \ Controllers;
  4.  
  5. gunakan App \ Repository \ Eloquent \ DetailAdditionalOrderRepository;
  6. gunakan App \ Repository \ Eloquent \ MasterAdditionalOrderRepository;
  7. gunakan Illuminate \ Support \ Facades \ Cache;
  8. gunakan Yajra \ Datatables \ Datatables;
  9. gunakan App \ Models \ Cache sebagai CacheModel;
  10.  
  11. kelas TambahanOrderDatatablesController meluaskan Pengawal
  12. {
  13.     fungsi awam tambahanOrderJsonDraft (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
  14.     {
  15.         $ idUser = session () -> get ('user') ['id_user'];
  16.         $ idDealer = session () -> get ('user') ['id_dealer'];
  17.         $ cache_name = 'datatable-extraOrderJsonDraft-idUser -'. $ idUser;
  18.         $ datas = Cache :: ingat ($ cache_name, 10,
  19.         fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
  20.             CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
  21.             pulangkan $ masterAdditionalOrderRepository-> getDraft ($ idDealer);
  22.         });
  23.  
  24.         mengembalikan Datatables :: of ($ datas)
  25.         -> addColumn ('action', function ($ data) {
  26.             kembali '<input type = "checkbox" class = "new-control-input checkId"
  27.            onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
  28.            id = "'. $ data-> id_master_additional_order_unit.'"
  29.            nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
  30.         })
  31.         -> addColumn ('details_url', fungsi ($ data) {
  32.             kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
  33.         })
  34.         -> buat (benar);
  35.     }
  36.  
  37.     fungsi awam tambahanOrderJsonWaitingApprovalDealerPrinciple (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
  38.     {
  39.         $ idUser = session () -> get ('user') ['id_user'];
  40.         $ idDealer = session () -> get ('user') ['id_dealer'];
  41.         $ cache_name = 'datatable-extraOrderJsonWaitingApprovalDealerPrinciple-idUser -'. $ idUser;
  42.         $ datas = Cache :: ingat ($ cache_name, 10,
  43.         fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
  44.             CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
  45.             pulangkan $ masterAdditionalOrderRepository-> getWaitingApprovalDealerPrinciple ($ idDealer);
  46.         });
  47.  
  48.         mengembalikan Datatables :: of ($ datas)
  49.         -> addColumn ('action', function ($ data) {
  50.             kembali '<input type = "checkbox" class = "new-control-input checkId"
  51.            onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
  52.            id = "'. $ data-> id_master_additional_order_unit.'"
  53.            nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
  54.         })
  55.         -> addColumn ('details_url', fungsi ($ data) {
  56.             kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
  57.         })
  58.         -> buat (benar);
  59.     }
  60.  
  61.     fungsi awam tambahanOrderJsonApprovalDealerPrinciple (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
  62.     {
  63.         $ idUser = session () -> get ('user') ['id_user'];
  64.         $ idDealer = session () -> get ('user') ['id_dealer'];
  65.         $ cache_name = 'datatable-extraOrderJsonApprovalDealerPrinciple-idUser -'. $ idUser;
  66.         $ datas = Cache :: ingat ($ cache_name, 10,
  67.         fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
  68.             CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
  69.             pulangkan $ masterAdditionalOrderRepository-> getApprovalDealerPrinciple ($ idDealer);
  70.         });
  71.  
  72.         mengembalikan Datatables :: of ($ datas)
  73.         -> addColumn ('action', function ($ data) {
  74.             kembali '<input type = "checkbox" class = "new-control-input checkId"
  75.            onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
  76.            id = "'. $ data-> id_master_additional_order_unit.'"
  77.            nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
  78.         })
  79.         -> addColumn ('details_url', fungsi ($ data) {
  80.             kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
  81.         })
  82.         -> buat (benar);
  83.     }
  84.  
  85.     fungsi awam tambahanOrderJsonSubmittedATPM (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
  86.     {
  87.         $ idUser = session () -> get ('user') ['id_user'];
  88.         $ idDealer = session () -> get ('user') ['id_dealer'];
  89.         $ cache_name = 'datatable-extraOrderJsonSubmittedATPM-idUser -'. $ idUser;
  90.         $ datas = Cache :: ingat ($ cache_name, 10,
  91.         fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
  92.             CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
  93.             pulangkan $ masterAdditionalOrderRepository-> getSubmittedATPM ($ idDealer);
  94.         });
  95.  
  96.         mengembalikan Datatables :: of ($ datas)
  97.         -> addColumn ('action', function ($ data) {
  98.             kembali '<input type = "checkbox" class = "new-control-input checkId"
  99.            onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
  100.            id = "'. $ data-> id_master_additional_order_unit.'"
  101.            nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
  102.         })
  103.         -> addColumn ('details_url', fungsi ($ data) {
  104.             kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
  105.         })
  106.         -> buat (benar);
  107.     }
  108.  
  109.     fungsi awam tambahanOrderJsonATPMAllocation (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
  110.     {
  111.         $ idUser = session () -> get ('user') ['id_user'];
  112.         $ idDealer = session () -> get ('user') ['id_dealer'];
  113.         $ cache_name = 'datatable-extraOrderJsonATPMAllocation-idUser -'. $ idUser;
  114.         $ datas = Cache :: ingat ($ cache_name, 10,
  115.         fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
  116.             CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
  117.             pulangkan $ masterAdditionalOrderRepository-> getATPMAllocation ($ idDealer);
  118.         });
  119.  
  120.         mengembalikan Datatables :: of ($ datas)
  121.         -> addColumn ('action', function ($ data) {
  122.             kembali '<input type = "checkbox" class = "new-control-input checkId"
  123.            onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
  124.            id = "'. $ data-> id_master_additional_order_unit.'"
  125.            nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
  126.         })
  127.         -> addColumn ('details_url', fungsi ($ data) {
  128.             kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
  129.         })
  130.         -> buat (benar);
  131.     }
  132.  
  133.     fungsi awam tambahanOrderJsonCanceled (MasterAdditionalOrderRepository $ masterAdditionalOrderRepository)
  134.     {
  135.         $ idUser = session () -> get ('user') ['id_user'];
  136.         $ idDealer = session () -> get ('user') ['id_dealer'];
  137.         $ cache_name = 'datatable-extraOrderJsonCanceled-idUser -'. $ idUser;
  138.         $ datas = Cache :: ingat ($ cache_name, 10,
  139.         fungsi () gunakan ($ masterAdditionalOrderRepository, $ idUser, $ idDealer, $ cache_name) {
  140.             CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => $ idUser]);
  141.             pulangkan $ masterAdditionalOrderRepository-> getCanceledAdditionalOrder ($ idDealer);
  142.         });
  143.  
  144.         mengembalikan Datatables :: of ($ datas)
  145.         -> addColumn ('action', function ($ data) {
  146.             kembali '<input type = "checkbox" class = "new-control-input checkId"
  147.            onclick = "updateCheck ('. $ data-> id_master_additional_order_unit.')"
  148.            id = "'. $ data-> id_master_additional_order_unit.'"
  149.            nilai = "'. $ data-> id_master_additional_order_unit.'"> ';
  150.         })
  151.         -> addColumn ('details_url', fungsi ($ data) {
  152.             kembali url ('datatable / detailAdditionalOrderJson /'. $ data-> id_master_additional_order_unit);
  153.         })
  154.         -> buat (benar);
  155.     }
  156.  
  157.     perincian fungsi awamAdditionalOrderJson ($ id, DetailAdditionalOrderRepository $ detailAdditionalOrderRepository)
  158.     {
  159.         $ cache_name = 'datatable-detail-extraOrderJson-id -'. $ id;
  160.         $ data = Cache :: ingat ($ cache_name, 10, fungsi () gunakan ($ detailAdditionalOrderRepository, $ id, $ cache_name) {
  161.             CacheModel :: firstOrCreate (['cache_name' => $ cache_name, 'id_user' => sesi () -> get ('user') ['id_user']]);
  162.             pulangkan $ detailAdditionalOrderRepository-> getByIdMaster ($ id);
  163.         });
  164.  
  165.         mengembalikan Datatables :: of ($ data) -> make (true);
  166.     }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement