Browse Source

refactoring ip section: new html formating

Serghey Rodin 13 years ago
parent
commit
3e477ced56

+ 65 - 0
bin/v_list_sys_users

@@ -0,0 +1,65 @@
+#!/bin/bash
+# info: list system users
+# options: [format]
+#
+# The function for obtaining the list of system users without
+# detailed information.
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
+
+# Argument defenition
+format=${1-shell}
+
+# Includes
+source $VESTA/func/main.sh
+
+# Json function
+json_list_users() {
+    users=$(grep @ /etc/passwd|cut -f 1 -d :)
+    int_counter=$(echo "$users" | wc -l)
+    i=1
+    echo '['
+    for user in $users; do
+        if [ "$i" -lt "$int_counter" ]; then
+            echo -e  "\t\"$user\","
+        else
+            echo -e  "\t\"$user\""
+        fi
+        (( ++i))
+    done
+    echo "]"
+}
+
+# Shell function
+shell_list_users() {
+    if [ -z "$nohead" ]; then
+        echo "USERS"
+        echo "----------"
+    fi
+    for user in $(grep @ /etc/passwd|cut -f 1 -d :); do
+        echo "$user"
+    done
+}
+
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
+
+# Listing domains
+case $format in
+    json)   json_list_users ;;
+    plain)  nohead=1; shell_list_users ;;
+    shell)  shell_list_users ;;
+    *)      check_args '1' '0' '[format]' ;;
+esac
+
+
+#----------------------------------------------------------#
+#                       Vesta                              #
+#----------------------------------------------------------#
+
+exit

+ 1 - 2
web/add/ip/index.php

@@ -74,11 +74,10 @@ if ($_SESSION['user'] == 'admin') {
     $interfaces = json_decode(implode('', $output), true);
     unset($output);
 
-    exec (VESTA_CMD."v_list_users 'json'", $output, $return_var);
+    exec (VESTA_CMD."v_list_sys_users 'json'", $output, $return_var);
     $users = json_decode(implode('', $output), true);
     unset($output);
 
-    include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_ip.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_ip.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);

+ 1 - 2
web/edit/ip/index.php

@@ -48,7 +48,7 @@ if ($_SESSION['user'] == 'admin') {
             $v_status =  'active';
         }
 
-        exec (VESTA_CMD."v_list_users 'json'", $output, $return_var);
+        exec (VESTA_CMD."v_list_sys_users 'json'", $output, $return_var);
         $users = json_decode(implode('', $output), true);
         unset($output);
 
@@ -110,7 +110,6 @@ if ($_SESSION['user'] == 'admin') {
         }
     }
 
-    include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_edit_ip.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_ip.html');
     unset($_SESSION['error_msg']);
     unset($_SESSION['ok_msg']);

+ 0 - 3
web/list/ip/index.php

@@ -15,14 +15,11 @@ top_panel($user,$TAB);
 
 // Data
 if ($_SESSION['user'] == 'admin') {
-
     exec (VESTA_CMD."v_list_sys_ips json", $output, $return_var);
     check_error($return_var);
     $data = json_decode(implode('', $output), true);
     $data = array_reverse($data);
     unset($output);
-
-    include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_ip.html');
     include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_ip.html');
 }
 

+ 137 - 72
web/templates/admin/add_ip.html

@@ -1,74 +1,139 @@
-<script type="text/javascript">
-  function elementHideShow(elementToHideOrShow)
-    {
-      var el = document.getElementById(elementToHideOrShow);
-      if (el.style.display == "block") {
-        el.style.display = "none";
-      } else {
-        el.style.display = "block";
-      }
-    }
-    function randomString() {
-        var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
-        var string_length = 10;
-        var randomstring = '';
-        for (var i=0; i<string_length; i++) {
-          var rnum = Math.floor(Math.random() * chars.length);
-          randomstring += chars.substring(rnum,rnum+1);
-        }
-        document.getElementById('v_password').value = randomstring;
-    }
-</script>
 
-<table class='data'>
-<tr class="data-add">
-    <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
-        <table class="data-col1">
-            <tr><td style="padding: 18 0 4 18;"></td></tr>
-        </table>
-    </td>
-    <td class="data-dotted" width="830px" style="vertical-align:top;">
-        <table width="830px"><tr>
-            <td></td>
-        </tr></table>
-        <table class="data-col2" width="600px">
-            <form method="post" name="v_add_user">
-            <tr><td class="add-text" style="padding: 10 0 0 2px;">IP</td></tr>
-            <tr><td><input type="text" size="20" class="add-input" name="v_ip" <?php if (!empty($v_ip)) echo "value=".$v_ip; ?>></td></tr>
-            <tr><td class="add-text" style="padding: 10px 0 0 2px;">Netmask</td></tr>
-            <tr><td></span><input type="text" size="20" class="add-input" name="v_netmask" <?php if (!empty($v_netmask)) echo "value=".$v_netmask; ?>></tr>
-            <tr><td class="add-text" style="padding: 10 0 0 2px;">Interface</td></tr>
-            <tr><td><select class="add-list" name="v_interface">
-            <?php
-                foreach ($interfaces as $key => $value) {
-                    echo "\t\t\t\t<option value=\"".$value."\"";
-                    if ((!empty($v_interface)) && ( $value == $v_interface )) echo ' selected';
-                    echo ">".$value."</option>\n";
-                }
-            ?>
-            </select></td></tr>
-            <tr><td class="add-text" style="padding: 10px 0 0 2px;">Shared</td></tr>
-            <tr><td><input type="checkbox" size="20" class="add-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?> onclick="javascript:elementHideShow('usrtable');"></tr>
-            <tr><td><table style="display:<?php if (empty($v_dedicated)) { echo 'none';} else {echo 'block';}?> ;" id="usrtable"><tr>
-                <tr><td class="add-text" style="padding: 0 0 0 2px;">Assigned User</td></tr>
-                <tr><td><select class="add-list" name="v_owner">
-                <?php
-                    foreach ($users as $key => $value) {
-                        echo "\t\t\t\t<option value=\"".$value."\"";
-                        if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
-                        echo ">".$value."</option>\n";
-                    }
-                ?>
-                </select></td></tr>
-            </table></td></tr>
-            <tr><td class="add-text" style="padding: 10 0 0 2px;">Associated Domain <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(optional)</span></td></tr>
-            <tr><td><input type="text" size="20" class="add-input" name="v_name" <?php if (!empty($v_name)) echo "value=".$v_name; ?>></td></tr>
+                                <table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 2px 16px 0;" ><a class="add-name"><b>Adding IP Address</b></a>
+                                            <?php
+                                                if (!empty($_SESSION['error_msg'])) {
+                                                    echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
+                                                } else {
+                                                    if (!empty($_SESSION['ok_msg'])) {
+                                                        echo "<a class=\"add-ok\"> → ".$_SESSION['ok_msg']."</a>";
+                                                    }
+                                                }
+                                            ?>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
 
-            <tr><td style="padding: 24px 0 0 0;">
-                <input type="submit" name="ok" value="OK" class="add-button"></form>
-                <input type="button" class="add-button" value="Cancel" onClick="location.href='/list/ip/'">
-            </td></tr>
-        </table>
-    </td>
-</tr>
-</table>
+                    <form id="vstobjects" name="v_add_ip" method="post">
+                        <script type="text/javascript">
+                            function elementHideShow(elementToHideOrShow) {
+                                var el = document.getElementById(elementToHideOrShow);
+                                if (el.style.display == "block") {
+                                    el.style.display = "none";
+                                } else {
+                                    el.style.display = "block";
+                                }
+                            }
+                        </script>
+
+                        <table class='data'>
+                            <tr class="data-add">
+                                <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
+                                    <table class="data-col1">
+                                        <tr><td style="padding: 18 0 4 18;"></td></tr>
+                                    </table>
+                                </td>
+                                <td class="data-dotted" width="830px" style="vertical-align:top;">
+                                    <table width="830px">
+                                        <tr>
+                                            <td></td>
+                                        </tr>
+                                    </table>
+                                    <table class="data-col2" width="600px">
+                                        <tr>
+                                            <td class="add-text" style="padding: 10 0 0 2px;">
+                                                IP
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="text" size="20" class="add-input" name="v_ip" <?php if (!empty($v_ip)) echo "value=".$v_ip; ?>>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10px 0 0 2px;">
+                                                Netmask
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="text" size="20" class="add-input" name="v_netmask" <?php if (!empty($v_netmask)) echo "value=".$v_netmask; ?>>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10 0 0 2px;">
+                                                Interface
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <select class="add-list" name="v_interface">
+                                                    <?php
+                                                        foreach ($interfaces as $key => $value) {
+                                                            echo "\t\t\t\t<option value=\"".$value."\"";
+                                                            if ((!empty($v_interface)) && ( $value == $v_interface )) echo ' selected';
+                                                            echo ">".$value."</option>\n";
+                                                        }
+                                                    ?> 
+                                                </select>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10px 0 0 2px;">
+                                                Shared
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="checkbox" size="20" class="add-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?> onclick="javascript:elementHideShow('usrtable');">
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <table style="display:<?php if (empty($v_dedicated)) { echo 'none';} else {echo 'block';}?> ;" id="usrtable">
+                                                    <tr>
+                                                        <td class="add-text" style="padding: 0 0 0 2px;">
+                                                            Assigned User
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>
+                                                            <select class="add-list" name="v_owner">
+                                                                <?php
+                                                                    foreach ($users as $key => $value) {
+                                                                        echo "\t\t\t\t<option value=\"".$value."\"";
+                                                                        if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
+                                                                        echo ">".$value."</option>\n";
+                                                                    }
+                                                                ?>
+                                                            </select>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10 0 0 2px;">
+                                                Associated Domain <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(optional)</span>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="text" size="20" class="add-input" name="v_name" <?php if (!empty($v_name)) echo "value=".$v_name; ?>>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td style="padding: 24px 0 0 0;">
+                                                <input type="submit" name="ok" value="OK" class="button">
+                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/ip/'">
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+                        </table>
+                    </from>

+ 126 - 64
web/templates/admin/edit_ip.html

@@ -1,66 +1,128 @@
-<script type="text/javascript">
-  function elementHideShow(elementToHideOrShow)
-    {
-      var el = document.getElementById(elementToHideOrShow);
-      if (el.style.display == "block") {
-        el.style.display = "none";
-      } else {
-        el.style.display = "block";
-      }
-    }
-    function randomString() {
-        var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
-        var string_length = 10;
-        var randomstring = '';
-        for (var i=0; i<string_length; i++) {
-          var rnum = Math.floor(Math.random() * chars.length);
-          randomstring += chars.substring(rnum,rnum+1);
-        }
-        document.getElementById('v_password').value = randomstring;
-    }
-</script>
 
-<table class='data'>
-<tr class="data-add">
-    <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
-        <table class="data-col1">
-            <tr><td style="padding: 24px 0 2px 4px;"><a class="data-date" ?><?php echo date("d M Y", strtotime($v_date))?></a></td></tr>
-            <tr><td style="padding: 0 0 6px 4px;"><a class="data-date" ?><?php echo $v_time?></a></td></tr>
-            <tr><td style="padding: 0 0 0 21px;" class="data-<?php echo $v_status ?>"><b><?php echo $v_status ?></b></td></tr>
-        </table>
-    </td>
-    <td class="data-dotted" width="830px" style="vertical-align:top;">
-        <table width="830px"><tr>
-            <td></td>
-        </tr></table>
-        <table class="data-col2" width="600px">
-            <form method="post" name="v_add_user">
-            <tr><td class="add-text" style="padding: 10 0 0 2px;">IP</td></tr>
-            <tr><td><input type="text" size="20" class="add-input" name="v_ip" <?php if (!empty($v_ip)) echo "value=".$v_ip; ?> disabled> <input type="hidden" name="v_ip" <?php if (!empty($v_ip)) echo "value=".$v_ip; ?>></td></tr>
-            <tr><td class="add-text" style="padding: 10px 0 0 2px;">Netmask</td></tr>
-            <tr><td></span><input type="text" size="20" class="add-input" name="v_netmask" <?php if (!empty($v_netmask)) echo "value=".$v_netmask; ?> disabled></tr>
-            <tr><td class="add-text" style="padding: 10 0 0 2px;">Interface</td></tr>
-            <tr><td></span><input type="text" size="20" class="add-input" name="v_netmask" <?php if (!empty($v_interace)) echo "value=".$v_interace; ?> disabled></tr>
-            <tr><td class="add-text" style="padding: 10px 0 0 2px;">Shared</td></tr>
-            <tr><td><input type="checkbox" size="20" class="add-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?></tr>
-            <tr><td class="add-text" style="padding: 10px 0 0 2px;">Assigned User</td></tr>
-            <tr><td><select class="add-list" name="v_owner">
-                <?php
-                    foreach ($users as $key => $value) {
-                        echo "\t\t\t\t<option value=\"".$value."\"";
-                        if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
-                        echo ">".$value."</option>\n";
-                    }
-                ?>
-                </select></td></tr>
-            <tr><td class="add-text" style="padding: 10 0 0 2px;">Associated Domain <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(optional)</span></td></tr>
-            <tr><td><input type="text" size="20" class="add-input" name="v_name" <?php if (!empty($v_name)) echo "value=".$v_name; ?>></td></tr>
+                                <table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 2px 16px 0;" ><a class="add-name"><b>Editing IP Address</b></a>
+                                            <?php
+                                                if (!empty($_SESSION['error_msg'])) {
+                                                    echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
+                                                } else {
+                                                    if (!empty($_SESSION['ok_msg'])) {
+                                                        echo "<a class=\"add-ok\"> → ".$_SESSION['ok_msg']."</a>";
+                                                    }
+                                                }
+                                            ?>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
 
