11
neda_barna
Re: combo box
  • 2007/9/24 11:03

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


this problem solved
thx for your guide

12
script_fu
Re: combo box

Quote:

kaotik wrote:
script_fu: I'm curious about your garage project Did you start this module based on my tutorials?


Not the one we have now. I sure have learned from your tuts. I will be starting a new module based on your code and this code here. The new module will be called cars or requester.

Year, make and model will be the main focus of the new module as a way to populate the database.

13
script_fu
Re: combo box

Quote:

neda_barna wrote:
this problem solved
thx for your guide


Can you post your finished code? So the community may benifit.

14
script_fu
Re: combo box

Quote:

neda_barna wrote:
this problem solved
thx for your guide


I hate when this happens. Its like the users gets what he needs from the help people give. But never posts the full answer to the question.

Can a dev post the finished code please?

15
neda_barna
Re: combo box
  • 2007/9/25 4:53

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


ok i send for u
this is my code
i have 1 problem
please see a segment that elseif ($_POST['referee']=='B')
because my actin is expire_date it dosent work
why??
if we have 2 <form> that action of that is equal is it problem????????
<?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 ( 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$queryTRUE$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 ( ) {
                } elseif ( 
) {
                } elseif ( 
) {
                } 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' ), );

        if ( 
) {
                } elseif ( 
) {
        } elseif ( 
) {
        } 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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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>'
;



$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_UNIQE.'</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;


if (
$_POST['referee']=='A')
{

echo 
$form;
echo 
refereeList'referee''assign'$sidTRUE  );
} elseif (
$_POST['referee']=='B')
{
$form1 '<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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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 ");
$query="UPDATE ".$xoopsDB->prefix referee )." SET exp_date = exp_date + '$word1' WHERE 1";
$xoopsDB->query($query);
if(
$xoopsDB->query($query)){
echo 
"Data was correctly inserted into DB!";
}  
}
//-------------------------------------
foreach ($_POST['check'] as $chk)
{
$word=$_POST['key'];
$word1=$word 86400;
$query="UPDATE ".$xoopsDB->prefix referee )." SET exp_date = exp_date + '$word1' WHERE uid='$chk'  ";
$res=$xoopsDB->query($query);
if(
$res){
echo 
"Data was correctly inserted into DB!";
}
}




//------------------------------
//-------------------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" );
?>

16
kaotik
Re: combo box
  • 2007/9/25 9:30

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


I don't understand your question, but I do see an error in your code:

Replace:
$xoopsDB->prefix referee )


with:
$xoopsDB->prefix "referee" )


you forgot to place quotes on your table name
www.kaotik.biz

17
neda_barna
Re: combo box
  • 2007/9/25 10:20

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


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$queryTRUE$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 ( ) {
                } elseif ( 
) {
                } elseif ( 
) {
                } 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' ), );

        if ( 
) {
                } elseif ( 
) {
        } elseif ( 
) {
        } 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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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'$sidTRUE  );

} 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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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$queryTRUE$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 ( ) {
                } elseif ( 
) {
                } elseif ( 
) {
                } 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' ), );

        if ( 
) {
                } elseif ( 
) {
        } elseif ( 
) {
        } 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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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'$sidTRUE  );

} 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>&nbsp;</td></tr><tr><td colspan="1" nowrap>&nbsp;</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" );
?>

18
script_fu
Re: combo box

bump

19
kaotik
Re: combo box
  • 2007/9/26 9:19

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Ok, a couple of things:
replace:
$query1="UPDATE ".$xoopsDB->prefix referee )." SET exp_date = exp_date + '$word1' WHERE 1";
$res=$xoopsDB->query($query);


with:
$query1="UPDATE ".$xoopsDB->prefix ( [color=990000]"[/color]referee[color=990000]"[/color] )." SET exp_date = exp_date + '$word1' WHERE 1";
$res=$xoopsDB->query([color=990000]$query1[/color]);


-On the first line you used $query1 but in the second you used $query
- You should place the table name in quotes, otherwise PHP will interpret it as a constant.
www.kaotik.biz

Login

Who's Online

250 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 250


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits