'; $calendar.= ''.$month_big[$month].' '.$year.''; $calendar.= ' Пон Вто Сря Чет Пет Съб Нед '; $running_day = date('w',mktime(0,0,0,$month,1,$year)-1); $days_in_month = date('t',mktime(0,0,0,$month,1,$year)); $days_in_this_week = 1; $day_counter = 0; $dates_array = array(); $calendar.= ''; for($x = 0; $x < $running_day; $x++): $calendar.= ' '; $days_in_this_week++; endfor; for($list_day = 1; $list_day <= $days_in_month; $list_day++): if ($list_day == date('j')) { $calendar.= ''; } else if($running_day > 4) { $calendar.= ''; } else { $calendar.= '';} $calendar.= ''.$list_day.''; $calendar.= ''; if($running_day == 6): $calendar.= ''; if(($day_counter+1) != $days_in_month): $calendar.= ''; endif; $running_day = -1; $days_in_this_week = 0; endif; $days_in_this_week++; $running_day++; $day_counter++; endfor; if($days_in_this_week < 8): for($x = 1; $x <= (8 - $days_in_this_week); $x++): $calendar.= ' '; endfor; endif; $calendar.= ''; $calendar.= ''; return $calendar; } function curl_open($url, $data){ $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_TIMEOUT, 40); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, false);//show response header curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $ret = curl_exec ($ch); // execute the curl command if($error = curl_error($ch)){ return false; //echo date("d.m.Y H:i:s")."\n".'FAN CURL ERROR:'.print_r($error,true); } curl_close ($ch); return $ret; } ?> Express One


Клиентски модул