-            <tr><td style="padding: 24px 0 0 0;">
-                <input type="submit" name="save" value="Save" class="add-button"></form>
-                <input type="button" class="add-button" value="Cancel" onClick="location.href='/list/ip/'">
-            </td></tr>
-        </table>
-    </td>
-</tr>
-</table>
+                    <form id="vstobjects" name="v_edit_ip" method="post">
+
+                        <script type="text/javascript">
+                            function elementHideShow(elementToHideOrShow) {
+                                var el = document.getElementById(elementToHideOrShow);
+                                if (el.style.display == "block") {
+                                    el.style.display = "none";
+                                } else {
+                                    el.style.display = "block";
+                                }
+                            }
+                        </script>
+
+                        <table class='data'>
+                            <tr class="data-add">
+                                <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
+                                    <table class="data-col1">
+                                        <tr><td style="padding: 24px 0 2px 4px;"><a class="data-date" ?><?php echo date("d M Y", strtotime($v_date))?></a></td></tr>
+                                        <tr><td style="padding: 0 0 6px 4px;"><a class="data-date" ?><?php echo $v_time?></a></td></tr>
+                                        <tr><td style="padding: 0 0 0 21px;" class="data-<?php echo $v_status ?>"><b><?php echo $v_status ?></b></td></tr>
+                                    </table>
+                                </td>
+                                <td class="data-dotted" width="830px" style="vertical-align:top;">
+                                    <table width="830px">
+                                        <tr>
+                                            <td></td>
+                                        </tr>
+                                    </table>
+                                    <table class="data-col2" width="600px">
+                                        <tr>
+                                            <td class="add-text" style="padding: 10 0 0 2px;">
+                                                IP
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="text" size="20" class="add-input" name="v_ip" <?php if (!empty($v_ip)) echo "value=".$v_ip; ?> disabled> <input type="hidden" name="v_ip" <?php if (!empty($v_ip)) echo "value=".$v_ip; ?>>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10px 0 0 2px;">
+                                                Netmask
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="text" size="20" class="add-input" name="v_netmask" <?php if (!empty($v_netmask)) echo "value=".$v_netmask; ?> disabled>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10 0 0 2px;">
+                                                Interface
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="text" size="20" class="add-input" name="v_netmask" <?php if (!empty($v_interace)) echo "value=".$v_interace; ?> disabled>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10px 0 0 2px;">
+                                                Shared
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="checkbox" size="20" class="add-checkbox" name="v_shared" <?php if (empty($v_dedicated)) echo "checked=yes" ?>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10px 0 0 2px;">
+                                                Assigned User
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <select class="add-list" name="v_owner">
+                                                    <?php
+                                                        foreach ($users as $key => $value) {
+                                                            echo "\t\t\t\t<option value=\"".$value."\"";
+                                                            if ((!empty($v_owner)) && ( $value == $v_owner )) echo ' selected';
+                                                            echo ">".$value."</option>\n";
+                                                        }
+                                                    ?> 
+                                                </select>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td class="add-text" style="padding: 10 0 0 2px;">
+                                                Associated Domain <span style="padding:0 0 0 6px; font-size: 10pt; color:#555;">(optional)</span>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>
+                                                <input type="text" size="20" class="add-input" name="v_name" <?php if (!empty($v_name)) echo "value=".$v_name; ?>>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td style="padding: 24px 0 0 0;">
+                                                <input type="submit" name="save" value="Save" class="button">
+                                                <input type="button" class="button" value="Cancel" onclick="location.href='/list/ip/'">
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+                        </table>
+                    </form>

