@client.callback_query_handler(lambda call: call.data == 'buytovaryes' or call.data == 'buytovarno')
def buy_callback(call):
if call.data == 'buytovaryes':
for info in sql.execute(f"SELECT * FROM users WHERE id = {call.from_user.id}"):
for infoshop in sql.execute(f"SELECT * FROM shop WHERE id = {tovarid}"):
cashtovar = int(info[2] - infoshop[2])
boughttovar = int(info[4] + 1)
whobuytovarinttostr = str(info[0])
whobuytovar = str(infoshop[4] + whobuytovarinttostr + ',')
sql.execute(f"SELECT * FROM users WHERE id = {call.from_user.id}")
client.delete_message(call.message.chat.id, call.message.message_id-0)
client.send_message(call.message.chat.id, f"✅ | Вы успешно купили товар\n\nНазвание товара: {infoshop[1]}\nЦена: {infoshop[2]}\n\nТовар: {infoshop[3]}\n\nСпасибо за покупку!")
for admin in sql.execute(f"SELECT * FROM users WHERE id = {call.from_user.id}"):
client.send_message(6037918044, f"➖➖➖➖➖➖➖➖➖➖➖➖\nНовый заказ!\nТовар: {infoshop[1]}\nЦена: {infoshop[2]}\n\nТовар: {infoshop[3]}\nЗакащик:\n ID:{call.message.chat.id}\n Имя:{call.from_user.first_name}\n➖➖➖➖➖➖➖➖➖➖➖➖")
sql.execute(f"UPDATE users SET cash = {cashtovar} WHERE id = {call.from_user.id}")
sql.execute(f"UPDATE users SET bought = {boughttovar} WHERE id = {call.from_user.id}")
sql.execute(f"SELECT * FROM shop WHERE id = {tovarid}")
sql.execute(f"UPDATE shop SET whobuy = '{whobuytovar}' WHERE id = {tovarid}")
db.commit()
elif call.data == 'buytovarno':
client.delete_message(call.message.chat.id, call.message.message_id-0)
client.send_message(call.message.chat.id, f"❌ | Вы отменили покупку товара!")
client.answer_callback_query(callback_query_id=call.id)
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$db = mysqli_connect(данные для подключения);
$name = $_POST["name"];
$login = $_POST["login"];
$pass = $_POST["password"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$bio = $_POST["bio"];
$query="INSERT INTO `accounts` (`login`, `password`, `name`, `bio`, `email`, `phone`, `rating`) VALUES ('$login', '$password', '$name', '$bio', '$email', '$phone', '1') ";
$result=mysqli_query($db, $query);
if ($result)
header("Location: formreg.php");
mysqli_close($db);
?>
section {
background: black;
color: white;
border-radius: 1em;
padding: 1em;
border: 3px solid #fff; /* ����� ����� */
}
.menu {
top: 0%;
left: 100%;
}
.main {
background: black;
color: white;
border-radius: 1em;
padding: 1em;
border: 3px solid #fff; /* ����� ����� */
position: fixed;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%) }
}
<section class="main">
<section >
<h2>Меню</h2>
<a href="logout.php">
<button>Выйти</button>
</a>
</section>
<section>
<form action="newart.php" method="post">
<p>Название статьи:</p>
<input name="nameart">
<p>Текст статьи:</p>
<textarea name="text"></textarea>
<p>Текст ссылки в меню:</p>
<input name="menu">
<input type="submit" value="Добавить статью">
</form>
</section>
</section>