Jump to content

Multiple action on table rows


dapcigar

Recommended Posts

i want to add two different actions to each row. for example, i want to be able to approve or deny the report on each row.

 

 

 

 i want the approve and deny  icon to update every row in the database.. 

 

Yea, am a newbie.. if you could please give me a syntax that could make this work, i woud appreciate it..

 

 

 Thanks in advance

post-168806-0-74912200-1399472891.png

Link to comment
Share on other sites

Here is the issue.. i have this particular code getting data from the DB...

 

 <?php
         include('mysql_connect.php');
  $query1 =  mysql_query ("select * from requisition where username = '$user' ") or die(mysql_error());
 // $result= mysql_query($query1) ;
echo "
                              <thead>
                                  <tr>
                                      <th>ID</th>
                                      <th>Category</th>
                                      <th>Description</th>
                                      <th>Status</th>                                          
                                  </tr>
                              </thead>   
                              <tbody>";
while($row = mysql_fetch_array($query1))
{
 
  echo"<tr>";
    echo"<td> $row[id]</td>";
    echo"<td> $row[category]</td>";                
    echo"<td> $row[description]</td>";
    echo"<td> $row[status]</td>";
    
       
    echo"</tr>";
 
   }
   echo"</table>";
              echo"</table>";
              echo"<div align=center>";
              echo"<br>";
              
             
             echo"</div>";

 

 

 

 

....................................................

 

Now i want to include something like this to control the data in each row

 

<td class="center"><span class="label label-success">Approved</span></td>
                      <td class="center">
                      <a class="btn btn-info" href="#">
                                        <i class="icon-edit icon-white"></i>  
                      Approve                                           
                                    </a>
                                    <a class="btn btn-danger" href="#">
                                        <i class="icon-trash icon-white"></i>
                                        Deny
                      </td>

Link to comment
Share on other sites

To control the data in each row.  Interesting choice of words.

 

I'm guessing you want to display the data from your db for a specific user.  Then you wish to allow the user to approve or deny a row at will.  Do you envision this process being done at the server and then having the screen refreshed with the data changed according to the process that occurred?  Very confusing to look at an anchor with no href - what is it supposed to do?

 

I have done this in the past by making the data of each row a separate form with a hidden field (?) containing the key of the row and then having two buttons that submit the form with a script that responds to handle the button clicked.  Then the screen is refreshed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.