lundi 2 mars 2015

Get Option Value Using Jquery for Multiple Tables

Hi I'm fairly new to js/php/html and am having an issue being able to pull data from the "action" column to check if the value is equal to "Closed." Basically, my code retrieves rows from a database and creates individual tables for each entry. Now I want to be able to write back into the db based upon whether the select="Closed." I've been doing a lot of research and I can't seem to find a method of being able to increment through the multiple tables to find the value of the select. Any help would be greatly appreciated. Thanks


enter image description here





<?php

$dbname='C:\Users\irgcbk\Documents\hotpartdb.mdb';
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbname; Uid=''; Pwd='';");

$cnx=odbc_connect('ReceivingODBC', 'root', '');
$sql="
SELECT *
FROM HotPartLog
WHERE CompletionStatus is NULL ";
$result=odbc_exec( $cnx, $sql);
$myarray=array();

$i=0;

While (odbc_fetch_into($result,$myarray)){

/*foreach($myarray as $row){
foreach($row as $key=> $value){*/
?>


<div class="datagrid">

<table cellpadding="0" cellspacing="0" id=<?php $tablename?> >
<thead>
<tr>
<th class="remove-whitespace">Action</th>
<th>Date</th>
<th>Status</th>
<th>Line</th>
<th>Part Number</th>
<th>Number of Parts</th>
<th>Materials Reason</th>
<th>Comments</th>
</tr>
</thead>

<tbody>

<col width="100px">
<tr>

<td width= "10%" align="left" class="no-padding" >
<select name="action" style="WIDTH: 100px; HEIGHT: 20px" type="text" cellpadding="0" cellspacing="0" >
<option value="" selected="selected"></option>
<option value="Closed" style="background-color:#66FF66" id="closedcheck <?php $i ?>" >Closed</option>
<option value="In Progress" style="background-color:#FF0000" id="inprog" selected="selected">In Progress</option>
</select>
</td>


<td width= "10%" align="left" class="no-padding"><?php echo $myarray[1] ?></td>
<td width= "10%" align="left" class="no-padding"><?php echo $myarray[2] ?> </td>
<td width= "10%" align="left" class="no-padding"><?php echo $myarray[3] ?></td>
<td width= "10%" align="left" class="no-padding"><?php echo $myarray[6] ?></td>
<td width= "10%" align="left" class="no-padding"><?php echo $myarray[5] ?></td>
<td width= "10%" align="left" class="no-padding"><input type="text" name="materialsreason" size="21"></td>
<td width= "10%" align="left" class="no-padding"><input type="text" name="receivingcomments" size="21"></td>
</tr>

</col>
</tbody>
</table>
</div>
<?php
$i++;
}
odbc_close($cnx);
?>



<form name="receivingform" method="post">
</br></br>
<b>Please Click And Enter Password to Verify Closure of Ticket: </b> </br>
<input class="button_text" type="submit" value="Delete Closed Rows" onclick="checkstatus();">
</form>



Aucun commentaire:

Enregistrer un commentaire