/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require ("./inc/settings.php");
-require ("./inc/db/mysql.php");
-
-$error = false;
-try {
- $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
- $usrtblexists = $connection->users_table_exists ();
- $itemstblexists = $connection->items_table_exists ();
-} catch (Exception $e) {
- $error = true;
-}
-if (!$usrtblexists || !$itemstblexists) {
- $error = true;
-}
- if ($error) {
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
- <title>SYP admin</title>
- <link rel="stylesheet" href="./media/admin.css" type="text/css">
-</head>
-<body>
- <p class="error center">SYP n'est pas correctement installé. Veuillez
- consulter le fichier README.txt et suivez les instructions
- d'installation.</p>
-</body>
-</html>
-<?php
- exit ();
- } // if ($error)
+ require ('inc/langutils.php');
+ require ('inc/templates_admin.php');
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
- <title>SYP admin</title>
-
- <link rel="stylesheet" href="./media/admin.css" type="text/css">
- <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
-
- <script type="text/javascript">
- <?php
- $bbox = $connection->mbr ();
- printf ("var sypOrig = [%.18F, %.18F, %.18F, %.18F];\n",
- $bbox [0], $bbox [1], $bbox [2], $bbox [3]);
- ?>
- </script>
- <script src="./js/jquery-1.3.2.js" type="text/javascript"></script>
- <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
- <script src="./js/admin.js" type="text/javascript"></script>
-
- <noscript>
- <style type="text/css">
- #map, #editor, #newimage, #global_admin, #login_area {
- display: none;
- }
- </style>
- </noscript>
-
-</head>
-
-<body>
-
- <noscript>
- <p>SYP nécessite javascript pour fonctionner. Veuillez activer les scripts
- dans votre navigateur.</p>
- </noscript>
-
-
- <div id="map"></div>
-
- <p id="logout"><a href="auth.php?logout=true">Déconnexion</a></p>
-
- <!-- we need to set some random content to give some height to
- #features_success -->
- <p class="success center" id="features_success">.</p>
-
- <div id="editor" class="center">
- <label for="title_input">titre :</label><br>
- <input id="title_input" class="input" size="50"><br>
- <label for="desc_input">description :</label><br>
- <textarea id="desc_input" class="input" cols="45" rows="4"></textarea><br>
- <img id="img"><br>
- <input id="deletephoto_button" type="button" class="center" value="supprimer cette photo">
- </div>
-
- <div id="newimage">
- <img id="newimage_close" src="openlayers/theme/default/img/close.gif" alt="fermer">
- <form id="file_form"
- action="changes.php"
- method="POST"
- enctype="multipart/form-data"
- target="fileframe"
- accept="image/gif image/jpeg image/jpg image/png"
- >
- <label for="newimage_input">sélectionnez une image</label>
- <input id="newimage_input" name="newimage_input" type="file">
- </form>
- <p id="newimage_throbber" class="throbber center">
- Upload en cours
- <img src="media/newimage_throbber.gif" alt="throbber">
- </p>
- <img id="newimage_preview" src="">
- <p class="warn center" id="newimage_warn"></p>
- <p class="error center" id="newimage_error"></p>
- </div>
-
- <div id="global_admin" class="center">
- <p id="modify_howto">Pour modifier les données d'une photo, sélectionnez le marqueur correspondant</p>
- <p id="dragdrop_howto">Vous pouvez déplacer le marqueur en effectuant un glisser-déposer</p>
- <input id="addphoto_button" type="button" class="center" value="ajouter une image">
- <p class="error" id="features_connect_error"></p>
- </div>
-
-
- <div id="login_area"<?php
- $cookie_name = sprintf ("%sauth", DBPREFIX);
- if (isset ($_COOKIE [$cookie_name])) {
- if ($connection->checkpwdmd5 ("admin", $_COOKIE [$cookie_name])) {
- echo ' class="hidden"';
- }
- }
- ?>>
- <div id="login_transparency"></div>
- <div id="login_padding"></div>
- <div id="login_content">
- <form id="login_form" method="post" action="auth.php">
- <table>
- <tr>
- <td><label for="user_pwd">mot de passe</label></td>
- <td style="width: 100%"><input id="user_pwd" name="user_pwd" type="password"></td>
- </tr>
- </table>
- <p class="center">
- <input id="login_submit" type="submit">
- </p>
- <p id="pwd_throbber" class="throbber center">
- Connexion en cours
- <img src="media/pwd_throbber.gif" alt="throbber">
- </p>
- <p class="error center" id="login_connect_error"></p>
- <p class="error center" id="login_password_error">Le mot de passe n'est pas correct</p>
- </form>
- </div>
- </div>
-
- <iframe id="fileframe" name="fileframe" src="" frameborder="0" width="0" height="0"></iframe>
-</body>
-</html>