Learning with Texts - Fork 2.4.0-fork
Learn foreign languages with texts
Namespaces | Functions
ajax_chg_term_status.php File Reference

Change term status (Table Test) More...

Namespaces

namespace  Lwt
 

Functions

 get_new_status ($oldstatus, $up)
 
 update_word_status ($wid, $currstatus)
 
 do_ajax_chg_term_status ($wid, $up)
 

Detailed Description

Change term status (Table Test)

Call: inc/ajax_chg_term_status.php?id=[wordID]&data=[translation]

Function Documentation

◆ do_ajax_chg_term_status()

do_ajax_chg_term_status (   $wid,
  $up 
)

Do a word status change and print the result.

Parameters
int$widWord ID
bool$upShould the status be incremeted or decremented
Returns
void

@global string $tbpref Database table prefix.

◆ get_new_status()

get_new_status (   $oldstatus,
  $up 
)

Check the consistency of the new status.

Parameters
int$oldstatusOld status
bool$upTrue if status should incremented, false if decrementation needed
Returns
int<1, 5>|98|99 New status in the good number range.

◆ update_word_status()

update_word_status (   $wid,
  $currstatus 
)

Save the new word status to the database.

Parameters
int$widWord ID
int$currstatusCurrent status in the good value range.
Returns
string|null HTML-formatted string with plus/minus controls if a success.

@global string $tbpref Database table prefix