list_db.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <table class="sub-menu" style="background: white;">
  2. <tr>
  3. <td style="padding: 12px 0 8px 6px">
  4. <div style="float:left">
  5. <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/db/'"> <?php print _('Add Database');?> </button>
  6. </div>
  7. <div style="text-align: right; float: right;">
  8. <form action="/search/" method="get" >
  9. <input type="text" name="q" style="margin: 2px 2px 0px 0px; width: 250px; padding: 3px;" size="30">
  10. <input type="submit" value="Search" class="button" style="font-size: 12px; height: 24px;">
  11. </form>
  12. </div>
  13. <div style="float:left; padding-left: 26px;">
  14. <form action="/bulk/db/" method="post" id="objects">
  15. <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> <?php print _('toggle all');?> </a>
  16. <select style="margin:0 2px 0 0px;" name="action">
  17. <option><?php print _('apply to selected');?></option>
  18. <option><?php print _('delete');?></option>
  19. </select>
  20. <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
  21. </div>
  22. </td>
  23. </tr>
  24. </table>
  25. </td>
  26. </tr>
  27. </table>
  28. <div id="vstobjects">
  29. <table class='data'>
  30. <?php
  31. list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
  32. foreach ($data as $key => $value) {
  33. ++$i;
  34. if ($data[$key]['SUSPENDED'] == 'yes') {
  35. $status = 'suspended';
  36. $spnd_action = 'unsuspend' ;
  37. } else {
  38. $status = 'active';
  39. $spnd_action = 'suspend' ;
  40. }
  41. if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin";
  42. if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/";
  43. if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin";
  44. if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/";
  45. ?>
  46. <tr class="data-row">
  47. <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
  48. <table class="data-col1">
  49. <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="database[]" value="<?php echo $key ?>" ></td></tr>
  50. <tr><td><a class="data-date" title="<?php echo $data[$key]['DATE']." ".$data[$key]['TIME'] ?>"><?php echo strftime("%d %b %Y", strtotime($data[$key]['DATE'])) ?></td></tr>
  51. <tr><td class="data-<?php echo $status ?>"><b><?php echo _($status); ?></b></td></tr>
  52. </table>
  53. </td>
  54. <td class="data-dotted" width="830px" style="vertical-align:top;">
  55. <a id="delete_link_<?php echo $i ?>" class="do_delete">
  56. <span class="data-controls do_delete">
  57. <img src="/images/delete.png" width="7px" height="7px">
  58. <?php echo _('delete') ?>
  59. <input type="hidden" name="delete_url" value="/delete/db/?database=<?php echo "$key" ?>" />
  60. <div id="delete_dialog_<?php echo $i ?>" class="confirmation-text-delete hidden" title="<?php print _('Confirmation');?>">
  61. <p class="counter-value"><?php print _('DATABASE_ACTION_CONFIRMATION',_('delete'),$key);?></p>
  62. </div>
  63. </span>
  64. </a>
  65. <a href="/edit/db/?database=<?php echo $key ?>">
  66. <span class="data-controls" width="50px">
  67. <img src="/images/edit.png" width="8px" height="8px">
  68. <?php print _('edit');?>
  69. </span>
  70. </a>
  71. <a href="<?php echo $db_admin_link; ?>" target="_blank">
  72. <span class="data-controls" width="128px">
  73. <img src="/images/new_window.png" width="8px" height="8px">
  74. <?php print _('open %s',$db_admin);?>
  75. </span>
  76. </a>
  77. <table class="data-col2" width="830px">
  78. <tr>
  79. <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
  80. <b><?php echo $key ?></b>
  81. </td>
  82. </tr>
  83. <tr>
  84. <td style="vertical-align:top;" >
  85. <table>
  86. <tr>
  87. <td class="counter-name" style="padding: 2px 0 4px 2px">
  88. [<?php echo $data[$key]['TYPE'] ?>] <?php print _('database');?>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="chart1" style="padding: 0px 0 0px 2px"><?php print _('Disk');?>: <?php echo humanize_usage($data[$key]['U_DISK']) ?>
  93. <div style="width:160px; height:6px; font-size:0;background-color:#c7d5b3;">
  94. <div style="width:<?php echo get_percentage($data[$key]['U_DISK'],$panel[$user]['DISK_QUOTA']) ?>%; height:6px; background-color:#9bbb62; border-right:1px #9bbb62 solid;"></div>
  95. </div>
  96. </td>
  97. </tr>
  98. </table>
  99. </td>
  100. <td style="vertical-align:top;" width="250">
  101. <table>
  102. <tr>
  103. <td class="counter-name">
  104. <?php print _('User');?>:
  105. </td>
  106. <td class="counter-value">
  107. <?php echo $data[$key]['DBUSER'] ?>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td class="counter-name">
  112. <?php print _('Host');?>:
  113. </td>
  114. <td class="counter-value">
  115. <?php echo $data[$key]['HOST'] ?>
  116. </td>
  117. </tr>
  118. </table>
  119. </td>
  120. <td rowspan=4 style="vertical-align:top;" width="300">
  121. <table>
  122. <tr>
  123. <td class="counter-name">
  124. <?php print _('Charset');?>:
  125. </td>
  126. <td class="counter-value">
  127. <?php echo $data[$key]['CHARSET'] ?>
  128. </td>
  129. </tr>
  130. </table>
  131. </td>
  132. </tr>
  133. </table>
  134. </td>
  135. </tr>
  136. <?php
  137. }
  138. ?>
  139. </table>
  140. </form>
  141. <table class="data-count">
  142. <tr>
  143. <td width="160px"></td>
  144. <td>
  145. <?php
  146. if ( $i == 1) {
  147. echo _('1 database');
  148. } else {
  149. echo _('%s databases',$i);
  150. }
  151. ?>
  152. </td>
  153. </tr>
  154. </table>
  155. </div>