global.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\models;
  3. echo "Global!";
  4. if ( $addwork == 5) {
  5. $serviceModel = new \app\models\ServiceModel;
  6. $params = [];
  7. $params['place'] = 'a84d0a15-08ec-11e5-829d-00155d6cab05';
  8. $params['date'] = '1562077752';
  9. $res = \app\models\Api::getSectionList($params);
  10. $res = json_decode($res)->array;
  11. $params = $res[0];
  12. $r = $serviceModel->addWokrWeb($params);
  13. //$r = $res->getPositions();
  14. /*
  15. $employeesModel = new \app\models\EmployeesModel;
  16. $params['placeOfRepair'] = 'a84d0a15-08ec-11e5-829d-00155d6cab05';
  17. $res = $employeesModel->getWorkers($params);
  18. $res = json_decode($res);
  19. $res = $res->array;
  20. $positionsArray = [];
  21. foreach( $res as $r){
  22. $positionsArray[] = $r->Position;
  23. }
  24. $posit = [];
  25. $i = 0 ;
  26. foreach( $r as $pos){
  27. if( in_array($pos->Position, $positionsArray) ){
  28. $posit[] = $pos->Position;
  29. $i++;
  30. }
  31. }
  32. echo $i;
  33. */
  34. echo '<pre>'; var_dump($r); echo '</pre>';
  35. }
  36. ?>
  37. <input name="New" type="button" id="New" onClick="addNewWork()" value="Создать Братск">