-
egon w. stemle authoredegon w. stemle authored
F_simplesearch.php 5.44 KiB
<div id="main">
<?php
// side bar
require('F_mainsidebar.php');
//$corpora = array("1215" => array("name" => "CORP1", "value" => "ids", "query" => "quevals"), "1415" => array("name" => "CORP2", "value" => "zwoids", "query" => "zwoquevals"), "215" => array("name" => "CORP3", "value" => "idos", "query" => "quevoals"));
$corpora = array();
if(isset($_SESSION['corpora'])){
$corpora = $_SESSION['corpora'];
}
//var_dump($corpora);
//echo $_SESSION['corpora'][0]['name'];
$selected_corp = '1215';
// check if a corpus was pre-selected
function process_post(){
if(isset($_POST)){
if(! empty($_POST['selected_corp'])){
return $_POST['selected_corp']-1;
}
else{
return '1215';
}
}
else{
return '1215';
}
}
$selected_corp = process_post();
function make_select($prefix, $name, $options, $selected, $trans, $long = 0) {
$result = $prefix . "<select " . ($long ? "class=\"shorten\" " : "class=\"wide\" ") . "name=\"" . $name
. "\" size=\"1\">\n";
if (preg_match("/1215/", $selected)) {
$sel = " selected=\"selected\"";
} else {
$sel = "";
}
$result .= $prefix . " <option value=\"full\"" . $sel . ">".$trans['full'][$_SESSION['lang']]."</option>\n";
if(! empty($options)){
foreach ($options as $k => $v) {
if ($selected == $k) {
$sel = " selected=\"selected\"";
} else {
$sel = "";
}
$result .= $prefix . " <option value=\"" . $k . "\"" . $sel . ">" . $v["name"]
. "</option>\n";
}
}
$result .= $prefix . "</select>\n";
return $result;
}
?>
<!--MAIN PART-->
<div id="mainpartwrapper">
<div id="mainpart">
<?php
require('F_searchmenu.php');
?>
<div id="content-menu">
<!--### IFRAME PART-->
<p class="boldp"><?php echo $trans['search_ph'][$_SESSION['lang']]; ?></p>
<!--NEW NEW NEW-->
<div style="width: 100%; overflow: hidden;">
<p><?php echo $trans['examples'][$_SESSION['lang']]; ?> <a href="#" onclick="document.forms['example1'].submit();"><i>welchen</i></a>, <a href="#" onclick="document.forms['example2'].submit();"><i>gli</i></a>, <a href="#" onclick="document.forms['example3'].submit();"><i>rád</i></a></p>
<form name="example1" action="index.php" method="post">
<input type="hidden" name="curscr" value="F_showkwic.php">
<input type="hidden" name="searchin" value="text">
<input type="hidden" name="setpage" value="1">
<input type="hidden" name="word" value="welchen">
<input type="hidden" name="cur_corpus" value="full">
</form>
<form name="example2" action="index.php" method="post">
<input type="hidden" name="curscr" value="F_showkwic.php">
<input type="hidden" name="searchin" value="text">
<input type="hidden" name="setpage" value="1">
<input type="hidden" name="word" value="gli">
<input type="hidden" name="cur_corpus" value="full">
</form>
<form name="example3" action="index.php" method="post">
<input type="hidden" name="curscr" value="F_showkwic.php">
<input type="hidden" name="searchin" value="text">
<input type="hidden" name="setpage" value="1">
<input type="hidden" name="word" value="rád">
<input type="hidden" name="cur_corpus" value="full">
</form>
<form action="index.php" method="post">
<p><input type="text" name="word" size="29" maxlength="100" /><input type="hidden" name="curscr" value="F_showkwic.php"><input type="hidden" name="setpage" value="1"><input class="bt" type="submit" value="<?php echo $trans['search_word'][$_SESSION['lang']]; ?>" /> <a href="#se111" onClick="toggle('#keyb','#img111')"><img src="img/1423252054_keyboard.png"> <img id="img111" src="img/toggle-expand.png"></a></p>
<div id="se111"></div>
<div id="keyb" class="content">
<iframe src="//www.virtualkeyboard.ws/plugin.shtml?lang=9" frameborder="0" marginheight="0" marginwidth="0" scrolling="yes" width="350" height="480" style="border:thin outset" sandbox>
Free virtual keyboard plugin from <a href="//www.virtualkeyboard.ws" target="_blank">virtualkeyboard.ws</a></iframe>
</div>
<div class="Table">
<div class="Row">
<div class="Cell">
<p><?php echo $trans['search_in'][$_SESSION['lang']]; ?>:</p>
</div>
<div class="Cell">
<p><select name="searchin" class="wide" size="1">
<option value="text"><?php echo $trans['ltext'][$_SESSION['lang']]; ?></option>
<option value="th1"><?php echo $trans['th1'][$_SESSION['lang']]; ?></option>
<option value="th2"><?php echo $trans['th2'][$_SESSION['lang']]; ?></option>
</select><a href="#" class="clickTip exampleTip" title="<?php echo $trans['tt_th'][$_SESSION['lang']]; ?>"><img class="helpicon" src="img/icon_info.png" ></a></p>
</div>
<div class="Cell">
</div>
</div>
<div class="Row">
<div class="Cell">
<p><?php echo $trans['corpus'][$_SESSION['lang']]; ?> </p>
</div>
<div class="Cell">
<p><?php print(make_select(" ", "cur_corpus", $corpora, $selected_corp, $trans)); ?><a href="#" class="clickTip" title="<?php echo $trans['tt_corpus'][$_SESSION['lang']]; ?>"><img class="helpicon" src="img/icon_info.png" ></a></p>
</div>
<div class="Cell">
</div>
</div>
</div>
<br>
<h4><?php echo $trans['hint_subcorpus'][$_SESSION['lang']]; ?> <a href="#" onclick="document.forms['documents'].submit();"><?php echo $trans['here'][$_SESSION['lang']]; ?></a>.</h4>
<p></p>
</div>
</form>
<!--### IFRAME PART END-->
</div>
<?php
$current_script = $_SESSION['lang']."/start.php";
require($current_script);
?>
</div>
<!--MAIN PART END-->
</div>