Пример #1
0
function secartdelete($artid, $ok = 0)
{
    global $NPDS_Prefix;
    // protection
    $result = sql_query("SELECT secid FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
    list($secid) = sql_fetch_row($result);
    $tmp = droits_publication($secid);
    if ($tmp != 7 and $tmp != 4) {
        Header("Location: admin.php?op=sections");
    }
    if ($ok == 1) {
        sql_query("DELETE FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
        sql_query("DELETE FROM " . $NPDS_Prefix . "compatsujet WHERE id1='{$artid}'");
        global $aid;
        Ecr_Log("security", "DeleteArticlesSections({$artid}) by AID : {$aid}", "");
        Header("Location: admin.php?op=sections");
    } else {
        global $hlpfile;
        include 'header.php';
        GraphicAdmin($hlpfile);
        opentable();
        $result = sql_query("SELECT title FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
        list($title) = sql_fetch_row($result);
        echo "<p align=\"center\">" . adm_translate("Etes-vous certain de vouloir effacer cette publication ?") . " : " . aff_langue($title);
        echo "<br /><br />[ <a href=\"admin.php?op=secartdelete&amp;artid={$artid}&amp;ok=1\" class=\"rouge\">" . adm_translate("Oui") . "</a> | <a href=\"admin.php?op=sections\" class=\"noir\">" . adm_translate("Non") . "</a> ]</p><br />";
        closetable();
        include "footer.php";
    }
}
Пример #2
0
function secartdelete($artid, $ok = 0)
{
    global $NPDS_Prefix;
    // protection
    $result = sql_query("SELECT secid FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
    list($secid) = sql_fetch_row($result);
    $tmp = droits_publication($secid);
    if ($tmp != 7 and $tmp != 4) {
        Header("Location: admin.php?op=sections");
    }
    if ($ok == 1) {
        sql_query("DELETE FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
        sql_query("DELETE FROM " . $NPDS_Prefix . "compatsujet WHERE id1='{$artid}'");
        global $aid;
        Ecr_Log("security", "DeleteArticlesSections({$artid}) by AID : {$aid}", "");
        Header("Location: admin.php?op=sections");
    } else {
        global $hlpfile, $f_meta_nom, $f_titre, $adminimg;
        include 'header.php';
        GraphicAdmin($hlpfile);
        adminhead($f_meta_nom, $f_titre, $adminimg);
        $result = sql_query("SELECT title FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
        list($title) = sql_fetch_row($result);
        echo '
      <hr />
      <h3 class="mb-1 text-danger">' . adm_translate("Effacer la publication :") . ' <span class="text-muted">' . aff_langue($title) . '</span></h3>
      <p class="alert alert-danger">
         <strong>' . adm_translate("Etes-vous certain de vouloir effacer cette publication ?") . '</strong><br /><br />
         <a class="btn btn-danger btn-sm" href="admin.php?op=secartdelete&amp;artid=' . $artid . '&amp;ok=1" role="button">' . adm_translate("Oui") . '</a>&nbsp;<a class="btn btn-secondary btn-sm" role="button" href="admin.php?op=sections" >' . adm_translate("Non") . '</a>
      </p>';
        include "footer.php";
    }
}