<?php
$step = 5;
$offset = isset($_SESSION['galgenoffset']) && $_SESSION['galgenoffset'] ? $_SESSION['galgenoffset'] : 0;
$miniShop2 = $modx->getService('minishop2');
$modx->setLogLevel(MODX_LOG_LEVEL_ERROR);
$q = $modx->newQuery('msProductFile', array('parent' => 0));
$total = $modx->getCount('msProductFile', $q);
$q->sortby('product_id', 'ASC');
$q->sortby('rank', 'DESC');
$q->limit($step,$offset);
$resources = $modx->getCollection('msProductFile', $q);
foreach ($resources as $resource) {
$modx->runProcessor('mgr/gallery/generate', array('id' => $resource->id),
array('processors_path' => $modx->getOption('core_path').'components/minishop2/processors/'));
}
$_SESSION['galgenoffset'] = $offset + $step;
if ($_SESSION['galgenoffset'] >= $total) {
$sucsess = 100;
$_SESSION['Console']['completed'] = true;
unset($_SESSION['galgenoffset']);
} else {
$sucsess = round($_SESSION['galgenoffset'] / $total, 2) * 100;
$_SESSION['Console']['completed'] = false;
}
for ($i=0; $i<=100; $i++) {
if ($i <= $sucsess) {
print '=';
} else {
print '_';
}
}
$current = $_SESSION['galgenoffset'] ?
$_SESSION['galgenoffset'] :
($sucsess == 100 ? $total : 0);
print "\n";
print $sucsess.'% ('.$current.')'."\n\n";
$resources = $modx->getCollection('modResource',array('parent' => 2)); // id раздела "2"
foreach ($resources as $res) {
$res->set('uri-override', 1);
$res->save();
}
onChange: function (data) {
console.log(data.from);
console.log(data.to);
}
onStart: updateInputs,
onChange: updateInputs
$filename = 'file.mp3'; //сам файл
$format = pathinfo($filename, PATHINFO_EXTENSION); //определяем формат
//условия
if($format == 'mp3'){
echo '<audio src="'.$filename.'"></audio>'
}else if($format == 'mp4'){
echo '<video><source src="'.$filename.'" type="video/mp4"></video>'
}else if($format == 'jpg'){
echo '<img src="'.$filename.'">'
}else{
echo 'формат не найден'
}
<div id="USD"> 00,0000 руб.</div>
<divid="EUR">0,0000 руб.</div>
function CBR_XML_Daily_Ru(rates) {
function trend(current, previous) {
if (current > previous) return '<span class="plus-cbr"></span>';
if (current < previous) return '<span class="minus-cbr"></span>';
return '';
}
var USDrate = rates.Valute.USD.Value.toFixed(4).replace('.', ',');
var USD = document.getElementById('USD');
USD.innerHTML = USD.innerHTML.replace('00,0000', USDrate);
USD.innerHTML += trend(rates.Valute.USD.Value, rates.Valute.USD.Previous);
var EURrate = rates.Valute.EUR.Value.toFixed(4).replace('.', ',');
var EUR = document.getElementById('EUR');
EUR.innerHTML = EUR.innerHTML.replace('00,0000', EURrate);
EUR.innerHTML += trend(rates.Valute.EUR.Value, rates.Valute.EUR.Previous);
}
<script src="//www.cbr-xml-daily.ru/daily_jsonp.js" async></script>
<ul>
<li><a>Доставка</a></li>
<li><a>Оплата</a></li>
</ul>
<select multiple="multiple" name="select_1[]">
.social {
width: 443px;
height: 153px;
margin: 0 auto;
padding: 2em;
background-image: url(image/socialbackground.png);
display:flex;
}
.logo {
width: 40%;
height: 90px;
background-image: url(image/twitchicon.png);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
margin:0 15px 0 0
}
. content{
width: 60%;
}
<select class="form-select" name="select_1"
<select class="form-select" name="select_2"
$title = $_POST['name'];
$url = $_POST['url'];
$get_id_type = $_GET['id'];
$select_1 = $_POST['select_1'];
$select_2 = $_POST['select_2'];
$sql = ("INSERT INTO `xf_type` (`title`, `url`,`select_1`, `select_2`) VALUES (?,?,?,?)");