home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / pdf_pages.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  23.7 KB  |  530 lines

  1. <?php
  2. /* $Id: pdf_pages.php,v 2.3 2003/11/26 22:52:24 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Gets some core libraries
  8.  */
  9. require_once('./libraries/grab_globals.lib.php');
  10. require_once('./libraries/common.lib.php');
  11. require_once('./db_details_common.php');
  12.  
  13.  
  14. /**
  15.  * Settings for relation stuff
  16.  */
  17. require_once('./libraries/relation.lib.php');
  18. $cfgRelation = PMA_getRelationsParam();
  19.  
  20.  
  21. /**
  22.  * Now in ./libraries/relation.lib.php we check for all tables
  23.  * that we need, but if we don't find them we are quiet about it
  24.  * so people can work without.
  25.  * This page is absolutely useless if you didn't set up your tables
  26.  * correctly, so it is a good place to see which tables we can and
  27.  * complain ;-)
  28.  */
  29. if (!$cfgRelation['relwork']) {
  30.     echo sprintf($strNotSet, 'relation', 'config.inc.php') . '<br />' . "\n"
  31.          . '<a href="./Documentation.html#relation" target="documentation">' . $strDocu . '</a>' . "\n";
  32.     require_once('./footer.inc.php');
  33. }
  34.  
  35. if (!$cfgRelation['displaywork']) {
  36.     echo sprintf($strNotSet, 'table_info', 'config.inc.php') . '<br />' . "\n"
  37.          . '<a href="./Documentation.html#table_info" target="documentation">' . $strDocu . '</a>' . "\n";
  38.     require_once('./footer.inc.php');
  39. }
  40.  
  41. if (!isset($cfgRelation['table_coords'])){
  42.     echo sprintf($strNotSet, 'table_coords', 'config.inc.php') . '<br />' . "\n"
  43.          . '<a href="./Documentation.html#table_coords" target="documentation">' . $strDocu . '</a>' . "\n";
  44.     exit();
  45. }
  46. if (!isset($cfgRelation['pdf_pages'])) {
  47.     echo sprintf($strNotSet, 'pdf_page', 'config.inc.php') . '<br />' . "\n"
  48.          . '<a href="./Documentation.html#pdf_pages" target="documentation">' . $strDocu . '</a>' . "\n";
  49.     exit();
  50. }
  51.  
  52. if ($cfgRelation['pdfwork']) {
  53.     // Now is the time to work on all changes
  54.     if (isset($do)) {
  55.         switch ($do) {
  56.             case 'choosepage':
  57.                 if ($action_choose=="1") {
  58.                     $ch_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords'])
  59.                               .   ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
  60.                               .   ' AND   pdf_page_number = ' . $chpage;
  61.                     PMA_query_as_cu($ch_query);
  62.  
  63.                     $ch_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
  64.                               .   ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
  65.                               .   ' AND   page_nr = ' . $chpage;
  66.                     PMA_query_as_cu($ch_query);
  67.  
  68.                     unset($chpage);
  69.                 }
  70.                 break;
  71.             case 'createpage':
  72.                 if (!isset($newpage) || $newpage == '') {
  73.                     $newpage = $strNoDescription;
  74.                 }
  75.                 $ins_query   = 'INSERT INTO ' . PMA_backquote($cfgRelation['pdf_pages'])
  76.                              . ' (db_name, page_descr)'
  77.                              . ' VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($newpage) . '\')';
  78.                 PMA_query_as_cu($ins_query);
  79.  
  80.                 // A u t o m a t i c    l a y o u t
  81.  
  82.                 if (isset($autolayout)) {
  83.                     // save the page number
  84.                     $pdf_page_number = mysql_insert_id((isset($dbh)?$dbh:''));
  85.  
  86.                     // get the tables that have relations, by descending
  87.                     // number of links
  88.                     $master_tables = 'SELECT COUNT(master_table), master_table'
  89.                                 . ' FROM ' . PMA_backquote($cfgRelation['relation'])
  90.                                 . ' WHERE master_db = \'' . $db . '\''
  91.                                 . ' GROUP BY master_table'
  92.                                 . ' ORDER BY ' . PMA_backquote('COUNT(master_table)') . ' DESC ';
  93.                     $master_tables_rs = PMA_query_as_cu($master_tables);
  94.                     if ($master_tables_rs && mysql_num_rows($master_tables_rs) > 0) {
  95.                         // first put all the master tables at beginning
  96.                         // of the list, so they are near the center of
  97.                         // the schema
  98.                         while (list(,$master_table) = mysql_fetch_row($master_tables_rs)) {
  99.                             $all_tables[] = $master_table;
  100.                         }
  101.  
  102.                         // then for each master, add its foreigns into an array
  103.                         // of foreign tables, if not already there
  104.                         // (a foreign might be foreign for more than
  105.                         // one table, and might be a master itself)
  106.  
  107.                         $foreign_tables = array();
  108.                         foreach($all_tables AS $master_table) {
  109.                             $foreigners = PMA_getForeigners($db, $master_table);
  110.                             foreach($foreigners AS $foreigner) {
  111.                                 if (!in_array($foreigner['foreign_table'], $foreign_tables)) {
  112.                                     $foreign_tables[] = $foreigner['foreign_table'];
  113.                                 }
  114.                             }
  115.                         }
  116.  
  117.                         // then merge the arrays
  118.                         foreach($foreign_tables AS $foreign_table) {
  119.                             if (!in_array($foreign_table, $all_tables)) {
  120.                                 $all_tables[] = $foreign_table;
  121.                             }
  122.  
  123.                         }
  124.                         // now generate the coordinates for the schema,
  125.                         // in a clockwise spiral
  126.  
  127.                         $pos_x = 300;
  128.                         $pos_y = 300;
  129.                         $delta = 50;
  130.                         $delta_mult = 1.34;
  131.                         $direction = "right";
  132.                         foreach($all_tables AS $current_table) {
  133.  
  134.                             // save current table's coordinates
  135.                             $insert_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['table_coords']) . ' '
  136.                                           . '(db_name, table_name, pdf_page_number, x, y) '
  137.                                           . 'VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($current_table) . '\',' . $pdf_page_number . ',' . $pos_x . ',' . $pos_y . ')';
  138.                             PMA_query_as_cu($insert_query);
  139.  
  140.  
  141.                             // compute for the next table
  142.                             switch ($direction) {
  143.                                 case 'right':
  144.                                     $pos_x += $delta;
  145.                                     $direction = "down";
  146.                                     $delta *= $delta_mult;
  147.                                     break;
  148.                                 case 'down':
  149.                                     $pos_y += $delta;
  150.                                     $direction = "left";
  151.                                     $delta *= $delta_mult;
  152.                                     break;
  153.                                 case 'left':
  154.                                     $pos_x -= $delta;
  155.                                     $direction = "up";
  156.                                     $delta *= $delta_mult;
  157.                                     break;
  158.                                 case 'up':
  159.                                     $pos_y -= $delta;
  160.                                     $direction = "right";
  161.                                     $delta *= $delta_mult;
  162.                                     break;
  163.                             } // end switch
  164.                         } // end while
  165.                     } // end if there are master tables
  166.  
  167.                     $chpage = $pdf_page_number;
  168.                 } // end if isset autolayout
  169.  
  170.                 break;
  171.  
  172.             case 'edcoord':
  173.                 for ($i = 0; $i < $c_table_rows; $i++) {
  174.                     $arrvalue = 'c_table_' . $i;
  175.                     $arrvalue = $$arrvalue;
  176.                     if (!isset($arrvalue['x']) || $arrvalue['x'] == '') {
  177.                         $arrvalue['x'] = 0;
  178.                     }
  179.                     if (!isset($arrvalue['y']) || $arrvalue['y'] == '') {
  180.                         $arrvalue['y'] = 0;
  181.                     }
  182.                     if (isset($arrvalue['name']) && $arrvalue['name'] != '--') {
  183.                         $test_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['table_coords'])
  184.                                     .   ' WHERE db_name = \'' .  PMA_sqlAddslashes($db) . '\''
  185.                                     .   ' AND   table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
  186.                                     .   ' AND   pdf_page_number = ' . $chpage;
  187.                         $test_rs    = PMA_query_as_cu($test_query);
  188.                         if ($test_rs && mysql_num_rows($test_rs) > 0) {
  189.                             if (isset($arrvalue['delete']) && $arrvalue['delete'] == 'y') {
  190.                                 $ch_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords'])
  191.                                           .   ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
  192.                                           .   ' AND   table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
  193.                                           .   ' AND   pdf_page_number = ' . $chpage;
  194.                             } else {
  195.                                 $ch_query = 'UPDATE ' . PMA_backquote($cfgRelation['table_coords']) . ' '
  196.                                           . 'SET x = ' . $arrvalue['x'] . ', y= ' . $arrvalue['y']
  197.                                           .   ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
  198.                                           .   ' AND   table_name = \'' . PMA_sqlAddslashes($arrvalue['name']) . '\''
  199.                                           .   ' AND   pdf_page_number = ' . $chpage;
  200.                             }
  201.                         } else {
  202.                             $ch_query     = 'INSERT INTO ' . PMA_backquote($cfgRelation['table_coords']) . ' '
  203.                                           . '(db_name, table_name, pdf_page_number, x, y) '
  204.                                           . 'VALUES (\'' . PMA_sqlAddslashes($db) . '\', \'' . PMA_sqlAddslashes($arrvalue['name']) . '\',' . $chpage . ',' . $arrvalue['x'] . ',' . $arrvalue['y'] . ')';
  205.                         }
  206.                         PMA_query_as_cu($ch_query);
  207.                     } // end if
  208.                 } // end for
  209.                 break;
  210.             case 'deleteCrap':
  211.                 foreach($delrow AS $current_row) {
  212.                     $d_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords']) . ' ' . "\n"
  213.                              .   ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . "\n"
  214.                              .   ' AND   table_name = \'' . PMA_sqlAddslashes($current_row) . '\'' . "\n"
  215.                              .   ' AND   pdf_page_number = ' . $chpage;
  216.                     PMA_query_as_cu($d_query);
  217.                 }
  218.                 break;
  219.         } // end switch
  220.     } // end if (isset($do))
  221.  
  222.     // We will need an array of all tables in this db
  223.     $selectboxall = array('--');
  224.     $alltab_qry     = 'SHOW TABLES FROM ' . PMA_backquote($db);
  225.     $alltab_rs      = @PMA_mysql_query($alltab_qry) or PMA_mysqlDie('', $alltab_qry, '', $err_url_0);
  226.     while ($val = @PMA_mysql_fetch_array($alltab_rs)) {
  227.         $selectboxall[] = $val[0];
  228.     }
  229.  
  230.  
  231.     // Now first show some possibility to choose a page for the pdf
  232.     $page_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['pdf_pages'])
  233.                 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
  234.     $page_rs    = PMA_query_as_cu($page_query);
  235.     if ($page_rs && mysql_num_rows($page_rs) > 0) {
  236.         ?>
  237. <form method="get" action="pdf_pages.php" name="selpage">
  238.     <?php echo $strChoosePage . "\n"; ?>
  239.     <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
  240.     <input type="hidden" name="do" value="choosepage" />
  241.     <select name="chpage" onchange="this.form.submit()">
  242.         <?php
  243.         while ($curr_page = @PMA_mysql_fetch_array($page_rs)) {
  244.             echo "\n" . '        '
  245.                  . '<option value="' . $curr_page['page_nr'] . '"';
  246.             if (isset($chpage) && $chpage == $curr_page['page_nr']) {
  247.                 echo ' selected="selected"';
  248.             }
  249.             echo '>' . $curr_page['page_nr'] . ': ' . $curr_page['page_descr'] . '</option>';
  250.         } // end while
  251.         echo "\n";
  252.         ?>
  253.     </select>
  254.     <input type="radio" name="action_choose" value="0" id="radio_choose0" checked="checked" style="vertical-align: middle" /> <label for="radio_choose0">
  255. <?php echo $strEdit; ?> </label>
  256.     <input type="radio" name="action_choose" value="1" id="radio_choose1"  style="vertical-align: middle" /> <label for="radio_choose1">
  257. <?php echo $strDelete; ?> </label>
  258.  
  259.     <input type="submit" value="<?php echo $strGo; ?>" />
  260. </form>
  261.         <?php
  262.     }
  263.     echo "\n";
  264.  
  265.     // Possibility to create a new page:
  266.     ?>
  267. <form method="post" action="pdf_pages.php" name="crpage">
  268.     <?php echo $strCreatePage . "\n"; ?>
  269.     <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
  270.     <input type="hidden" name="do" value="createpage" />
  271.     <input type="text" name="newpage" size="20" maxlength="50" />
  272.     <input type="checkbox" name="autolayout" />
  273.     <?php echo '(' . $strAutomaticLayout . ')' . "\n"; ?>
  274.     <input type="submit" value="<?php echo $strGo; ?>" />
  275. </form>
  276.     <?php
  277.     // Now if we already have chosen a page number then we should show the
  278.     // tables involved
  279.     if (isset($chpage) && $chpage > 0) {
  280.         echo "\n";
  281.         ?>
  282. <hr />
  283.  
  284. <h2><?php echo $strSelectTables ;?></h2>
  285.  
  286. <?php
  287. $page_query = 'SELECT * FROM ' . PMA_backquote($cfgRelation['table_coords'])
  288.             . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
  289.             . ' AND pdf_page_number = ' . $chpage;
  290. $page_rs    = PMA_query_as_cu($page_query);
  291. $array_sh_page = array();
  292. $draginit = '';
  293. $reset_draginit = '';
  294. $i = 0;
  295. while ($temp_sh_page = @PMA_mysql_fetch_array($page_rs)) {
  296.     $array_sh_page[] = $temp_sh_page;
  297. }
  298.  
  299. // garvin: Display WYSIWYG-PDF parts?
  300. if ($cfg['WYSIWYG-PDF']) {
  301. ?>
  302. <script type="text/javascript" src="./libraries/dom-drag.js"></script>
  303. <form method="post" action="pdf_pages.php" name="dragdrop">
  304. <input type="button" name="dragdrop" value="<?php echo $strToggleScratchboard; ?>" onclick="ToggleDragDrop('pdflayout');" />
  305.  <input type="button" name="dragdropreset" value="<?php echo $strReset; ?>" onclick="resetDrag();" />
  306. </form>
  307. <div id="pdflayout" class="pdflayout" style="visibility: hidden;">
  308. <?php
  309. foreach($array_sh_page AS $key => $temp_sh_page) {
  310.     $drag_x = $temp_sh_page['x'];
  311.     $drag_y = $temp_sh_page['y'];
  312.  
  313.     $draginit       .= '    Drag.init(getElement("table_' . $i . '"), null, 0, parseInt(myid.style.width)-2, 0, parseInt(myid.style.height)-5);' . "\n";
  314.     $draginit       .= '    getElement("table_' . $i . '").onDrag = function (x, y) { document.edcoord.elements["c_table_' . $i . '[x]"].value = parseInt(x); document.edcoord.elements["c_table_' . $i . '[y]"].value = parseInt(y) }' . "\n";
  315.     $draginit       .= '    getElement("table_' . $i . '").style.left = "' . $drag_x . 'px";' . "\n";
  316.     $draginit       .= '    getElement("table_' . $i . '").style.top  = "' . $drag_y . 'px";' . "\n";
  317.     $reset_draginit .= '    getElement("table_' . $i . '").style.left = "2px";' . "\n";
  318.     $reset_draginit .= '    getElement("table_' . $i . '").style.top  = "' . (15 * $i) . 'px";' . "\n";
  319.     $reset_draginit .= '    document.edcoord.elements["c_table_' . $i . '[x]"].value = "2"' . "\n";
  320.     $reset_draginit .= '    document.edcoord.elements["c_table_' . $i . '[y]"].value = "' . (15 * $i) . '"' . "\n";
  321.  
  322.     $local_query = 'SHOW FIELDS FROM '
  323.                  .  PMA_backquote($temp_sh_page['table_name'] )
  324.                 . ' FROM ' . PMA_backquote($db);
  325.     $fields_rs = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
  326.     $fields_cnt = mysql_num_rows($fields_rs);
  327.  
  328.     echo '<div id="table_' . $i . '" class="pdflayout_table"><u>' . $temp_sh_page['table_name'] . '</u>';
  329.     while ($row = PMA_mysql_fetch_array($fields_rs)) {
  330.         echo "<br>".htmlspecialchars($row['Field'])."\n";
  331.     }
  332.     echo '</div>' . "\n";
  333.     mysql_free_result($fields_rs);
  334.  
  335.     $i++;
  336. }
  337. ?>
  338. </div>
  339. <script type="text/javascript">
  340. <!--
  341. function init() {
  342.     refreshLayout();
  343.     myid = getElement('pdflayout');
  344.     <?php echo $draginit; ?>
  345. }
  346.  
  347. function resetDrag() {
  348.     <?php echo $reset_draginit; ?>
  349. }
  350. // -->
  351. </script>
  352. <?php
  353. } // end if WYSIWYG-PDF
  354. ?>
  355.  
  356. <form method="post" action="pdf_pages.php" name="edcoord">
  357.     <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
  358.     <input type="hidden" name="chpage" value="<?php echo $chpage; ?>" />
  359.     <input type="hidden" name="do" value="edcoord" />
  360.     <table border="0">
  361.     <tr>
  362.         <th><?php echo $strTable; ?></th>
  363.         <th><?php echo $strDelete; ?></th>
  364.         <th>X</th>
  365.         <th>Y</th>
  366.     </tr>
  367.         <?php
  368.         if (isset($ctable)) {
  369.             unset($ctable);
  370.         }
  371.  
  372.  
  373.         $i = 0;
  374.         foreach($array_sh_page AS $dummy_sh_page => $sh_page) {
  375.             $_mtab       = $sh_page['table_name'];
  376.             $tabExist[$_mtab] = FALSE;
  377.             echo "\n" . '    <tr ';
  378.             if ($i % 2 == 0) {
  379.                 echo 'bgcolor="' . $cfg['BgcolorOne'] . '"';
  380.             } else {
  381.                 echo 'bgcolor="' . $cfg['BgcolorTwo'] . '"';
  382.             }
  383.             echo '>';
  384.             echo "\n" . '        <td>'
  385.                  . "\n" . '            <select name="c_table_' . $i . '[name]">';
  386.             foreach($selectboxall AS $key => $value) {
  387.                 echo "\n" . '                <option value="' . $value . '"';
  388.                 if ($value == $sh_page['table_name']) {
  389.                     echo ' selected="selected"';
  390.                     $tabExist[$_mtab] = TRUE;
  391.                 }
  392.                 echo '>' . $value . '</option>';
  393.             } // end while
  394.             echo "\n" . '            </select>'
  395.                  . "\n" . '        </td>';
  396.             echo "\n" . '        <td>'
  397.                  . "\n" . '            <input type="checkbox" name="c_table_' . $i . '[delete]" value="y" />' . $strDelete;
  398.             echo "\n" . '        </td>';
  399.             echo "\n" . '        <td>'
  400.                  . "\n" . '            <input type="text" ' . ($cfg['WYSIWYG-PDF'] ? 'onchange="dragPlace(' . $i . ', \'x\', this.value)"' : '') . ' name="c_table_' . $i . '[x]" value="' . $sh_page['x'] . '" />';
  401.             echo "\n" . '        </td>';
  402.             echo "\n" . '        <td>'
  403.                  . "\n" . '            <input type="text" ' . ($cfg['WYSIWYG-PDF'] ? 'onchange="dragPlace(' . $i . ', \'y\', this.value)"' : '') . ' name="c_table_' . $i . '[y]" value="' . $sh_page['y'] . '" />';
  404.             echo "\n" . '        </td>';
  405.             echo "\n" . '    </tr>';
  406.             $i++;
  407.         } // end while
  408.         // Do one more empty row
  409.         echo "\n" . '    <tr ';
  410.         if ($i % 2 == 0) {
  411.             echo 'bgcolor="' . $cfg['BgcolorOne'] . '"';
  412.         } else {
  413.             echo 'bgcolor="' . $cfg['BgcolorTwo'] . '"';
  414.         }
  415.         echo '>';
  416.         echo "\n" . '        <td>'
  417.              . "\n" . '            <select name="c_table_' . $i . '[name]">';
  418.         foreach($selectboxall AS $key => $value) {
  419.             echo "\n" . '                <option value="' . $value . '">' . $value . '</option>';
  420.         }
  421.         echo "\n" . '            </select>'
  422.              . "\n" . '        </td>';
  423.         echo "\n" . '        <td>'
  424.              . "\n" . '            <input type="checkbox" name="c_table_' . $i . '[delete]" value="y" />' . $strDelete;
  425.         echo "\n" . '        </td>';
  426.         echo "\n" . '        <td>'
  427.              . "\n" . '            <input type="text" name="c_table_' . $i . '[x]" value="' . (isset($sh_page['x'])?$sh_page['x']:'') . '" />';
  428.         echo "\n" . '        </td>';
  429.         echo "\n" . '        <td>'
  430.              . "\n" . '            <input type="text" name="c_table_' . $i . '[y]" value="' . (isset($sh_page['y'])?$sh_page['y']:'') . '" />';
  431.         echo "\n" . '        </td>';
  432.         echo "\n" . '    </tr>';
  433.         echo "\n" . '    </table>' . "\n";
  434.  
  435.         echo "\n" . '    <input type="hidden" name="c_table_rows" value="' . ($i + 1) . '" />';
  436.         echo ($cfg['WYSIWYG-PDF'] ? "\n" . '    <input type="hidden" name="showwysiwyg" value="' . ((isset($showwysiwyg) && $showwysiwyg == '1') ? '1' : '0') . '" />' : '');
  437.         echo "\n" . '    <input type="submit" value="' . $strGo . '" />';
  438.         echo "\n" . '</form>' . "\n\n";
  439.     } // end if
  440.  
  441.     //  Check if there are tables that need to be deleted,
  442.     //  if there are, ask the user for allowance
  443.     $_strtrans  = '';
  444.     $_strname   = '';
  445.     $shoot      = FALSE;
  446.     if (!empty($tabExist) && is_array($tabExist)) {
  447.         foreach($tabExist AS $key => $value) {
  448.             if (!$value) {
  449.                 $_strtrans  .= '<input type="hidden" name="delrow[]" value="' . $key . '">' . "\n";
  450.                 $_strname   .= '<li>' . $key . '</li>' . "\n";
  451.                 $shoot       = TRUE;
  452.             }
  453.         }
  454.         if ($shoot) {
  455.             echo '<FORM action="pdf_pages.php" method="post">' . "\n"
  456.                . PMA_generate_common_hidden_inputs($db, $table)
  457.                . '<input type="hidden" name="do" value="deleteCrap">' . "\n"
  458.                . '<input type="hidden" name="chpage" value="' . $chpage . '">' . "\n"
  459.                . $strDelOld
  460.                . '<ul>' . "\n"
  461.                . $_strname
  462.                . '</ul>' . "\n"
  463.                . $_strtrans
  464.                . '<input type="submit" value="' . $strGo . '">' . "\n"
  465.                . '</FORM>';
  466.         }
  467.     }
  468.     //    ------------------------------------
  469.     //    d i s p l a y   p d f    s c h e m a
  470.     //    ------------------------------------
  471.  
  472.     if (isset($do)
  473.     && ($do == 'edcoord'
  474.        || ($do == 'choosepage' && isset($chpage))
  475.        || ($do == 'createpage' && isset($chpage)))) {
  476.         ?>
  477. <form method="post" action="pdf_schema.php" name="pdfoptions">
  478.     <?php echo PMA_generate_common_hidden_inputs($db); ?>
  479.     <input type="hidden" name="pdf_page_number" value="<?php echo $chpage; ?>" />
  480.     <?php echo $strDisplayPDF; ?> :<br />
  481.     <input type="checkbox" name="show_grid" id="show_grid_opt" />
  482.     <label for="show_grid_opt"><?php echo $strShowGrid; ?></label><br />
  483.     <input type="checkbox" name="show_color" id="show_color_opt" checked="checked" />
  484.     <label for="show_color_opt"><?php echo $strShowColor; ?></label><br />
  485.     <input type="checkbox" name="show_table_dimension" id="show_table_dim_opt" />
  486.     <label for="show_table_dim_opt"><?php echo $strShowTableDimension; ?></label><br />
  487.     <input type="checkbox" name="all_tab_same_wide" id="all_tab_same_wide" />
  488.     <label for="all_tab_same_wide"><?php echo $strAllTableSameWidth; ?></label><br />
  489.     <input type="checkbox" name="with_doc" id="with_doc" checked="checked" />
  490.     <label for="with_doc"><?php echo $strDataDict; ?></label> <br />
  491.     <?php echo $strShowDatadictAs; ?>
  492.     <select name="orientation" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>>
  493.         <option value="L"><?php echo $strLandscape;?></option>
  494.         <option value="P"><?php echo $strPortrait;?></option>
  495.     </select><br />
  496.     <?php echo $strPaperSize; ?>
  497.     <select name="paper" <?php echo ($cfg['WYSIWYG-PDF'] ? 'onchange="refreshDragOption(\'pdflayout\');"' : ''); ?>>
  498. <?php
  499.     foreach($cfg['PDFPageSizes'] AS $key => $val) {
  500.         echo '<option value="' . $val . '"';
  501.         if ($val == $cfg['PDFDefaultPageSize']) {
  502.             echo ' selected="selected"';
  503.         }
  504.         echo ' >' . $val . '</option>' . "\n";
  505.     }
  506. ?>
  507.     </select><br />
  508.       <input type="submit" value="<?php echo $strGo; ?>" />
  509. </form>
  510.         <?php
  511.         if ((isset($showwysiwyg) && $showwysiwyg == '1')) {
  512.         ?>
  513. <script type="text/javascript">
  514. <!--
  515. ToggleDragDrop('pdflayout');
  516. // -->
  517. </script>
  518.         <?php
  519.         }
  520.     } // end if
  521. } // end if ($cfgRelation['pdfwork'])
  522.  
  523.  
  524. /**
  525.  * Displays the footer
  526.  */
  527. echo "\n";
  528. require_once('./footer.inc.php');
  529. ?>
  530.