0

Hi,
i need urgent help..
iam working on leave management system(LMS).if the employee apply for the leaves means,one message go to HR inbox (internal application inbox).
iam designing inbox for this..it has two parts(2 coloums).in the first coloumn iam displaying messages with employe name,id nd subject(just like preview of the message)..iam retriving employee name and id,and subject from the database.if the HR click on the particular messages,that message whole content should display in the second coloumn.it should be dynamic.
any idea,any help?how to achive this??

Edited by shashigowda

2
Contributors
4
Replies
30
Views
1 Year
Discussion Span
Last Post by shashigowda
1

If you are only pulling through the name and subject initially (and ID presumably) then when the preview is clicked on you do another database query to get the rest of the message information using the ID as the identifier. And then display that in the seond area in pretty much the same way you displayed the preview.

0

my problem is how to pass jS variable from .js file to .php file.
means if i click on the preveiew of message, the message id is storing in external jS file
inbox.js

  $( ".sender" ).on("click",function()
    {
    var test=(($("input[name=sender]").val()));
    var id=$(this).parent().attr('id');
    });

now i want to send that variable id to .php file
( if i click on the preveiew of message,respective content should be display on the right side)

1

Look into jquery http.post method. It lets you make an AJAX call to a URL you specify and pass in data.
The PHP script reads in the $_POST variables and you're all set to do your database query

0

Any help?

inbox.js

$( ".sender" ).on("click",function()
        {
        var test=(($("input[name=sender]").val()));
        var id=$(this).parent().attr('id');
    alert(id);//its working fine ,iam getting the id here


    $.ajax({
                        type:'post',
                        url: "inbox.php",
                        data:{
                            msg_id:id

                            },

                        success: function(data){

                        alert(data);

                      }
                });



        });

inbox.php

<?php $msg_id=$_POST['msg_id'];
?>

iam not getting the $msg_id ,
getting 404 server response error

any help??

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.