Example #1
0
function PrintArbo()
{
    global $ModPath, $ModStart, $ThisFile, $NPDS_Prefix;
    // Retro compatibilité SABLE
    if (!function_exists("MM_img")) {
        include_once "modules/{$ModPath}/retro-compat/togglediv.class.php";
        echo "\n<script type=\"text/javascript\" src=\"modules/{$ModPath}/retro-compat/cookies.js\"></script>\n";
    } else {
        include_once "lib/togglediv.class.php";
    }
    // Retro compatibilité SABLE
    echo "<script type=\"text/javascript\">\n//<![CDATA[\n";
    echo "   function aff_image(img_id, img_src) {\n";
    echo "   var image_open = new Image();\n";
    echo "   image_open.src = img_src;\n";
    echo "   var image_closed = new Image();\n";
    echo "   image_closed.src = 'modules/{$ModPath}/data/img.gif'\n";
    echo "      if (document.all) {\n";
    echo "         if (document.all[img_id].src == image_closed.src) {\n";
    echo "            document.all[img_id].src = image_open.src;\n";
    echo "         } else {\n";
    echo "            document.all[img_id].src = image_closed.src;\n";
    echo "         }\n";
    echo "      } else {\n";
    echo "         if (document.getElementById(img_id).src == image_closed.src) {\n";
    echo "            document.getElementById(img_id).src = image_open.src;\n";
    echo "         } else {\n";
    echo "            document.getElementById(img_id).src = image_closed.src;\n";
    echo "         }\n";
    echo "      }\n";
    echo "   }";
    echo "   \n//]]>\n</script>\n";
    $toggle_import = new ToggleDiv(1);
    echo $toggle_import->Img();
    echo "<strong>" . gal_trans("Galerie temporaire") . "</strong>";
    echo $toggle_import->Begin();
    $queryZ = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_img WHERE gal_id='-1' ORDER BY id");
    // Image de la galerie temporaire
    echo '<ul class="list-group">';
    while ($rowZ_img = sql_fetch_row($queryZ)) {
        echo '<p><li class="list-group-item"><a href="modules.php?ModPath=' . $ModPath . '&amp;ModStart=gal&amp;op=one-img&amp;galid=-1&amp;pos=' . $rowZ_img[0] . '" target="_blank"><img class="img-fluid img-thumbnail" src="modules/' . $ModPath . '/mini/' . $rowZ_img[2] . '" border="0" alt="' . $rowZ_img[3] . '" title="' . $rowZ_img[3] . '" /></a><br />';
        echo '<span class="label label-default">ref : ' . $rowZ_img[2] . ' ' . stripslashes($rowZ_img[3]) . '</span>';
        if ($rowZ_img[6] == 1) {
            echo '<a href="' . $ThisFile . '&amp;subop=validimg&amp;imgid=' . $rowZ_img[0] . '"><i class="fa fa-check-square-o fa-lg"></i></a>';
        } else {
            echo '<span class="pull-xs-right"><a href="' . $ThisFile . '&amp;subop=editimg&amp;imgid=' . $rowZ_img[0] . '"><i title="" class="fa fa-edit fa-lg" data-original-title="Editer" data-toggle="tooltip"></i></a>&nbsp;&nbsp;';
        }
        echo '<a href="' . $ThisFile . '&amp;subop=delimg&amp;imgid=' . $rowZ_img[0] . '"><i title="" class="fa fa-trash-o fa-lg text-danger" data-original-title="Effacer" data-toggle="tooltip"></i></a></span></li></p>';
    }
    echo '</ul>';
    echo $toggle_import->End();
    echo $toggle_import->Cookies_all();
    echo "<br />\n";
    $sql_cat = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_cat WHERE cid='0' ORDER BY nom ASC");
    $num_cat = sql_num_rows($sql_cat);
    if ($num_cat == 0) {
        echo "<span class=\"text-danger\">" . gal_trans("Aucune catégorie trouvée") . "</span>";
    } else {
        $sql_sscat = "SELECT * FROM " . $NPDS_Prefix . "tdgal_cat WHERE cid!=0";
        $num_sscat = sql_num_rows(sql_query($sql_sscat));
        $sql_gal = "SELECT * FROM " . $NPDS_Prefix . "tdgal_gal";
        $num_gal = sql_num_rows(sql_query($sql_gal));
        $num_toggle = $num_cat + $num_sscat + $num_gal - 1;
        $toggle = new ToggleDiv($num_toggle);
        echo '<hr />';
        echo $toggle->All("");
        echo '<hr />';
        // CATEGORIE
        echo '
      <div class="card" id="accordion_1" role="tablist" aria-multiselectable="true">
         <div class="card-block">
            <h4 class="card-title">
            <a data-toggle="collapse" data-parent="#accordion_1" href="#faq_' . $id . '" aria-expanded="true" aria-controls="' . $id . '"><i class="fa fa-bars"></i></a>&nbsp;' . aff_langue($question) . '
            </h4>
            <div class="collapse" id="faq_' . $id . '" >
               <div class="card-text">
               toto fait du vélo<br />
               toto est descendu de son vélo
              
               </div>
            </div>
         </div>
      </div>';
        echo '<br /><br /><br /><br />';
        while ($row_cat = sql_fetch_row($sql_cat)) {
            /*echo '
               <div class="bg-faded">
               <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#souscat">
                  <i class="fa fa-caret-down fa-lg"></i> Marine
               </button>
            </nav>
            <div class="collapse" id="souscat">
               <div class="bg-success">
                  <div class="bg-primary">
                     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#galerie">
                        <i class="fa fa-caret-down fa-lg"></i> Bateaux
                     </button>
                  </div>
                  <div class="collapse" id="galerie">
                     <div class="bg-danger">
                              <div class="bg-primary">
                     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#galerie">
                        <i class="fa fa-caret-down fa-lg"></i> Galeries
                     </button>
                  </div>
                  <div class="collapse" id="galerie">
                     <div class="bg-danger">
                        les photos
                     </div>
                  </div>
                     </div>
                  </div>
               </div>
            </div>
            ';*/
            echo '<ul class="list-group">';
            echo $toggle->Img();
            echo '<li class="list-group-item">' . stripslashes($row_cat[2]);
            echo "<span class=\"pull-xs-right\"><a href=\"" . $ThisFile . "&amp;subop=editcat&amp;catid=" . $row_cat[0] . "\">";
            echo "<i title=\"\" class=\"fa fa-edit fa-lg\" data-original-title=\"Editer\" data-toggle=\"tooltip\"></i></a>";
            echo "&nbsp;&nbsp;<a href=\"" . $ThisFile . "&amp;subop=delcat&amp;catid=" . $row_cat[0] . "\">";
            echo "<i title=\"\" class=\"fa fa-trash-o fa-lg text-danger\" data-original-title=\"Effacer\" data-toggle=\"tooltip\"></i></a>";
            echo '</span></li></ul>';
            echo $toggle->Begin();
            $queryX = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_gal WHERE cid='" . $row_cat[0] . "' ORDER BY nom ASC");
            // Image de la galerie
            while ($rowX_gal = sql_fetch_row($queryX)) {
                echo '<ul class="list-group">';
                echo $toggle->Img();
                echo '<li class="list-group-item list-group-item-info"> ' . gal_trans("Galerie") . ' : ';
                echo stripslashes($rowX_gal[2]);
                echo "<span class=\"pull-xs-right\"><a href=\"" . $ThisFile . "&amp;subop=editgal&amp;galid=" . $rowX_gal[0] . "\">";
                echo "<i title=\"\" class=\"fa fa-edit fa-lg\" data-original-title=\"Editer\" data-toggle=\"tooltip\"></i></a>";
                echo "&nbsp;&nbsp;<a href=\"" . $ThisFile . "&amp;subop=delgal&amp;galid=" . $rowX_gal[0] . "\">";
                echo "<i title=\"\" class=\"fa fa-trash-o fa-lg text-danger\" data-original-title=\"Effacer\" data-toggle=\"tooltip\"></i></a>";
                echo '</span></li></ul>';
                echo $toggle->Begin();
                $queryZ = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_img WHERE gal_id='" . $rowX_gal[0] . "' ORDER BY ordre,id,noaff");
                // Image de la galerie
                echo "<table class=\"table\" width=\"100%\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\">";
                echo "<form action=\"" . $ThisFile . "&amp;subop=ordre\" method=\"post\" name=\"FormArbo{$rowX_gal['0']}\">";
                echo "<input type=\"hidden\" name=\"subop\" value=\"ordre\">";
                $i = 1;
                while ($rowZ_img = sql_fetch_row($queryZ)) {
                    echo "<tr>\n<td width=\"35\">&nbsp;</td>\n";
                    if ($rowZ_img[6] == 1) {
                        echo "<td width=\"150\" align=\"center\"><a href=\"modules.php?ModPath={$ModPath}&amp;ModStart=gal&amp;op=one-img&amp;galid={$rowX_gal['0']}&amp;pos={$rowZ_img['0']}\" target=\"_blank\"><img src=\"modules/{$ModPath}/mini/{$rowZ_img['2']}\" border=\"0\" alt=\"mini/{$rowZ_img['2']}\" title=\"mini/{$rowZ_img['2']}\" /></a>&nbsp;</td>\n";
                    } else {
                        echo "<td width=\"150\" align=\"center\"><a href=\"javascript: void(0);\" onMouseDown=\"aff_image('image{$rowX_gal['0']}_{$i}','modules/{$ModPath}/mini/{$rowZ_img['2']}');\"><img src=\"modules/{$ModPath}/data/img.gif\" id=\"image{$rowX_gal['0']}_{$i}\" border=\"0\" alt=\"mini/{$rowZ_img['2']}\" title=\"mini/{$rowZ_img['2']}\" /></a>";
                    }
                    echo "<td align=\"left\">&nbsp;" . stripslashes($rowZ_img[3]) . "</td>\n";
                    echo "<td width=\"40\" align=\"right\"><input class=\"textbox_standard\" type=\"text\" name=\"ordre[{$i}]\" value=\"{$rowZ_img['5']}\" size=\"3\" maxlength=\"11\">";
                    echo "<input type=\"hidden\" name=\"img_id[{$i}]\" value=\"{$rowZ_img['0']}\">";
                    echo "</td>";
                    $i++;
                    echo "<td width=\"40\" align=\"right\">";
                    if ($rowZ_img[6] == 1) {
                        echo "<a href=\"" . $ThisFile . "&amp;subop=validimg&amp;imgid=" . $rowZ_img[0] . "\"><i class=\"fa fa-check-square-o\"></i></a>&nbsp;&nbsp;";
                    } else {
                        echo "<a href=\"" . $ThisFile . "&amp;subop=editimg&amp;imgid=" . $rowZ_img[0] . "\"><i title=\"\" class=\"fa fa-edit fa-lg\" data-original-title=\"Editer\" data-toggle=\"tooltip\"></i></a>&nbsp;&nbsp;";
                    }
                    echo "<a href=\"" . $ThisFile . "&amp;subop=delimg&amp;imgid=" . $rowZ_img[0] . "\"><i title=\"\" class=\"fa fa-trash-o fa-lg text-danger\" data-original-title=\"Effacer\" data-toggle=\"tooltip\"></i></a></td></tr>\n";
                }
                // Fin Image De La Galerie
                if ($i != 1) {
                    echo "<tr><td colspan=\"5\" align=\"right\"><input class=\"bouton_standard\" type=\"submit\" value=\"" . gal_trans("MAJ ordre") . "\"></td></tr>";
                }
                echo "<tr><td colspan=\"5\">&nbsp;</td></tr>";
                echo "</form>";
                echo "</table>\n";
                echo $toggle->End();
                // Fin Toggle Galerie
            }
            // Fin Galerie Catégorie
            $query = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_cat WHERE cid='" . $row_cat[0] . "' ORDER BY nom ASC");
            // SOUS-CATEGORIE
            while ($row_sscat = sql_fetch_row($query)) {
                echo '<ul class="list-group">';
                echo $toggle->Img();
                echo '<li class="list-group-item list-group-item-warning">';
                echo '' . gal_trans("Sous-catégorie") . ' : ';
                echo stripslashes($row_sscat[2]);
                echo "<span class=\"pull-xs-right\"><a href=\"" . $ThisFile . "&amp;subop=editcat&amp;catid=" . $row_sscat[0] . "\">";
                echo "<i title=\"\" class=\"fa fa-edit fa-lg\" data-original-title=\"Editer\" data-toggle=\"tooltip\"></i></a>";
                echo "&nbsp;&nbsp;<a href=\"" . $ThisFile . "&amp;subop=delsscat&amp;sscatid=" . $row_sscat[0] . "\">";
                echo "<i title=\"\" class=\"fa fa-trash-o fa-lg text-danger\" data-original-title=\"Effacer\" data-toggle=\"tooltip\"></i></a>";
                echo '</span></li></ul>';
                echo $toggle->Begin();
                $querx = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_gal WHERE cid='" . $row_sscat[0] . "' ORDER BY nom ASC");
                // SOUS-CATEGORIE
                while ($row_gal = sql_fetch_row($querx)) {
                    echo '<ul class="list-group">';
                    echo $toggle->Img();
                    echo '<li class="list-group-item list-group-item-info">';
                    echo 'Galerie : ';
                    echo stripslashes($row_gal[2]) . "";
                    echo "<span class=\"pull-xs-right\"><a href=\"" . $ThisFile . "&amp;subop=editgal&amp;galid=" . $row_gal[0] . "\">";
                    echo "<i title=\"\" class=\"fa fa-edit fa-lg\" data-original-title=\"Editer\" data-toggle=\"tooltip\"></i></a>";
                    echo "&nbsp;&nbsp;<a href=\"" . $ThisFile . "&amp;subop=delgal&amp;galid=" . $row_gal[0] . "\">";
                    echo "<i title=\"\" class=\"fa fa-trash-o fa-lg text-danger\" data-original-title=\"Effacer\" data-toggle=\"tooltip\"></i></a>";
                    echo '</span></li></ul>';
                    echo $toggle->Begin();
                    $querz = sql_query("SELECT * FROM " . $NPDS_Prefix . "tdgal_img WHERE gal_id='" . $row_gal[0] . "' ORDER BY ordre,id,noaff");
                    // Image de la galerie
                    echo '<ul class="list-group">';
                    echo "<form action=\"" . $ThisFile . "&amp;subop=ordre\" method=\"post\" name=\"FormArbo{$row_gal['0']}\">";
                    echo "<input type=\"hidden\" name=\"subop\" value=\"ordre\">";
                    $i = 1;
                    while ($row_img = sql_fetch_row($querz)) {
                        echo '<li class="list-group-item">';
                        if ($row_img[6] == 1) {
                            echo "<a href=\"modules.php?ModPath={$ModPath}&amp;ModStart=gal&amp;op=one-img&amp;galid={$row_gal['0']}&amp;pos={$row_img['0']}\" target=\"_blank\"><img src=\"modules/{$ModPath}/mini/{$row_img['2']}\" border=\"0\" alt=\"mini/{$row_img['2']}\" title=\"mini/{$row_img['2']}\" /></a>\n";
                        } else {
                            echo "<a href=\"javascript: void(0);\" onMouseDown=\"aff_image('image{$row_gal['0']}_{$i}','modules/{$ModPath}/mini/{$row_img['2']}');\"><img src=\"modules/{$ModPath}/data/img.gif\" id=\"image{$row_gal['0']}_{$i}\" border=\"0\" alt=\"mini/{$row_img['2']}\" title=\"mini/{$row_img['2']}\" /></a>";
                        }
                        echo "&nbsp;" . stripslashes($row_img[3]) . "\n";
                        echo "<input class=\"textbox_standard\" type=\"text\" name=\"ordre[{$i}]\" value=\"{$row_img['5']}\" size=\"3\" maxlength=\"11\">";
                        echo "<input type=\"hidden\" name=\"img_id[{$i}]\" value=\"{$row_img['0']}\">";
                        $i++;
                        if ($row_img[6] == 1) {
                            echo "<span class=\"pull-xs-right\"><a href=\"" . $ThisFile . "&amp;subop=validimg&amp;imgid=" . $row_img[0] . "\"><i class=\"fa fa-check-square-o\"></i></a>&nbsp;&nbsp;";
                        } else {
                            echo "<span class=\"pull-xs-right\"><a href=\"" . $ThisFile . "&amp;subop=editimg&amp;imgid=" . $row_img[0] . "\"><i title=\"\" class=\"fa fa-edit fa-lg\" data-original-title=\"Editer\" data-toggle=\"tooltip\"></i></a>&nbsp;&nbsp;";
                        }
                        echo "<a href=\"" . $ThisFile . "&amp;subop=delimg&amp;imgid=" . $row_img[0] . "\"><i title=\"\" class=\"fa fa-trash-o fa-lg text-danger\" data-original-title=\"Effacer\" data-toggle=\"tooltip\"></i></a>\n";
                    }
                    // Fin Image De La Galerie
                    if ($i != 1) {
                        echo "<input class=\"bouton_standard\" type=\"submit\" value=\"" . gal_trans("MAJ ordre") . "\">";
                    }
                    echo "</form>";
                    echo '</span></li></ul>';
                    echo $toggle->End();
                    // Fin Toggle Galerie
                }
                // Fin Galerie Sous Catégorie
                echo $toggle->End();
                // Fin Toggle Sous-Catégorie
            }
            // Fin Sous Catégorie
            echo $toggle->End();
            // Fin Toggle Catégorie
        }
        // Fin Catégorie
        echo "<hr noshade class=\"ongl\"><table class=\"table\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr>\n<td>\n";
        echo $toggle->All();
        echo $toggle->Cookies_all();
        echo "</td>\n</tr>\n</table>\n<hr noshade class=\"ongl\">";
    }
}
Example #2
0
function publishrights($author)
{
    global $NPDS_Prefix, $hlpfile, $radminsuper, $f_meta_nom, $f_titre, $adminimg;
    if ($radminsuper != 1) {
        Header("Location: admin.php?op=sections");
    }
    include "header.php";
    GraphicAdmin($hlpfile);
    adminhead($f_meta_nom, $f_titre, $adminimg);
    echo '
   <h3>' . adm_translate("Droits des auteurs") . ' :: ' . $author . '</h3>
   <form action="admin.php" method="post">';
    include_once "lib/togglediv.class.php";
    $result1 = sql_query("SELECT rubid, rubname FROM " . $NPDS_Prefix . "rubriques ORDER BY ordre");
    $numrow = sql_num_rows($result1);
    $toggle = new ToggleDiv($numrow);
    echo $toggle->All();
    echo "<hr noshade=\"noshade\" class=\"ongl\" />";
    $i = 0;
    while (list($rubid, $rubname) = sql_fetch_row($result1)) {
        echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"0\" border=\"0\">\n            <tr>\n            <td class=\"header\" width=\"40%\">";
        echo $toggle->Img();
        echo aff_langue($rubname) . "</td>\n            <td class=\"header\"align=\"center\" width=\"15%\">" . adm_translate("Créer") . "</td>\n            <td class=\"header\"align=\"center\" width=\"15%\">" . adm_translate("Publier") . "</td>\n            <td class=\"header\"align=\"center\" width=\"15%\">" . adm_translate("Modifier") . "</td>\n            <td class=\"header\"align=\"center\" width=\"15%\">" . adm_translate("Supprimer") . "</td>\n            </tr></table>";
        echo $toggle->Begin();
        $result2 = sql_query("SELECT secid, secname FROM " . $NPDS_Prefix . "sections WHERE rubid='{$rubid}' ORDER BY ordre");
        echo "<table width=\"100%\" cellspacing=\"1\" cellpadding=\"2\" border=\"0\">";
        $rowcolor = tablos();
        while (list($secid, $secname) = sql_fetch_row($result2)) {
            $result3 = sql_query("SELECT type FROM " . $NPDS_Prefix . "publisujet WHERE secid2='{$secid}' and aid='{$author}'");
            $i++;
            $crea = "";
            $publi = "";
            $modif = "";
            $supp = "";
            if (sql_num_rows($result3) > 0) {
                while (list($type) = sql_fetch_row($result3)) {
                    if ($type == 1) {
                        $crea = "checked=\"checked\"";
                    } else {
                        if ($type == 2) {
                            $publi = "checked=\"checked\"";
                        } else {
                            if ($type == 3) {
                                $modif = "checked=\"checked\"";
                            } else {
                                if ($type == 4) {
                                    $supp = "checked=\"checked\"";
                                }
                            }
                        }
                    }
                }
            }
            echo "<tr>\n               <td width=\"40%\">" . aff_langue($secname) . "</td>\n               <td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"creation[{$i}]\" value=\"{$secid}\" {$crea} /></td>\n               <td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"publication[{$i}]\" value=\"{$secid}\" {$publi} /></td>\n               <td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"modification[{$i}]\" value=\"{$secid}\" {$modif} /></td>\n               <td align=\"center\" width=\"15%\"><input type=\"checkbox\" name=\"suppression[{$i}]\" value=\"{$secid}\" {$supp} /></td>\n               </tr>";
        }
        echo '</table>';
        echo $toggle->End();
        echo '<br />';
    }
    echo '<input type="hidden" name="chng_aid" value="' . $author . '" />
         <input type="hidden" name="op" value="updatedroitauteurs" />
         <input type="hidden" name="maxindex" value="' . $i . '" />
         <input class="btn btn-primary" type="submit" value="' . adm_translate("Valider") . '" />&nbsp;&nbsp;
         <input class="btn btn-secondary" type="button" onclick="javascript:history.back()" value="' . adm_translate("Retour en arrière") . '" />
         </form>';
    closetable();
    include "footer.php";
}
Example #3
0
function DownloadAdmin()
{
    global $hlpfile, $NPDS_Prefix, $f_meta_nom, $f_titre, $adminimg;
    include "header.php";
    include_once "lib/togglediv.class.php";
    GraphicAdmin($hlpfile);
    adminhead($f_meta_nom, $f_titre, $adminimg);
    echo "<form action=\"admin.php\" method=\"post\">";
    $resultX = sql_query("SELECT DISTINCT dcategory FROM " . $NPDS_Prefix . "downloads ORDER BY dcategory");
    $num_row = sql_num_rows($resultX);
    $toggle = new ToggleDiv($num_row);
    echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"header\">\n";
    echo adm_translate("Téléchargements");
    echo "</td><td class=\"ongl\">" . $toggle->All() . "</td>";
    echo "</td></tr></table>";
    while (list($dcategory) = sql_fetch_row($resultX)) {
        echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">";
        echo "<tr><td class=\"ongl\">";
        echo $toggle->Img();
        echo adm_translate("Catégorie") . " : " . aff_langue(stripslashes($dcategory));
        echo $toggle->Begin();
        echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n          <tr>\n             <td class=\"ongl\">" . adm_translate("ID") . "</td>\n             <td class=\"ongl\">" . adm_translate("Compt.") . "</td>\n             <td class=\"ongl\">Typ.</td>\n             <td class=\"ongl\">" . adm_translate("URL") . "</td>\n             <td class=\"ongl\">" . adm_translate("Nom de fichier") . "</td>\n             <td class=\"ongl\" align=\"center\">" . adm_translate("Ver.") . "</td>\n             <td class=\"ongl\" align=\"center\">" . adm_translate("Taille de fichier") . "</td>\n             <td class=\"ongl\" align=\"center\">" . adm_translate("Date") . "</td>\n             <td class=\"ongl\" align=\"center\">" . adm_translate("Fonctions") . "</td>\n          </tr>";
        $result = sql_query("SELECT did, dcounter, durl, dfilename, dfilesize, ddate, dver, perms FROM " . $NPDS_Prefix . "downloads WHERE dcategory='" . addslashes($dcategory) . "' ORDER BY did ASC");
        while (list($did, $dcounter, $durl, $dfilename, $dfilesize, $ddate, $dver, $dperm) = sql_fetch_row($result)) {
            $rowcolor = tablos();
            echo "<tr {$rowcolor}>\n                <td align=\"center\">{$did}</td>\n                <td align=\"center\">{$dcounter}</td>";
            if ($dperm == 0) {
                $dperm = "Al";
            }
            if ($dperm >= 1) {
                $dperm = "Mb";
            }
            if ($dperm == -127) {
                $dperm = "Ad";
            }
            if ($dperm == -1) {
                $dperm = "An";
            }
            echo "<td align=\"left\">{$dperm}</td>\n                <td><a href=\"{$durl}\" class=\"noir\">" . adm_translate("Téléchargements") . "</a></td>\n                <td>{$dfilename}</td>\n                <td align=\"center\">&nbsp;{$dver}</td>\n                <td align=\"center\">";
            //$Fichier = new File($durl);
            $Fichier = new FileManagement();
            // essai class
            if ($dfilesize != 0) {
                //echo $Fichier->Pretty_Size($dfilesize);
                echo $Fichier->file_size_auto($durl, 2);
            } else {
                //echo $Fichier->Affiche_Size();
                echo $Fichier->file_size_auto($durl, 2);
            }
            echo "</td>\n                <td align=\"center\">{$ddate}</td>\n                <td align=\"center\"><a href=\"admin.php?op=DownloadEdit&amp;did={$did}\" class=\"noir\">" . adm_translate("Editer") . "</a> |\n                <a href=\"admin.php?op=DownloadDel&amp;did={$did}&amp;ok=0\" class=\"rouge\">" . adm_translate("Effacer") . "</a></td>\n               </tr>";
        }
        echo "</table>";
        echo $toggle->End();
        echo "</td></tr></table>";
    }
    echo '
   </form>';
    echo '
   <h3>' . adm_translate("Ajouter un Téléchargement") . '</h3>
   <form action="admin.php" method="post" name="adminForm">
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="durl">' . adm_translate("Télécharger URL") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="url" id="durl" name="durl" maxlength="255" required="required" />
   &nbsp;<a href="javascript:void(0);" onclick="window.open(\'admin.php?op=FileManagerDisplay\', \'wdir\', \'width=650, height=450, menubar=no, location=no, directories=no, status=no, copyhistory=no, toolbar=no, scrollbars=yes, resizable=yes\');">
   <span class="">[' . adm_translate("Parcourir") . ']</span></a>
            <span class="help-block text-xs-right"><span id="countcar_durl"></span></span>

   
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="dcounter">' . adm_translate("Compteur") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="number" name="dcounter" maxlength="30" />
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="dfilename">' . adm_translate("Nom de fichier") . '</label>
            <div class="col-sm-8">
               <input class="form-control" type="text" id="dfilename" name="dfilename" maxlength="255" />
               <span class="help-block text-xs-right"><span id="countcar_dfilename"></span></span>
            </div>
         </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="dver">' . adm_translate("Version") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="text" name="dver" maxlength="6" />
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="dfilesize">' . adm_translate("Taille de fichier") . ' (bytes)</label>
         <div class="col-sm-8">
            <input class="form-control" type="text" name="dfilesize" maxlength="31" />
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="dweb">' . adm_translate("Propriétaire de la page Web") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="text" id="dweb" name="dweb" maxlength="255" />
            <span class="help-block text-xs-right"><span id="countcar_dweb"></span></span>
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="duser">' . adm_translate("Propriétaire") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="text" id="duser" name="duser" maxlength="30" />
            <span class="help-block text-xs-right"><span id="countcar_duser"></span></span>
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="dcategory">' . adm_translate("Catégorie") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="text" id="dcategory" name="dcategory" maxlength="250" />
            <span class="help-block text-xs-right"><span id="countcar_dcategory"></span></span>
            <select class="c-select form-control" name="sdcategory">';
    $result = sql_query("SELECT DISTINCT dcategory FROM " . $NPDS_Prefix . "downloads ORDER BY dcategory");
    while (list($dcategory) = sql_fetch_row($result)) {
        $dcategory = stripslashes($dcategory);
        echo '
               <option ' . $sel . ' value="' . $dcategory . '">' . aff_langue($dcategory) . '</option>';
    }
    echo '
            </select>
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-12" for="xtext">' . adm_translate("Description") . '</label>
         <div class="col-sm-12">
            <textarea class="tin form-control" name="xtext" rows="20" ></textarea>
         </div>
      </div>';
    echo aff_editeur('xtext', '');
    echo '                         <fieldset>
                        <legend>' . adm_translate("Droits") . '</legend>';
    droits('');
    echo '</fieldset>
      <input type="hidden" name="op" value="DownloadAdd" />
      <div class="form-group row">
         <input class="btn btn-primary" type="submit" value="' . adm_translate("Ajouter") . '" />
      </div>
    </form>
    <script type="text/javascript">
   //<![CDATA[
      $(document).ready(function() {
         inpandfieldlen("durl",255);
         inpandfieldlen("dfilename",255);
         inpandfieldlen("dver",6);
         inpandfieldlen("dfilesize",31);
         inpandfieldlen("dweb",255);
         inpandfieldlen("duser",30);
         inpandfieldlen("dcategory",250);
      });
   //]]>
   </script>';
    adminfoot('fv', '', '', '');
    //   include("footer.php");
}