Maybe this helps. Thats my list_data.php with the extra for edit the entry. the url goes to the standart show_data.php. The show_data.php is modified to. so you have the option on the right side to edit the entry. In the second show_data.php (edit) option you have the same as the original show_data.php entrys but the option to change. If you submit the form it opends another form how updates your sql entries. You have to setup these forms for your own envoirement. because i dosnt setup my solution to a dynamic form.
I just wrote that in a few minutes, so i am not sure thats what you need.
---->list_data*php
<?php
/**
* CHRONOFORMS version 4.0
* Copyright (c) 2006 - 2011 Chrono_Man, ChronoEngine.com. All rights reserved.
* Author: Chrono_Man (ChronoEngine.com)
* @license GNU/GPL
* Visit http://www.ChronoEngine.com for regular updates and information.
* Edited by David Peetzen www.dp-networld.de
**/
$mainframe =& JFactory::getApplication();
$primary = '';
foreach($table_fields as $table_field => $field_data){
if($field_data->Key == 'PRI'){
$primary = $table_field;
}
}
?>
<h3>Listing data records for table: <?php echo $table_name; ?></h3>
<?php if(empty($primary)): ?>
<h3 style="color:red;">This table has no primary keys and its records can't be viewed!</h3>
<?php endif; ?>
<?php
$extra_dataview_actions = array();
if(isset($_POST['form_id'])){
$row =& JTable::getInstance('chronoforms', 'Table');
$row->load($_POST['form_id']);
$params = new JParameter($row->params);
$dataview_actions = $params->get('dataview_actions', '');
if(!empty($dataview_actions)){
$dataview_actions = explode(",", $dataview_actions);
foreach($dataview_actions as $dataview_action){
$action_pieces = explode(":", $dataview_action);
$extra_dataview_actions[$action_pieces[0]] = $action_pieces[1];
}
}
}
?>
<form action="index.php?option=com_chronoforms" method="post" name="adminForm" id="adminForm">
<table class="adminlist">
<thead>
<th width="1%" class='title'>#</th>
<?php if(!empty($primary)): ?>
<th width="2%" class='title' style="text-align: left;">ID</th>
<th width="1%" class='title' style="text-align: left;"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($table_data); ?>);" /></th>
<?php endif; ?>
<th width="10%" align="left" class='title' style="text-align: left;">Record</th>
<?php // Eingefügt von David Peetzen?>
<th align='left' class='title' style="text-align: left;">Editieren</th>
<?php foreach($extra_dataview_actions as $action_k => $action_title): ?>
<th width="10%" align="left" class='title' style="text-align: left;"><?php echo $action_title; ?></th>
<?php endforeach; ?>
</thead>
<?php if(!empty($table_data)): ?>
<?php $i = 0; ?>
<?php foreach($table_data as $row): ?>
<tr>
<td width="1%" class='title'><?php echo $i + 1;?></td>
<?php if(!empty($primary)): ?>
<td width="2%" class='title'><?php echo $row->$primary; ?></td>
<td width="1%" class='title'>
<input type="checkbox" id="cb<?php echo $i;?>" name="cb[]" value="<?php echo $row->$primary; ?>" onclick="isChecked(this.checked);" />
</td>
<?php endif; ?>
<td width="10%" align="left" class='title'><a href="#show_data" onclick="return listItemTask('cb<?php echo $i;?>','show_data')">Record #<?php echo $i + 1 + $pageNav->limitstart; ?></a></td>
<?php //Eingefügt von David Peetzen ?>
<td width="10%" align="left" class='title'><a href="#show_data_dp" onclick="return listItemTask('cb<?php echo $i;?>','show_data_dp')">Record #<?php echo $i + 1 + $pageNav->limitstart; ?></a></td>
<?php foreach($extra_dataview_actions as $action_k => $action_title): ?>
<td width="10%" align="left" class='title'><a href="#admin_form:<?php echo $action_k; ?>" onclick="return listItemTask('cb<?php echo $i;?>','admin_form:<?php echo $action_k; ?>')"><?php echo $action_title; ?> #<?php echo $i + 1 + $pageNav->limitstart; ?></a></td>
<?php endforeach; ?>
</tr>
<?php $i++; ?>
<?php endforeach; ?>
<?php endif; ?>
<tr><td colspan="<?php echo (5 + count($extra_dataview_actions)); ?>" style="white-space:nowrap;" height="20px"><?php echo $pageNav->getListFooter(); ?></td></tr>
</table>
<input type="hidden" name="table_name" value="<?php echo $table_name; ?>" />
<?php if(isset($_POST['form_id'])): ?>
<input type="hidden" name="form_id" value="<?php echo $_POST['form_id']; ?>" />
<?php endif; ?>
<input type="hidden" name="boxchecked" value="" />
<input type="hidden" name="task" value="list_data" />
<input type="hidden" name="option" value="com_chronoforms" />
</form>
show_data*php
<?php
/**
* CHRONOFORMS version 4.0
* Copyright (c) 2006 - 2011 Chrono_Man, ChronoEngine.com. All rights reserved.
* Author: Chrono_Man (ChronoEngine.com)
* @license GNU/GPL
* Visit http://www.ChronoEngine.com for regular updates and information.
* Edited by David Peetzen www.dp-networld.de
**/
$mainframe =& JFactory::getApplication();
$primary = '';
foreach($table_fields as $table_field => $field_data){
if($field_data->Key == 'PRI'){
$primary = $table_field;
}
}
//Just prepared for my next update to include the System in Joomla
if ($_POST['update11'] == 'updaten11'){
$table_name = isset($_POST['table_name']) ? $_POST['table_name'] : $_GET['table_name'];
$mainframe =& JFactory::getApplication();
$database =& JFactory::getDBO();
$database->setQuery("Update * FROM ".$table_name." WHERE ".$primary."='".$_POST['cb'][0]."'");
$form = $database->loadObject();
}
//echo $row_data->input_Name;
?>
<?php
if ($_POST['task'] == 'show_data_dp'){?>
<form action="http://xxxxxxxx/edit_form.php" method="post" name="adminForm" id="adminForm" accept-charset="UTF-8">
<table class="adminlist">
<thead>
<th width="20%" class='title'>Field title</th>
<th width="80%" class='title'>Field value</th>
</thead>
<?php if(!empty($row_data)): ?>
<?php $i = 0; ?>
<?php //foreach($table_fields as $table_field => $field_data): ?>
<tr>
<td width='20%' class='title'>Nachname </td>
<td><input type='text' class='title' name='nachname' value='<?php echo $row_data->input_Name;?>' /></td>
</tr>
<tr>
<td width='20%' class='title'>Vorname </td>
<td><input type='text' class='title' name='vorname' value='<?php echo $row_data->input_Vorname;?>' /></td>
</tr>
<tr>
<td width='20%' class='title'>E-Mail </td>
<td><input type='text' class='title' name='email' value='<?php echo $row_data->input_email;?>' /></td>
</tr>
<tr>
<td width='20%' class='title'>Telefon </td>
<td><input type='text' class='title' name='telefon' value='<?php echo $row_data->input_Tel;?>' /></td>
</tr>
<tr>
<td width='20%' class='title'>Anfrage </td>
<td><textarea name='anfrage' cols='50' rows='10' ><?php echo $row_data->input_anfrage;?></textarea></td>
</tr>
<tr>
<td width='20%' class='title'>Bemerkung </td>
<td><textarea name='bemerkung' cols='50' rows='10' ><?php echo $row_data->bemerkung_admin;?></textarea></td>
</tr>
<tr>
<td colspan="2">
<?php //$i++; ?>
<?php //endforeach; ?>
<?php endif; ?>
<input type="hidden" name="table_name" value="<?php echo $table_name; ?>" />
<?php if(isset($_POST['form_id'])): ?>
<input type="hidden" name="post_id" value="<?php echo $row_data->cf_id; ?>" />
<?php endif; ?>
<input type="hidden" name="boxchecked" value="" />
<input type="hidden" name="form_id" value="<?php echo $_POST['form_id']; ?>" />
<input type="hidden" name="option" value="com_chronoforms" />
<tr><td colspan="2"><input type="submit" name="submit" value="updaten" />
</table>
</form>
<?php } else {?>
<form action="index.php?option=com_chronoforms" method="post" name="adminForm" id="adminForm">
<table class="adminlist">
<thead>
<th width="20%" class='title'>Field title</th>
<th width="80%" class='title'>Field value</th>
</thead>
<?php if(!empty($row_data)): ?>
<?php $i = 0; ?>
<?php foreach($table_fields as $table_field => $field_data): ?>
<tr>
<td width="20%" class='title'><?php echo $table_field; ?></td>
<td width="80%" class='title'><?php echo htmlspecialchars($row_data->$table_field); ?></td>
</tr>
<?php $i++; ?>
<?php endforeach; ?>
<?php endif; ?>
</table>
<input type="hidden" name="table_name" value="<?php echo $table_name; ?>" />
<?php if(isset($_POST['form_id'])): ?>
<input type="hidden" name="form_id" value="<?php echo $_POST['form_id']; ?>" />
<?php endif; ?>
<input type="hidden" name="boxchecked" value="" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="option" value="com_chronoforms" />
</form>
<?php } ?>
edit_form*php
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<?php
//Created by David Peetzen www.dp-networld.de
//echo $_POST['submit'];
//echo $_POST['post_id'];
$debug = '0';
if ($debug == '1') {
echo $_POST['submit'];
echo '<br>';
echo $_POST['form_id'];
echo '<br>';
echo $_POST['post_id'];
echo '<br>';
echo $_POST['table_name'];
echo '<br>';
echo $_POST['nachname'];
echo '<br>';
echo $_POST['vorname'];
echo '<br>';
echo $_POST['email'];
echo '<br>';
echo $_POST['telefon'];
echo '<br>';
echo $_POST['anfrage'];
echo '<br>';
echo $_POST['bemerkung'];
}
//Variabeln setzen für Übergabe aus verständlichkeit nicht direkt übernommen
$post_id = $_POST['post_id'];
$form = $_POST['form_id'];
$nach = $_POST['nachname'];
$vorn = $_POST['vorname'];
$emai = $_POST['email'];
$tele = $_POST['telefon'];
$anfr = $_POST['anfrage'];
$beme = $_POST['bemerkung'];
$table_name = $_POST['table_name'];
echo $table_name;
$mysql_hostname = 'xxxxx';
$mysql_username = 'xxxxx';
$mysql_password = 'xxxxx';
$mysql_database = 'xxxxx';
//Datenbank verbindung
$con =mysql_connect($mysql_hostname, $mysql_username, $mysql_password) or die('Fehler bei der Verbindung');
mysql_select_db($mysql_database, $con) or die('Fehler beim aufbauen der Verbindung by mysql_select');
$mysql = "SELECT * FROM ".$table_name." WHERE cf_id=".$post_id." LIMIT 1";
$result=mysql_query($mysql);
$row1 = mysql_fetch_assoc($result);
//echo '<br>';
// echo $row1["cf_id"];
// echo $row1["input_Name"];
// echo $row1['input_Vorname'];
//echo'<br><br><br><br><br><br><br><br>';
$mysqlupd="UPDATE ".$table_name." SET input_Name='".$nach."', input_Vorname='".$vorn."', input_email='".$emai."', input_Tel='".$tele."', input_anfrage='".$anfr."', bemerkung_admin='".$beme."' WHERE cf_id=".$post_id." " OR mysql_error();
echo $mysqlupd;
$result1=mysql_db_query($mysql_database, $mysqlupd);
if ($result1) {
echo '<br>Anzahl geänderter Datensätze: '.mysql_affected_rows($con);
}else {
echo '<br>Datensatz nicht gespeichert';
}
mysql_close($con);
echo '<a href="xxxxxxxxxxxxx/administrator/index.php?option=com_chronoforms">zurück</a>';
?>