Improve docs.
[phpmyadmin/crack.git] / pmd_pdf.php
blob0bc7420e65a5220724809f8044f5f46e2e61cf19
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 include_once 'pmd_session.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';
11 require_once 'pmd_config.php';
13 if (isset($scale)) {
14 if (empty($pdf_page_number)) {
15 die("<script>alert('Pages not found!');history.go(-2);</script>");
17 $cfgRelation = PMA_getRelationsParam();
19 $pmd_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']);
20 $pma_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']);
22 if (isset($exp)) {
24 $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 . "'";
26 PMA_query_as_cu($sql,TRUE,PMA_DBI_QUERY_STORE);
29 if (isset($imp)) {
30 PMA_query_as_cu(
31 'UPDATE ' . $pma_table . ',' . $pmd_table .
32 ' SET ' . $pmd_table . '.`x`= ' . $pma_table . '.`x` * '. $scale . ',
33 ' . $pmd_table . '.`y`= ' . $pma_table . '.`y` * '.$scale.'
34 WHERE
35 ' . $pmd_table . '.`db_name`=' . $pma_table . '.`db_name`
36 AND
37 ' . $pmd_table . '.`table_name` = ' . $pma_table . '.`table_name`
38 AND
39 ' . $pmd_table . '.`db_name`=\''.$db.'\'
40 AND pdf_page_number = '.$pdf_page_number.';',TRUE,PMA_DBI_QUERY_STORE); }
42 die("<script>alert('$strModifications');history.go(-2);</script>");
45 <html>
46 <head>
47 <?php if(0){ ?>
48 <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
49 <link rel="stylesheet" type="text/css" href="pmd/styles/default/style1.css">
50 <?php } ?>
51 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
52 <link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
53 <title>phpMyDesigner</title>
54 </head>
55 <body>
56 <br>
57 <div style="text-align:center; font-weight:bold;">
58 <form name="form1" method="post" action="pmd_pdf.php?db=<? echo $db ?>&token=<? echo $token ?>">
59 <p><?php echo $strExportImportToScale; ?>:
60 <select name="scale">
61 <option value="1">1:1</option>
62 <option value="2">1:2</option>
63 <option value="3" selected>1:3 (<?php echo $strRecommended; ?>)</option>
64 <option value="4">1:4</option>
65 <option value="5">1:5</option>
66 </select>
67 </p>
68 <p><?php echo $strToFromPage; ?>:
70 <select name="pdf_page_number">
72 $table_info_result = PMA_query_as_cu('SELECT * FROM '.PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']).'
73 WHERE db_name = \''.$db.'\'');
74 while($page = PMA_DBI_fetch_assoc($table_info_result))
77 <option value="<? echo $page['page_nr'] ?>"><? echo $page['page_descr'] ?></option>
81 </select>
82 <br>
83 <br>
84 <input type="submit" name="exp" value="<?php echo $strExport; ?>">
85 <input type="submit" name="imp" value="<?php echo $strImport; ?>">
86 </p>
87 </form>
88 </div>
89 </body>
90 </html>