Add IF NOT EXISTS to CREATE DATABASE query (RFE #1608372), reload navigation after...
[phpmyadmin/last10db.git] / pmd_pdf.php
blob0c27015c627bbf19c9874921a559561c35f78823
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 include_once 'pmd_common.php';
6 if ( ! isset($scale)) {
7 $no_die_save_pos = 1;
8 include_once 'pmd_save_pos.php';
10 require_once './libraries/relation.lib.php';
12 if (isset($scale)) {
13 if (empty($pdf_page_number)) {
14 die("<script>alert('Pages not found!');history.go(-2);</script>");
17 $pmd_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']);
18 $pma_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']);
20 if (isset($exp)) {
22 $sql = "REPLACE INTO " . $pma_table . " (db_name, table_name, pdf_page_number, x, y) SELECT db_name, table_name, " . $pdf_page_number . ", x, y FROM " . $pmd_table . " WHERE db_name = '" . $db . "'";
24 PMA_query_as_cu($sql,TRUE,PMA_DBI_QUERY_STORE);
27 if (isset($imp)) {
28 PMA_query_as_cu(
29 'UPDATE ' . $pma_table . ',' . $pmd_table .
30 ' SET ' . $pmd_table . '.`x`= ' . $pma_table . '.`x` * '. $scale . ',
31 ' . $pmd_table . '.`y`= ' . $pma_table . '.`y` * '.$scale.'
32 WHERE
33 ' . $pmd_table . '.`db_name`=' . $pma_table . '.`db_name`
34 AND
35 ' . $pmd_table . '.`table_name` = ' . $pma_table . '.`table_name`
36 AND
37 ' . $pmd_table . '.`db_name`=\''.$db.'\'
38 AND pdf_page_number = '.$pdf_page_number.';',TRUE,PMA_DBI_QUERY_STORE); }
40 die("<script>alert('$strModifications');history.go(-2);</script>");
43 <html>
44 <head>
45 <?php if(0){ ?>
46 <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
47 <link rel="stylesheet" type="text/css" href="pmd/styles/default/style1.css">
48 <?php } ?>
49 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
50 <link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
51 <title>Designer</title>
52 </head>
53 <body>
54 <br>
55 <div style="text-align:center; font-weight:bold;">
56 <form name="form1" method="post" action="pmd_pdf.php?db=<? echo $db ?>&token=<? echo $token ?>">
57 <p><?php echo $strExportImportToScale; ?>:
58 <select name="scale">
59 <option value="1">1:1</option>
60 <option value="2">1:2</option>
61 <option value="3" selected>1:3 (<?php echo $strRecommended; ?>)</option>
62 <option value="4">1:4</option>
63 <option value="5">1:5</option>
64 </select>
65 </p>
66 <p><?php echo $strToFromPage; ?>:
68 <select name="pdf_page_number">
70 $table_info_result = PMA_query_as_cu('SELECT * FROM '.PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']).'
71 WHERE db_name = \''.$db.'\'');
72 while($page = PMA_DBI_fetch_assoc($table_info_result))
75 <option value="<? echo $page['page_nr'] ?>"><? echo $page['page_descr'] ?></option>
79 </select>
80 <br>
81 <br>
82 <input type="submit" name="exp" value="<?php echo $strExport; ?>">
83 <input type="submit" name="imp" value="<?php echo $strImport; ?>">
84 </p>
85 </form>
86 </div>
87 </body>
88 </html>