function parseCron($day, $month) { $today = array(); $today['day'] = date('d'); $today['month'] = date('m'); if (!findMatch(date('d'), split(',', $day))) { return false; } if (!findMatch(date('m'), split(',', $month))) { return false; } return true; }
foreach ($mp_RET as $sem => $mps) { foreach ($mps as $mp) { unset($periods_done[$to_move['STUDENT_ID']][$mp['MARKING_PERIOD_ID']][$to_move_course['PERIOD_ID']]); } } } elseif ($to_move_course['MP'] == 'SEM') { foreach ($mp_RET[$to_move_course['MARKING_PERIOD_ID']] as $mp) { unset($periods_done[$to_move['STUDENT_ID']][$mp['MARKING_PERIOD_ID']][$to_move_course['PERIOD_ID']]); } } else { unset($periods_done[$to_move['STUDENT_ID']][$to_move_course['MARKING_PERIOD_ID']][$to_move_course['PERIOD_ID']]); } //$periods_RET[$to_move['COURSE_ID']][$to_move['COURSE_WEIGHT']][$to_move_course['COURSE_PERIOD_ID']][1]['AVAILABLE_SEATS']++; unset($requests_undone[$request['STUDENT_ID']][$request['REQUEST_ID']]); $match[$request_id][] = $period; findMatch($match[$request_id], $request_id, $request); continue 2; } } } } } $c++; if ($c % 5000 == 0) { echo '1'; flush(); } } } echo "Done With Semesters 2nd Run\n\n"; echo '-->';
function calcRange($iparray) { //print_r($iparray); $iparray = array_unique($iparray); $iparray = array_map("ip2long", $iparray); sort($iparray); $iparray = array_map("long2ip", $iparray); $ip_begin = $iparray[0]; $ip_end = $iparray[count($iparray) - 1]; $ip_begin_bin = addZero(decbin(ip2long($ip_begin))); $ip_end_bin = addZero(decbin(ip2long($ip_end))); $ip_shortened = findMatch($ip_begin_bin, $ip_end_bin); $cidr_range = strlen($ip_shortened); $cidr_difference = 32 - $cidr_range; $cidr_begin = $ip_shortened . str_repeat('0', $cidr_difference); $cidr_end = $ip_shortened . str_repeat('1', $cidr_difference); $ip_count = bindec($cidr_end) - bindec($cidr_begin) + 1; return array('begin' => $ip_begin, 'end' => $ip_end, 'count' => $ip_count, 'shortened' => $ip_shortened, 'suffix' => $cidr_range); }