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

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 provides 3 buttons, 2 of them are hidden. If you want to use them remove the sign
line comment (//). If you want to use more than 3 buttons, paste them by copying and
changing the code.

3. The above script shows buttons for 3 related tables. Ignore the redundancy for
1 and 2 linked tables.

4. Possible matches of variable names and other objects with names in tables.php.
This problem is caused by the careless attitude of the CMS developers to the naming of objects.
We apologize to those who will be using the CMS to develop applications.
We recommend using names starting with a capital letter, except L.

5. As a rule, the scripts of the client part are part of a single data processing algorithm.
This part usually contains the conditions for running the algorithm based on the analysis of data at the client.
The developers recommend to include in the client script as much as possible to reduce the load on the server
possible part of the data processing algorithm.

6. Debugging of the code is performed by pressing the appropriate button and analyzing the result and error messages.

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

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

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

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