Translation update done using Pootle.
[phpmyadmin/crack.git] / pmd_pdf.php
blob069f6f1a9ce8c5b94a4635bbfde7326711908eee
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin-Designer
6 */
8 include_once 'pmd_common.php';
10 /**
11 * If called directly from the designer, first save the positions
13 if (! isset($scale)) {
14 $no_die_save_pos = 1;
15 include_once 'pmd_save_pos.php';
18 require_once './libraries/relation.lib.php';
20 if (isset($scale) && ! isset($createpage)) {
21 if (empty($pdf_page_number)) {
22 die("<script>alert('Pages not found!');history.go(-2);</script>");
25 $pmd_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']);
26 $pma_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']);
27 $scale_q = PMA_sqlAddslashes($scale);
28 $pdf_page_number_q = PMA_sqlAddslashes($pdf_page_number);
30 if (isset($exp)) {
32 $sql = "REPLACE INTO " . $pma_table . " (db_name, table_name, pdf_page_number, x, y) SELECT db_name, table_name, " . $pdf_page_number_q . ", ROUND(x/" . $scale_q . ") , ROUND(y/" . $scale_q . ") y FROM " . $pmd_table . " WHERE db_name = '" . PMA_sqlAddslashes($db) . "'";
34 PMA_query_as_controluser($sql,TRUE,PMA_DBI_QUERY_STORE);
37 if (isset($imp)) {
38 PMA_query_as_controluser(
39 'UPDATE ' . $pma_table . ',' . $pmd_table .
40 ' SET ' . $pmd_table . '.`x`= ' . $pma_table . '.`x` * '. $scale_q . ',
41 ' . $pmd_table . '.`y`= ' . $pma_table . '.`y` * '. $scale_q .'
42 WHERE
43 ' . $pmd_table . '.`db_name`=' . $pma_table . '.`db_name`
44 AND
45 ' . $pmd_table . '.`table_name` = ' . $pma_table . '.`table_name`
46 AND
47 ' . $pmd_table . '.`db_name`=\''. PMA_sqlAddslashes($db) .'\'
48 AND pdf_page_number = ' . $pdf_page_number_q . ';', TRUE, PMA_DBI_QUERY_STORE);
51 die("<script>alert('__('Modifications have been saved')');history.go(-2);</script>");
54 if (isset($createpage)) {
56 * @see pdf_pages.php
58 $query_default_option = PMA_DBI_QUERY_STORE;
60 $pdf_page_number = PMA_REL_create_page($newpage, $cfgRelation, $db, $query_default_option);
61 if ($pdf_page_number > 0) {
62 $message = PMA_Message::success(__('Page has been created'));
63 } else {
64 $message = PMA_Message::error(__('Page creation failed'));
68 // no need to use pmd/styles
69 require_once './libraries/header_meta_style.inc.php';
71 </head>
72 <body>
73 <br>
74 <div>
75 <?php
76 if (!empty($message)) {
77 $message->display();
80 <form name="form1" method="post" action="pmd_pdf.php">
81 <?php echo PMA_generate_common_hidden_inputs($db); ?>
82 <div>
83 <fieldset><legend><?php echo __('Export') . '/' . __('Import'); ?></legend>
84 <p><?php echo __('Export/Import to scale'); ?>:
85 <select name="scale">
86 <option value="1">1:1</option>
87 <option value="2">1:2</option>
88 <option value="3" selected>1:3 (<?php echo __('recommended'); ?>)</option>
89 <option value="4">1:4</option>
90 <option value="5">1:5</option>
91 </select>
92 </p>
93 <p><?php echo __('to/from page'); ?>:
95 <select name="pdf_page_number">
96 <?php
97 $table_info_result = PMA_query_as_controluser('SELECT * FROM '
98 . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages'])
99 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'');
100 while($page = PMA_DBI_fetch_assoc($table_info_result))
103 <option value="<?php echo $page['page_nr'] ?>"><?php echo htmlspecialchars($page['page_descr']) ?></option>
104 <?php
107 </select>
108 <input type="submit" name="exp" value="<?php echo __('Export'); ?>">
109 <input type="submit" name="imp" value="<?php echo __('Import'); ?>">
110 </fieldset>
111 </div>
112 <div>
113 <fieldset><legend><?php echo __('Create a page'); ?></legend>
114 <input type="text" name="newpage" />
115 <input type="submit" name="createpage" value="<?php echo __('Go'); ?>">
116 </fieldset>
117 </div>
118 </form>
119 </div>
120 </body>
121 </html>