当前位置: 首页>>代码示例>>PHP>>正文


PHP main::done方法代码示例

本文整理汇总了PHP中main::done方法的典型用法代码示例。如果您正苦于以下问题:PHP main::done方法的具体用法?PHP main::done怎么用?PHP main::done使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在main的用法示例。


在下文中一共展示了main::done方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: content

 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     $version_info = main::latest_version();
     $current_version = $version_info['THT'];
     $new_version_download = $version_info['THT_DL'];
     $running_version = $dbh->config('version');
     $install_check = $this->checkDir(INC . "../install/");
     $conf_check = $this->checkPerms(INC . "/conf.inc.php");
     if ($current_version == $running_version) {
         $updatemsg = "<span style='color:green'>Up-To-Date</span>";
         $upgrademsg = "";
     } else {
         $updatemsg = "<span style='color:red'>Upgrade Avaliable</span>";
         $upgrademsg = "<div class='warn'><img src='../themes/icons/error.png' alt='' /> There is a new version ({$current_version}) avaliable! <a href = '" . $new_version_download . "' target = '_blank'>Please download it here</a> and upgrade!</div>";
     }
     unset($current_version);
     unset($running_version);
     $stats['VERSION'] = $dbh->config('version');
     $stats['THEME'] = $dbh->config('theme');
     $stats['CENABLED'] = main::cleaninteger($dbh->config('cenabled'));
     $stats['SVID'] = main::cleaninteger($dbh->config('show_version_id'));
     $stats['SENABLED'] = main::cleaninteger($dbh->config('senabled'));
     $stats['DEFAULT'] = $dbh->config('default_page');
     $stats['EMETHOD'] = $dbh->config('emailmethod');
     $stats['SIGNENABLE'] = main::cleaninteger($dbh->config('general'));
     $stats['MULTI'] = main::cleaninteger($dbh->config('multiple'));
     $stats['UPDATE'] = $updatemsg;
     $stats['UPG_BOX'] = $upgrademsg;
     $stats_box = style::replaceVar('tpl/admin/home/stats.tpl', $stats);
     $content = '<strong>Welcome to your Admin Dashboard!</strong><br />Welcome to the dashboard of your Admin Control Panel. In this area you can do the tasks that you need to complete such as manage servers, create packages, manage users.<br />
             Here, you can also change the look and feel of your THT Installation. If you require any help, be sure to ask at the <a href="http://thehostingtool.com/forum" title="THT Community is the official stop for THT Support, THT Modules, Developer Center and more! Visit our growing community now!" class="tooltip">THT Community</a><br /><br />' . $stats_box . '<br />' . $install_check . $conf_check . '</div></div>';
     echo $content;
     if ($_POST) {
         $dbh->update("admin_notes", array("notes" => $postvar['admin_notes']), array("id", "=", "1"));
         main::errors("Settings Updated!");
         main::done();
     }
     $notes_data = $dbh->select("admin_notes", array("id", "=", "1"));
     $notepad_array['NOTEPAD'] = $notes_data['notes'];
     $content_notepad = style::replaceVar('tpl/admin/home/notepad.tpl', $notepad_array);
     echo '<br />';
     echo main::table('Admin Notepad', $content_notepad, 'auto', 'auto');
     $news = main::sub("<strong>Add the THT RSS Feed!</strong>", '<a href="http://thehostingtool.com/forum/syndication.php?fid=2" target="_blank" class="tooltip" title="Add the THT RSS Feed!"><img src="<URL>themes/icons/feed.png" /></a>');
     $rss_feed = @file_get_contents("http://thehostingtool.com/forum/syndication.php?fid=2&limit=3");
     if ($rss_feed !== false) {
         $xml = new SimpleXMLElement($rss_feed);
         foreach ($xml->channel->item as $item) {
             $newsitem_array['title'] = $item->title;
             $newsitem_array['author'] = "THT";
             $newsitem_array['link'] = $item->link;
             $newsitem_array['TIME'] = main::convertdate("n/d/Y", strtotime($item->pubDate));
             $newsitem_array['SUMMARY'] = $item->description;
             $news .= style::replaceVar('tpl/admin/home/news-item.tpl', $newsitem_array);
         }
     }
     echo "<br />";
     echo main::table('THT News & Updates', $news);
 }
开发者ID:cozylife,项目名称:tht-reworked,代码行数:59,代码来源:home.php

示例2: TerminateClient

 private function TerminateClient($client)
 {
     global $dbh, $postvar, $getvar, $instance;
     if (!$postvar['submitreason']) {
         $client_uname = main::uname($client['id']);
         $reason_array['WARNTEXT'] = 'CAUTION: If you proceed, the account "' . $client_uname . '" will be completely and irrevocably removed from the server and THT.<br><br>Why are you terminating this account? Leave blank if you just feel like terminating them.';
         $reason_array['ACTION'] = 'terminating';
         $reason_array['ACTIONBUTT'] = 'Terminate Client';
         $clientview_array['BOX'] = "";
         $clientview_array['CONTENT'] = style::replaceVar("tpl/admin/clients/reason.tpl", $reason_array);
         return $clientview_array;
     } else {
         $command = server::terminate($client['id'], $postvar['reason']);
         if ($command == true) {
             //Terminated
             main::done();
         } else {
             main::errors($command);
         }
     }
 }
开发者ID:cozylife,项目名称:tht-reworked,代码行数:21,代码来源:users.php

示例3: content

 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     switch ($getvar['sub']) {
         default:
             if ($_POST) {
                 check::empty_fields();
                 foreach ($postvar as $key => $value) {
                     $broke = explode("_", $key);
                     if ($broke[0] == "pages") {
                         $postvar['perms'][$broke[1]] = $value;
                     }
                 }
                 if (!main::errors()) {
                     $staff_query = $dbh->select("staff", array("user", "=", $postvar['user']), 0, "1", 1);
                     if (!check::email($postvar['email'])) {
                         main::errors("Your email is the wrong format or is already in use by another staff member or client.");
                     } elseif ($postvar['pass'] != $postvar['conpass']) {
                         main::errors("Passwords don't match!");
                     } elseif ($dbh->num_rows($staff_query) >= 1) {
                         main::errors("That account already exists!");
                     } else {
                         if ($postvar['perms']) {
                             foreach ($postvar['perms'] as $key => $value) {
                                 if ($n) {
                                     $perms .= ",";
                                 }
                                 if ($value == "1") {
                                     $perms .= $key;
                                 }
                                 $n++;
                             }
                         }
                         $salt = crypto::salt();
                         $password = crypto::passhash($postvar['pass'], $salt);
                         $staff_insert = array("user" => $postvar['user'], "name" => $postvar['name'], "email" => $postvar['email'], "password" => $password, "salt" => $salt, "perms" => $perms, "tzadjust" => $postvar['tzones']);
                         $dbh->insert("staff", $staff_insert);
                         main::errors("Account added!");
                     }
                 }
             }
             $acpnav_query = $dbh->select("acpnav", array("link", "!=", "home"), array("id", "ASC"), 0, 1);
             $add_staff_member_array['PAGES'] = '<table width="100%" border="0" cellspacing="0" cellpadding="1">';
             while ($acpnav_data = $dbh->fetch_array($acpnav_query)) {
                 $add_staff_member_array['PAGES'] .= '<tr><td width="30%" align="left">' . $acpnav_data['visual'] . ':</td><td><input name="pages_' . $acpnav_data['id'] . '" id="pages_' . $acpnav_data['id'] . '" type="checkbox" value="1" /></td></tr>';
             }
             $add_staff_member_array['PAGES'] .= '<tr><td width="30%" align="left">Paid Configuration:</td><td><input name="pages_paid" id="pages_paid" type="checkbox" value="1" /></td></tr>';
             $add_staff_member_array['PAGES'] .= '<tr><td width="30%" align="left">P2H Forums:</td><td><input name="pages_p2h" id="pages_p2h" type="checkbox" value="1" /></td></tr>';
             $add_staff_member_array['PAGES'] .= "</table>";
             $add_staff_member_array['TZADJUST'] = main::tzlist();
             echo style::replaceVar("tpl/admin/staff/add-staff-member.tpl", $add_staff_member_array);
             break;
         case "edit":
             if (isset($getvar['do'])) {
                 $staff_data = $dbh->select("staff", array("id", "=", $getvar['do']));
                 if (!$staff_data["user"]) {
                     echo "That account doesn't exist!";
                 } else {
                     if ($_POST) {
                         check::empty_fields();
                         foreach ($postvar as $key => $value) {
                             $broke = explode("_", $key);
                             if ($broke[0] == "pages") {
                                 $postvar['perms'][$broke[1]] = $value;
                             }
                         }
                         if (!main::errors()) {
                             if (!check::email($postvar['email'], $getvar['do'], "staff")) {
                                 main::errors("Your email is the wrong format or is already in use by another staff member or client.");
                             } else {
                                 if ($postvar['perms']) {
                                     foreach ($postvar['perms'] as $key => $value) {
                                         if ($n) {
                                             $perms .= ",";
                                         }
                                         if ($value == "1") {
                                             $perms .= $key;
                                         }
                                         $n++;
                                     }
                                 }
                                 $staff_update = array("email" => $postvar['email'], "name" => $postvar['name'], "perms" => $perms, "tzadjust" => $postvar['tzones'], "user" => $postvar['user']);
                                 $dbh->update("staff", $staff_update, array("id", "=", $getvar['do']));
                                 //Staff account edit complete
                                 main::done();
                             }
                         }
                     }
                     $edit_staff_member_array['USER'] = $staff_data['user'];
                     $edit_staff_member_array['EMAIL'] = $staff_data['email'];
                     $edit_staff_member_array['NAME'] = $staff_data['name'];
                     $edit_staff_member_array['TZADJUST'] = main::tzlist($staff_data['tzadjust']);
                     $acpnav_query = $dbh->select("acpnav", array("link", "!=", "home"), array("id", "ASC"), 0, 1);
                     $edit_staff_member_array['PAGES'] = '<table width="100%" border="0" cellspacing="0" cellpadding="1">';
                     while ($acpnav_data = $dbh->fetch_array($acpnav_query)) {
                         if (!main::checkPerms($acpnav_data['id'], $staff_data['id'])) {
                             $checked = 'checked="checked"';
                         }
                         $edit_staff_member_array['PAGES'] .= '<tr><td width="30%" align="left">' . $acpnav_data['visual'] . ':</td><td><input name="pages_' . $acpnav_data['id'] . '" id="pages_' . $acpnav_data['id'] . '" type="checkbox" value="1" ' . $checked . '/></td></tr>' . "\n";
                         $checked = NULL;
//.........这里部分代码省略.........
开发者ID:cozylife,项目名称:tht-reworked,代码行数:101,代码来源:staff.php

示例4: acpPage

 public function acpPage()
 {
     global $dbh, $postvar, $getvar, $instance;
     switch ($getvar['do']) {
         default:
             if ($_POST) {
                 check::empty_fields(array("prefix"));
                 if (!main::errors()) {
                     $forumcon = $dbh->connect($postvar['hostname'], $postvar['username'], $postvar['password'], $postvar['database']);
                     if (is_string($forumcon)) {
                         main::errors($forumcon);
                     } else {
                         $forums_params = $this->forumdata($postvar['forumname']);
                         if ($forums_params['id']) {
                             main::errors("This forum name has already been used! Please choose a new one.<br>");
                         } else {
                             $p2h_insert = array("forumname" => $postvar['forumname'], "username" => $postvar['username'], "password" => $postvar['password'], "forumdb" => $postvar['database'], "hostname" => $postvar['hostname'], "prefix" => $postvar['prefix'], "forumtype" => $postvar['forum'], "url" => $postvar['url']);
                             $dbh->insert("p2h", $p2h_insert);
                             main::errors("Your forum has been added!<br>");
                         }
                     }
                 }
             }
             $manage_forums_array['CONTENT'] = style::replaceVar("tpl/admin/p2h/add-forum.tpl");
             break;
         case "edit":
             $forums_params = $this->forumdata();
             if ($dbh->num_rows($forums_params) == 0) {
                 $manage_forums_array['CONTENT'] = "There are no forums to edit!<br>";
             } else {
                 if ($getvar['id']) {
                     if ($_POST) {
                         check::empty_fields(array("password"));
                         if (!main::errors()) {
                             $forumcon = $dbh->connect($postvar['hostname'], $postvar['username'], $postvar['password'], $postvar['database']);
                             if (is_string($forumcon)) {
                                 main::errors($forumcon);
                             } else {
                                 $forums_params = $this->forumdata($getvar['id']);
                                 if (!$forums_params['id']) {
                                     main::errors("This forum name does not exist.<br>");
                                 } else {
                                     $p2h_update = array("forumname" => $postvar['forumname'], "username" => $postvar['username'], "forumdb" => $postvar['database'], "hostname" => $postvar['hostname'], "prefix" => $postvar['prefix'], "url" => $postvar['url']);
                                     $dbh->update("p2h", $p2h_update, array("id", "=", $getvar['id']));
                                     if ($postvar['password']) {
                                         $dbh->update("p2h", array("password" => $postvar['password']), array("id", "=", $getvar['id']));
                                     }
                                     main::errors("Forum Edited!<br>");
                                 }
                             }
                         }
                     }
                     $forumdata = $this->forumdata($getvar['id']);
                     if (!$forumdata['id']) {
                         main::done();
                     }
                     $edit_forum_array['HOST'] = $forumdata['hostname'];
                     $edit_forum_array['NAME'] = $forumdata['forumname'];
                     $edit_forum_array['URL'] = $forumdata['url'];
                     $manage_forums_array['CONTENT'] = style::replaceVar("tpl/admin/p2h/edit-forum.tpl", $edit_forum_array);
                 } else {
                     $manage_forums_array['CONTENT'] .= "<ERRORS>";
                     while ($forums_params_data = $dbh->fetch_array($forums_params)) {
                         $manage_forums_array['CONTENT'] .= main::sub("<strong>" . $forums_params_data['forumname'] . "</strong>", '<a href="?page=type&type=p2h&sub=forums&do=edit&id=' . $forums_params_data['id'] . '"><img src="' . URL . 'themes/icons/pencil.png"></a>');
                     }
                 }
             }
             break;
         case "delete":
             $forums_params = $this->forumdata();
             if ($dbh->num_rows($forums_params) == 0) {
                 $manage_forums_array['CONTENT'] = "There are no forums to delete!<br>";
             } else {
                 if ($getvar['id']) {
                     $dbh->delete("p2h", array("id", "=", $getvar['id']));
                     main::errors("Forum deleted!<br>");
                     $forums_params = $this->forumdata();
                 }
                 $manage_forums_array['CONTENT'] .= "<ERRORS>";
                 while ($forums_params_data = $dbh->fetch_array($forums_params)) {
                     $manage_forums_array['CONTENT'] .= main::sub("<strong>" . $forums_params_data['forumname'] . "</strong>", '<a href="?page=type&type=p2h&sub=forums&do=delete&id=' . $forums_params_data['id'] . '"><img src="' . URL . 'themes/icons/delete.png"></a>');
                 }
             }
             break;
         case "config":
             if ($_POST) {
                 check::empty_fields(array("password"));
                 if (!main::errors()) {
                     if (!is_numeric($postvar['p2hwarndate']) || !($postvar['p2hwarndate'] < 28)) {
                         main::errors("The P2H Warn date must be a number less than 28.<br>");
                     } else {
                         $dbh->updateConfig("p2hwarndate", $postvar['p2hwarndate']);
                         main::errors("Configuration updated.<br>");
                     }
                 }
             }
             $forum_config_array['WARNDATE'] = $dbh->config("p2hwarndate");
             $manage_forums_array['CONTENT'] = style::replaceVar("tpl/admin/p2h/forum-config.tpl", $forum_config_array);
             break;
     }
//.........这里部分代码省略.........
开发者ID:cozylife,项目名称:tht-reworked,代码行数:101,代码来源:p2h.php

示例5: content

 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     switch ($getvar['sub']) {
         default:
             if ($_POST['add']) {
                 $no_check_array = array("resellerport", "welcome", "nstmp", "passtoo", "resellerid");
                 check::empty_fields($no_check_array);
                 if (!main::errors()) {
                     $servers_insert = array("ip" => $postvar['ip'], "resellerport" => $postvar['resellerport'], "port" => $postvar['port'], "nameservers" => $postvar['nameservers'], "name" => $postvar['name'], "host" => $postvar['host'], "user" => $postvar['user'], "accesshash" => $postvar['hash'], "type" => $postvar['type'], "dnstemplate" => $postvar['nstmp'], "welcome" => $postvar['welcome'], "pass" => $postvar['pass'], "reseller_id" => $postvar['resellerid'], "https" => $postvar['https'], "apiport" => $postvar['apiport']);
                     $dbh->insert("servers", $servers_insert);
                     main::errors("Server has been added!");
                 }
             }
             if ($_POST['addtype'] || $_POST['add']) {
                 $serverfile = server::createServer(0, $postvar['type']);
                 $server_fields = $serverfile->acp_form();
                 $add_server_array['SERVER_FIELDS'] = $server_fields;
                 $add_server_array['TYPE'] = $postvar['type'];
                 echo style::replaceVar("tpl/admin/servers/add-server.tpl", $add_server_array);
                 break;
             }
             $files = main::folderFiles(INC . "/servers/");
             foreach ($files as $value) {
                 include INC . "/servers/" . $value;
                 $fname = explode(".", $value);
                 $stype = new $fname[0]();
                 $values[] = array($stype->name, $fname[0]);
             }
             $server_type_array['TYPE'] = main::dropDown("type", $values, 0);
             echo style::replaceVar("tpl/admin/servers/server-type.tpl", $server_type_array);
             break;
         case "view":
             if (isset($getvar['do'])) {
                 $servers_query = $dbh->select("servers", array("id", "=", $getvar['do']), 0, 0, 1);
                 if ($dbh->num_rows($servers_query) == 0) {
                     echo "That server doesn't exist!";
                 } else {
                     if ($_POST) {
                         check::empty_fields();
                         if (!main::errors()) {
                             $servers_update = array("name" => $postvar['name'], "host" => $postvar['host'], "reseller_id" => $postvar['resellerid'], "user" => $postvar['user'], "pass" => $postvar['pass'], "accesshash" => $postvar['hash'], "port" => $postvar['port'], "resellerport" => $postvar['resellerport'], "nameservers" => $postvar['nameservers'], "ip" => $postvar['ip'], "dnstemplate" => $postvar['nstmp'], "welcome" => $postvar['welcome'], "https" => $postvar['https'], "apiport" => $postvar['apiport']);
                             $dbh->update("servers", $servers_update, array("id", "=", $getvar['do']), 1);
                             //Server edit complete
                             main::done();
                         }
                     }
                     $servers_data = $dbh->fetch_array($servers_query);
                     $serverfile = server::createServer(0, $servers_data['type']);
                     $server_fields = $serverfile->acp_form($getvar['do']);
                     $edit_server_array['NAME'] = $servers_data['name'];
                     $edit_server_array['HOST'] = $servers_data['host'];
                     $edit_server_array['SERVERIP'] = $servers_data['ip'];
                     $edit_server_array['RESELLERPORT'] = $servers_data['resellerport'];
                     $edit_server_array['PORT'] = $servers_data['port'];
                     $edit_server_array['NAMESERVERS'] = $servers_data['nameservers'];
                     $edit_server_array['SERVER_FIELDS'] = $server_fields;
                     echo style::replaceVar("tpl/admin/servers/edit-server.tpl", $edit_server_array);
                 }
             } else {
                 $servers_query = $dbh->select("servers");
                 if ($dbh->num_rows($servers_query) == 0) {
                     echo "There are no servers to view!";
                 } else {
                     echo "<ERRORS>";
                     while ($servers_data = $dbh->fetch_array($servers_query)) {
                         echo main::sub("<strong>" . $servers_data['name'] . "</strong>", '<a href="?page=servers&sub=view&do=' . $servers_data['id'] . '"><img src="' . URL . 'themes/icons/magnifier.png"></a>');
                     }
                 }
             }
             break;
         case "delete":
             if ($getvar['do']) {
                 $dbh->delete("servers", array("id", "=", $getvar['do']));
                 main::errors("Server Deleted!");
             }
             $servers_query = $dbh->select("servers");
             if ($dbh->num_rows($servers_query) == 0) {
                 echo "There are no servers to delete!";
             } else {
                 echo "<ERRORS>";
                 while ($servers_data = $dbh->fetch_array($servers_query)) {
                     echo main::sub("<strong>" . $servers_data['name'] . "</strong>", '<a href="?page=servers&sub=delete&do=' . $servers_data['id'] . '"><img src="' . URL . 'themes/icons/delete.png"></a>');
                 }
             }
             break;
         case "test":
             if (isset($getvar["do"])) {
                 $result = server::testConnection($getvar["do"]);
                 if ($result === true) {
                     echo '<div style="text-align:center;padding-top:10px;">' . style::notice(true, "Connected to the server successfully!") . "</div>";
                 } else {
                     echo '<div style="text-align:center;">' . style::notice(false, "Couldn't connect to the server...") . "</div>";
                     echo '<strong>Error:</strong><pre>' . (string) $result . '</pre>';
                 }
             } else {
                 $servers_query = $dbh->select("servers");
                 if ($dbh->num_rows($servers_query) == 0) {
                     echo "There are no servers to view!";
                 } else {
//.........这里部分代码省略.........
开发者ID:cozylife,项目名称:tht-reworked,代码行数:101,代码来源:servers.php

示例6: content

 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     switch ($getvar['sub']) {
         default:
             if ($_POST) {
                 check::empty_fields();
                 if (!main::errors()) {
                     $subdomains_insert = array("domain" => $postvar['domain'], "server" => $postvar['server']);
                     $dbh->insert("subdomains", $subdomains_insert);
                     main::errors("Subdomain domain has been added!");
                 }
             }
             $servers_query = $dbh->select("servers");
             if ($dbh->num_rows($servers_query) == 0) {
                 echo "There are no servers, you need to add a server first!";
                 return;
             }
             while ($servers_data = $dbh->fetch_array($servers_query)) {
                 $values[] = array($servers_data['name'], $servers_data['id']);
             }
             $add_subdomain_array['SERVER'] = main::dropDown("server", $values);
             echo style::replaceVar("tpl/admin/subdomains/add-subdomain.tpl", $add_subdomain_array);
             break;
         case "edit":
             if (isset($getvar['do'])) {
                 $subdomains_data = $dbh->select("subdomains", array("id", "=", $getvar['do']));
                 if (!$subdomains_data['id']) {
                     echo "That subdomain domain doesn't exist!";
                 } else {
                     if ($_POST) {
                         check::empty_fields();
                         if (!main::errors()) {
                             $subdomains_update = array("domain" => $postvar['domain'], "server" => $postvar['server']);
                             $dbh->update("subdomains", $subdomains_update, array("id", "=", $getvar['do']));
                             //Subdomain added
                             main::done();
                         }
                     }
                     $edit_subdomain_array['DOMAIN'] = $subdomains_data['domain'];
                     $servers_query = $dbh->select("servers");
                     while ($servers_data = $dbh->fetch_array($servers_query)) {
                         $values[] = array($servers_data['name'], $servers_data['id']);
                     }
                     $edit_subdomain_array['SERVER'] = main::dropDown("server", $values, $servers_data['server']);
                     echo style::replaceVar("tpl/admin/subdomains/edit-subdomain.tpl", $edit_subdomain_array);
                 }
             } else {
                 $subdomains_query = $dbh->select("subdomains");
                 if ($dbh->num_rows($subdomains_query) == 0) {
                     echo "There are no subdomain domains to edit!";
                 } else {
                     echo "<ERRORS>";
                     while ($subdomains_data = $dbh->fetch_array($subdomains_query)) {
                         echo main::sub("<strong>" . $subdomains_data['domain'] . "</strong>", '<a href="?page=sub&sub=edit&do=' . $subdomains_data['id'] . '"><img src="' . URL . 'themes/icons/pencil.png"></a>');
                     }
                 }
             }
             break;
         case "delete":
             if (isset($getvar['do'])) {
                 $dbh->delete("subdomains", array("id", "=", $getvar['do']));
                 main::errors("Subdomain Deleted!");
             }
             $subdomains_query = $dbh->select("subdomains");
             if ($dbh->num_rows($subdomains_query) == 0) {
                 echo "There are no subdomain domains to delete!";
             } else {
                 echo "<ERRORS>";
                 while ($subdomains_data = $dbh->fetch_array($subdomains_query)) {
                     echo main::sub("<strong>" . $subdomains_data['domain'] . "</strong>", '<a href="?page=sub&sub=delete&do=' . $subdomains_data['id'] . '"><img src="' . URL . 'themes/icons/delete.png"></a>');
                 }
             }
             break;
     }
 }
开发者ID:cozylife,项目名称:tht-reworked,代码行数:76,代码来源:sub.php

示例7: content


//.........这里部分代码省略.........
                             main::errors("Please enter a positive number for the cost or posts fields.");
                         }
                         if (!main::errors()) {
                             $not_additional_array = array("edit", "name", "backend", "description", "type", "server", "admin", "groupid", "sendwelcome", "welcomesubject", "welcomebody", $GLOBALS['csrf']['input-name']);
                             foreach ($postvar as $key => $value) {
                                 if (!in_array($key, $not_additional_array)) {
                                     if ($n) {
                                         $additional .= ",";
                                     }
                                     $additional .= $key . "=" . str_replace(array(" ", ","), array("", "."), $value);
                                     $n++;
                                 }
                             }
                             if ($postvar['sendwelcome'] && (!$postvar['welcomesubject'] || !$postvar['welcomebody'])) {
                                 $serverid = $postvar['server'];
                                 $server_type_data = $dbh->select("servers", array("id", "=", $serverid));
                                 $server_type = $server_type_data['type'];
                                 if ($server_type == "zpanel") {
                                     include INC . "/servers/" . $server_type . ".php";
                                     $server = new $server_type();
                                     $server_subject_def = server::email_subject;
                                     $server_body_def = server::email_body;
                                     if (!$postvar['welcomesubject']) {
                                         $postvar['welcomesubject'] = $server_subject_def;
                                     }
                                     if (!$postvar['welcomebody']) {
                                         $postvar['welcomebody'] = $server_body_def;
                                     }
                                 }
                             }
                             $packages_update = array("name" => $postvar['name'], "backend" => $postvar['backend'], "description" => $postvar['description'], "server" => $postvar['server'], "admin" => $postvar['admin'], "additional" => $additional, "reseller" => $postvar['reseller'], "is_hidden" => $postvar['hidden'], "is_disabled" => $postvar['disabled'], "type" => $postvar['type'], "groupid" => $postvar['groupid'], "send_email" => $postvar['sendwelcome'], "email_subject" => $postvar['welcomesubject'], "email_body" => $postvar['welcomebody']);
                             $dbh->update("packages", $packages_update, array("id", "=", $getvar['do']));
                             //Package edit complete.
                             main::done();
                         }
                     }
                     $packages_data = $dbh->fetch_array($packages_query);
                     $edit_package_array['BACKEND'] = $packages_data['backend'];
                     $edit_package_array['DESCRIPTION'] = $packages_data['description'];
                     $edit_package_array['NAME'] = $packages_data['name'];
                     $edit_package_array['URL'] = $dbh->config("url");
                     $edit_package_array['ID'] = $packages_data['id'];
                     if ($packages_data['admin'] == 1) {
                         $edit_package_array['ADMIN_CHECKED'] = 'checked="checked"';
                     } else {
                         $edit_package_array['ADMIN_CHECKED'] = "";
                     }
                     if ($packages_data['reseller'] == 1) {
                         $edit_package_array['RESELLER_CHECKED'] = 'checked="checked"';
                     } else {
                         $edit_package_array['RESELLER_CHECKED'] = "";
                     }
                     if ($packages_data['is_hidden'] == 1) {
                         $edit_package_array['HIDDEN_CHECKED'] = 'checked="checked"';
                     } else {
                         $edit_package_array['HIDDEN_CHECKED'] = "";
                     }
                     if ($packages_data['is_disabled'] == 1) {
                         $edit_package_array['DISABLED_CHECKED'] = 'checked="checked"';
                     } else {
                         $edit_package_array['DISABLED_CHECKED'] = "";
                     }
                     $serverfile = server::createServer($getvar['do']);
                     $package_fields = $serverfile->acp_packages_form($getvar['do']);
                     $edit_package_array['PACKAGES_FIELDS'] = $package_fields;
                     $p2h_query = $dbh->select("p2h");
开发者ID:cozylife,项目名称:tht-reworked,代码行数:67,代码来源:packages.php

示例8: acp


//.........这里部分代码省略.........
        $sidebarlink_array['IMGURL'] = "information.png";
        $sidebarlink_array['LINK'] = "?page=credits";
        $sidebarlink_array['VISUAL'] = "Credits";
        $sidebar_array['LINKS'] .= style::replaceVar("tpl/sidebar-link.tpl", $sidebarlink_array);
        $sidebarlink_array['IMGURL'] = "delete.png";
        $sidebarlink_array['LINK'] = "?page=logout";
        $sidebarlink_array['VISUAL'] = "Logout";
        $sidebar_array['LINKS'] .= style::replaceVar("tpl/sidebar-link.tpl", $sidebarlink_array);
        $sidebar = style::replaceVar("tpl/sidebar.tpl", $sidebar_array);
        //Page Sidebar
        if ($content->navtitle) {
            $subnav = $content->navtitle;
            foreach ($content->navlist as $key => $value) {
                $sub_sidebarlink_array['IMGURL'] = $value[1];
                $sub_sidebarlink_array['LINK'] = "?page=" . $getvar['page'] . "&sub=" . $value[2];
                $sub_sidebarlink_array['VISUAL'] = $value[0];
                $sub_sidebar_array['LINKS'] .= style::replaceVar("tpl/sidebar-link.tpl", $sub_sidebarlink_array);
            }
            $subsidebar = style::replaceVar("tpl/sidebar.tpl", $sub_sidebar_array);
        }
        if ($getvar['sub'] && $getvar['page'] != "type") {
            foreach ($content->navlist as $key => $value) {
                if ($value[2] == $getvar['sub']) {
                    if (!$value[0]) {
                        define("SUB", $getvar['page']);
                        $header = $getvar['page'];
                    } else {
                        define("SUB", $value[0]);
                        $header = $value[0];
                    }
                }
            }
        }
        if ($getvar['sub'] == "delete" && isset($getvar['do']) && !$_POST && !$getvar['confirm']) {
            foreach ($postvar as $key => $value) {
                $warning_array['HIDDEN'] .= '<input name="' . $key . '" type="hidden" value="' . $value . '" />';
            }
            $warning_array['HIDDEN'] .= " ";
            $html = style::replaceVar("tpl/warning.tpl", $warning_array);
        } elseif ($getvar['sub'] == "delete" && isset($getvar['do']) && $_POST && !$getvar['confirm']) {
            if ($postvar['yes']) {
                foreach ($getvar as $key => $value) {
                    if ($i) {
                        $i = "&";
                    } else {
                        $i = "?";
                    }
                    $url .= $i . $key . "=" . $value;
                }
                $url .= "&confirm=1";
                main::redirect($url);
            } elseif ($postvar['no']) {
                main::done();
            }
        } else {
            if (isset($getvar['sub'])) {
                ob_start();
                $content->content();
                $html = ob_get_contents();
                // Retrieve the HTML
                ob_clean();
                // Flush the HTML
            } elseif ($content->navlist) {
                $html .= $content->description();
                // First, we gotta get the page description.
                $html .= "<br /><br />";
                // Break it up
                // Now we should prepend some stuff here
                $subsidebar2 .= "<strong>Page Submenu</strong><div class='break'></div>";
                $subsidebar2 .= $subsidebar;
                // Done, now output it in a sub() table
                $html .= main::sub($subsidebar2, NULL);
                // Initial implementation, add the SubSidebar(var) into the description, basically append it
            } else {
                ob_start();
                $content->content();
                $html = ob_get_contents();
                // Retrieve the HTML
                ob_clean();
                // Flush the HTML
            }
        }
    }
    $staffuser = $dbh->staff($_SESSION['user']);
    define("SUB", $header);
    define("INFO", '<b>Welcome back, ' . strip_tags($staffuser['name']) . '</b><br />' . SUB);
    echo '<div id="left">';
    echo main::table($nav, $sidebar);
    if ($content->navtitle) {
        echo "<br />";
        echo main::table($subnav, $subsidebar);
    }
    echo '</div>';
    echo '<div id="right">';
    echo main::table($header, $html);
    echo '</div>';
    $html_buff = ob_get_contents();
    ob_clean();
    return $html_buff;
}
开发者ID:cozylife,项目名称:tht-reworked,代码行数:101,代码来源:index.php

示例9: client

function client()
{
    global $dbh, $postvar, $getvar, $instance;
    ob_start();
    // Stop the output buffer
    if (!$getvar['page']) {
        $getvar['page'] = "home";
    }
    $page = $dbh->select("clientnav", array("link", "=", $getvar['page']), array("id", "ASC"));
    $header = $page['visual'];
    $link = "pages/" . $getvar['page'] . ".php";
    if (!file_exists($link)) {
        $html = "That page doesn't exist.";
    } else {
        if (preg_match("/[\\.*]/", $getvar['page']) == 0) {
            include $link;
            $content = new page();
            // Main Side Bar HTML
            $nav = "Sidebar";
            if (!$dbh->config("delacc")) {
                $clientnav_query = $dbh->select("clientnav", array("link", "!=", "delete"), array("id", "ASC"), 0, 1);
            } else {
                $clientnav_query = $dbh->select("clientnav", 0, array("id", "ASC"), 0, 1);
            }
            while ($clientnav_data = $dbh->fetch_array($clientnav_query)) {
                $sidebar_link_array['IMGURL'] = $clientnav_data['icon'];
                $sidebar_link_array['LINK'] = "?page=" . $clientnav_data['link'];
                $sidebar_link_array['VISUAL'] = $clientnav_data['visual'];
                $sidebar_array['LINKS'] .= style::replaceVar("tpl/sidebar-link.tpl", $sidebar_link_array);
            }
            // Types Navbar
            $client = $dbh->client($_SESSION['cuser']);
            $packtype = $instance->packtypes[type::packagetype($client['pid'])];
            if ($packtype->clientNav) {
                foreach ($packtype->clientNav as $key2 => $value) {
                    $sidebar_link_array['IMGURL'] = $value[2];
                    $sidebar_link_array['LINK'] = "?page=type&type=" . type::packagetype($client['pid']) . "&sub=" . $value[1];
                    $sidebar_link_array['VISUAL'] = $value[0];
                    $sidebar_array['LINKS'] .= style::replaceVar("tpl/sidebar-link.tpl", $sidebar_link_array);
                    if ($getvar['page'] == "type" && $getvar['type'] == type::packagetype($client['pid']) && $getvar['sub'] == $value[1]) {
                        define("SUB", $value[3]);
                        $header = $value[3];
                        $getvar['myheader'] = $value[3];
                    }
                }
            }
            $sidebar_link_array['IMGURL'] = "delete.png";
            $sidebar_link_array['LINK'] = "?page=logout";
            $sidebar_link_array['VISUAL'] = "Logout";
            $sidebar_array['LINKS'] .= style::replaceVar("tpl/sidebar-link.tpl", $sidebar_link_array);
            $sidebar = style::replaceVar("tpl/sidebar.tpl", $sidebar_array);
            //Page Sidebar
            if ($content->navtitle) {
                $subnav = $content->navtitle;
                foreach ($content->navlist as $key => $value) {
                    $sidebar_link_array['IMGURL'] = $value[1];
                    $sidebar_link_array['LINK'] = "?page=" . $getvar['page'] . "&sub=" . $value[2];
                    $sidebar_link_array['VISUAL'] = $value[0];
                    $sub_sidebar_array['LINKS'] .= style::replaceVar("tpl/sidebar-link.tpl", $sidebar_link_array);
                }
                $subsidebar = style::replaceVar("tpl/sidebar.tpl", $sub_sidebar_array);
            }
            if ($getvar['sub'] == "delete" && isset($getvar['do']) && !$_POST && !$getvar['confirm']) {
                foreach ($postvar as $key => $value) {
                    $warning_array['HIDDEN'] .= '<input name="' . $key . '" type="hidden" value="' . $value . '" />';
                }
                $warning_array['HIDDEN'] .= " ";
                $html = style::replaceVar("tpl/warning.tpl", $warning_array);
            } elseif ($getvar['sub'] == "delete" && isset($getvar['do']) && $_POST && !$getvar['confirm']) {
                if ($postvar['yes']) {
                    foreach ($getvar as $key => $value) {
                        if ($i) {
                            $i = "&";
                        } else {
                            $i = "?";
                        }
                        $url .= $i . $key . "=" . $value;
                    }
                    $url .= "&confirm=1";
                    main::redirect($url);
                } elseif ($postvar['no']) {
                    main::done();
                }
            } else {
                if (isset($getvar['sub'])) {
                    ob_start();
                    $content->content();
                    $html = ob_get_contents();
                    // Retrieve the HTML
                    ob_clean();
                    // Flush the HTML
                } elseif ($content->navlist) {
                    if ($content->description()) {
                        $html = $content->description() . "<br><br>";
                    }
                    $html .= "Select a sub-page from the sidebar.";
                } else {
                    ob_start();
                    $content->content();
                    $html = ob_get_contents();
//.........这里部分代码省略.........
开发者ID:cozylife,项目名称:tht-reworked,代码行数:101,代码来源:index.php


注:本文中的main::done方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。