Hallo zusammen,
ich habe das Formular erweitert um das Feld "Info".
Es wird zwar angezeigt aber leider wird es in der Datenbank nicht gefüllt.
Info ist in der Tabelle eingetragen: info varchar(40) utf8_general_ci
Beim Abspeichern wird der Wert "info" so nicht erkannt. Vielleicht kann mir jemand einen Tipp geben. Suche echt schon ne Weile.
Bitte um einen Anhaltspunkt.
Liebe Grüße
Joachim
ich habe das Formular erweitert um das Feld "Info".
Es wird zwar angezeigt aber leider wird es in der Datenbank nicht gefüllt.
Info ist in der Tabelle eingetragen: info varchar(40) utf8_general_ci
Beim Abspeichern wird der Wert "info" so nicht erkannt. Vielleicht kann mir jemand einen Tipp geben. Suche echt schon ne Weile.
PHP-Code:
<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real estate agency
*
* @version $Id: form.php 145 2010-03-31 10:03:47Z ilhooq $
* @package Jea.site
* @copyright Copyright (C) 2008 PHILIP Sylvain. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla Estate Agency is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses.
*
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' ) ;
JHTML::stylesheet('jea.admin.css', 'media/com_jea/css/');
JHTML::_( 'behavior.calendar' );
JHTML::_( 'behavior.modal' );
JFilterOutput::objectHTMLSafe( $this->row );
$editor =& JFactory::getEditor();
// Ajax behavior on towns and departments
$ajaxScript=<<<EOB
$access = canEdit
var townOptionsCallback = {
onComplete: function(response){
var first = $('area_id').getFirst().clone();
$('area_id').empty();
$('area_id').appendChild(first);
response.each(function(item){
var option = new Element('option', {'value' : item.id});
option.appendText(item.value);
$('area_id').appendChild(option);
});
}
};
var deptOptionsCallback = {
onComplete: function(response){
var first = $('town_id').getFirst().clone();
$('town_id').empty();
$('town_id').appendChild(first);
if(response){
response.each(function(item){
var option = new Element('option', {'value' : item.id});
option.appendText(item.value);
$('town_id').appendChild(option);
});
}
}
};
window.addEvent('domready', function() {
$('departments').addEvent('change', function(){
var url = 'index.php?option=com_jea&controller=frontajax&task=get_towns'
+ '&departments=' + this.value;
var jSonRequest = new Json.Remote( url , deptOptionsCallback );
jSonRequest.send();
});
$('town_id').addEvent('change', function(){
var url = 'index.php?option=com_jea&controller=frontajax&task=get_areas'
+ '&town_id=' + this.value;
var jSonRequest = new Json.Remote( url , townOptionsCallback );
jSonRequest.send();
});
});
EOB;
$document=& JFactory::getDocument();
$document->addScriptDeclaration($ajaxScript);
$document->addScriptDeclaration( '
function checkForm(no_redirect_after_save) {
var form = document.jeaForm;
if ( form.ref.value == "" ) {
alert( "' . JText::_('Property must have a reference') . '" );
return false;
} else if ( form.type_id.value == "0" ) {
alert( "' . JText::_('Select a type of property') . '" );
return false;
}
else if ( form.departments.value == "" ) {
alert( "' . JText::_('Select a type of property') . '" );
return false;
}
' . $editor->save( 'description' ) .'
form.no_redirect_after_save.value=no_redirect_after_save;
return true;
}');
?>
<div style="width:474px">
<h1><?php echo $this->page_title ?></h1>
Hier können Sie kostenlos eine Wohnung inserieren. Bitte füllen Sie folgendes Formular aus. Sie können am Ende des Formulars eine Emailadresse angeben, an die Ihnen ein Link mit Ihrem Eintrag geschickt wird. Sie können so jederzeit nachträglich noch Änderungen vornehmen. Ihre inserierte Wohnung wird nach 60 Tagen automatisch aus unserer Datenbank gelöscht.<br /><br />
<form action="<?php echo JRoute::_('&task=save()') ?>" method="post" name="jeaForm" id="jeaForm" enctype="multipart/form-data" onsubmit="return checkForm()" >
<table class="adminform">
<tr>
<td nowrap="nowrap"> <label for="ref"><?php echo JText::_('Titel *') ?> : </label></td>
<td width="100%">
<input id="ref" type="text" name="ref" value="<?php echo $this->escape( $this->row->ref ) ?>" class="inputbox" size="55" />
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="type_id"><?php echo JText::_('Wohnungstyp ') ?> :</label></td>
<td width="100%" ><?php echo $this->getHtmlList('types', $this->row->type_id) ?></td>
</tr>
<tr>
<td nowrap="nowrap"><label for="adress"><?php echo JText::_('Adresse') ?> :</label></td>
<td width="100%" >
<input id="adress" type="text" name="adress" value="<?php echo $this->escape( $this->row->adress ) ?>" class="inputbox" size="55" />
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="zip_code"><?php echo JText::_('Postleitzahl') ?> :</label></td>
<td width="100%" >
<input id="zip_code" type="text" name="zip_code" size="5" value="<?php echo $this->row->zip_code ?>" class="inputbox" />
<span style="margin-left:25px">
</span>
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="departments"><?php echo JText::_('Stadtteil *') ?> :</label></td>
<td width="100%" ><?php echo $this->getHtmlList('departments', $this->row->departments) ?></td>
</tr>
<tr>
<td valign="top" colspan="2"><?php echo JText::_('Beschreibung') ?> :</td>
</tr>
<tr>
<td colspan="2" style="vertical-align:top">
<?php
// parameters : areaname, content, width, height, cols, rows, show buttons
echo $editor->display( 'description', $this->row->description , '99%', '150', '75', '20', false ) ;
?>
</td>
</tr>
</table>
<fieldset><legend><?php echo JText::_('Preis') ?></legend><br />
<table>
<tr>
<td nowrap="nowrap" class="label">
<label for="price"><?php echo JText::_('Kaltmiete *') ?> :</label></td>
<td width="100%">
<input id="price" type="text" name="price" value="<?php echo $this->row->price ?>" class="numberbox" />
<?php echo $this->params->get('currency_symbol', '€') ?>
</td>
</tr>
<tr>
<td nowrap="nowrap" class="label">
<label for="charges"><?php echo JText::_('Nebenkosten') ?> :</label></td>
<td width="100%">
<input id="charges" type="text" name="charges" value="<?php echo $this->row->charges ?>" class="numberbox" />
<?php echo $this->params->get('currency_symbol', '€') ?>
</td>
</tr>
<tr>
<td nowrap="nowrap" class="label"><label for="fees"><?php echo JText::_('Kaution') ?> :</label></td>
<td class="spacer_bottom" >
<input id="fees" type="text" name="fees" value="<?php echo $this->row->fees ?>" class="numberbox" />
<?php echo $this->params->get('currency_symbol', '€') ?>
</td>
</tr>
<tr>
<td nowrap="nowrap" class="label"><label for="abloese"><?php echo JText::_('Ablöse') ?> :</label></td>
<td class="spacer_bottom" >
<input id="abloese" type="text" name="abloese" value="<?php echo $this->row->abloese ?>" class="numberbox" />
<?php echo $this->params->get('currency_symbol', '€') ?>
</td>
</tr>
</table>
</fieldset>
<fieldset><legend><?php echo JText::_('Größe') ?></legend><br />
<table>
<tr>
<td nowrap="nowrap" class="label">
<label for="living_space"><?php echo JText::_('Wohnfläche *') ?> :</label>
</td>
<td width="100%">
<input id="living_space" type="text" name="living_space" value="<?php echo $this->row->living_space ?>" class="numberbox" size="7" />
<?php echo $this->params->get('surface_measure', 'M²') ?>
</td>
</tr>
<tr>
<td nowrap="nowrap" class="label"><label for="rooms"><?php echo JText::_('Zimmeranzahl *') ?> :</label></td>
<td width="100%"><input id="rooms" type="text" name="rooms" value="<?php echo $this->row->rooms ?>" class="numberbox" size="3" /> </td>
</tr>
</table>
</fieldset>
<fieldset><legend><?php echo JText::_('Ausstattung') ?></legend><br />
<?php echo $this->getAdvantagesRadioList() ?>
</fieldset>
<fieldset><legend><?php echo JText::_('Verfügbarkeit') ?></legend><br />
<table>
<tr>
<td nowrap="nowrap" class="label">
<label for="availability"><?php echo JText::_('Frei ab *') ?> :</label>
</td>
<td width="100%">
<input id="availability" type="text" name="availability" value="<?php echo $this->row->availability ?>" class="inputbox" size="20" />
</td>
</tr>
</table>
</fieldset>
<fieldset><legend><?php echo JText::_('Kontakt Vermieter') ?></legend><br />
Bitte geben Sie wahlweise eine Emailadresse oder Telefonnummer an<br /><br />
<table>
<tr>
<td nowrap="nowrap" class="label">
<label for="vermietername"><?php echo JText::_('Name') ?> :</label>
</td>
<td width="100%">
<input id="vermietername" type="text" name="vermietername" value="<?php echo $this->row->vermietername ?>" class="inputbox" size="40" />
</td>
</tr>
<tr>
<td nowrap="nowrap" class="label">
<label for="vermieteremail"><?php echo JText::_('Email') ?> :</label>
</td>
<td width="100%">
<input id="vermieteremail" type="text" name="vermieteremail" value="<?php echo $this->row->vermieteremail ?>" class="inputbox" size="40" />
</td>
</tr>
</tr>
<tr>
<td nowrap="nowrap" class="label">
<label for="vermietertelefon"><?php echo JText::_('Telefon') ?> :</label>
</td>
<td width="100%">
<input id="vermietertelefon" type="text" name="vermietertelefon" value="<?php echo $this->row->vermietertelefon ?>" class="inputbox" size="40" />
</td>
</tr>
[B] <tr>
<td nowrap="nowrap" class="label">
<label for="info"><?php echo JText::_('Info') ?> :</label>
</td>
<td width="100%">
<input id="info" type="text" name="info" value="<?php echo $this->row->info ?>" class="inputbox" size="40" />
</td>
</tr>[/B]
</table>
</fieldset><br />
* Pflichtfelder
<fieldset><legend><?php echo JText::_('Hauptansicht') ?></legend><br />
Maximale Bildgröße: 450 KB<br />
<input type="file" name="main_image" value="" size="30"/> <input type="submit" value="<?php echo JText::_('Hochladen') ?>" onclick="if (checkForm(2)) this.form.submit()" />
<?php if (!empty($this->main_image)) : ?>
<fieldset style="margin-top:10px;">
<a class="modal" rel="{handler: 'iframe', size: {x: 400, y: 150}}" >
<img src="<?php echo $this->main_image['min_url'] ?>" alt="preview.jpg" title="<?php echo $this->main_image['width'].'X'.$this->main_image['height'].'px - '.$this->main_image['weight'].' ko' ?>" />
</a>
<a href="<?php echo $this->main_image['delete_url'] ?>"><?php echo JText::_('Löschen') ?></a>
</fieldset>
<?php endif ?>
</fieldset>
<a name="second_image"> </a>
<fieldset><legend><?php echo JText::_('weitere Bilder') ?></legend><br />
Maximale Bildgröße: 450 KB<br />
<input type="file" name="second_image" value="" size="30"/> <input type="submit" value="<?php echo JText::_('Hochladen') ?>" onclick="if (checkForm(2)) this.form.submit()" />
<div style="height:200px; overflow:auto;">
<?php foreach($this->secondaries_images as $image) : ?>
<fieldset style="margin-top:10px;">
<a class="modal" rel="{handler: 'iframe', size: {x: 400, y: 150}}" >
<img src="<?php echo $image['min_url'] ?>" alt="<?php echo $image['name'] ?>" title="<?php echo $image['width'].'X'.$image['height'].'px - '.$image['weight'].' ko' ?>" />
</a>
<a href="<?php echo $image['delete_url'] ?>"><?php echo JText::_('Löschen') ?></a>
</fieldset>
<?php endforeach ?>
</div>
</fieldset>
<fieldset><legend><?php echo JText::_('Eintrag ändern') ?></legend><br />
Wenn Sie Ihren Eintrag nachträglich bearbeiten wollen, können Sie hier eine Emailadresse angeben, und bekommen einen Link zugeschickt, mit dem Sie Ihren Eintrag ändern können.<br /><br />
<table>
<tr>
<td nowrap="nowrap" class="label">
<label for="eintrag"><?php echo JText::_('Email') ?> :</label>
</td>
<td width="100%">
<input id="eintrag" type="text" name="eintrag" value="<?php echo $this->row->eintrag ?>" class="inputbox" size="40" />
</td>
</tr>
</tr>
</table>
</fieldset>
<p style="margin-top:10px; margin-left:395px" >
<input type="hidden" name="id" value="<?php echo $this->row->id ?>" />
<?php
echo JHTML::_( 'form.token' ) ?>
<input type="submit" name="full_save" value="<?php echo JText::_('Speichern') ?>" />
</p>
</form>
</div>
Liebe Grüße
Joachim

Kommentar