17
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
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 ''; print_r( $referee_r ); echo '
'; // !!!!!!!!!! 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 = '
';
return $head.$content;
}
//----------------------------End Function
include_once ( XOOPS_ROOT_PATH."/header.php" );
$form= '';
//$form.= ' | | ';
$form1 .= ' ._REF_SAVE.'" /> |
';
$caption = '';
$combo = '';
echo $caption;
echo $combo;
$list1= ''
._REF_SAVE1.'';
if ($_POST['referee']=='A')
{
echo $form;
echo refereeList( 'referee', 'assign', $sid, TRUE );
} elseif ($_POST['referee']=='B')
{
$form1 = '';
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
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 = ';
$form1 .= ' ._REF_RETURN.'" /> |
';
$list= ''
._REF_SAVE1.'';
$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
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 ''; print_r( $referee_r ); echo '
'; // !!!!!!!!!! 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 = '
';
return $head.$content;
}
//----------------------------End Function
include_once ( XOOPS_ROOT_PATH."/header.php" );
$form= '';
//$form.= ' | | ';
$form1 .= ' ._REF_SAVE.'" /> |
';
$caption = '';
$combo = '';
echo $caption;
echo $combo;
$list1= ''
._REF_SAVE1.'';
if ($_POST['referee']=='A')
{
echo $form;
echo refereeList( 'referee', 'assign', $sid, TRUE );
} elseif ($_POST['referee']=='B')
{
$form1 = '';
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" );
?>