"; else echo " No Picture";}; function pic2($path,$pict,$atrib){global $site_url;if (file_exists("./".$path.$pict)) return ""; else return "";}; function striptags($str) { if ( strstr($str, ">") AND strstr($str, "'); $str=substr($str, $from+1); }; return $str; }; function adr2var($striplex) { $striplex=str_replace('_',' ',$striplex); $striplex=str_replace('plus','+',$striplex); $striplex=str_replace(' and ',' & ',$striplex); return $striplex; }; function var2adr($striplex) { $striplex=str_replace('"','',$striplex); $striplex=str_replace('“','',$striplex); $striplex=str_replace('”','',$striplex); $striplex=str_replace(',','',$striplex); $striplex=str_replace(' - ','_',$striplex); $striplex=str_replace(' ','_',$striplex); $striplex=str_replace('_&_','_and_',$striplex); $striplex=str_replace('+','plus',$striplex); $striplex=str_replace('/','',$striplex); return $striplex; }; function pricedspl($price) { $price=""; return $price; } function plural($cnt) { if ($cnt>1) return 's'; } function avail($txt) { if (!$txt) return 'N/A'; return $txt; } function weather($where) { if (!$where) $where='st_id=2&st_id=3&st_id=15'; else $where='st_id='.implode($where,'&st_id='); ?>
 
 
 

 
"; return $startxt; }; function fontcolor($str) { if (strstr($str, "#")) { $pos=strpos($str, "#")+1; $col=substr($str, $pos, 6); }; return $col; }; function fontsize($str) { if ( strstr($str, "size:") AND strstr($str, "pt")) { $to=strpos($str, "pt"); $str=substr($str, 0, $to); $from=strrpos($str, 'size:'); $str=substr($str, $from+6); }; return $str; }; function fontbold($str) { if ( strstr($str, "") AND strstr($str, "")) return '1'; }; function showhide($switch,$what,$ID) { if ($switch) $act='SHOW'; else $act='HIDE'; echo "".$act.""; }; function editmod($what,$ID) { echo "EDIT"; }; function addnew($what) { echo "ADD NEW ".strtoupper(adr2var($what)).""; }; function delold($what,$ID) { echo "DEL"; }; function num2lang($LID) { switch ($LID) { case 1: return "€ EUR"; case 2: return "$ USD"; case 3: return "£ GBP"; case 4: return "lv BGN"; }; }; function checkpic($pict,$atrib){ if (file_exists($pict)) echo "Edit Picture"; else echo "Add Picture";}; function showpic($path,$pict,$atrib) { global $site_url; if (($pict) AND (file_exists($path.$pict))) echo ""; }; /*function form_vote($caption,$name,$value) { echo " $caption:  "; for ($i=1;$i<6;$i++) { $sl=''; if ($value==$i) $sl='checked'; echo ""; }; echo " "; }; */ function form_vote($caption,$name,$value) { echo " $caption:  "; for ($i=1;$i<6;$i++) { $sl=''; if ($value==$i) $sl='checked'; echo ""; }; echo "
"; }; function form_pass($caption,$name,$value,$size,$maxlength) { echo " $caption:  "; }; function form_text($caption,$name,$value,$size,$maxlength) { echo " $caption:  "; }; function form_textarea($caption,$name,$value,$rows,$cols) { echo " $caption:    "; }; function form_textarea_row($caption,$name,$value,$rows,$cols) { echo " $caption:  "; }; function form_text_text($name1,$value1,$size1,$maxlength1,$name2,$value2,$size2,$maxlength2) { echo "   "; }; function form_text_textarea($caption,$name1,$value1,$size,$maxlength,$name2,$value2,$rows,$cols) { echo " $caption:  "; }; function form_checkbox($caption,$name,$value,$val) { echo " $caption "; }; function form_checkboxes_query($query,$name,$letter,$caption,$value) { $i=0; dbcon(); $res=mysql_query("$query"); mysql_error(); //echo "$query"; while ($row=mysql_fetch_assoc($res)) { $i++; echo " ".$row[$caption]." "; }; /*echo " ";*/ }; function form_select_query($query,$caption,$name,$value,$val_fld,$cap_fld1,$cap_fld2,$sep) { dbcon(); $res=mysql_query("$query"); mysql_error(); //echo "$query"; echo " $caption:  "; }; function form_select_query_multiple($query,$caption,$name,$value,$val_fld,$cap_fld1,$cap_fld2,$sep) { dbcon(); $res=mysql_query("$query"); mysql_error(); //echo "$query"; echo " $caption:  "; }; function form_select_array($masiv,$caption,$name,$value) { echo " $caption:  "; }; function form_select_array_multiple($masiv,$caption,$name,$value) { echo " $caption:  "; }; function form_radio($masiv,$caption,$name,$value) { echo " $caption:  "; while (list($key,$val)=each($masiv)) { echo "".$val.'
'; }; echo " "; }; function form_cal($form,$caption,$dval,$mval,$yval,$seldate) { $masdate=explode('-',$seldate); $yeardate=(int)$masdate['0']; $monthdate=(int)$masdate['1']; $daydate=(int)$masdate['2']; if (!$daydate) $$dval = date ("d", mktime (0,0,0,date("m") ,date("d") , date("Y"))); else $$dval=$daydate; if (!$monthdate) $$mval = date ("m", mktime (0,0,0,date("m") ,date("d") , date("Y"))); else $$mval=$monthdate; if (!$yeardate) $$yval = date ("Y", mktime (0,0,0,date("m") ,date("d") , date("Y"))); else $$yval=$yeardate; echo " $caption:  "; calgen($form,$dval,$mval,$yval,$$dval,$$mval,$$yval); echo " "; }; function calinit() {global $site_main; ?> "; echo ""; $mas[1]="January"; $mas[2]="February"; $mas[3]="March"; $mas[4]="April"; $mas[5]="May"; $mas[6]="June"; $mas[7]="July"; $mas[8]="August"; $mas[9]="September"; $mas[10]="October"; $mas[11]="November"; $mas[12]="December"; echo ""; echo ""; ?> callendar "; for ($i=$from;$i<=$to;$i++) if ($value!=$i) echo ""; else echo ""; echo ""; }; function sql2dat($indata) { $data=strtotime($indata); $dat['day']=date('d',$data); $dat['month']=date('m',$data); $dat['year']=date('Y',$data); return $dat; } function DaysBetween( $date1, $date2 ) { return ( date( "Y", $date1 ) * 366 + date( "z", $date1 ) ) - ( date( "Y", $date2 ) * 366 + date( "z", $date2 ) ); }; function getDaysInMonth($month=null,$year=null) { if ($month==null) { $month = date("n",time()); } if ($year=null) { $year = date("Y",time()); } $dim = date( "j", mktime(0, 0, 0, $month + 1, 1, $year) - 1 ); return $dim; } function rescal($year,$fd,$td) { echo ""; $cy=2003;$clr="green"; for ($cm=1; $cm<=12;$cm++) { if ($cm==1 or $cm==5 or $cm==9) echo ""; echo ""; if ($cm==4 or $cm==8 or $cm==12) echo ""; } echo "
"; $otm=date ("w", mktime (0,0,0,$cm,1,$cy)); echo "\n"; echo " "; if ($otm>0) echo "\n"; for ($cd=1; $cd<=date ("t",mktime (0,0,0,$cm,1, $cy));$cd++) { $dc="$cy-".str_pad($cm,2,"0",STR_PAD_LEFT)."-".str_pad($cd,2,"0",STR_PAD_LEFT); reset($fd); reset($td); while (list($kk,$vv)=each($fd)) if (strtotime($dc)==strtotime($vv)) $clr="red"; echo "\n"; if (($cd+$otm)%7==0) {echo "\n\n\n\n";$nn=0;}; $nn++; while (list($kk,$vv)=each($td)) if (strtotime($dc)==strtotime($vv)) $clr="green"; }; $nn=8-$nn; if ($nn>1) echo "\n"; echo "
".date ("F", mktime (0,0,0,$cm,1,$cy))."
SU MO TU WE TH FR SA
 ".str_pad($cd,2,"0",STR_PAD_LEFT)."
 
"; echo "
"; }; function fld_validate($value,$obl,$length,$contain,$caption,$errmsg) { if (($obl) AND (!$value)) $res[$errmsg]=''; else if (($length) AND (strlen($value)<$length)) $res[$errmsg]=''; else if (($contain) AND (!strstr ($value, $contain))) $res[$errmsg]=''; else if ($value) $res['']="$caption : $value"; else $res['']=''; return $res; }; function date_validate($dval,$mval,$yval,$datecaption,$obl) { $dcur = date ("d", mktime (0,0,0,date("m") ,date("d") , date("Y"))); $mcur = date ("m", mktime (0,0,0,date("m") ,date("d") , date("Y"))); $ycur = date ("Y", mktime (0,0,0,date("m") ,date("d") , date("Y"))); if (($obl) AND ((($mval<$mcur) AND ($yval==$ycur)) OR ($yval<$ycur) OR (($dval<=$dcur) AND ($mval==$mcur)))) $res['Bitte wählen '.$datecaption.'.']=''; else if ((($mval<$mcur) AND ($yval==$ycur)) OR ($yval<$ycur) OR (($dval<=$dcur) AND ($mval==$mcur))) $res['']=''; else $res['']="".ucfirst($datecaption)." : $dval / $mval / $yval"; return $res; }; function date_sequence($d1,$m1,$y1,$d2,$m2,$y2,$caption1,$caption2) { if ((($m2<$m1) AND ($y2==$y1)) OR ($y2<$y1) OR (($d2<=$d1) AND ($m2==$m1))) $res['Bitte wählen dates - '.$caption2.' is before '.$caption1.'.']=''; else $res['']=''; return $res; }; function echogen($title,$value) { echo "$title $value "; }; ?>