<?php
$modules = R::findAll('modules', 'id = ?');
$lessons = R::findAll('lessons', 'module_id = ?');
foreach ($modules as $module) {
foreach ($lessons as $lesson) {
if ( $lesson->module_id == $module->id ) {
echo '
<p>Модуль №', ++$i,' | ', $module->name,'</p>
<p>Урок: ', $lesson->name, '</p><br/>
';
}
}
}
?>
select
m.name as `module`,
l.name as `lesson`
from modules m
left join lessons l ON l.module_id = m.id
where l.id is not null
<?php
$file = file('test.txt');
$i = 0;
foreach($file as $line) {
$i++;
$arr = explode(';', $line);
$v = $arr[0];
$ip = $arr[1];
$output = shell_exec("ping $ip -n 1");
$text = iconv("cp866","utf-8", $output);
$pos = strpos($text, "потеряно = 1");
if ( $pos > 0 ) {
echo "<a href='http://$ip:8080' title='$v'>Offline</a><br>";
} else {
if (strlen($text) > 300 ) {
echo "<a href='http://$ip:8080' title='$v'>Online</a><br>";
} else {
echo "<a href='http://$ip:8080' title='$v'>-</a><br>";
}
}
}
?>
require_once ( "../app/core.php" );
// пример роутинга
if ( file_exists("../app/".$module."/conf.php") ) {
require_once ( $module."/conf.php" );
require_once ( "header.php" );
require_once ( $module."/i.php" );
require_once ( "footer.php" );
} else {
require_once ( "404/i.php" );
}
buy.on('click', function() {
// При нажатии на кнопку складываются значения
let productPrice = +buy.attr('data-price');
let productCount = +$('#input').val();
let oldSum = +cartPrice.text();
let oldCount = +cartCount.text();
cartPrice.text(oldSum+productPrice*productCount);
cartCount.text(oldCount+productCount);
})
foreach ($data as $elem) {
$selected = ( $id == $elem[id] ? 'selected="selected"' : '' );
$contentCity .= "<option $selected value=\"$elem[id]\">$elem[city]</option>";
}