<div class="summary_block">
<span class="summary">3000</span>руб.
<input id="summary" type="hidden" value="3000">
</div>
<div class="delivery_method hide">Описания или форма или что там у тебя</div>
<div class="product_grid">
<div class="product_item">
<p>Описание товара</p>
<a href="/buy" id="product_buy" data-id="100">В корзину</a>
</div>
<div class="product_item">
<p>Описание товара</p>
<a href="/buy" id="product_buy" data-id="101">В корзину</a>
</div>
<div class="product_item">
<p>Описание товара</p>
<a href="/buy" id="product_buy" data-id="101">В корзину</a>
</div>
</div>
.hide {
display: none;
}
jQuery(document).on('load', function() {
jQuery('#product_buy').on('click', function(e) {
e.preventDefault(); // Сбрасываю клик по ссылке, так как скорее всего тут должно быть что-то еще для добавления товара в корзину
let summary = jQuery('#summary').val(); // Получаю число из скрытого поля
if(Number(summary) >= 5000) { // Проверяю соответствует ли оно требуемому и если да, показываю блок
jQuery('.delivery_method').removeClass('hide');
} else { // Иначе скрываю блок обратно
jQuery('.delivery_method').addClass('hide');
}
});
<?php
$regexp = '/\d+\s\w+\s\d+/iu'; // ыыы, регуларке обожае
// Тупа твой вывод ыыы
$response = "default has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
No Members
No Callers
110 has 0 calls (max unlimited) in 'rrmemory' strategy (100s holdtime, 78s talktime), W:0, C:12, A:18, SL:25.0% within 60s
Members:
Local/801@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken 4 calls (last was 6516 secs ago)
Local/769@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken 1 calls (last was 4535 secs ago)
Local/744@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken no calls yet
Local/739@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken 1 calls (last was 6952 secs ago)
Local/771@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken 3 calls (last was 1905 secs ago)
Local/756@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken 1 calls (last was 9914 secs ago)
Local/746@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken 1 calls (last was 2874 secs ago)
Local/774@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken no calls yet
Local/755@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken no calls yet
Local/748@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken no calls yet
Local/779@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken no calls yet
Local/726@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken no calls yet
Local/728@from-queue/n (ringinuse disabled)[1;36;40m (dynamic)[0m[0m[0m[0m ([1;32;40mNot in use[0m) has taken no calls yet
No Callers";
// хо ба
preg_match($regexp,$response,$match);
// не ну тут всо ясно
$match = explode(' ',$match[0]);
$json = [$match[0] => $match[2]]; // не ну а чо :D
echo json_encode($json);
header('Content-type: text/css');
function filter_data ($value, $db) {
$quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r", "*", "%", "<", ">", "?", "!","-", "+", "#");
$value = trim($value);
$value = preg_replace("/[\r\n]{3,}/i", "\r\n\r\n", $value);
$value = stripslashes($value);
$value = strip_tags($value);
$value = str_replace($quotes, '', $value);
$value = $db->real_escape_string($value);
return $value;
}