This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function ($) { | |
"use strict"; | |
// нахожу элемент с классом loading | |
const loading = $('.loading'); | |
// нахожу мета тег с именем csrf-token и беру его значение в атрибуте content | |
const token = $('meta[name="csrf-token"]').attr('content') | |
// отслеживаю клики по ссылкам с классом delete-brand | |
// которые выгдядят <a href="#" class="delete-brand" data-id="3"> | |
$('.delete-brand').on('click', function(e){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const normalizeUrl = (url) => { | |
const urlType = url.startsWith('https://'); | |
if (urlType !== 'https://') { | |
return `https://${url}`; | |
} | |
return url; | |
} | |
const res = normalizeUrl("google.com"); | |
console.log(res) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function password_renerate(int $chars, int $res_ammount) | |
{ | |
if ($chars === 0) { | |
throw new \RangeException("Длина пароля должна быть больше 0"); | |
} | |
if ($res_ammount === 0) { | |
throw new \RangeException("Количество результатов должно быть больше 0"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) строка 7 | |
Метод getInstance, где происходит соединение с БД нужно вынести в отдельных класс а не мешать с классом User | |
2) строки 21-23 | |
Переменные $dsn, $user, $password нужно задать константами и вынести в отдельных файл настроек Или использовать файл .env для этих же целей | |
3) строка 24 | |
Нет проверки на ошибку при соединении | |
4) строка 37, 63 | |
В sql запросе нет фильтрации входящих данных. | |
4) строка 38, 64 | |
Хотя используют подготовленный запрос, нет безопаной подстановки переменных в execute и bindParam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Manager | |
1) строка 7 | |
Именовать константы нужно в верхнем регистре | |
2) строка 16 | |
Имя переменной $ageFrom в методе getUsers совпадает с именем аргумента данного метода | |
Нет проверки равенства аргумента 0 или отрицательному числу | |
3) строка 28 | |
Нет проверки на isset и !empty массива $_GET['names'] | |
Нет проверки что это массив, а не строка | |
4) строка 29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (dictionary_data.value_source) { | |
case 'DICT': | |
if(dictionary.use_values){ | |
} | |
if(dictionary.use_koef){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data_parameters = DB::table('data_parameters') | |
->select('data_parameters.id', 'data_parameters.name', 'data_parameters.groupname', | |
'data_parameters.group_alias', 'data_parameters.parameter_type', 'data_parameters.value_source', | |
'data_parameters.operation_act', 'data_parameters.operation', 'data_parameters.repeatable', | |
'data_parameters.scope', 'data_parameters.visible_on', 'data_parameters.order_no', | |
'data_parameters.error_text', 'data_parameters.dictionary_id', | |
) | |
->where([ | |
['data_parameters.company_id', $owner->company_id], | |
['data_parameters.isactive', 1], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<h2 class="h2">Выберите ваш регион</h2> | |
<form class="mt-3" @submit.prevent="sendPhone" v-if="countries.length > 0"> | |
<transition name="fade"> | |
<div class="mb-3"> | |
<label for="country" class="form-label">Страна</label> | |
<Multiselect | |
v-model="countryId" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select r.currency_code, round(min(r.sell),2) as sell, | |
round(max(r.buy),2) as buy | |
from rate_ru r | |
where (r.date_json = CURDATE()) and r.exchanger_id <> r.exchanger_id in (select id | |
from exchanger_ru e | |
where (e.centralbank = 0 or e.centralbank is null)) | |
group by r.currency_code order by r.currency_code |
NewerOlder