+ 158 - 92
web/templates/admin/list_ip.html

@@ -1,99 +1,165 @@
-<table class='data'>
 
-<?php
-foreach ($data as $key => $value) {
-    ++$i;
-?>
-<script type="text/javascript">
-    $(function(){
-        $('#delete_dialog_<?php echo "$i" ?>').dialog({
-            modal: true,
-            autoOpen: false,
-            width: 360,
-            buttons: {
-                "Ok": function(event, ui) {
-                     location.href = '/delete/ip/?ip=<?php echo "$key" ?>';
-                },
-                "Cancel": function() {
-                    $(this).dialog("close");
-                }
-            }
-        });
-        $('#delete_link_<?php echo "$i" ?>').click(function(){
-            $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
-            return false;
-        });
+                                <table class="sub-menu" style="background: white;">
+                                    <tr>
+                                        <td style="padding: 12px 0 8px 6px">
+                                            <div style="float:left">
+                                                <button style="width:120px; padding: 2px 0px;" onclick="location.href='/add/ip/'"> Add IP </button>
+                                            </div>
+                                            <div style="text-align: right; float: right;">
+                                                <input type="text" size="30" style="padding: 3px 80px 3px 0; margin: 0 2px 0 0;">
+                                                <button> Search </button>
+                                            </div>
+                                            <div style="float:left; padding-left: 26px;">
+                                                <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
+                                                <select style="margin:0 2px 0 0px;" >
+                                                    <option>apply to selected</option>
+                                                    <option>rebuild</option>
+                                                    <option>update counters</option>
+                                                    <option>suspend</option>
+                                                    <option>unsuspend</option>
+                                                    <option>delete</option>
+                                                </select>
+                                                <button style="width:27px;"> › </button>
+                                            </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
 
-    });
-</script>
+                    <form id="vstobjects">
+                        <table class='data'>
 
-<tr class="data-row">
-    <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
-        <table class="data-col1">
-            <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
-            <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
-            <tr><td class="data-active"><b>active</b></td></tr>
-        </table>
-    </td>
-    <td class="data-dotted" width="830px" style="vertical-align:top;">
-        <table width="830px"><tr>
-            <td></td>
-            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/ip/?ip=<?php echo "$key" ?>"> edit</a></td>
-            <td class="data-controls" width="70px">
-                <img src="/images/delete.png" width="7px" height="7px">
-                <a href="#" id="delete_link_<?php echo $i ?>"> delete</a>
-                <div id="delete_dialog_<?php echo $i ?>" title="Confirmation">
-                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> ip?</p>
-                </div>
-            </td>
-        </tr></table>
+                            <?php
+                                foreach ($data as $key => $value) {
+                                    ++$i;
+                            ?> 
 
-        <table class="data-col2" width="830px">
-            <tr><td colspan=3 class="domain" style="padding: 0 0 0 4px;"><b><?php echo $key ?></b><a class="aliases" style="padding:0 0 0 8px;"><?php echo  $data[$key]['NAME'] ?></a></td></tr>
-            <tr>
-                <td style="vertical-align:top;" >
-                    <table>
-                        <tr><td class="counter-name" style="padding: 2px 0 0 0"> <?php echo $data[$key]['NETMASK'] ?></td></tr>
-                        <tr><td class="counter-name"> <?php echo $data[$key]['INTERFACE'] ?> </td></tr>
-                    </table>
-                </td>
-                <td style="vertical-align:top;" width="250">
-                    <table>
-                        <tr><td class="counter-name">Web Domains: </td> <td><a class="counter-value"><?php echo $data[$key]['U_WEB_DOMAINS'] ?></a></td></tr>
-                        <tr><td class="counter-name">Status: </td><td><a class="counter-value"> <?php echo $data[$key]['STATUS'] ?></a></td></tr>
+                            <script type="text/javascript">
+                                $(function(){
+                                    $('#delete_dialog_<?php echo "$i" ?>').dialog({
+                                        modal: true,
+                                        autoOpen: false,
+                                        width: 360,
+                                        buttons: {
+                                            "Ok": function(event, ui) {
+                                                 location.href = '/delete/ip/?ip=<?php echo "$key" ?>';
+                                            },
+                                            "Cancel": function() {
+                                                $(this).dialog("close");
+                                            }
+                                        }
+                                    });
+                                    $('#delete_link_<?php echo "$i" ?>').click(function(){
+                                        $('#delete_dialog_<?php echo "$i" ?>').dialog('open');
+                                        return false;
+                                    });
+                                });
+                            </script>
 
-                    </table>
-                </td>
-                <td rowspan=4 style="vertical-align:top;" width="300">
-                    <table>
-                        <tr><td class="counter-name" colspan="2" >Sys Users: <a style="padding: 0 0 0 26" class="nginx-ext"><?php echo str_replace(',', ', ', $data[$key]['U_SYS_USERS']) ?></td></tr>
-                    </table>
-                </td>
-            </tr>
-        </table>
-    </td>
-</tr>
+                            <tr class="data-row">
+                                <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
+                                    <table class="data-col1">
+                                        <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="object" ></td></tr>
+                                        <tr><td><a class="data-date" title="<?php echo  $data[$key]['DATE']."  ".$data[$key]['TIME'] ?>"><?php echo date("d M Y", strtotime($data[$key]['DATE'])) ?></td></tr>
+                                        <tr><td class="data-active"><b>active</b></td></tr>
+                                    </table>
+                                </td>
+                                <td class="data-dotted" width="830px" style="vertical-align:top;">
+                                    <table width="830px">
+                                        <tr>
+                                            <td></td>
+                                            <td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/ip/?ip=<?php echo "$key" ?>"> edit</a></td>
+                                            <td class="data-controls" width="70px">
+                                                <img src="/images/delete.png" width="7px" height="7px">
+                                                <a href="#" id="delete_link_<?php echo $i ?>"> delete</a>
+                                                <div id="delete_dialog_<?php echo $i ?>" title="Confirmation">
+                                                    <p class="counter-value">Are you sure you want to delete <b><?php echo "$key" ?></b> ip?</p>
+                                                </div>
+                                            </td>
+                                        </tr>
+                                    </table>
+
+                                    <table class="data-col2" width="830px">
+                                        <tr>
+                                            <td colspan=3 class="domain" style="padding: 0 0 0 4px;">
+                                                <b><?php echo $key ?></b><a class="aliases" style="padding:0 0 0 8px;"><?php echo  $data[$key]['NAME'] ?></a>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td style="vertical-align:top;" >
+                                                <table>
+                                                    <tr>
+                                                        <td class="counter-name" style="padding: 2px 0 0 0">
+                                                            <?php echo $data[$key]['NETMASK'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            <?php echo $data[$key]['INTERFACE'] ?> 
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td style="vertical-align:top;" width="250">
+                                                <table>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            Web Domains: 
+                                                        </td>
+                                                        <td>
+                                                            <a class="counter-value"><?php echo $data[$key]['U_WEB_DOMAINS'] ?></a>
+                                                        </td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td class="counter-name">
+                                                            Status: 
+                                                        </td>
+                                                        <td>
+                                                            <a class="counter-value"> <?php echo $data[$key]['STATUS'] ?></a>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                            <td rowspan=4 style="vertical-align:top;" width="300">
+                                                <table>
+                                                    <tr>
+                                                        <td class="counter-name" colspan="2" >
+                                                            Sys Users: <a style="padding: 0 0 0 26" class="nginx-ext"><?php echo str_replace(',', ', ', $data[$key]['U_SYS_USERS']) ?>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+
+                            <?php
+                                }
+                            ?> 
+
+                        </table>
+
+                        <?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?> 
 
+                        <table class="data-count">
+                            <tr>
+                                <td width="160px"></td>
+                                <td>
+                                    <?php
+                                        if ( $i == 1) {
+                                            echo "1 ip address ";
+                                        } else {
+                                            echo "$i ip addresses ";
+                                        }
+                                    ?>
+                                </td>
+                            </tr>
+                        </table>
+                    </form>
 
-    <?php
-}
-?>
-</table>
-<?php if ($i == 0) echo "<table class=\"data-null\"><tr><td></td></tr></table>"; ?>
-<table class="data-count">
-<tr>
-    <td>→ 
-    <?php
-        if ( $i == 1) {
-            echo "1 ip address ";
-        } else {
-            echo "$i ip addresses ";
-        }
-    ?>
-    </td>
-</tr>
-</table>
-</form>
-<?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
-<?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:173px\"><tr><td></td></tr></table>"; ?>
-<?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:57px\"><tr><td></td></tr></table>"; ?>
+                    <?php if ($i == 0) echo "<table class=\"data-spacer\" style=\"height:279px\"><tr><td></td></tr></table>"; ?>
+                    <?php if ($i == 1) echo "<table class=\"data-spacer\" style=\"height:173px\"><tr><td></td></tr></table>"; ?>
+                    <?php if ($i == 2) echo "<table class=\"data-spacer\" style=\"height:57px\"><tr><td></td></tr></table>"; ?>

+ 0 - 15
web/templates/admin/menu_add_ip.html

@@ -1,15 +0,0 @@
-<table class="sub-menu">
-<tr>
-    <td style="padding: 14px 0 24px 0;" ><a class="add-name"><b>Adding IP Address</b></a>
-    <?php 
-        if (!empty($_SESSION['error_msg'])) {
-            echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
-        } else {
-            if (!empty($_SESSION['ok_msg'])) {
-                echo "<a class=\"add-ok\"> → ".$_SESSION['ok_msg']."</a>";
-            }
-        }
-    ?>
-    </td>
-</tr>
-</table>

+ 0 - 15
web/templates/admin/menu_edit_ip.html

@@ -1,15 +0,0 @@
-<table class="sub-menu">
-<tr>
-    <td style="padding: 14px 0 24px 0;" ><a class="add-name"><b>Editing IP Address</b></a>
-    <?php 
-        if (!empty($_SESSION['error_msg'])) {
-            echo "<a class=\"add-error\"> → ".$_SESSION['error_msg']."</a>";
-        } else {
-            if (!empty($_SESSION['ok_msg'])) {
-                echo "<a class=\"add-ok\"> → ".$_SESSION['ok_msg']."</a>";
-            }
-        }
-    ?>
-    </td>
-</tr>
-</table>

+ 0 - 39
web/templates/admin/menu_ip.html

@@ -1,39 +0,0 @@
-<?php
-    if (!empty($_SESSION['error_msg'])) {
-?>
-        <script type="text/javascript">
-            $(function() {
-                $( "#dialog:ui-dialog" ).dialog( "destroy" );
-                $( "#dialog-message" ).dialog({
-                    modal: true,
-                    buttons: {
-                        Ok: function() {
-                            $( this ).dialog( "close" );
-                        }
-                    }
-                });
-            });
-        </script>
-        <div id="dialog-message" title="Error">
-        <p><?php echo $_SESSION['error_msg'] ?>.</p>
-        </div>
-<?php
-        unset($_SESSION['error_msg']);
-    }
-?>
-<table class="sub-menu">
-<tr>
-    <td width="142px" style="padding: 16px 0 16px 6px">
-    <button style="width:120px; padding: 2px 0px 2px 0px;" onclick="location.href='/add/ip/'">Add IP</button>
-    <td><a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("vstobjects");'> toggle all </a>
-    <select style="margin:0 0 0 0px">
-        <option>apply to selected</option>
-        <option>rebuild</option>
-        <option>delete</option>
-    </select> <button> > </button></td>
-</td>
-    <td style="text-align: right;"><input type="text" size="30" style="padding: 3px 80px 3px 0;"> <button> Search </button></td>
-</tr><tr>
-</tr>
-</table>
-<form id="vstobjects">