1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| <?php defined('_JEXEC') or die;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('formbehavior2.select2', '.test1');
/**
* File default.php
* Created 5/22/13 6:43 AM
* Author Matt Thomas | matt@betweenbrain.com | http://betweenbrain.com
* Support https://github.com/betweenbrain/
* Copyright Copyright (C) 2013 betweenbrain llc. All Rights Reserved.
* License GNU General Public License version 2, or later.
*/
$document =& JFactory::getDocument();
$document->addCustomTag( '<link rel="stylesheet" type="text/css" href="'. JURI::base() . 'modules/mod_tasawaq/tmpl/tasawaq.css" title="default" />' );
$uri = JURI::getInstance();
$url = $uri->toString();
use Joomla\CMS\Factory;
$db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('id', 'mot', 'tg_pl')))
->from($db->quoteName('#__tasawaq'));
$db->setQuery($query);
$results = $db->loadAssocList();
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>
<script>
function JouerSon() {
var sound = document.getElementById("beep");
sound.play();
}
</script>
<form method="POST" action="">
<select class="test1" style="width: 220px;" name="mot">
<option selected="selected" value=""><h1> - chercher un mot - </h1></option>
<?php foreach ($results as $row) { ?>
<option value="<?php echo $row["mot"]; ?>" <?php echo isset($_POST["mot"])&&$_POST["mot"]==$row["mot"]?" selected":"";?>>
<?php echo $row["mot"];?>
</option>
<?php } ?>
</select>
<input type="submit" value="Traduire" name ="choix"/>
</form>
<?php
if (isset($_POST["mot"]))
{
echo "Le mot est :".$_POST["mot"];
}
?> |