Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $user_id = $_POST['user_id'];
  2.  
  3. $month = $_POST['month'];
  4.  
  5. $year = $_POST['year'];
  6.  
  7. $numberOfDaysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
  8.  
  9.  
  10. $weekDays = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
  11.  
  12. for($i=0;$i<$numberOfDaysInMonth;$i++){
  13. $NewDate= date('01') + $i . '/' . $month . '/' . $year;
  14. $y = date('w');
  15. $monthlyHour[$i] = new myClass();
  16. $monthlyHour[$i]->user_id= $user_id;
  17. $monthlyHour[$i]->tp = 10;
  18. $monthlyHour[$i]->days= $weekDays[$y];
  19. $monthlyHour[$i]->date= $NewDate;
  20. $monthlyHour[$i]->working_hours = 5;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement