~josephjamesmills/zpanelcp/zpanelcp

« back to all changes in this revision

Viewing changes to debian/zpanelx/etc/zpanel/dryden/ui/tpl/clientdomains.class.php

  • Committer: Joseph Mills
  • Date: 2012-05-09 02:52:32 UTC
  • Revision ID: josephjamesmills@gmail.com-20120509025232-ob5xni0ggrse28c0
setup framwork for www

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
 
3
 
/**
4
 
 * Generic template place holder class.
5
 
 * @package zpanelx
6
 
 * @subpackage dryden -> ui -> tpl
7
 
 * @version 1.0.0
8
 
 * @author Bobby Allen (ballen@zpanelcp.com)
9
 
 * @copyright ZPanel Project (http://www.zpanelcp.com/)
10
 
 * @link http://www.zpanelcp.com/
11
 
 * @license GPL (http://www.gnu.org/licenses/gpl.html)
12
 
 */
13
 
class ui_tpl_clientdomains {
14
 
 
15
 
    public function Template() {
16
 
                global $zdbh;
17
 
        $currentuser = ctrl_users::GetUserDetail();                     
18
 
                $line = "<table  border=\"0\" cellSpacing=\"0\" cellPadding=\"2\" width=\"100%\">";
19
 
 
20
 
        $sql = "SELECT * FROM x_vhosts WHERE vh_acc_fk=" .$currentuser['userid']. " AND vh_type_in=1 AND vh_deleted_ts IS NULL ORDER BY vh_id_pk LIMIT 4";
21
 
        $numrows = $zdbh->query($sql);
22
 
        if ($numrows->fetchColumn() <> 0) {
23
 
            $sql = $zdbh->prepare($sql);
24
 
            $sql->execute();
25
 
                        $limit = 0;
26
 
                        $line .= "<tr><td nowrap=\"nowrap\"><img class=\"raquo\" src=\"<# ui_tpl_assetfolderpath #>/images/blank.png\" border=\"0\"><strong>Domains</strong></td><td></td></tr>";
27
 
            while ($rowdomains = $sql->fetch()) {
28
 
                                if ($rowdomains['vh_type_in'] == 1){
29
 
                                        $line .= "<tr>";
30
 
                                        $line .= "<td nowrap=\"nowrap\" width=\"100%\" style=\"text-indent:14px;\"><a href=\"http://".$rowdomains['vh_name_vc']."\" target=\"_blank\">".$rowdomains['vh_name_vc']."</a></td>";
31
 
                                        $line .= "<td nowrap=\"nowrap\" align=\"left\">";
32
 
 
33
 
                                        if($rowdomains['vh_active_in']==1 && $rowdomains['vh_enabled_in']==1){
34
 
                                                $line .= "<a href=\"#\" title=\"Live\"><img src=\"<# ui_tpl_assetfolderpath #>/images/live.png\"></a> ";
35
 
                                        }elseif ($rowdomains['vh_active_in']==0 && $rowdomains['vh_enabled_in']==1){
36
 
                                                $line .= "<a href=\"#\" title=\"Pending\"><img src=\"<# ui_tpl_assetfolderpath #>/images/pending.png\"></a> ";
37
 
                                        }else{
38
 
                                                $line .= "";
39
 
                                        }
40
 
                                        if($rowdomains['vh_enabled_in']==0){
41
 
                                                $line .= "<a href=\"#\" title=\"Disabled\"><img src=\"<# ui_tpl_assetfolderpath #>/images/disabled.png\"></a> ";
42
 
                                        }
43
 
                                }
44
 
                                $limit++;
45
 
                        }
46
 
                        if ($limit >= 4){
47
 
                                $line .= "<tr><td>&nbsp;&nbsp;&nbsp;<a href=\"?module=domains\">(Show All)</a></td><td></td></tr>";
48
 
                        }
49
 
                } else {
50
 
                        $line .= "<tr><td nowrap=\"nowrap\"><img class=\"raquo\" src=\"<# ui_tpl_assetfolderpath #>/images/blank.png\" border=\"0\"><strong>Domains</strong></td><td></td></tr>";
51
 
                        $line .= "<tr><td nowrap=\"nowrap\" style=\"text-indent:14px;\"><span class=\"Side_Info_None\">No Domains Found</span></td><td><a href=\"?module=domains\">CREATE</a></td></tr>";
52
 
                        //$line .= "<tr><td>&nbsp;</td><td></td></tr>";
53
 
                }
54
 
 
55
 
        $sql = "SELECT * FROM x_vhosts WHERE vh_acc_fk=" .$currentuser['userid']. " AND vh_type_in=2 AND vh_deleted_ts IS NULL ORDER BY vh_id_pk LIMIT 4";
56
 
        $numrows = $zdbh->query($sql);
57
 
        if ($numrows->fetchColumn() <> 0) {
58
 
            $sql = $zdbh->prepare($sql);
59
 
            $sql->execute();
60
 
                        $limit = 0;
61
 
                        $line .= "<tr><td nowrap=\"nowrap\"><img class=\"raquo\" src=\"<# ui_tpl_assetfolderpath #>/images/blank.png\" border=\"0\"><strong>Sub Domains</strong></td><td></td></tr>";
62
 
            while ($rowdomains = $sql->fetch()) {
63
 
                                if ($rowdomains['vh_type_in'] == 2){
64
 
                                        $line .= "<tr>";
65
 
                                        $line .= "<td nowrap=\"nowrap\" width=\"100%\" style=\"text-indent:14px;\"><a href=\"http://".$rowdomains['vh_name_vc']."\" target=\"_blank\">".$rowdomains['vh_name_vc']."</a></td>";
66
 
                                        $line .= "<td nowrap=\"nowrap\" align=\"left\">";
67
 
 
68
 
                                        if($rowdomains['vh_active_in']==1 && $rowdomains['vh_enabled_in']==1){
69
 
                                                $line .= "<a href=\"#\" title=\"Live\"><img src=\"<# ui_tpl_assetfolderpath #>/images/live.png\"></a> ";
70
 
                                        }elseif ($rowdomains['vh_active_in']==0 && $rowdomains['vh_enabled_in']==1){
71
 
                                                $line .= "<a href=\"#\" title=\"Pending\"><img src=\"<# ui_tpl_assetfolderpath #>/images/pending.png\"></a> ";
72
 
                                        }else{
73
 
                                                $line .= "";
74
 
                                        }
75
 
                                        if($rowdomains['vh_enabled_in']==0){
76
 
                                                $line .= "<a href=\"#\" title=\"Disabled\"><img src=\"<# ui_tpl_assetfolderpath #>/images/disabled.png\"></a> ";
77
 
                                        }
78
 
                                }
79
 
                                $limit++;
80
 
                        }
81
 
                        if ($limit >= 4){
82
 
                                $line .= "<tr><td>&nbsp;&nbsp;&nbsp;<a href=\"?module=sub_domains\">(Show All)</a></td><td></td></tr>";
83
 
                        }
84
 
                } else {
85
 
                        $line .= "<tr><td nowrap=\"nowrap\"><img class=\"raquo\" src=\"<# ui_tpl_assetfolderpath #>/images/blank.png\" border=\"0\"><strong>Sub Domains</strong></td></td><td></tr>";
86
 
                        $line .= "<tr><td nowrap=\"nowrap\" style=\"text-indent:14px;\"><span class=\"Side_Info_None\">No Sub Domains Found</span></td><td><a href=\"?module=sub_domains\">CREATE</a></td></tr>";
87
 
                        //$line .= "<tr><td>&nbsp;</td><td></td></tr>";
88
 
                }
89
 
                
90
 
        $sql = "SELECT * FROM x_vhosts WHERE vh_acc_fk=" .$currentuser['userid']. " AND vh_type_in=3 AND vh_deleted_ts IS NULL ORDER BY vh_id_pk LIMIT 4";
91
 
        $numrows = $zdbh->query($sql);
92
 
        if ($numrows->fetchColumn() <> 0) {
93
 
            $sql = $zdbh->prepare($sql);
94
 
            $sql->execute();
95
 
                        $limit = 0;
96
 
                        $line .= "<tr><td nowrap=\"nowrap\"><img class=\"raquo\" src=\"<# ui_tpl_assetfolderpath #>/images/blank.png\" border=\"0\"><strong>Parked Domains</strong></td><td></td></tr>";
97
 
            while ($rowdomains = $sql->fetch()) {
98
 
                                if ($rowdomains['vh_type_in'] == 3){
99
 
                                        $line .= "<tr>";
100
 
                                        $line .= "<td nowrap=\"nowrap\" width=\"100%\" style=\"text-indent:14px;\"><a href=\"http://".$rowdomains['vh_name_vc']."\" target=\"_blank\">".$rowdomains['vh_name_vc']."</a></td>";
101
 
                                        $line .= "<td nowrap=\"nowrap\" align=\"left\">";
102
 
 
103
 
                                        if($rowdomains['vh_active_in']==1 && $rowdomains['vh_enabled_in']==1){
104
 
                                                $line .= "<a href=\"#\" title=\"Live\"><img src=\"<# ui_tpl_assetfolderpath #>/images/live.png\"></a> ";
105
 
                                        }elseif ($rowdomains['vh_active_in']==0 && $rowdomains['vh_enabled_in']==1){
106
 
                                                $line .= "<a href=\"#\" title=\"Pending\"><img src=\"<# ui_tpl_assetfolderpath #>/images/pending.png\"></a> ";
107
 
                                        }else{
108
 
                                                $line .= "";
109
 
                                        }
110
 
                                        if($rowdomains['vh_enabled_in']==0){
111
 
                                                $line .= "<a href=\"#\" title=\"Disabled\"><img src=\"<# ui_tpl_assetfolderpath #>/images/disabled.png\"></a> ";
112
 
                                        }
113
 
                                }
114
 
                                $limit++;
115
 
                        }
116
 
                        if ($limit >= 4){
117
 
                                $line .= "<tr><td>&nbsp;&nbsp;&nbsp;<a href=\"?module=parked_domains\">(Show All)</a></td><td></td></tr>";
118
 
                        }
119
 
                } else {
120
 
                        $line .= "<tr><td nowrap=\"nowrap\"><img class=\"raquo\" src=\"<# ui_tpl_assetfolderpath #>/images/blank.png\" border=\"0\"><strong>Parked Domains</strong></td></td><td></tr>";
121
 
                        $line .= "<tr><td nowrap=\"nowrap\" style=\"text-indent:14px;\"><span class=\"Side_Info_None\">No Parked Domains Found</span></td><td><a href=\"?module=parked_domains\">CREATE</a></td></tr>";
122
 
                        //$line .= "<tr><td>&nbsp;</td><td></td></tr>";
123
 
                }
124
 
                
125
 
                $line .= "</td>";
126
 
                $line .= "</tr>";
127
 
                $line .= "</table>";
128
 
 
129
 
        return $line;
130
 
        }
131
 
}
132
 
 
133
 
?>
 
 
b'\\ No newline at end of file'