Source for file mod.php
Documentation is available at mod.php
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
if (isset ($_GET['id'])) $scale_id= $_GET['id'];
if (isset ($_POST['id'])) $scale_id= $_POST['id'];
$scale_object= new scale;
$data= $sql_object->DBSelect($requete, 'OBJECT');
$current_title= formatText($data[0]->scale_denomination, '2HTML');
$current_scale_dependencies= $data[0]->scale_dependencies;
$current_root= $data[0]->scale_root;
if(isset ($_POST['valider'])) {
$table[0]= $_POST['denomination'];
$table[1]= $_POST['surface'];
$table[2]= $_POST['population'];
$table[3]= $_POST['root_scale'];
$table[4]= $_POST['com_scale'];
$table[5]= $_POST['statut_scale'];
$integrity= $scale_object->CheckDataIntegrity($table);
if(is_string($integrity)) $format_text= '2FIELD';
else $format_text= '2HTML';
$form_denomination= formatText($_POST['denomination'], $format_text);
$form_surface= $_POST['surface'];
$form_population= $_POST['population'];
$form_comment= $_POST['com_scale'];
$form_root_scale= $_POST['root_scale'];
$form_statut_scale= $_POST['statut_scale'];
if(isset ($_POST['enregistrer'])) {
$result= $scale_object->ModifyScale($scale_id, $data_table, $sql_object);
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo. "&id=". $scale_id;
if($result) header("Location: ". $link_confirm);
$data= $sql_object->DBSelect($requete, 'OBJECT');
$form_denomination= formatText($data[0]->scale_denomination, '2FIELD');
$form_surface= $data[0]->scale_surface;
$form_population= $data[0]->scale_inhabitantsnumber;
$form_root_scale= $data[0]->scale_root;
$form_statut_scale= $data[0]->scale_statut;
$form_comment= formatText($data[0]->scale_comment, '2FIELD');
if($form_statut_scale== 'P') $mask_statut_P= ' checked="checked"';
if($form_statut_scale== 'D') $mask_statut_D= ' checked="checked"';
<a href="index.php"> <? echo $GLOBALS['lang']['way']['home'] ?></a>
<a href=" <?php echo $rub_link; ?>"> <? echo $GLOBALS['lang']['menu']['scale']?></a>
<span> <? echo $GLOBALS['lang']['scale']['mod'] . ' : '. formatNavTitle($current_title);?></span>
include_once("quickicons.php");
if($current_scale_dependencies!= 0) {
include_once("../lib/input_helpers.php");
// select-box des échelles
$table_exclu= $scale_object->getMaxDepth($scale_id, $sql_object);
$data= $sql_object->DBSelect($req_mod);
$select_statut= "<label for=\"statut_P\" >". $GLOBALS['lang']['divers']['statut'] . " : *</label>\n";
$select_statut.= "<input type=\"radio\" name=\"statut_scale\" id=\"statut_P\" value=\"P\"". $mask_statut_P. " /><span class=\"radio\">". $GLOBALS['lang']['statut']['public']. "</span>\n";
$select_statut.= "<input type=\"radio\" name=\"statut_scale\" id=\"statut_D\" value=\"D\"". $mask_statut_D. " /><span class=\"radio\">". $GLOBALS['lang']['statut']['draft']. "</span>\n";
$select_root .= "<input type=\"hidden\" name=\"root_scale\" value=\"0\" id=\"root_scale\" />\n";
$select_statut= "<input type=\"hidden\" name=\"statut_scale\" value=\"P\" id=\"statut_scale\" />\n";
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer">
include_once($dir. "/menurub.php");
<form id="modscale" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="denomination"> <? echo $GLOBALS['lang']['scale']['denomination']; ?> : *</label>
<input name="denomination" type="text" id="denomination" maxlength="200" value=" <?php echo $form_denomination; ?>" class="textfield"/>
<label for="surface"> <? echo $GLOBALS['lang']['scale']['surface']; ?> ( <?php echo SURFACE_UNIT; ?>) :</label>
<input name="surface" type="text" id="surface" maxlength="8" value=" <?php echo $form_surface; ?>" class="textfield" />
<label for="population"> <? echo $GLOBALS['lang']['scale']['population']; ?> :</label>
<input name="population" type="text" id="population" maxlength="8" value=" <?php echo $form_population; ?>" class="textfield" />
<label for="root_scale"> <?php echo $GLOBALS['lang']['scale']['root']; ?> : *</label>
<?php echo $select_root; ?>
<?php echo $select_statut; ?>
<label for="com_scale"> <? echo $GLOBALS['lang']['scale']['comment']; ?> : </label>
<textarea id="com_scale" name="com_scale" class="largetextfield" <?php echo AREA_SETTINGS; ?> > <?php echo $form_comment; ?></textarea>
<input name="statut_scale" type="hidden" value="P" id="statut_P" />
<input name="id" type="hidden" value=" <?php echo $scale_id; ?>" id="scale_id" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="valider" type="submit" value=" <? echo $GLOBALS['lang']['btn']['valid'] ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?>
$display_form_surface= empty_nc($form_surface);
$display_form_population= empty_nc($form_population);
// sélection de l'échelle racine si elle en a une (!echelle root)
if($current_scale_dependencies!= 0) {
$data= $sql_object->DBSelect($requete);
$display_root_scale= "<dt>". $GLOBALS['lang']['scale']['root']. " : </dt>\n";
$display_root_scale.= "<dd>". formatText($data[0]['scale_denomination'], '2HTML'). "<br /></dd>\n";
} else $display_root_scale= '';
<div class="contentcontainer">
include_once($dir. "/menurub.php");
<h2> <? echo $GLOBALS['lang']['recap']['title']; ?></h2>
<dt> <? echo $GLOBALS['lang']['scale']['denomination']; ?> : </dt>
<dd> <?php echo $form_denomination; ?><br /></dd>
<dt> <? echo $GLOBALS['lang']['scale']['surface']; ?> ( <?php echo SURFACE_UNIT; ?>) :</dt>
<dd> <?php echo $display_form_surface; ?><br /></dd>
<dt> <? echo $GLOBALS['lang']['scale']['population']; ?> :</dt>
<dd> <?php echo $display_form_population; ?><br /></dd>
<?php echo $display_root_scale; ?>
<? /*<dt><? echo $GLOBALS['lang']['divers']['statut']; ?>: </dt>
<dd><?php echo $display_statut_scale; ?><br /></dd> */ ?>
<dt> <? echo $GLOBALS['lang']['scale']['comment']; ?> : </dt>
<dd> <?php echo formatText($display_form_comment, '2HTML'); ?><br /></dd>
<form id="addscale" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<input name="id" type="hidden" value=" <?php echo $scale_id; ?>" id="scale_id" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="data_table" type="hidden" value=" <?php echo $table; ?>" id="data_table" />
<input name="retour" type="button" value=" <? echo $GLOBALS['lang']['btn']['preview'] ?>" class="button" id="retour" onclick="history.go(-1);" />
<input name="enregistrer" type="submit" value=" <? echo $GLOBALS['lang']['btn']['save'] ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?>
|