adding updated code

This commit is contained in:
Janis Steiner
2024-06-18 09:36:11 +01:00
parent 0aaa1964fb
commit 0d7038c4b6
29 changed files with 4350 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
include "../config/config.php";
session_start();
if(isset($_GET["telegram_id"])){
$telegram_id=htmlspecialchars($_GET["telegram_id"]);
$id=$_SESSION["id"];
$sql="update users set telegram_id=? where id=?";
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_bind_param($stmt, "si", $telegram_id,$id);
mysqli_stmt_execute($stmt);
$_SESSION["telegram_id"]=$telegram_id;
}
if(isset($_GET["notification_telegram"])){
if($_GET["notification_telegram"]=="true"){
$sql="update users set notification_telegram=1 where id=?";
$_SESSION["notification_telegram"]=1;
}
else{
$sql="update users set notification_telegram=0 where id=?";
$_SESSION["notification_telegram"]=0;
}
$id=$_SESSION["id"];
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_bind_param($stmt, "i" ,$id);
mysqli_stmt_execute($stmt);
}
if(isset($_GET["notification_mail"])){
if($_GET["notification_mail"]=="true"){
$sql="update users set notification_mail=1 where id=?";
$_SESSION["notification_mail"]=1;
}
else{
$sql="update users set notification_mail=0 where id=?";
$_SESSION["notification_mail"]=0;
}
$id=$_SESSION["id"];
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_bind_param($stmt, "i" ,$id);
mysqli_stmt_execute($stmt);
}
?>