Подскажите пожалуйста, возможно ли каким-то образом подгружать данные в модельное окно после добавления/обновления элементов с контентом?! Да и вообще, возможно ли такое сделать?!
var recipient = button.getAttribute('data-bs-whatever');
modalTitle.textContent = 'Запрос цены ' + recipient;
define( "DB_HOST", 'localhost' );
define( 'DB_NAME', '' ); // заполнить
define( 'DB_USER', '' );
define( 'DB_PASSWORD', '' );
define( 'DB_CHARSET', 'utf8mb4' );
$host_db = DB_HOST;
$name_db = DB_NAME;
$user_db = DB_USER;
$pass_db = DB_PASSWORD;
$char_db = DB_CHARSET;
$dsn = "mysql:host=$host_db;dbname=$name_db;charset=$char_db";
$options=[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
try{
$dbh = new PDO($dsn,$user_db,$pass_db,$options);
}catch(
PDOException $e){
die("NO CONNECT -- ". $e->getMessage());
}
function db_user($email){
global $dbh;
$user = $dbh->prepare("SELECT * FROM `users` WHERE `email` = :email ");
$user->execute([
"email" => $email,
]);
$result = $user->fetchAll();
return (count($result) > 0) ? $result : []; // <-- многомерный массив! , т.к. возможны юзеры с одинаковой почтой
}
$email = ''; // искомая почта
$users = db_user($email);
$_SESSION['id'] = isset($users[0]['id']) ? $users[0]['id'] : '0'; // в сессию id первого попавшегося или 0
echo var_export($users,1);
<table border>
<thead>
<tr>
<th>Имя</th>
<th>Фамилия</th>
<th>Отчество</th>
<th>Дата рождения</th>
</tr>
</thead>
<tbody>
<tr>
<td>Андрей</td>
<td>Андреевич</td>
<td>Андреев</td>
<td>09.10.1989</td>
</tr>
</tbody>
</table>
function token($data) {
return mb_substr(strtoupper(preg_replace('~[^-a-z0-9_]+~','', password_hash(strtolower(iconv("utf-8", "us-ascii//TRANSLIT", trim(preg_replace('~[^\\pL0-9_]+~u', '-', $data), "-"))),PASSWORD_BCRYPT, ['cost' => 12,]))),4,16);
}
$first_name = 'Василий';
$last_name = 'Petrov';
$date = date('h:i:s A');
$token = token($first_name . $last_name . $_SERVER['HTTP_USER_AGENT'].$date);
echo 'токен: ' .$token . ' длина: '. strlen($token). "\n";
function bs_tg($tgam) {
$ch = curl_init();
$opt = array(
CURLOPT_URL => 'https://api.telegram.org/bot' . TELEGRAM_TOKEN . '/sendMessage',
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_TIMEOUT => 10,
CURLOPT_POSTFIELDS => array(
'chat_id' => TELEGRAM_CHATID,
'text' => $tgam,
);
curl_setopt_array($ch, $opt);
curl_exec($ch);
curl_close($ch);
}
$tempbody = is_array($massiv) ? implode(',' , $massiv) : $massiv ;
bs_tg($tempbody);
server_name *.domain.com;
root /var/www/sites/$http_host;
$txt = '';
foreach ($sPD as $key => $value) {
$txt .= "<b>".$key."</b>".$value."%0A";
};
.header__menu {
position: fixed;
top: 0;
/* left: -100%;*/ right:-100%;
width: 50%;
height: 100%;
overflow: auto;
background-color: black;
transition: all 0.3s ease 0s;
padding: 70px 10px 20px 10px;
}
.header__menu.active {
/* left: 0;*/ right:0;
}
$(".dropbox").hide();
$( ".nav_list_item" ).mouseover(function() {
$( this ).children( ".dropbox" ).addClass('active_dropbox');
});
$( ".nav_list_item" ).mouseout(function() {
$( this ).children( ".active_dropbox" ).removeClass('active_dropbox');
});
.navbar-expand{-sm|-md|-lg|-xl}