Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $user_id = $_POST['user_id'];
- $month = $_POST['month'];
- $year = $_POST['year'];
- $numberOfDaysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
- $weekDays = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
- for($i=0;$i<$numberOfDaysInMonth;$i++){
- $NewDate= date('01') + $i . '/' . $month . '/' . $year;
- $y = date('w');
- $monthlyHour[$i] = new myClass();
- $monthlyHour[$i]->user_id= $user_id;
- $monthlyHour[$i]->tp = 10;
- $monthlyHour[$i]->days= $weekDays[$y];
- $monthlyHour[$i]->date= $NewDate;
- $monthlyHour[$i]->working_hours = 5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement