conn_tr,"SELECT DOGOVOR FROM companies cs where cs.id=".intval($uid)); $user_info = ibase_fetch_assoc($res); if ($user_info['DOGOVOR'] == 1) { return true; } else { return false; } } function getSettings($cid) { global $amf; $res = ibase_query($amf->conn_tr,"SELECT * FROM CS_CLIENT_SETTINGS cs where cs.CID=".$_SESSION['UID']); $user_settings = ibase_fetch_assoc($res); ibase_free_result($res); if (isset($user_settings['CID'])) { $_SESSION['AUTO_PRINT']=$user_settings['PRINT_AUTO']; $_SESSION['PRINTER']=$user_settings['PRINT_NAME']; $_SESSION['PRINT_LABEL']=$user_settings['PRINT_LABEL']; } } function getAddressCount($uid) { global $amf; $count_query = "SELECT count(*) FROM caddress ca WHERE ca.cid= ".$uid; $count_result = ibase_query($amf->conn_tr,$count_query); $count_data = ibase_fetch_assoc($count_result); return intval($count_data['COUNT']); } function draw_calendar($month=null,$year=null){ $month_big[1] = 'Януари'; $month_big[2] = 'Февруари'; $month_big[3] = 'Март'; $month_big[4] = 'Април'; $month_big[5] = 'Май'; $month_big[6] = 'Юни'; $month_big[7] = 'Юли'; $month_big[8] = 'Август'; $month_big[9] = 'Септември'; $month_big[10] = 'Октомври'; $month_big[11] = 'Ноември'; $month_big[12] = 'Декември'; if ($month == null) {$month = date('n');} if ($year == null) {$year = date('Y');} /* draw table */ $calendar = ''; $calendar.= ''; $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.= ''; 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.= '
'.$month_big[$month].' '.$year.'
Пон Вто Сря Чет Пет Съб Нед
'; } else if($running_day > 4) { $calendar.= ''; } else { $calendar.= '';} $calendar.= ''.$list_day.''; $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


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