added more customer intel. Response message from customer order and email
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 5.3 MiB After Width: | Height: | Size: 5.3 MiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
Before Width: | Height: | Size: 25 MiB After Width: | Height: | Size: 25 MiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 25 MiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 25 MiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 25 MiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 25 MiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 5.3 MiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 978 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 69 KiB |