DELIMITER //
CREATE PROCEDURE insert_attr()
BEGIN
DECLARE i INT DEFAULT 10;
DECLARE j INT DEFAULT 1097;
DECLARE max_count INT DEFAULT 12;
DECLARE max_attr INT DEFAULT 1099;
DECLARE product_count INT;
DECLARE product_id INT;
DECLARE product_price DECIMAL(10,2);
DECLARE product_old_price DECIMAL(10,2);
DECLARE product_ean VARCHAR(255);
SELECT MAX(`product_id`) INTO product_id FROM `osn86_jshopping_products`;
WHILE i <= max_count DO
SET j = 1097;
WHILE j <= max_attr DO
SET product_count = i;
SET product_price = (SELECT `product_price` FROM `osn86_jshopping_products` WHERE `product_id` = product_id);
SET product_old_price = (SELECT `product_old_price` FROM `osn86_jshopping_products` WHERE `product_id` = product_id);
SET product_ean = (SELECT `product_ean` FROM `osn86_jshopping_products` WHERE `product_id` = product_id);
INSERT INTO `osn86_jshopping_products_attr` (`product_id`, `price`, `old_price`, `count`, `ean`, `attr_29`)
VALUES (product_id, product_price, product_old_price, product_count, product_ean, j);
SET j = j + 1;
END WHILE;
SET i = i + 1;
END WHILE;
END //
DELIMITER ;
CALL insert_attr();
$dates = [];
for ($i = 1; $i <= 6; $i++) {
$date = new DateTime();
$date->modify('first day of this month');
$date->modify("-$i month");
$dates[$i] = [
'month' => $date->format('n'),
'year' => $date->format('Y'),
];
}
print_r($dates);
function c($a, $b, $numbers) {
foreach ($numbers as $key => $value) {
if ($b === $key && $a % $value == 0) {
//
}
}
}
$a = 1;
$b = 0;
c($a, $b, [7, 3, 2]);
$a++;
var html = '<div class="box"><strong><!-- comment-->Яблоко<!-- /comment--></strong>Текст текст тектс<!-- comment-->Груша<!-- /comment-->Текст текст</div>';
var arr = html.match(/<!-- comment-->(.*?)<!-- \/comment-->/g).map(function(val){
return val.replace(/<!-- \/?comment-->/g,'');
});
console.log(arr);
/etc/nginx/conf.d/default.conf
server {
server_name 123.321.44.55;
listen 123.321.44.55:80 default_server;
listen [gffd:hter:3:6:7::gfdf]:80 default_server;
}
server {
server_name 123.321.44.55;
ssl_certificate /usr/local/mgr5/etc/manager.crt;
ssl_certificate_key /usr/local/mgr5/etc/manager.key;
listen 123.321.44.55:443 ssl default_server;
listen [gffd:hter:3:6:7::gfdf]:443 ssl default_server;
}
/etc/nginx/vhosts-includes
есть конфиг для phpmyadmin. Там нужно добавить в location @apache
:proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
send_timeout 3600;
max_execution_time
оказался тут не причем. owl.trigger('refresh.owl.carousel');
function navbar(){
if( $("#nav").height() == 800 ){
$("#nav").height('0px');
}else{
$("#nav").height('800px');
}
}
// PHP
$db =&JFactory::getDBO();
$query = 'SELECT * FROM `#__virtuemart_countries` WHERE virtuemart_country_id >= "1" AND virtuemart_country_id <= "30"';
$db->setQuery($query);
$result = $db->loadObjectList();
$si = [];
$sk = [];
foreach($result as $row) {
$si[$row->virtuemart_country_id] = $row->country_3_code;
$sk[$row->virtuemart_country_id] = $row->country_3_code;
};
// JS
jQuery(function($) {
$('body').on('change', '#virtuemart_country_id', function() {
var ssnull = '',
s = {
i: <?php echo json_encode($si) ?>,
k: <?php echo json_encode($sk) ?>,
},
selector = {
i: $('#inn_field'),
k: $('#kpp_field'),
}
val = $(this).val();
if (val == 0) {
selector.i.val($ssnull);
selector.k.val($ssnull);
return;
}
$.each(s, function(key, data) {
$.each(data, function(index, value) {
if(val == index + 1) {
selector[key].val(value);
}
});
});
});
});