having some troubles
its not updating the submitted entries
heres my code:
PHP Code:
if($_REQUEST['do']=="moderateentries")
{
print_cp_header("Moderate Journal Entries");
print_form_header('journaladmin', 'doentries');
print_table_header("Moderate Journal Entries");
$getentries= $DB_site->query("SELECT journal_entries.entrytitle,journal_entries.journal_id,journals.journalname,
journals.journalist,journals.journalist_id,journal_entries.entrytext,journal_entries.entry_id
FROM ".TABLE_PREFIX."journal_entries
LEFT JOIN ".TABLE_PREFIX."journals ON (journal_entries.journal_id=journals.journal_id)
WHERE journal_entries.entry_active!=1");
if(!empty($getentries))
{
while($entry=$DB_site->fetch_array($getentries))
{
print_description_row('<span class="smallfont"> </span>', 0, 2, 'thead');
print_label_row('<b>Entered By</b>:', '<a href=user.php?do=edit&userid='.$entry[journalist_id].'>'.$entry[journalist].'</a>');
print_label_row('<b>Belongs to Journal</b>:', '<a href=journaladmin.php?do=editj&j='.$entry[journal_id].'>'.iif(empty($entry[journalname]), ''.$entry[journalist].'\'s Journal', $entry[journalname]).'</a>');
print_input_row("<i>Entry Title</i>:", "entrytitle[$entry[entry_id]]", $entry[entrytitle], 0);
print_textarea_row("<i>Entry Message</i>:", "entrytext[$entry[entry_id]]", $entry[entrytext], 8, 60);
print_label_row($vbphrase['action'], "
<label for=\"val_$entry[entry_id]\"><input type=\"radio\" name=\"entryaction[$entry[entry_id]]\" value=\"1\" id=\"val_$entry[entry_id]\" tabindex=\"1\" />Approve</label>
<label for=\"del_$entry[entry_id]\"><input type=\"radio\" name=\"entryaction[$entry[entry_id]]\" value=\"2\" id=\"del_$entry[entry_id]\" tabindex=\"1\" />" . $vbphrase['delete'] . "</label>
<label for=\"ign_$entry[entry_id]\"><input type=\"radio\" name=\"entryaction[$entry[entry_id]]\" value=\"3\" id=\"ign_$entry[entry_id]\" tabindex=\"1\" checked=\"checked\" />" . $vbphrase['ignore'] . "</label>
", '', 'top', 'entryaction');
}
print_submit_row();
}
else
{
print_description_row("No Entries to Moderate");
print_table_footer();
}
}
if($_POST['do']=="doentries")
{
globalize($_POST, array('entryaction', 'entrytitle', 'entrytext'));
foreach($entryaction AS $entryid => $action)
{
$entryid= intval($entryid);
if($action==1)
{
$DB_site->query("UPDATE ".TABLE_PREFIX."journal_entries SET entrytitle='".addslashes($entrytitle[$entryid])."',entrytext='".addslashes($entrytext[$entryid])."' WHERE entry_id='".$entryid."'");
}
elseif($action==2)
{
$DB_site->query("DELETE FROM ".TABLE_PREFIX."journal_entries WHERE entry_id='".$entryid."'");
}
}
define('CP_REDIRECT', 'journaladmin.php?do=moderateentries');
print_stop_message('journal_entries_moderated_successfully');
}
thanks in advance