Server : LiteSpeed
System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64
User : gazetufm ( 1431)
PHP Version : 8.1.35
Disable Function : NONE
Directory :  /home2/gazetufm/drsupernova.com/locations/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: process.php

Path: //home2/gazetufm/drsupernova.com/locations/process.php

Size: 2.02 KB

Permissions: 0644

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
include 'config.php';

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $emri = $_POST['EmriBiznesit'];
    $kontakt = $_POST['AgjentiKontakt'];
    $email = $_POST['Email'];
    $tel = $_POST['Tel'];

    // 1. Kontrolli p�r Agjencin�
    $check_agj = $conn->prepare("SELECT ID FROM Agjencite WHERE Email = ?");
    $check_agj->bind_param("s", $email);
    $check_agj->execute();
    $res = $check_agj->get_result();

    if ($res->num_rows > 0) {
        $agjenciId = $res->fetch_assoc()['ID'];
    } else {
        $ins_agj = $conn->prepare("INSERT INTO Agjencite (EmriBiznesit, AgjentiKontakt, Tel, Email) VALUES (?, ?, ?, ?)");
        $ins_agj->bind_param("ssss", $emri, $kontakt, $tel, $email);
        $ins_agj->execute();
        $agjenciId = $ins_agj->insert_id;
    }

    // 2. Ruajtja e Lokacionit
    // Kemi 14 kolona (p�rfshir� AgjenciaID), pra duhen 14 pik�pyetje
    $ins_p = $conn->prepare("INSERT INTO Lokacionet (AgjenciaID, Pershkrimi, Adresa, MapsLink, Siperfaqja, Kati, Vizibiliteti, Aksesi, Parkimi, InfraEnergji, Infrastruktura, CmimiQira, DataLirimit, FotoLink) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
    
    // Stringu i tipave duhet t� ket� 14 karaktere. 
    // "i" p�r integer, "s" p�r string, "d" p�r double (�mimi).
    // Korrigjimi: "isssissssssdss" (14 karaktere)
    $types = "isssissssssdss"; 
    
    $ins_p->bind_param($types, 
        $agjenciId, 
        $_POST['Pershkrimi'], 
        $_POST['Adresa'], 
        $_POST['MapsLink'], 
        $_POST['Siperfaqja'], 
        $_POST['Kati'], 
        $_POST['Vizibiliteti'], 
        $_POST['Aksesi'], 
        $_POST['Parkimi'], 
        $_POST['InfraEnergji'], 
        $_POST['Infrastruktura'], 
        $_POST['CmimiQira'], 
        $_POST['DataLirimit'], 
        $_POST['FotoLink']
    );

    if ($ins_p->execute()) {
        echo "<script>alert('The proposal was sent successfully!'); window.location.href='index.php';</script>";
    } else {
        echo "Error: " . $ins_p->error;
    }
}
?>

← Back to Directory Edit File 🔒 Chmod

WP File Manager