added more customer intel. Response message from customer order and email

This commit is contained in:
2026-10-20 10:15:30 +03:00
parent c41e56d382
commit 9634551a68
49 changed files with 50 additions and 17 deletions
+14 -5
View File
@@ -78,14 +78,23 @@ if(is_dir("uploads/".$customername)){
//resize picture on upload dont see any reason to keep original picturefiles on server at this moment
$source = imagecreatefromjpeg($urls);
list($width, $height) = getimagesize($urls);
list($old_width, $old_height) = getimagesize($urls);
// Define new dimensions
/*$newWidth = 400;
$newHeight = 400;
*/
$newWidth = $width / 20;
$newHeight = $height / 20;
$max_width = 400;
if ($old_width > $max_width) {
$ratio = $old_width / $max_width;
$newWidth = $max_width;
$newHeight = (int) round($old_height / $ratio);
} else {
$newWidth = $old_width;
$newHeight = $old_height;
}
// Create a blank true-color image
$thumb = imagecreatetruecolor($newWidth, $newHeight);
@@ -98,11 +107,11 @@ imagejpeg($thumb, $urls, 80);
// Free up memory
imagedestroy($source);
imagedestroy($thumb);
//image is resized next step watermark
//image is resized next step watermark
// Ladataan pääkuva ja vesileimalogo
$mainImg = imagecreatefromjpeg($urls);
$watermark = imagecreatefrompng('raccoon.png');
$watermark = imagecreatefrompng('styles/tes.png');
// Haetaan kuvien mitat
$mainWidth = imagesx($mainImg);
+9 -5
View File
@@ -13,7 +13,7 @@ $stmt = $mysqli ->prepare("SELECT usersname FROM users WHERE idusers = ? AND use
$stmt -> bind_param("ss",$id,$username);
$stmt -> execute();
$result = $stmt->get_result();
$stmt->store_result();
//$stmt->store_result();
@@ -63,7 +63,7 @@ exit;}
</div>
</header>
<body >
<p id="msg"></p>
<?php foreach($images as $picture): ?>
<div class="imagesDiv" onclick='add("<?php echo($picture["imagesname"]) ?>", this)'>
<img style=""src="<?php echo($picture["imagesurls"]); ?>" alt="" >
@@ -108,7 +108,10 @@ if (arr.includes(name)) {
}
function send(){
var dataToSend = "variableName=" + arr;
var dataToSend = "variableName=" + arr + "&user="+<?php echo($id); ?>;
//var customer = ;
//console.log(customer);
console.log(dataToSend);
// Prepare the data to send
var xhr = new XMLHttpRequest();
@@ -128,7 +131,8 @@ function send(){
// Check if the request was successful
console.log(xhr.responseText);
let elemMsg = document.getElementById("msg");
elemMsg.innerHTML = xhr.responseText;
// Output the response from the PHP script
} else {
@@ -144,7 +148,7 @@ function send(){
}
}
;
// const test = {dataToSend , customer};
xhr.send(dataToSend);
}
</script>
+27 -7
View File
@@ -2,13 +2,25 @@
use Socketlabs\SocketLabsClient;
use Socketlabs\Message\BasicMessage;
use Socketlabs\Message\EmailAddress;
include "db.php";
include "socketlabs-php-main/socketlabs-php-main/InjectionApi/src/includes.php";
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["variableName"])) {
$receivedVariable = $_POST["variableName"];
// Process the received variable here
// echo "Received variable: " . $receivedVariable;
$user = $_POST["user"];
$stmt = $mysqli ->prepare("SELECT usersname,usersphone,usersemail FROM users WHERE idusers = ? ");
$stmt -> bind_param("s",$user);
$stmt -> execute();
$result = $stmt->get_result();
//$stmt->store_result();
$customer;
if ($row = $result->fetch_assoc()) {
$customer=$row;
}
else
{echo("warning");}
//echo "Received variable: " . $receivedVariable;
@@ -18,8 +30,15 @@ $apiKey = "RB1ix50wg5NW19mvUHvx.DImVryVSWvWwgjr61XNGhYAVtlr5yNEmmZmsj3ev";
$client = new SocketLabsClient($serverId, $apiKey);
$message = new BasicMessage();
$message->subject = "Test Message";
$message->htmlBody = "<html><body><p>".$receivedVariable."</p></body></html>";
$message->subject = "Halutut kuvat";
$message->htmlBody =
"<html>
<body>"."<p>".$customer["usersname"]."<p> ".
"<p> puhelin: ".$customer["usersphone"]."<p> ".
"<p> sähköposti: ".$customer["usersemail"]."<p> ".
"<p>".$receivedVariable."</p>
</body>
</html>";
$message->plainTextBody = "Test email body";
// Ensure this From address uses your verified domain in SocketLabs!
@@ -29,8 +48,9 @@ $message->addToAddress("[email protected]");
try {
$response = $client->send($message);
if($response->result == "Success"){
echo("Tilaus lähetetty");
echo "Received variable: " . $receivedVariable;
echo("Tilaus lähetetty <br>");
echo "Kuvat: ". $receivedVariable;
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File
View File
View File

Before

Width:  |  Height:  |  Size: 5.3 MiB

After

Width:  |  Height:  |  Size: 5.3 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Before

Width:  |  Height:  |  Size: 25 MiB

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB