* @author yuji TAKAHASHI */ // // getCalendar // // 年月を与えると曜日を配列で返す // function getCalendar($year, $month) { $day = 1; while (checkdate($month, $day, $year)) { $ar_cal[$day - 1] = Date("w", mktime(0, 0, 0, $month, $day, $year)); $day++; } return $ar_cal; } // // getScheduleCount // // DBから一月の各日付のスケジュール数を配列にして返す // function getScheduleCount ($con, $year, $month, $emp, $phpAuthUser,$dbSqlObj,$dbExecObj) { $sqlstr = $dbSqlObj->selectScheduleCalendar($year,$month,$emp,$phpAuthUser); $result = $dbExecObj->exeSql($con, $sqlstr); $i=0; $j=0; while (checkdate($month, $i+1, $year) && $j < $dbExecObj->getNumRows($result)) { if (intval($dbExecObj->getResult($result, $j, "sday")) == $i + 1) { $ar_scdl_count[$i] = $dbExecObj->getResult($result, $j, "count_of_records"); $j++; } else { $ar_scdl_count[$i] = 0; } $i++; } $dbExecObj->freeResult($result); return $ar_scdl_count; } ?>