[ Index ]
 

Code source de phpMyAdmin 2.10.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> pmd_general.php (source)

   1  <?php
   2  /* $Id: pmd_general.php 10413 2007-05-26 18:31:40Z lem9 $ */
   3  // vim: expandtab sw=4 ts=4 sts=4:
   4  
   5  /*
   6  @author  Ivan A Kirillov (Ivan.A.Kirillov@gmail.com)
   7  */
   8  include_once  "./pmd_common.php";
   9  
  10  $tab_column       = get_tab_info();
  11  $script_tabs      = get_script_tabs();
  12  $script_contr     = get_script_contr();
  13  $tab_pos          = get_tab_pos();
  14  $tables_pk_or_unique_keys = get_pk_or_unique_keys();
  15  $tables_all_keys  = get_all_keys();
  16  $hidden           = "hidden";
  17  
  18  ?>
  19  <html xmlns:v="urn:schemas-microsoft-com:vml">
  20  <head>
  21  <link rel="SHORTCUT ICON" href="pmd/images/favicon.ico" />
  22  <?php if(0){ ?>
  23  <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
  24  <link rel="stylesheet" type="text/css" href="pmd/styles/default/style1.css">
  25  <?php } ?>
  26  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
  27  <link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
  28  
  29  <title>Designer</title>
  30  </head>
  31  
  32  <?php 
  33  echo '
  34  <script>
  35  var server = "' . $server . '";
  36  var db = "' . $db . '";
  37  var token = "' . $token . '";
  38  var LangSelectReferencedKey = "' . $strSelectReferencedKey . '";
  39  var LangSelectForeignKey = "' . $strSelectForeignKey . '";
  40  var LangPleaseSelectPrimaryOrUniqueKey = "' . $strPleaseSelectPrimaryOrUniqueKey . '";
  41  var LangIEnotSupport = "' . $strIEUnsupported . '";
  42  var LangChangeDisplay = "' . $strChangeDisplay . '";   
  43  
  44  var strLang = Array();
  45  strLang["strModifications"] = "' . $strModifications . '";
  46  strLang["strRelationDeleted"] = "' . $strRelationDeleted . '";
  47  strLang["strInnoDBRelationAdded"] = "' . $strInnoDBRelationAdded . '";
  48  strLang["strGeneralRelationFeat:strDisabled"] = "' . $strGeneralRelationFeat . ' : ' . $strDisabled . '";
  49  strLang["strInternalRelationAdded"] = "' . $strInternalRelationAdded . '";
  50  strLang["strErrorRelationAdded"] = "' . $strErrorRelationAdded . '";   
  51  strLang["strErrorRelationExists"] = "' . $strErrorRelationExists . '";   
  52  strLang["strErrorSaveTable"] = "' . $strErrorSaveTable . '";                   
  53  </script>';  
  54  ?>
  55  <script language=javascript src="pmd/scripts/ajax.js" type=text/javascript></script>
  56  <script language=javascript src="pmd/scripts/move.js" type=text/javascript></script>
  57  <!--[if IE]><script type="text/javascript" src="pmd/scripts/iecanvas.js"></script><![endif]-->
  58  
  59  <?php
  60  echo $script_tabs . $script_contr . $script_display_field;
  61  ?>
  62  <body onLoad="Main()" class="general_body" marginheight="0" marginwidth="0">
  63    <ul class="header" id="top_menu"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  64        <tr>
  65          <td width="10%" align="left"><a 
  66            href="javascript:Show_left_menu(document.getElementById('key_Show_left_menu'));" onMouseDown="return false;" class="M_butt" target="_self"><img id='key_Show_left_menu' title="<?php echo $strShowHideLeftMenu; ?>" alt="v" src="pmd/images/downarrow2_m.png" ></a></td>
  67          <td width="80%" align="center" nowrap><a
  68            href="javascript:Save2();" onMouseDown="return false;" class="M_butt" target="_self"><img  title="<?php echo $strSavePosition ?>" src="pmd/images/save.png"></a><a 
  69            href="javascript:Start_table_new();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strCreateTable ?>"     src="pmd/images/table.png"></a><a 
  70            href="javascript:Start_relation();" onMouseDown="return false;" class="M_butt" id="rel_button" target="_self"><img title="<?php echo $strCreateRelation ?>"  src="pmd/images/relation.png"></a><a 
  71            href="javascript:Start_display_field();" onMouseDown="return false;" class="M_butt" id="display_field_button" target="_self"><img title="<?php echo $strChangeDisplay ?>"  src="pmd/images/display_field.png"></a><a 
  72            href="javascript:location.reload();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strReload; ?>" src="pmd/images/reload.png"></a><a 
  73            href="javascript:Help();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strHelp; ?>" src="pmd/images/help.png"></a><img class="M_bord" src="pmd/images/bord.png"><a 
  74            href="javascript:Angular_direct();" onMouseDown="return false;" class="M_butt" id="angular_direct_button" target="_self"><img title="<?php echo $strAngularLinks.' / '.$strDirectLinks; ?>"  src="pmd/images/ang_direct.png"></a><a 
  75            href="javascript:Grid();" onMouseDown="return false;" class="M_butt" id="grid_button" target="_self"><img title="<?php echo $strSnapToGrid ?>"  src="pmd/images/grid.png"></a><img class="M_bord" src="pmd/images/bord.png"><a 
  76            href="javascript:Small_tab_all(document.getElementById('key_SB_all'));" onMouseDown="return false;" class="M_butt" target="_self"><img id='key_SB_all' title="<?php echo $strSmallBigAll; ?>" alt="v" src="pmd/images/downarrow1.png" ></a><a 
  77            href="javascript:Small_tab_invert();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strToggleSmallBig; ?>" alt="key" src="pmd/images/bottom.png" ></a><img class="M_bord" src="pmd/images/bord.png"><a
  78            href="javascript:PDF_save();" onMouseDown="return false;" class="M_butt" target="_self"><img src="pmd/images/pdf.png" alt="key" width="20" height="20" title="<?php echo $strImportExportCoords; ?>"></a></td>
  79          <td width="10%" align="right"><a
  80            href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));" onMouseDown="return false;" class="M_butt" target="_self"><img src="pmd/images/2rightarrow_m.png" id="key_Left_Right" alt=">" title="<?php echo $strMoveMenu; ?>"></a></td>
  81        </tr>
  82      </table></ul>
  83    
  84  <div id="osn_tab">
  85    <CANVAS id="canvas" width="100" height="100" onClick="Canvas_click(this)"></CANVAS>    
  86  </div>
  87  
  88  <form action="" method="post" name="form1">
  89  <div id="layer_menu" style="left:0px; top:28px; width:150px; visibility:<?PHP echo $hidden ?>;  position:fixed; z-index:1000; background-color:#EAEEF0; border:#999999 solid 1px;">
  90  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  91  <tr>
  92    <td height="1px">
  93  
  94    <div align="center" style="padding-top:5px">
  95        <a 
  96    href="javascript:Hide_tab_all(document.getElementById('key_HS_all'));" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strHideShowAll; ?>" alt="v" src="pmd/images/downarrow1.png" id='key_HS_all' ></a><a 
  97    href="javascript:No_have_constr(document.getElementById('key_HS'));" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strHideShowNoRelation; ?>" alt="v" src="pmd/images/downarrow2.png" id='key_HS'></a>      
  98    </div>
  99    </td>
 100  </tr>
 101  <tr>
 102    <td>
 103      <div id="id_scroll_tab" class="scroll_tab">
 104          <table width="100%" style="padding-left:3px;">
 105            <?php
 106          for ( $i=0; $i < sizeof( $GLOBALS['PMD']['TABLE_NAME'] ); $i++ ) 
 107          {
 108          ?>
 109            <tr>
 110        <td title="<?php echo $strStructure; ?>" width="1px" onMouseOver="this.className='L_butt2_2'" onMouseOut="this.className='L_butt2_1'" ><img onClick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');" src="pmd/images/exec.png"></td>
 111              <td width="1px"><input onClick="VisibleTab(this,'<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>')" title="<?php echo $strHide ?>" id="check_vis_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>" style="margin:0px;" type="checkbox" value="<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"  <?php if( isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]) ) echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"]?"checked":""; else echo "checked"; ?>></td>
 112              <td class="Tabs" onMouseOver="this.className='Tabs2'" onMouseOut="this.className='Tabs'" onClick="Select_tab('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>');"><?php echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i]; ?></td>
 113            </tr>
 114            <?php 
 115          }
 116          ?>
 117          </table>
 118    </div>
 119    </td> 
 120  </tr>
 121  <tr>
 122    <td height="1px">
 123    <div align="center"><?php echo $strNumberOfTables ?>: <?php echo sizeof( $GLOBALS['PMD']['TABLE_NAME'] ) ?></div>
 124    <div align="right"><div style=" background-image:url(pmd/images/resize.png); cursor:nw-resize; width:16px; height:16px; " onMouseDown="layer_menu_cur_click=1" onMouseUp="layer_menu_cur_click=0"></div></div>
 125    </td>
 126  </tr>
 127  </table>
 128  </div>
 129  <?php
 130  for ( $i=0; $i < sizeof( $GLOBALS['PMD']["TABLE_NAME"] ); $i++ ) 
 131  {
 132    $t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
 133    $t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
 134  ?>
 135  <input name="t_x[<?php echo $t_n_url ?>]" type="hidden" id="t_x[<?php echo $t_n_url ?>]">
 136  <input name="t_y[<?php echo $t_n_url ?>]" type="hidden" id="t_y[<?php echo $t_n_url ?>]">
 137  <input name="t_v[<?php echo $t_n_url ?>]" type="hidden" id="t_v[<?php echo $t_n_url ?>]">
 138  <input name="t_h[<?php echo $t_n_url ?>]" type="hidden" id="t_h[<?php echo $t_n_url ?>]">
 139  
 140  <table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="tab" 
 141         style="position:absolute; 
 142                left: <?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["X"]; else echo rand(180,800); ?>; 
 143                top:  <?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["Y"]; else echo rand(30,500); ?>;
 144                visibility:  <?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["H"]?"visible":"hidden"; ?>;
 145               ">
 146    <tr>
 147      <td class="small_tab" onMouseOver="this.className='small_tab2';" onMouseOut="this.className='small_tab';" id="_|_hide_tbody_<?php echo $t_n_url ?>" onClick="Small_tab('<?php echo $t_n_url ?>',1)"><?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["V"]?"v":">";else echo "v"; ?></td>
 148      <td class="small_tab_pref" onMouseOver="this.className='small_tab_pref2';" onMouseOut="this.className='small_tab_pref';" onClick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');"><img src="pmd/images/exec_small.png"></td>
 149      <td nowrap id="_|_zag_<?php echo $t_n_url ?>" class="tab_zag" onMouseDown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"
 150      onMouseOver="this.className = 'tab_zag_2'" onMouseOut="this.className = 'tab_zag'"
 151      ><?php echo "<span class='owner'>".strtolower($GLOBALS['PMD_OUT']["OWNER"][$i]).".</span>".$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]; ?></td>
 152    </tr>
 153    <tbody id="_|_tbody_<?php echo $t_n_url ?>" 
 154           style="display:<?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["V"]?"":"none"; ?>;">
 155    <?php
 156    $display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
 157    for ( $j=0; $j < sizeof( $tab_column[$t_n]["COLUMN_ID"] ); $j++ ) 
 158    {
 159    ?>
 160      <tr id = "_|_tr_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i].'.'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
 161      <?php if($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) echo ' class="tab_field_3" '; else  echo ' class="tab_field" '; ?>
 162      onMouseOver="old_class = this.className; this.className = 'tab_field_2';" onMouseOut="this.className = old_class;" 
 163      onMouseDown="Click_field('<?php
 164          echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',";
 165          if ($GLOBALS['PMD']['TABLE_TYPE'][$i] != 'INNODB') {
 166              echo (isset( $tables_pk_or_unique_keys[ $t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j] ] ) ? 1 : 0);
 167          } else {
 168        // if this is an InnoDB table, it's not necessary that the
 169        // index is a primary key
 170              echo (isset( $tables_all_keys[ $t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j] ] ) ? 1 : 0);
 171          }
 172  ?>)">
 173          <td width="10px" colspan="3" id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
 174          ><div style="white-space:nowrap">
 175        <?php 
 176        if(isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
 177        ?>
 178        <img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE']
 179        ?>/images/FieldKey_small.png" alt="*"><?php 
 180        } else {
 181        ?><img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE']?>/images/Field_small<?php
 182          if(strstr($tab_column[$t_n]["TYPE"][$j],'char')
 183          || strstr($tab_column[$t_n]["TYPE"][$j],'text')  ) echo '_char';
 184          elseif(strstr($tab_column[$t_n]["TYPE"][$j],'int')
 185              || strstr($tab_column[$t_n]["TYPE"][$j],'float')
 186              || strstr($tab_column[$t_n]["TYPE"][$j],'double')
 187              || strstr($tab_column[$t_n]["TYPE"][$j],'decimal') ) echo '_int';
 188          elseif(strstr($tab_column[$t_n]["TYPE"][$j],'date')
 189              || strstr($tab_column[$t_n]["TYPE"][$j],'time')
 190              || strstr($tab_column[$t_n]["TYPE"][$j],'year') ) echo '_date';
 191         ?>.png" alt="*"><?php } ?> 
 192        <?php echo htmlspecialchars($tab_column[$t_n]["COLUMN_NAME"][$j]." : ".$tab_column[$t_n]["TYPE"][$j], ENT_QUOTES); ?>
 193          </div>
 194         </td>
 195      </tr>
 196      <?php
 197    }
 198    ?>
 199    </tbody>
 200  </table>
 201  <?php
 202  }
 203  ?>
 204  </form>
 205  <div id="hint"></div>
 206  <div id='layer_action' style="position:absolute; left:638px; top:52px; z-index:1000; 
 207                                visibility:<?PHP echo $hidden ?>; background-color:#CCFF99; padding:3px; border:#009933 solid 1px; white-space:nowrap; font-weight:bold">Load...</div>
 208  
 209    <table id="layer_new_relation" style="visibility:<?PHP echo $hidden ?>; position:absolute; left:636px; top:85px; z-index:1000; width: 153px;" width="5%" border="0" cellpadding="0" cellspacing="0">
 210      <tr>
 211        <td id="frams1" width="10px"></td>
 212        <td width="99%" id="frams5"></td>
 213        <td width="10px" id="frams2"><div class="bor"></div></td>
 214      </tr>
 215      <tr>
 216        <td id="frams8"></td>
 217        <td class="input_tab"><table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
 218            <tr>
 219        <td colspan="2" align="center" nowrap><b><?php echo $strCreateRelation; ?></b></td>
 220            </tr>
 221            <tbody id="InnoDB_relation">
 222            <tr>
 223              <td colspan="2" align="center" nowrap><b>InnoDB</b></td>
 224              </tr>
 225            <tr>
 226              <td width="58" nowrap>on delete</td>
 227              <td width="102"><select name="on_delete" id="on_delete">
 228                  <option value="nix" selected="selected">--</option>
 229                  <option value="CASCADE">CASCADE</option>
 230                  <option value="SET NULL">SET NULL</option>
 231                  <option value="NO ACTION">NO ACTION</option>
 232                  <option value="RESTRICT">RESTRICT</option>
 233                </select>            </td>
 234            </tr>
 235            <tr>
 236              <td nowrap>on update</td>
 237              <td><select name="on_update" id="on_update">
 238                  <option value="nix" selected="selected">--</option>
 239                  <option value="CASCADE">CASCADE</option>
 240                  <option value="SET NULL">SET NULL</option>
 241                  <option value="NO ACTION">NO ACTION</option>
 242                  <option value="RESTRICT">RESTRICT</option>
 243                </select>            </td>
 244            </tr>
 245            </tbody>
 246            <tr>
 247              <td colspan="2" align="center" nowrap>
 248          <input type="button" id="butt" name="Button" value="<?php echo $strOK; ?>" onClick="New_relation()" > 
 249            <input type="button" id="butt" name="Button" value="<?php echo $strCancel; ?>" onClick="document.getElementById('layer_new_relation').style.visibility = 'hidden';">
 250              </td>
 251            </tr>
 252        </table></td>
 253        <td id="frams6"></td>
 254      </tr>
 255      <tr>
 256        <td id="frams4"><div class="bor"></div></td>
 257        <td id="frams7"></td>
 258        <td id="frams3"></td>
 259      </tr>
 260  </table>
 261    <table id="layer_upd_relation" style="visibility:<?PHP echo $hidden ?>; position:absolute; left:637px; top:224px; z-index:1000;" width="5%" border="0" cellpadding="0" cellspacing="0">
 262      <tr>
 263        <td id="frams1" width="10px"></td>
 264        <td width="99%" id="frams5"></td>
 265        <td width="10px" id="frams2"><div class="bor"></div></td>
 266      </tr>
 267      <tr>
 268        <td id="frams8"></td>
 269        <td class="input_tab"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
 270            <tr>
 271        <td colspan="3" align="center" nowrap><b><?php echo $strDeleteRelation; ?></b></td>
 272            </tr>
 273            <tr>
 274              <td colspan="3" align="center" nowrap>
 275          <input name="Button" type="button" id="butt" onClick="Upd_relation()" value="<?php echo $strDelete; ?>" >
 276            <input type="button" id="butt" name="Button" value="<?php echo $strCancel; ?>" onClick="document.getElementById('layer_upd_relation').style.visibility = 'hidden'; Re_load();">
 277              </td>
 278            </tr>
 279        </table></td>
 280        <td id="frams6"></td>
 281      </tr>
 282      <tr>
 283        <td id="frams4"><div class="bor"></div></td>
 284        <td id="frams7"></td>
 285        <td id="frams3"></td>
 286      </tr>
 287  </table>
 288  <!-- cache images -->
 289  <img src="pmd/images/2leftarrow_m.png" width="0" height="0">
 290  <img src="pmd/images/rightarrow1.png" width="0" height="0">
 291  <img src="pmd/images/rightarrow2.png" width="0" height="0">
 292  <img src="pmd/images/uparrow2_m.png" width="0" height="0">
 293  </body>
 294  </html>


Généré le : Mon Nov 26 15:18:20 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics