X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=common.php;h=240ad2036726dbc3b3666ce7b6edb9398670f2f7;hb=59f504817c1232087c78af574696b0de7093edc0;hp=59a765ec6155b47a916b3e313ad9d34010d93588;hpb=ffd3bd41d1a0f91013b1e225051421de692de792;p=www.energie.vellum.cz.git diff --git a/common.php b/common.php index 59a765e..240ad20 100644 --- a/common.php +++ b/common.php @@ -1,6 +1,8 @@ '."\n"; + $head.=''."\n"; $user_agent=(!isset($HTTP_SERVER_VARS["HTTP_USER_AGENT"]) ? "" : $HTTP_SERVER_VARS["HTTP_USER_AGENT"]); if (ereg("[[:<:]]MSIE ([0-9]+)\\.",$user_agent,$msie_major_a)) @@ -28,6 +30,19 @@ $have_style=!isset($mozilla_major) || $mozilla_major!=4; $have_css=true; // doesn't hurt anybody AFAIK +function fixampvars() +{ + $ars=array("HTTP_GET_VARS","HTTP_POST_VARS"); + foreach ($ars as $ar) { + foreach ($GLOBALS[$ar] as $key=>$val) { + if (substr($key,0,4)!="amp;") + continue; + unset($GLOBALS[$ar][$key]); + $GLOBALS[$ar][substr($key,4)]=$val; + } + } +} + function addpercents($url) { $r=$c=""; @@ -49,7 +64,7 @@ function fatal($msg="UNKNOWN") footer(); } -function prepvar($name,$regex=".",$require=true) +function prepvar($name,$regex=".*",$require=true) { global $HTTP_GET_VARS,$HTTP_POST_VARS; @@ -167,14 +182,16 @@ function img_size($width,$height) function img($file,$alt,$attrs="") { - list($width,$height)=getimagesize($file); - return("\"".htmlspecialchars($alt)."\""); } function gsm_banking() { - return(img("img/sluzby_bankovni_pggsm.gif","Paegas GSM banking","class=\"img-align\"")); + return(img("img/sluzby_bankovni_pggsm.".(image_supported("video/x-mng") ? "mng" : "gif"), + "Paegas GSM banking","class=\"img-align\"")); } function price_a() @@ -354,6 +371,246 @@ function img_href($filename,$text) return(data_href($filename,$text,", ${width}x${height} bodù")); } +function print_pdf_layout($name,$base) +{ + $imgfmt=(image_supported("image/png") ? "png" : "gif"); + ?> +

Shodný je dostupný ve dvou rùzných formátech souboru. V pøípadì, +¾e nemáte/nechcete instalovat +Adobe Acrobat Reader, +zvolte prosím druhou mo¾nost:

+ + + +
+
    + +
  • + + + + +
    ".img("img/adobe-pdficon-alpha.".(image_supported("image/png") ? "png" : "gif"), + "Adobe PDF").""); ?>
    +
    + + + + +
    Soubor je ve formátu Adobe Acrobat, + pro jeho pøeètení si prosím nainstalujte + Adobe Acrobat Reader.
    +
    +
  • + +
  • + +
  • + +
+Zpìt" èi " + .""Back" prohlí¾eèe)" + : "\" onclick=\"history.back()\" />") + ); +} + +// Data acquision error checking: +function datacheck_fail() +{ + print("

Nyní se prosím ".return_back("vra»te zpìt") + ." na pøedchozí stránku a chybu zadaných dat opravte.

\n"); + footer(); +} + +function mail_data($title,$data) +{ + global $admin_mail,$mail_to; + + // 5th mail argument is supported from PHP-4.0.5 + return (!mail($mail_to,"EnergieWeb: $title",$data, +"From: EnergieWeb <$admin_mail> +Mime-Version: 1.0 +Content-Type: text/plain; charset=iso-8859-2 +Content-Disposition: inline +Content-Transfer-Encoding: 8bit +")); +} + +function gsm_row($name,$value) +{ + return("$name" + ."".($value=="" ? "neuvádìjte" : $value)."" + ."".strtr($value,"/.","#*")."\n"); +} + +function gsm_table($total,$varsym) +{ + global $firma_ucet,$firma_konstsym,$firma_specsym; + + return("
\n" + ."\n" + .gsm_row("Èíslo úètu",$firma_ucet) + .gsm_row("Èástka",sprintf("%.2f",$total)) + .gsm_row("Konstantní symbol",$firma_konstsym) + .gsm_row("Variabilní symbol",$varsym) + .gsm_row("Specifický symbol",$firma_specsym) + ."
polo¾kabankovní pøíkaz".gsm_banking()."
\n" + ); +} + +function return_to_homepage() +{ + global $HTTP_SERVER_VARS; + + return("

Nyní se mù¾ete vrátit na úvodní stránku.

\n"); +} + +function input_text($name,$size,$default_value="",$addons="") +{ + $r=""; + return($r); +} + +function print_form_radkova_inzerce($readonly,$total,$submit_name,$submit_value) +{ + global $have_js,$text,$doklad; + + $addons=(!$readonly ? "" : " readonly=\"readonly\""); + ?> +
+
+ + + + +
+ + + + + + +
Text inzerátu
" + .(!isset($text) ? "" : htmlspecialchars(trim($text))) + .""); + ?>

Celková cena: +
+ + + + + + + + +
Název firmy / Jméno:
Úplná adresa:
Telefon:
IÈO:DIÈ
Zaslat daòový doklad?"disabled" for them) + .($readonly ? "" : " onclick=\"sum_total(this)\"") + .(!($have_js || $readonly) ? "" : " disabled=\"disabled\"") + .(!isset($doklad) ? "" : " checked=\"checked\"") + .ereg_replace(" readonly=\"readonly\"","",$addons)." />"); + ?>
Poèet zveøejnìní:e-mail:
"); + ?>
+
+