Version 2
This commit is contained in:
66
temporary/pagecontent/action-train.php
Normal file
66
temporary/pagecontent/action-train.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
if($meta == 'start') {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$query_contains = 0; // Variable überprüft ob Auswahl Vokabeln enthält.
|
||||
|
||||
|
||||
$sql = "SELECT `value`,`id` FROM `VokabelBox2Content` WHERE `type` = 'voc' AND `path` = '$userid/lang/$list/'";
|
||||
$result_articles = mysql_query ($sql, $ezine_db);
|
||||
if(mysql_num_rows($result_articles))
|
||||
{
|
||||
|
||||
|
||||
while ($articleDb = mysql_fetch_object($result_articles))
|
||||
{
|
||||
|
||||
$voc = json_decode($articleDb->value, true);
|
||||
$id = $articleDb->id;
|
||||
|
||||
|
||||
if($voc[0]['learnStatus'] == 'false') {
|
||||
$value_new[0]['activeLearn'] = 'true';
|
||||
$value_new[0]['learnStatus'] = 'pending';
|
||||
$query_contains = 1;
|
||||
}
|
||||
else {
|
||||
$value_new[0]['activeLearn'] = '0';
|
||||
$value_new[0]['learnStatus'] = '0';
|
||||
}
|
||||
|
||||
|
||||
$value_new[0]['1'] = $voc[0]['1'];
|
||||
$value_new[0]['2'] = $voc[0]['2'];
|
||||
$value_new[0]['progress'] = $voc[0]['progress'];
|
||||
|
||||
|
||||
|
||||
$value_new_new = json_encode($value_new);
|
||||
|
||||
mysql_query("UPDATE `VokabelBox2Content`SET `value` = '$value_new_new' WHERE `path` = '$userid/lang/$list/' AND `id` = '$id'");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
die();
|
||||
}
|
||||
|
||||
if($query_contains != 1) {
|
||||
print("noSelection");
|
||||
die();
|
||||
}
|
||||
|
||||
print("true");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user