Unsupported scripts and control panel web app for a hosting company
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

siteoverview.php 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?PHP
  2. require_once('lib/database.php');
  3. require_once('lib/common.php');
  4. ?>
  5. <div class="block">
  6. <h2>My Sites</h2>
  7. <table class="innerblock">
  8. <tr>
  9. <th>&nbsp;</th>
  10. <th>Name</th>
  11. <th>Settings</th>
  12. <th>Stats</th>
  13. <th>Bandwidth</th>
  14. <th>Status</th>
  15. </tr>
  16. <?PHP
  17. $i = 0;
  18. $n = 0;
  19. /*
  20. /usr/local/apache/htdocs/bandquota - Bandwidth overing
  21. /usr/local/apache/htdocs/bill - Unpaid bill
  22. */
  23. $sql = 'SELECT site_id, site_name, site_bandin, site_bandout, site_docroot, site_curdocroot FROM sites WHERE user_id = '.UID;
  24. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  25. if (mysql_num_rows($res) == 0) {
  26. echo '<tr><td colspan="6" style="font-style: italic; text-align: center;">';
  27. echo 'You have no sites. Would you like to <a href="'.CP_PATH.'addsite">add one</a>?</td></tr>';
  28. }
  29. while ($row = mysql_fetch_array($res)) {
  30. $n++;
  31. ?>
  32. <tr class="<?PHP echo ($i == 0) ? 'even' : 'odd'; ?>">
  33. <td><?PHP echo $n; ?>.</td>
  34. <td><?PHP echo $row['site_name']; ?></td>
  35. <td><a href="<?PHP echo CP_PATH; ?>editsite/<?PHP echo $row['site_id']; ?>">Settings</a></td>
  36. <td><a href="<?PHP echo CP_PATH; ?>sitestats/<?PHP echo $row['site_id']; ?>">Stats</a></td>
  37. <td><?PHP echo NiceSize($row['site_bandin'] + $row['site_bandout']); ?></td>
  38. <?PHP
  39. /*if (!is_dir($row['site_docroot'])) {
  40. echo '<td class="err">Invalid docroot</td>';
  41. } else*/ if ($row['site_docroot'] == '/usr/local/apache/htdocs/bandquota') {
  42. echo '<td class="err">Disabled - bandwidth exceeded</td>';
  43. } elseif ($row['site_docroot'] == '/usr/local/apache/htdocs/hddquota') {
  44. echo '<td class="err">Disabled - disk quota exceeded</td>';
  45. } elseif ($row['site_docroot'] == '/usr/local/apache/htdocs/bill') {
  46. echo '<td class="err">Disabled - unpaid bill</td>';
  47. } else {
  48. echo '<td>OK</td>';
  49. }
  50. ?>
  51. </tr>
  52. <?PHP
  53. $i = 1 - $i;
  54. }
  55. ?>
  56. </table>
  57. </div>