in part 1 :if ($_POST['referee']=='A')
i call a function then i have 1 form for combo box and 1 form for function
in part 2 :if ($_POST['referee']=='B')
i have 2 form 1 form for combo box and 1 form for textbox and button
now if i write code of part 2 in another file my program
working but in main file it dosent working
now if my code become like this it workin
extended_expire.php
<?php
include_once ( "header.php" );
include_once ( XOOPS_ROOT_PATH."/class/xoopsformloader.php" );
include_once ( REFER_ROOT_PATH."/class/referee.php" );
include_once ( REFER_ROOT_PATH."/class/journal_referee.php" );
include_once ( REFER_ROOT_PATH."/class/referee_paper.php" );
include_once ( REFER_ROOT_PATH."/class/referee_record.php" );
include_once ( REFER_ROOT_PATH."/class/list.php" );
//include_once ( XOOPS_ROOT_PATH."/class/xoopsobject.php" );
//------------------Function referrlist
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 ='extended_expire.php';
//$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 ) {
$form= '<table border="0" class="listHead"><tr>
<td nowrap>'._REF_ASSIGN_ALLLIST.'</td>
</tr></table>';
$content.= '<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>';
$content.='<td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_SAVE.'" /></td>
</tr></table>';
//$content.= '<input type="hidden" name="sid" value="'.$sid.'">
//$content.= ' <input type="submit" class="formButton" name="assign1" value="'._REF_BUTTON_ASSIGN.'">';
}
$content.= '</form><br />';
return $head.$content;
}
//----------------------------End Function
include_once ( XOOPS_ROOT_PATH."/header.php" );
$form= '<table border="0" class="listHead"><tr>
<td nowrap>'._REF_ASSIGN_ALLLIST.'</td>
</tr></table>';
//$form.= '<td> </td></tr><tr><td colspan="1" nowrap> </td>';
$form1 .= '<td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_SAVE.'" /></td>
</tr></table>
</form>';
$caption = '<table>
<tr class="head"><td>'._REF_CHANGE.' </td></tr>
</table>';
$combo = '<form action="extended_expire.php" method="post">
<table class="eleHead"><tr>
<td nowrap><select name="referee">
<option selected>_________ </option>
<option value="A">'._REF_LIST_ALLA.'</option>
<option value="B">'._REF_LIST_KOL.'</option>
<option value="C">'._REF_LIST_REF.'</option>
</select></td>';
$combo .='<td nowrap> <input type="submit" class="formButton" name="go" value="'._REF_BUTTON_GO.'" /></td>
</tr></table>
</form>';
echo $caption;
echo $combo;
$list1= '<h4><font color="red">'._REF_SAVE1.'</font></h4>';
if ($_POST['referee']=='A')
{
echo $form;
echo refereeList( 'referee', 'assign', $sid, TRUE );
} elseif ($_POST['referee']=='B')
{
$form1 = '<form action="extended_expire1.php" name="a" 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>';
$form1 .= '<td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_SAVE.'" /></td>
</tr></table>
</form>';
echo $form1;
}
elseif ($_POST['referee']=='C')
{
}
//-------------------------------------
foreach ($_POST['check'] as $chk)
{
$word=$_POST['key'];
$word1=$word * 86400;
$query1="UPDATE ".$xoopsDB->prefix ( referee )." SET exp_date = exp_date + '$word1' WHERE uid='$chk' ";
$res=$xoopsDB->query($query1);
if($res){
echo $list1;
}
}
//------------------------------
//-------------------combo box
/**if ($_POST['referee']=='A')
{
//do something
} elseif ($_POST['referee']=='B')
{
//do something
} elseif ($_POST['referee']=='C')
{
//do something
}**/
include_once ( XOOPS_ROOT_PATH."/footer.php" );
?>
extended_expire1.php
<?php
include_once ( "header.php" );
include_once ( XOOPS_ROOT_PATH."/header.php" );
include_once ( XOOPS_ROOT_PATH."/class/xoopsformloader.php" );
//include_once ( REFER_ROOT_PATH."/class/referee_paper.php" );
$form1 = '<form action="extended_expire.php" method="post">';
$form1 .= '<tr><td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_RETURN.'" /></td>
</tr></table>
</form>';
$list= '<h4><font color="red">'._REF_SAVE1.'</font></h4>';
$word=$_POST['key'];
$word1=$word * 86400;
// $xoopsDB->query("UPDATE ".$xoopsDB->prefix ( refree )." SET exp_date = exp_date +$word1 ");
$query="UPDATE ".$xoopsDB->prefix ( referee )." SET exp_date = exp_date + '$word1' WHERE 1";
$res=$xoopsDB->query($query);
if($res){
echo $list;
echo $form1;
}
include_once ( XOOPS_ROOT_PATH."/footer.php" );
?>
it work
but if my code become like this
segment of if ($_POST['referee']=='B')
dont work
<?php
include_once ( "header.php" );
include_once ( XOOPS_ROOT_PATH."/class/xoopsformloader.php" );
include_once ( REFER_ROOT_PATH."/class/referee.php" );
include_once ( REFER_ROOT_PATH."/class/journal_referee.php" );
include_once ( REFER_ROOT_PATH."/class/referee_paper.php" );
include_once ( REFER_ROOT_PATH."/class/referee_record.php" );
include_once ( REFER_ROOT_PATH."/class/list.php" );
//include_once ( XOOPS_ROOT_PATH."/class/xoopsobject.php" );
//------------------Function referrlist
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 ='extended_expire.php';
//$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 ) {
$form= '<table border="0" class="listHead"><tr>
<td nowrap>'._REF_ASSIGN_ALLLIST.'</td>
</tr></table>';
$content.= '<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>';
$content.='<td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_SAVE.'" /></td>
</tr></table>';
//$content.= '<input type="hidden" name="sid" value="'.$sid.'">
//$content.= ' <input type="submit" class="formButton" name="assign1" value="'._REF_BUTTON_ASSIGN.'">';
}
$content.= '</form><br />';
return $head.$content;
}
//----------------------------End Function
include_once ( XOOPS_ROOT_PATH."/header.php" );
$form= '<table border="0" class="listHead"><tr>
<td nowrap>'._REF_ASSIGN_ALLLIST.'</td>
</tr></table>';
//$form.= '<td> </td></tr><tr><td colspan="1" nowrap> </td>';
$form1 .= '<td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_SAVE.'" /></td>
</tr></table>
</form>';
$caption = '<table>
<tr class="head"><td>'._REF_CHANGE.' </td></tr>
</table>';
$combo = '<form action="extended_expire.php" method="post">
<table class="eleHead"><tr>
<td nowrap><select name="referee">
<option selected>_________ </option>
<option value="A">'._REF_LIST_ALLA.'</option>
<option value="B">'._REF_LIST_KOL.'</option>
<option value="C">'._REF_LIST_REF.'</option>
</select></td>';
$combo .='<td nowrap> <input type="submit" class="formButton" name="go" value="'._REF_BUTTON_GO.'" /></td>
</tr></table>
</form>';
echo $caption;
echo $combo;
$list1= '<h4><font color="red">'._REF_SAVE1.'</font></h4>';
if ($_POST['referee']=='A')
{
echo $form;
echo refereeList( 'referee', 'assign', $sid, TRUE );
} elseif ($_POST['referee']=='B')
{
$form1 = '<form action="extended_expire.php" name="a" 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>';
$form1 .= '<td nowrap> <input type="submit" class="formButton" name="search" value="'._REF_SAVE.'" /></td>
</tr></table>
</form>';
echo $form1;
$word=$_POST['key'];
$word1=$word * 86400;
// $xoopsDB->query("UPDATE ".$xoopsDB->prefix ( refree )." SET exp_date = exp_date +$word1 ");
$query1="UPDATE ".$xoopsDB->prefix ( referee )." SET exp_date = exp_date + '$word1' WHERE 1";
$res=$xoopsDB->query($query);
if($res){
echo $list1;
}
}
elseif ($_POST['referee']=='C')
{
}
//-------------------------------------
foreach ($_POST['check'] as $chk)
{
$word=$_POST['key'];
$word1=$word * 86400;
$query1="UPDATE ".$xoopsDB->prefix ( referee )." SET exp_date = exp_date + '$word1' WHERE uid='$chk' ";
$res=$xoopsDB->query($query1);
if($res){
echo $list1;
}
}
//------------------------------
//-------------------combo box
/**if ($_POST['referee']=='A')
{
//do something
} elseif ($_POST['referee']=='B')
{
//do something
} elseif ($_POST['referee']=='C')
{
//do something
}**/
include_once ( XOOPS_ROOT_PATH."/footer.php" );
?>