$name = "Sök"; ?> include "f_header.php"; ?> include "f_top.php"; ?> include "f_top2.php"; ?> //session_start(); /* function GetDay() { $today = getdate(); if ($today["weekday"] == 'Sunday') { return 1; } else if ($today["weekday"] == 'Saturday') { return 2; } else { return 0; } } */ function GetTodayIndex() { $today = getdate(); if ($today["weekday"] == 'Monday') { return 1; } else if ($today["weekday"] == 'Tuesday') { return 2; } else if ($today["weekday"] == 'Wednesday') { return 3; } else if ($today["weekday"] == 'Thursday') { return 4; } else if ($today["weekday"] == 'Friday') { return 5; } else if ($today["weekday"] == 'Saturday') { return 6; } else { return 7; } } function GetTodayName($index) { if ($index == 1) { return "Måndag"; } else if ($index == 2) { return "Tisdag"; } else if ($index == 3) { return "Onsdag"; } else if ($index == 4) { return "Torsdag"; } else if ($index == 5) { return "Fredag"; } else if ($index == 6) { return "Lördag"; } else { return "Söndag"; } } function GetToday($openmf, $opentis, $openons, $opentor, $openfre, $openl, $opens) { $today = getdate(); if ($today["weekday"] == 'Monday') { return $openmf; } else if ($today["weekday"] == 'Tuesday') { return $opentis; } else if ($today["weekday"] == 'Wednesday') { return $openons; } else if ($today["weekday"] == 'Thursday') { return $opentor; } else if ($today["weekday"] == 'Friday') { return $openfre; } else if ($today["weekday"] == 'Saturday') { return $openl; } else { return $opens; } } function GetTomorrow($openmf, $opentis, $openons, $opentor, $openfre, $openl, $opens) { $today = getdate(); if ($today["weekday"] == 'Monday') { return $opentis; } else if ($today["weekday"] == 'Tuesday') { return $openons; } else if ($today["weekday"] == 'Wednesday') { return $opentor; } else if ($today["weekday"] == 'Thursday') { return $openfre; } else if ($today["weekday"] == 'Friday') { return $openl; } else if ($today["weekday"] == 'Saturday') { return $opens; } else { return $openmf; } } function GetYesterday($openmf, $opentis, $openons, $opentor, $openfre, $openl, $opens) { $today = getdate(); if ($today["weekday"] == 'Monday') { return $opens; } else if ($today["weekday"] == 'Tuesday') { return $openmf; } else if ($today["weekday"] == 'Wednesday') { return $opentis; } else if ($today["weekday"] == 'Thursday') { return $openons; } else if ($today["weekday"] == 'Friday') { return $opentor; } else if ($today["weekday"] == 'Saturday') { return $openfre; } else { return $openl; } } function GetDay() { $today = getdate(); if ($today["weekday"] == 'Saturday') { return 1; } else if ($today["weekday"] == 'Sunday') { return 2; } else { return 0; } } function CheckIfToday($val, $day) { if (GetDay() == $day) { ?> } else { ?> } } function WriteToFile($strTxt) { $filename = 's.log'; if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { // echo "Cannot open file ($filename)"; exit; } $ip = $_SERVER['REMOTE_ADDR']; $currentTime = date("Y-m-d H:i"); $txtToWrite = $ip." \t ".$currentTime." \t ".$strTxt."\r\n"; // Write $somecontent to our opened file. if (fwrite($handle, $txtToWrite) === FALSE) { //echo "Cannot write to file ($filename)"; exit; } //echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } } function CheckAcodeMini($dispValue) { If (strlen($dispValue) == 0) { return "Saknas"; } else { //if (strlen($_SESSION['acode'])>0) { return $dispValue; //} else { // return "*Kod"; } } function CheckTxt($searchTxt) { //global $searchTxt; if (strlen($searchTxt)==0 && $_GET["p"] == "showall") { $searchTxt = "%"; } if (strlen($searchTxt)>0) { require("dbInfo.php"); mysql_connect($serverpath, $usern, $passw); @mysql_select_db($database) or die( "Unable to select database"); if ($searchTxt<>'%') WriteToFile($searchTxt); $query="SELECT * from companies where region='tornby' and active = 1 and (name like '%$searchTxt%' or searchwords like '%$searchTxt%') order by name"; $result=mysql_query($query); $num=mysql_numrows($result); ?>
} if ($num > 1) { ?> | } ?> |
|
|
|
|
|
|||
0 träffar. |
|
|
|