<?php
// ************************************************ *******
// DEVELOPMENT BUTTONS AND THEIR SCRIPTS
// ************************************************ *******
/*
PROBLEMS OF PROGRAMMING SCRIPTES:

1. All scripts, including this one, are parts of the code that are inserted into the appropriate places in the tables.php code.

2. The script has 3 buttons 2 of which are hidden. If you want to use them delete the sign
comment line (//). If you want to use more than 3 buttons, insert them by copying and
code change.

3. The above script shows buttons for 3 linked tables. Do not pay attention to redundancy for
1 and 2 related tables.

4. Possible matches of variable names and other objects with names in tables.php.
This problem is due to the negligent attitude of CMS developers towards the names of objects.
We bring our apologies to those who will use CMS to develop applications.
We recommend using names beginning with a capital letter, except L.

5. Typically, the scripts of the client part form part of a single data processing algorithm.
This part usually contains the conditions for starting the algorithm based on the analysis of the data from the client.
Developers recommend to reduce the load on the server include in the client script as large as possible
Possible part of the processing algorithm is given.

6. Debugging the code is done by clicking the appropriate button and analyzing the result and error messages.

7. The client and server parts of the scripts are represented by a primitive message issuing code.

8. To write scripts, you need to access customer data.
This can be done efficiently using the tables.php data storage objects (HTML code of the table frames).
To do this, you need to get acquainted with tables.php in the part where you can specify for storage and
display: variables, arrays, JS scripts, HTML, objects.

9. Some objects of data storage:
1 The table data is stored in the array table [i] [j] where i is the index of the row of the table j - the index of the column of the table.
2 The table data is stored in <table id = t ...
3 In the code for the window.onload = function () function, you can learn a lot.

10. It's impossible to tell everything and it's necessary? How do you think ? Write to the developers about the wishes.
*/////////////////////////////////////////////////////////
//*******************************************************
//                            FATHER
//*******************************************************
//                           BUTTON 1
//*******************************************************
if (strpos($tabl,"-")==0)              // only data tables
{if ($kpre==1)                         // if the form of the father's table is a button
{
// to hide the button, comment it //
echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:green thin double' onclick=button11(0)   title='Enter the title'>";
//echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:blue thin double' onclick=button12(0)   title='Enter the title'>";
//echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:red thin double' onclick=button13(0)   title='Enter the title'>";
}}
?>
<script type="text/javascript">
//***************************
// 1 father button processing
//***************************
function button11(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button11 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{// if you comment out the following line, there will be a handler without the server part
form.elements["button11"].click()   // execute the server part of the handler
}}
//**************************
// 2 father button processing
//**************************
function button12(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button12 worked ")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{//if you comment out the following line, there will be a handler without the server part
form.elements["button12"].click()   // execute the server part of the handler
}}
//***************************
// 3 father button processing
//***************************
function button13(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button13 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{//if you comment out the following line, there will be a handler without the server part
form.elements["button13"].click()   // execute the server part of the handler
}}
</script>
<?php
//*******************************************************
//                          A SON
//*******************************************************
//                        BUTTON 1
//*******************************************************
if (strpos($tabl,"-")==0)              // only data tables
{if ($kpre==2)                         // if the form of the son's table is a button
{
echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:green thin double' onclick=button21(0)   title='Enter the title'>";
//echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:blue thin double' onclick=button22(0)   title='Enter the title'>";
//echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:red thin double' onclick=button23(0)   title='Enter the title'>";
}}
?>
<script type="text/javascript">
//***************************
// processor 1 buttons of the son
//***************************
function button21(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button21 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{//if you comment out the following line, there will be a handler without the server part
form.elements["button21"].click()   //execute the server part of the handler
}}
//**************************
// processor 2 buttons of the son
//**************************
function button22(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button22 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{// if you comment out the following line, there will be a handler without the server part
form.elements["button22"].click()   // execute the server part of the handler
}}
//***************************
// processor 3 buttons of the son
//***************************
function button23(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button23 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{// if you comment out the following line, there will be a handler without the server part
form.elements["button23"].click()   // execute the server part of the handler
}}
</script>
<?php
//*******************************************************
//                         GRANDSON
//*******************************************************
//                        BUTTON 1
//*******************************************************
if (strpos($tabl,"-")==0)              //only data tables
{if ($kpre==3)                         // if the shape of the grandson table is a button
{
echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:green thin double' onclick=button31(0)   title='Enter the title'>";
//echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:blue thin double' onclick=button32(0)   title='Enter the title'>";
//echo "&nbsp;&nbsp;<img src=../../../../d~e~f/do.bmp style='background:white;border:red thin double' onclick=button33(0)   title='Enter the title'>";
}}
?>
<script type="text/javascript">
//***************************
// handler 1 button grandson
//***************************
function button31(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button31 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{//if you comment out the following line, there will be a handler without the server part
form.elements["button31"].click()   //execute the server part of the handler
}}
//**************************
// handler 2 button grandson
//**************************
function button32(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button32 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{// 
form.elements["button32"].click()   //execute the server part of the handler
}}
//***************************
// handler 3 button grandson
//***************************
function button33(p)
{// here enter the processing script at the push of button11
// usually this is checking the data in the table
alert("The script button33 worked")
if (!confirm(" If everything is OK click OK. To cancel, click Cancel."))
{return
}
else
{//if you comment out the following line, there will be a handler without the server part
form.elements["button33"].click()   // execute the server part of the handler
}}
</script>
