lundi 27 juin 2016

Take output from MySQL array and post specific info to different table

Right now my array displays information that I need, but I am trying to allow users to claim the jobs by clicking the "claim button" and posting their username, user id, order id, and setting the claimed info to show it is claimed.

<h3>Current Jobs</h3>
        <p class="text-muted m-b-20">These are the jobs either in progress or are available to be claimed.</p>
        <div class="table-responsive">
          <? echo "<table class="table table-striped">
            <thead>
              <tr>
                <tr>
                <th>Order #</th>
                <th>Order Type</th>
                <th>Order ID Number</th>
                <th>Order Status</th>
                <th>Order Dates</th>
                <th>Order Claimed</th>
                <th>Claim Job</th>
              </tr>
            </thead>
            <tbody>";
    $order_id = $row['order_item_id'];
    $user_id = $uid;
    $user_name = $username;

while($row = mysql_fetch_array($wclaim)) 
    {   
     echo "<tr id=" . $row['order_item_id'] . ">";
     echo "<td >" . $row['order_item_id'] . "</td>";
     echo "<td>" . $row['order_item_name'] . "</td>";
     echo "<td>" . $row['order_id'] . "</td>";
     echo "<td>" . $row['post_status'] . "</td>";
     echo "<td>" . $row['post_date'] . "</td>";
     echo('<td>'.(($row['claim_aktiv']==1) ? 'Yes' : 'No').'</td>');
  ---> if(isset($_POST["submit"])) {
     "INSERT INTO claimsystem (claim_id, user_id, user_name, claim_aktiv)
 VALUES ('$order_id','$user_id','$user_name','1')";
       }
  ---> echo "<td><input type="submit" name="submit"></input></td>";
  echo "</tr>";
       }
  echo "</tbody></table>";
   ?>

The code I need help with has a arrow in front of it

--->

When I click on the submit button it does not do anything.

Aucun commentaire:

Enregistrer un commentaire