réponse au personnel sur le ticket d'assistance

$val){
            // File upload path
            $fileName = basename($_FILES('files')('name')($key));
            $targetFilePath = $targetDir . $fileName;
            
            // Check whether file type is valid
            $fileType = pathinfo($targetFilePath, PATHINFO_EXTENSION);
            if(in_array($fileType, $allowTypes)){
                // Upload file to server
                if(move_uploaded_file($_FILES("files")("tmp_name")($key), $targetFilePath)){
                    // Image db insert sql
                    $insertValuesSQL .= "('".$fileName."',LAST_INSERT_ID(),'".$username."','".$user_id."'),";
                   
                }else{
                    $errorUpload .= $_FILES('files')('name')($key).' | ';
                }
            }else{
                $errorUploadType .= $_FILES('files')('name')($key).' | ';
            }
        }
       
        if(!empty($insertValuesSQL)){
            $insertValuesSQL = trim($insertValuesSQL, ',');
            // Insert image file name into database
    $sql = "INSERT INTO ticket_replies (ticket_id, reply_text,user_type, user_id) VALUES ('$ticket_id','$reply_text','customer', '$user_id');";
    $sql .= "INSERT INTO support_ticket_files (file_name, ticket_id, user_name, user_id) VALUES $insertValuesSQL";
   
    if(mysqli_multi_query($link, $sql)){
        mysqli_multi_query($link,"UPDATE support_tickets set ticket_status = 'PENDING SUPPORT' where ticket_id ='$ticket_id'");
       
        $errorUpload = !empty($errorUpload)?'Upload Error: '.trim($errorUpload, ' | '):'';
$errorUploadType = !empty($errorUploadType)?'File Type Error: '.trim($errorUploadType, ' | '):'';
$errorMsg = !empty($errorUpload)?'
'.$errorUpload.'
'.$errorUploadType:'
'.$errorUploadType; echo "Replied Successfully."; }else{ $statusMsg = "Sorry, there was an error uploading your file."; } } } // Display status message echo $statusMsg; }
query("SELECT ticket_id, ticket_subject, ticket_message, ticket_status, DATE_FORMAT(created_at,'%d/%m/%Y at %H:%i:%s') AS created_at, DATE_FORMAT(ticket_timestamp,'%d/%m/%Y %H:%i:%s') AS ticket_timestamp FROM support_tickets WHERE ticket_id = ".$_GET('ticket_id')." and user_name = '".$_SESSION("user_name")."'")){ //'". $ticket_id. "' AND user_name ='". $_SESSION("user_name"). "'")){ //".$_GET('ticket_id')." and user_name = '".$_SESSION("user_name")."'")){ if ($result->num_rows > 0) { $ticket=$result->fetch_object(); ?>
" disabled>
" disabled>
ticket_status!='CLOSED'){ ?>

This support ticket is now closed, Please create new ticket for any issue

query("SELECT tr.ticket_id, tr.reply_text,tr.user_id, DATE_FORMAT(tr.reply_at,'%d/%m/%Y at %H:%i:%s') AS reply_at, u.customer_name FROM ticket_replies tr left join users u on (u.user_id=tr.user_id and tr.user_type='customer' and tr.user_id='".$_SESSION("user_id")."') WHERE ticket_id = '".$_GET("ticket_id")."' order by reply_at desc")){ //DATE_FORMAT(tr.reply_at,'%d/%m/%Y at %H:%i:%s') AS reply_at if ($replyresult->num_rows > 0) { while ($row = $replyresult->fetch_object()) { ?> user_id!=$_SESSION('user_id'))?'':''; ?>
 user_id==$_SESSION('user_id'))?$row->customer_name:'Support Team'; ?> reply_at?>
reply_text) ?>
Original Message
ticket_message ?>

PHP: