| Index
» Projects
» phpMyEdit
» Forum
» subforms and tabs |
 |
kendor
Joined: 02 Jan 2008
Posts: 6
Posted: 2008-01-02 23:21
Back to top
Reply with quote
|
hey there...
i've been searching and browsing for hours to find out about subforms (within tabs or not). but i couldn't find a way to get them working with the actual cvs (v.5.7.1). there's also no possibility to apply the subforuzm patch, since the cvs had some major changes i guess.
what i'm trying to do is simple:
lets' say i have 3 tables:
| Code: |
table1:
idpeople
name
age
table2:
idresult
idpeople
points
idtopic
table3:
idleaue
idpeople
year
league |
so as you might guess every person can have multiple results and multiple entries for leagues
all u want is to be able to edit all this on one page. so i would like to hava a tab where i can edit the person itself, one tab with a subform to edit the persons results and one tab to edit the persons leagues.
anyone knows how to realize this with the current cvs?
what i have at the moment looks something like this:
| Code: |
<style type="text/css" media="screen">
#PE_tab0 { display: block; }
#PE_tab1 { display: none; }
#PE_tab2 { display: none; }
</style>
<script type="text/javascript"><!--
var PE_current_tab = "PE_tab0";
function PE_show_tab(tab_name)
{
document.getElementById(PE_current_tab+"_up_label").className = "pme-tab";
document.getElementById(PE_current_tab+"_up_link").className = "pme-tab";
document.getElementById(tab_name+"_up_label").className = "pme-tab-selected";
document.getElementById(tab_name+"_up_link").className = "pme-tab-selected";
document.getElementById(PE_current_tab).style.display = "none";
document.getElementById(tab_name).style.display = "block";
PE_current_tab = tab_name;
document.PE_form.PE_current_tab.value = tab_name;
}
// --></script>
<?php
if((isset($_REQUEST['PME_sys_operation'])&&$_REQUEST['PME_sys_operation']!='add')||(isset($_REQUEST['EIN_sys_operation']))||(isset($_REQUEST['RES_sys_operation']))){
?>
<table class="pme-tab">
<tr class="pme-tab">
<td class="pme-tab-selected" id="PE_tab0_up_label"><a class="pme-tab-selected" id="PE_tab0_up_link" href="javascript:PE_show_tab('PE_tab0')">Generell</a></td>
<td class="pme-tab" id="PE_tab1_up_label"><a class="pme-tab" id="PE_tab1_up_link" href="javascript:PE_show_tab('PE_tab1')">Results</a></td>
<td class="pme-tab" id="PE_tab2_up_label"><a class="pme-tab" id="PE_tab2_up_link" href="javascript:PE_show_tab('PE_tab2')">Leagues</a></td>
<td class="pme-tab-end"> </td>
</tr>
</table>
<?php
}
$opts['tb'] = 'res_people';
// Name of field which is the unique key
$opts['key'] = 'idpeople';
[...] // and so on
$opts['fdd']['idpeople'] = array(
'name' => 'Global User ID',
'select' => 'T',
'options' => 'VCPDR', // auto increment
'maxlen' => 10,
'default' => '0',
'sort' => true
);
$opts['fdd']['Name'] = array(
'name' => 'Name',
'select' => 'T',
'maxlen' => 45,
'sort' => true,
'required' => true
);
[...] // and so on
// this creates actually a tab
echo "<div id='PE_tab0'>";
new phpMyEdit($opts);
echo "</div>";
if(isset($_REQUEST['PME_sys_operation'])&&$_REQUEST['PME_sys_operation']!='Add'){
$opts2['js']['prefix'] = 'RES_js_';
$opts2['dhtml']['prefix'] = 'RES_dhtml_';
$opts2['cgi']['prefix']['operation'] = 'RES_op_';
$opts2['cgi']['prefix']['sys'] = 'RES_sys_';
$opts2['cgi']['prefix']['data'] = 'RES_data_';
$opts2['dbh'] = $global_dbh;
//get the current main record ...
isset($_POST['PME_sys_rec']) && $frec = $_POST['PME_sys_rec'];
isset($_GET['PME_sys_rec']) && $frec = $_GET['PME_sys_rec'];
$opts2['cgi']['persist'] = array(
'in' => $in,
);
// ... and set the filters according to it
$opts2['filters'] = 'PMEtable0.idpeople = '.$frec;
$opts2['tb'] = 'res_resultate';
[...] // and so on
$opts2['fdd']['idResult'] = array(
'name' => 'Result ID',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 10,
'default' => '0',
'sort' => true
);
$opts2['fdd']['idpeople'] = array(
'name' => 'Who?',
'select' => 'T',
'maxlen' => 10,
'sort' => true,
'required' => true
);
$opts2['fdd']['idpeople']['values']['table'] = 'res_people';
$opts2['fdd']['idpeople']['values']['column'] = 'idpeople';
$opts2['fdd']['idpeople']['values']['description']['columns'][0] = 'Name';
$opts2['fdd']['Points'] = array(
'name' => 'Score',
'select' => 'T',
'maxlen' => 10,
'sort' => true,
'required' => true
);
[...] // and so on
// another TAB (works)
echo "<div id='PE_tab1'>";
new phpMyEdit($opts2);
echo "</div>";
$opts3['js']['prefix'] = 'EIN_js_';
$opts3['dhtml']['prefix'] = 'EIN_dhtml_';
$opts3['cgi']['prefix']['operation'] = 'EIN_op_';
$opts3['cgi']['prefix']['sys'] = 'EIN_sys_';
$opts3['cgi']['prefix']['data'] = 'EIN_data_';
$opts3['logtable'] = 'changelog';
$opts3['dbh'] = $global_dbh;
//get the current main record ...
isset($_POST['PME_sys_rec']) && $frec = $_POST['PME_sys_rec'];
isset($_GET['PME_sys_rec']) && $frec = $_GET['PME_sys_rec'];
$opts3['cgi']['persist'] = array(
'in' => $in );
// ... and set the filters according to it
$opts3['filters'] = 'PMEtable0.idpeople = '.$frec;
[...] // and so on
// last tab
echo "<div id='PE_tab2'>";
new phpMyEdit($opts3);
echo "</div>";
}
?> |
so basicly the tabs are working just fine, the subforms are showing up nicely but when i want to edit, add, view, delete or sort them, it's just not working.
anyone knows how to seriously set up this subform thingy? (with the current version of the PME... 5.7.1)
i'm glad for any help (mail: kendor (at) omrikon.com- as soon as possible (i should be done with this by yesterday - but spent too much time on research about the topic)
thanks
|
|
Post new topic
Reply to topic
|
|
|
|