Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. error_reporting(-1);
  3. ini_set('display_errors', 'On');
  4.  
  5. //echo $_POST['currentDay'];
  6. class OreGiorno {
  7. public $id_nominativo;
  8. public $tp;
  9. public $data;
  10. public $ore_lavorate;
  11. }
  12.  
  13. $hMese=array();
  14. $user_id = $_POST['id_operatore'];
  15. $month = $_POST['currentMonth'];
  16. $year = $_POST['currentYear'];
  17.  
  18. $numberOfDaysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
  19. $x = $numberOfDaysInMonth;
  20.  
  21. for($i=0;$i<=$x;$i++){
  22. $NuovaData = date('01') + $i . '/' . $month . '/' . $year;
  23. $hMese[$i] = new OreGiorno();
  24. $hMese[$i]->id_nominativo = $user_id;
  25. $hMese[$i]->tp = 10;
  26. $hMese[$i]->data = $NuovaData;
  27. $hMese[$i]->ore_lavorate = 5;
  28. }
  29. echo json_encode($hMese);
  30. //var_dump($week);
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement