2.11.2.1 release
[phpmyadmin/arisferyanto.git] / pmd_pdf.php
blobf960810398cff89ed14c7b375ffa4605d89d99b3
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 * @package phpMyAdmin-Designer
7 */
9 /**
12 include_once 'pmd_common.php';
13 if (! isset($scale)) {
14 $no_die_save_pos = 1;
15 include_once 'pmd_save_pos.php';
17 require_once './libraries/relation.lib.php';
19 if (isset($scale)) {
20 if (empty($pdf_page_number)) {
21 die("<script>alert('Pages not found!');history.go(-2);</script>");
24 $pmd_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']);
25 $pma_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']);
27 if (isset($exp)) {
29 $sql = "REPLACE INTO " . $pma_table . " (db_name, table_name, pdf_page_number, x, y) SELECT db_name, table_name, " . $pdf_page_number . ", ROUND(x/" . $scale . ") , ROUND(y/" . $scale . ") y FROM " . $pmd_table . " WHERE db_name = '" . $db . "'";
31 PMA_query_as_cu($sql,TRUE,PMA_DBI_QUERY_STORE);
34 if (isset($imp)) {
35 PMA_query_as_cu(
36 'UPDATE ' . $pma_table . ',' . $pmd_table .
37 ' SET ' . $pmd_table . '.`x`= ' . $pma_table . '.`x` * '. $scale . ',
38 ' . $pmd_table . '.`y`= ' . $pma_table . '.`y` * '.$scale.'
39 WHERE
40 ' . $pmd_table . '.`db_name`=' . $pma_table . '.`db_name`
41 AND
42 ' . $pmd_table . '.`table_name` = ' . $pma_table . '.`table_name`
43 AND
44 ' . $pmd_table . '.`db_name`=\''.$db.'\'
45 AND pdf_page_number = '.$pdf_page_number.';',TRUE,PMA_DBI_QUERY_STORE); }
47 die("<script>alert('$strModifications');history.go(-2);</script>");
50 <html>
51 <head>
52 <?php if(0){ ?>
53 <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
54 <link rel="stylesheet" type="text/css" href="pmd/styles/default/style1.css">
55 <?php } ?>
56 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
57 <link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
58 <title>Designer</title>
59 </head>
60 <body>
61 <br>
62 <div style="text-align:center; font-weight:bold;">
63 <form name="form1" method="post" action="pmd_pdf.php?server=<?php echo $server; ?>&db=<?php echo $db; ?>&token=<?php echo $token; ?>">
64 <p><?php echo $strExportImportToScale; ?>:
65 <select name="scale">
66 <option value="1">1:1</option>
67 <option value="2">1:2</option>
68 <option value="3" selected>1:3 (<?php echo $strRecommended; ?>)</option>
69 <option value="4">1:4</option>
70 <option value="5">1:5</option>
71 </select>
72 </p>
73 <p><?php echo $strToFromPage; ?>:
75 <select name="pdf_page_number">
76 <?php
77 $table_info_result = PMA_query_as_cu('SELECT * FROM '.PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']).'
78 WHERE db_name = \''.$db.'\'');
79 while($page = PMA_DBI_fetch_assoc($table_info_result))
82 <option value="<?php echo $page['page_nr'] ?>"><?php echo $page['page_descr'] ?></option>
83 <?php
86 </select>
87 <br>
88 <br>
89 <input type="submit" name="exp" value="<?php echo $strExport; ?>">
90 <input type="submit" name="imp" value="<?php echo $strImport; ?>">
91 </p>
92 </form>
93 </div>
94 </body>
95 </html>