Location: PHPKode > projects > phpMyDesigner > pmd_pdf.php
<?php
include_once 'pmd_session.php';
if(!isset($scale))
{
  $no_die_save_pos = 1;
  include_once 'pmd_save_pos.php';
}
require_once './libraries/relation.lib.php';
require_once 'pmd_config.php';

if(isset($scale))
{
  if(empty($pdf_page_number))die("<script>alert('Pages not found!');history.go(-2);</script>");
  $cfgRelation = PMA_getRelationsParam();
  if(isset($exp))
    PMA_query_as_cu(
    'UPDATE 
    '.PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']).',`pmd_table_coords`
    SET 
    `pma_table_coords`.`x`=`pmd_table_coords`.`x` / '.$scale.',
    `pma_table_coords`.`y`=`pmd_table_coords`.`y` / '.$scale.'
    WHERE
    `pma_table_coords`.`db_name`=`pmd_table_coords`.`db_name` 
    AND
    `pma_table_coords`.`table_name`=`pmd_table_coords`.`table_name`
    AND
    `pma_table_coords`.`db_name`=\''.$db.'\'
    AND pdf_page_number = '.$pdf_page_number.';',TRUE,PMA_DBI_QUERY_STORE); 
    
  if(isset($imp))
    PMA_query_as_cu(
    'UPDATE 
    '.PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']).',`pmd_table_coords`
    SET 
    `pmd_table_coords`.`x`=`pma_table_coords`.`x` * '.$scale.',
    `pmd_table_coords`.`y`=`pma_table_coords`.`y` * '.$scale.'
    WHERE
    `pmd_table_coords`.`db_name`=`pma_table_coords`.`db_name` 
    AND
    `pmd_table_coords`.`table_name`=`pma_table_coords`.`table_name`
    AND
    `pmd_table_coords`.`db_name`=\''.$db.'\'
    AND pdf_page_number = '.$pdf_page_number.';',TRUE,PMA_DBI_QUERY_STORE); 

die("<script>alert('$LangItIsKept');history.go(-2);</script>");
}
?>
<html>
<head>
<?php if(0){ ?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<link rel="stylesheet" type="text/css" href="pmd/styles/default/style1.css">
<?php } ?>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
<link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
<title>phpMyDesigner</title>
</head>
<body>
<br>
<div style="text-align:center; font-weight:bold;">
  <form name="form1" method="post" action="pmd_pdf.php?db=<? echo $db ?>&token=<? echo $token ?>">
    <p>Export/Import to scale:
      <select name="scale">
        <option value="1">1:1</option>
        <option value="2">1:2</option>
        <option value="3" selected>1:3 (recommended)</option>
        <option value="4">1:4</option>
        <option value="5">1:5</option>
        </select>
      </p>
    <p>in / from page:

      <select name="pdf_page_number">
      <?
      $table_info_result = PMA_query_as_cu('SELECT * FROM '.PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['pdf_pages']).'
                                             WHERE db_name = \''.$db.'\'');
      while($page = PMA_DBI_fetch_assoc($table_info_result))
      {
      ?>
      <option value="<? echo $page['page_nr'] ?>"><? echo $page['page_descr'] ?></option>
      <?
      }
      ?>
      </select>
      <br>
      <br>
      <input type="submit" name="exp" value="Export coords in pdf">
      <input type="submit" name="imp" value="Import coords from pdf">
        </p>
  </form>
</div>
</body>
</html>

Return current item: phpMyDesigner