8
thx
my problem solved
i forget that i must have submit button
koatik
i have another problem
i have a list that have check box
this code
function refereeList( $case, $case_next = NULL, $sid = NULL, $withcheck = FALSE ){
global $query, $order, $start, $limit;
$referee_r = JournalReferee::getAll( $query, TRUE, $order, $limit, $start );
//echo '<pre>'; print_r( $referee_r ); echo '</pre>'; // !!!!!!!!!! DEBUG !!!!!!!!!!!!!
$action = 'referee.php?case='.$case_next.'&case_pre='.$case.'&order='.$order.'"';
//if ( $sid ) { $action.= '&sid='.$sid; }
$total = JournalReferee::getCountAll( $query ); // DEBUG!!
//$total = count( JournalReferee::getAll( $query, FALSE ) );
$content = '<form action="'.$action.'" method="post">
<table><tr>';
if ( $withcheck ) {
$content.= '<td></td>';
}
$content.= '<td class="head">'._REF_NAME.'</td>
<td class="head">'._REF_FIELD.'</td>
<td class="head">'._REF_EMAIL.'</td>
<td class="head" nowrap>'._REF_STATUS;
// --- Status Description --- Referee's staus desc in brief !
if ( 0 ) {
} elseif ( 0 ) {
} elseif ( 0 ) {
} else {
$content.= '<br /><small><sup><font color="#AAAA22">'._REF_ASSIGN_JOB.'</font> '._REF_CHAR_PIPE.'
<font color="#CC2222">'._REF_ASSIGN_EXP.'</font> '._REF_CHAR_PIPE.'
<font color="#22AA22">'._REF_ASSIGN_FIN.'</font></sup></small>';
}
$content.= '</td></tr>';
$class = 'even';
foreach ( $referee_r as $referee ) {
$uid = $referee->getVar( 'uid' );
$name = $referee->getVar( 'name' );
$email = $referee->getVar( 'email' );
$status = $referee->getStatus();
$field = substr_words( $referee->getVar( 'bio' ), 5 );
if ( 0 ) {
} elseif ( 0 ) {
} elseif ( 0 ) {
} else {
$_status = '<table border="0" ><tr>
<td><b><font color="#AAAA22">'.$status[ 'assign' ].'</font></b></td><td> '._REF_CHAR_PIPE.' </td>
<td><b><font color="#CC2222">'.$status[ 'expire' ].'</font></b></td><td> '._REF_CHAR_PIPE.' </td>
<td><b><font color="#22AA22">'.$status[ 'finish' ].'</font></b></td>
</tr></table>';
}
//$date = formatTimestamp ( $paper->getVar( 'date' ), 's' );
$class = ($class == 'odd') ? 'even' : 'odd';
$content.= '<tr>';
if ( $withcheck ) {
$content.= '<td class="head"><input type="checkbox" name="check[]" value="'.$uid.'"</td>';
}
$content.= '
<td class="'.$class.'">'.$name.'</td>
<td class="'.$class.'">'.$field.'</td>
<td class="'.$class.'">'.$email.'</td>
<td class="'.$class.'">'.$_status.'</td>
';
$content.= '</tr>';
}
$content.= '</table><br />';
if ( $withcheck ) {
$searchForm = '<table border="0" class="listHead"><tr>
<td nowrap>'._REF_ASSIGN_ALLLIST.'</td>
</tr></table>';
$form = '<form action="extended_expire.php" method="post">
<table class="eleHead"><tr>
<td nowrap> '._REF_EXP.': <input type="text" name="key" value="" size="20" /></td>
</tr><tr>';
//$form.= '<td> </td></tr><tr><td colspan="1" nowrap> </td>';
$form .= '<td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_SAVE.'" /></td>
</tr></table>
</form>';
echo $searchForm;
echo $form;
//$content.= '<input type="hidden" name="sid" value="'.$sid.'">
// <input type="submit" class="formButton" name="assign" value="'._REF_BUTTON_ASSIGN.'">';
}
$content.= '</form><br />';
return $head.$content;
}
now i want if on1 row of list checked
do this code
[code]$word=$_POST['key'];
$word1=$word * 86400;
$query="UPDATE ".$xoopsDB->prefix ( referee )." SET exp_date = exp_date + '$word1' WHERE uid=$uid AND name=$name ";
$xoopsDB->query($query);
if($xoopsDB->query($query)){
echo "Data was correctly inserted into DB!";
}
} [code]
please tell me how can write this code
thx for your help