Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. public function postDet($idx,$id)
  2. {
  3. $dats = $this->ino_logistic_instruction->getDetLI($idx,$id);
  4.  
  5. $data = $this->ino_logistic_instruction->GetAll(['_id' => $id,'id_transfer' => $idx]);
  6.  
  7. $transporter = $this->ino_contractor->GetAll(['_id' => $dats['issued_to']]);
  8. if(count($transporter) > 0){
  9. foreach($transporter as $idx => $contr){
  10. $data[$idx]['contractor'] = $contr['name'];
  11. }
  12. }
  13.  
  14. $bill = $this->ino_logistic_instruction->getBillName($dats['issued_invoice_to']);
  15. if(count($bill) > 0){
  16. foreach($bill as $idx => $item){
  17. $data[$idx]['billing'] = $item['name'];
  18. }
  19. }
  20.  
  21. $customer = $this->ino_client->GetAll(['_id' => $dats['customer']]);
  22. if(count($customer) > 0){
  23. foreach($customer as $idx => $cust){
  24. $data[$idx]['customer_name'] = $cust['name'];
  25. }
  26. }
  27.  
  28. $from_yard = $this->ino_yard->GetAll(['_id' => $dats['from']]);
  29. if(count($from_yard) > 0){
  30. foreach($from_yard as $idx => $froms_y){
  31. $data[$idx]['from_name'] = $froms_y['name'];
  32. }
  33. }
  34.  
  35. $to_yard = $this->ino_yard->GetAll(['_id' => $dats['to']]);
  36. if(count($to_yard) > 0){
  37. foreach($to_yard as $idx => $tos_y){
  38. $data[$idx]['to_name'] = $tos_y['name'];
  39. }
  40. }
  41.  
  42. $from_port = $this->ino_port->GetAll(['_id' => $dats['from']]);
  43. if(count($from_port) > 0){
  44. foreach($from_port as $idx => $froms_p){
  45. $data[$idx]['from_name'] = $froms_p['name'];
  46. }
  47. }
  48.  
  49. $to_port = $this->ino_port->GetAll(['_id' => $dats['to']]);
  50. if(count($to_port) > 0){
  51. foreach($to_port as $idx => $tos_p){
  52. $data[$idx]['to_name'] = $tos_p['name'];
  53. }
  54. }
  55.  
  56. $this->setJson($data);
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement