🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux in-mum-web1643.main-hosting.eu 5.14.0-687.46.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Sep 11 09:03:19 EDT 2026 x86_64
👤 User: u621169360 (621169360)
🐘 PHP: 8.2.33
🚫 Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail

💻 Terminal

📁 /home/u621169360/domains/agriexpertt.com/public_html
$

📄 get_consultation_details.php

📁 Path: /home/u621169360/domains/agriexpertt.com/public_html/mobile/Flutter/get_consultation_details.php
📊 Size: 1.7 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php
header("Content-Type: application/json");
header("Access-Control-Allow-Origin: *");

require_once 'db.php';

if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    try {
        $ticket_id = $_GET['ticket_id'] ?? null;
        
        if (!$ticket_id) {
            throw new Exception("Ticket ID is required");
        }

        // Fetch consultation details with joined information
        $stmt = $pdo->prepare("
            SELECT 
                c.id, 
                c.ticket_id, 
                c.question_category, 
                c.question_subcategory, 
                c.problem_statement,
                c.crop_age,
                c.crop_age_period,
                c.status,
                c.created_at,
                cd.expert_diagnosis,
                cd.prescribed_medicines,
                cd.recommended_actions,
                cd.follow_up_advice
            FROM 
                consultations c
            LEFT JOIN 
                consultation_details cd ON c.id = cd.consultation_id
            WHERE 
                c.ticket_id = :ticket_id
        ");
        
        $stmt->execute(['ticket_id' => $ticket_id]);
        $consultation = $stmt->fetch(PDO::FETCH_ASSOC);

        if (!$consultation) {
            throw new Exception("Consultation not found");
        }

        // Parse prescribed medicines JSON
        $consultation['prescribed_medicines'] = 
            json_decode($consultation['prescribed_medicines'], true) ?? [];

        echo json_encode([
            'status' => 'success',
            'data' => $consultation
        ]);

    } catch (Exception $e) {
        echo json_encode([
            'status' => 'error',
            'message' => $e->getMessage()
        ]);
    }
}
?>
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