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


PHP email::staff方法代码示例

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


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

示例1: content

 public function content()
 {
     global $dbh, $postvar, $getvar, $instance;
     switch ($getvar['sub']) {
         default:
             if ($_POST) {
                 check::empty_fields();
                 if (!main::errors()) {
                     $time = time();
                     $tickets_insert = array("title" => $postvar['title'], "content" => $postvar['content'], "urgency" => $postvar['urgency'], "time" => $time, "userid" => $_SESSION['cuser']);
                     $dbh->insert("tickets", $tickets_insert);
                     $last_ticket_data = $dbh->select("tickets", array("time", "=", $time), 0, "1");
                     $template = email::emailTemplate("new-ticket");
                     $newticket_array['TITLE'] = $postvar['title'];
                     $newticket_array['URGENCY'] = $postvar['urgency'];
                     $newticket_array['CONTENT'] = $postvar['content'];
                     $newticket_array['LINK'] = $dbh->config("url") . ADMINDIR . "/?page=tickets&sub=view&do=" . $last_ticket_data['id'];
                     email::staff($template['subject'], $template['content'], $newticket_array);
                     main::errors("Ticket has been added!");
                 }
             }
             echo style::replaceVar("tpl/client/tickets/add-ticket.tpl");
             break;
         case "view":
             if (is_numeric($getvar['deltid'])) {
                 $userid = $_SESSION['cuser'];
                 $tid = $getvar['deltid'];
                 unset($where);
                 $where[] = array("id", "=", $tid, "AND");
                 $where[] = array("userid", "=", $userid);
                 $user_check = $dbh->select("tickets", $where, 0, "1", 1);
                 $user_check_rows = $dbh->num_rows($user_check);
                 if ($user_check_rows == "0") {
                     echo "<font color = '#FF0000'>This ticket is not yours to delete or does not exist.</font><br>";
                 } else {
                     unset($where);
                     $where[] = array("id", "=", $tid, "OR");
                     $where[] = array("ticketid", "=", $tid);
                     $dbh->delete("tickets", $where);
                 }
             }
             if (!$getvar['do']) {
                 unset($where);
                 $where[] = array("userid", "=", $_SESSION['cuser'], "AND");
                 $where[] = array("reply", "=", "0");
                 $tickets_query = $dbh->select("tickets", $where, 0, 0, 1);
                 if (!$dbh->num_rows($tickets_query)) {
                     echo "You currently have no tickets!";
                 } else {
                     while ($tickets_data = $dbh->fetch_array($tickets_query)) {
                         $ticket_view_box_array['TITLE'] = $tickets_data['title'];
                         $ticket_view_box_array['UPDATE'] = $this->lastUpdated($tickets_data['id']);
                         $ticket_view_box_array['ID'] = $tickets_data['id'];
                         $ticket_view_box_array['STATUS'] = $tickets_data['status'];
                         $ticket_view_box_array['STATUSMSG'] = $this->status($tickets_data['status']);
                         echo style::replaceVar("tpl/client/tickets/ticket-view-box.tpl", $ticket_view_box_array);
                     }
                 }
             } else {
                 unset($where);
                 $where[] = array("id", "=", $getvar['do'], "OR");
                 $where[] = array("ticketid", "=", $getvar['do']);
                 $tickets_query = $dbh->select("tickets", $where, array("time", "ASC"), 0, 1);
                 if (!$dbh->num_rows($tickets_query)) {
                     echo "That ticket doesn't exist!";
                 } else {
                     if ($_POST) {
                         check::empty_fields();
                         if (!main::errors()) {
                             $time = time();
                             $tickets_insert = array("title" => $postvar['title'], "content" => $postvar['content'], "time" => $time, "userid" => $_SESSION['cuser'], "reply" => "1", "ticketid" => $getvar['do']);
                             $dbh->insert("tickets", $tickets_insert);
                             $last_ticket_data = $dbh->select("tickets", array("time", "=", $time), 0, "1");
                             $tickets_data = $dbh->fetch_array($tickets_query);
                             $client = $dbh->client($_SESSION['cuser']);
                             $template = email::emailTemplate("ticket-client-responded");
                             $newresponse_array['TITLE'] = $tickets_data['title'];
                             $newresponse_array['USER'] = $client['user'];
                             $newresponse_array['CONTENT'] = $postvar['content'];
                             $newresponse_array['LINK'] = $dbh->config("url") . ADMINDIR . "/?page=tickets&sub=view&do=" . $last_ticket_data['ticketid'];
                             email::staff($template['subject'], $template['content'], $newresponse_array);
                             main::redirect("?page=tickets&sub=view&do=" . $getvar['do']);
                         }
                     }
                     $tickets_data = $dbh->fetch_array($tickets_query);
                     $view_ticket_array['AUTHOR'] = $this->determineAuthor($tickets_data['userid'], $tickets_data['staff']);
                     $view_ticket_array['TIME'] = main::convertdate("n/d/Y - g:i A", $tickets_data['time']);
                     $view_ticket_array['NUMREPLIES'] = $dbh->num_rows($tickets_query) - 1;
                     $view_ticket_array['UPDATED'] = $this->lastUpdated($tickets_data['id']);
                     $view_ticket_array['ORIG'] = $this->showReply($tickets_data['id']);
                     $view_ticket_array['URGENCY'] = $tickets_data['urgency'];
                     $view_ticket_array['STATUS'] = $this->status($tickets_data['status']);
                     switch ($tickets_data['status']) {
                         case "1":
                             $view_ticket_array['STATUSCOLOR'] = "779500";
                             break;
                         case "2":
                             $view_ticket_array['STATUSCOLOR'] = "FF9500";
                             break;
                         case "3":
//.........这里部分代码省略.........
开发者ID:cozylife,项目名称:tht-reworked,代码行数:101,代码来源:tickets.php

示例2: do_upgrade


//.........这里部分代码省略.........
         }
         if ($uemaildata) {
             $welcomeemail_array['USER'] = $username;
             $welcomeemail_array['EMAIL'] = $user_email;
             $welcomeemail_array['PACKAGE'] = $newpack_name;
             $welcomeemail_array['SERVERIP'] = $new_server_data['ip'];
             $welcomeemail_array['LNAME'] = $user_info['lastname'];
             $welcomeemail_array['FNAME'] = $user_info['firstname'];
             $welcomeemail_array['CPPORT'] = $new_server_data['port'];
             $welcomeemail_array['PASS'] = $new_serv_pass_for_email;
             $welcomeemail_array['RESELLERPORT'] = $new_server_data['resellerport'];
             $welcomeemail_array['NAMESERVERS'] = nl2br($new_server_data['nameservers']);
             $welcomeemail_array['DOMAIN'] = $user_data['user_data']['domain'];
             email::send($user_email, $uemaildata['subject'], $uemaildata['content'], $welcomeemail_array);
         }
     } else {
         main::errors("Your upgrade request has been added.");
     }
     //Now we need to send the admin a dozen emails.  lol  FIRE!  Nah, we'll only ever send them one email at a time.  ;)
     if ($admin_approval) {
         if ($new_server) {
             $emaildata = email::emailTemplate("upgrade-newserv-adminval");
         } else {
             $emaildata = email::emailTemplate("upgrade-adminval");
         }
     }
     if ($admin_inform) {
         $emaildata = email::emailTemplate("notify-upgrade-new-server");
     }
     if (!$emaildata && $change_tht) {
         $emaildata = email::emailTemplate("notify-upgrade");
     }
     if ($emaildata) {
         email::staff($emaildata['subject'], $emaildata['content'], $adminmsg_array);
     }
     if ($change_tht) {
         main::thtlog("Client Upgraded", "Upgraded from " . $current_pack_name . " to " . $newpack_name, $userid, "");
         if ($current_pack_type == "paid") {
             unset($where);
             $where[] = array("uid", "=", $userid, "AND");
             $where[] = array("pid", "=", "");
             $dbh->update("invoices", array("pid" => $current_pack_id), $where);
         }
         if ($new_plan_data['type'] != "p2h") {
             $dbh->delete("coupons_p2h", array("uid", "=", $userid));
         }
         $user_pack_data = $user_data['user_data'];
         $users_update = array("pid" => $newpack, "domain" => $user_pack_data['domain'], "additional" => $user_pack_data['additional']);
         $dbh->update("users", $users_update, array("id", "=", $userid), "1");
         $dbh->update("users_bak", $users_update, array("id", "=", $userid), "1");
         if ($current_pack_type == "paid") {
             unset($where);
             $where[] = array("user", "=", $userid, "AND");
             $where[] = array("disabled", "=", "0");
             $coupons_used_query = $dbh->select("coupons_used", $where, 0, 0, 1);
             while ($coupons_used_data = $dbh->fetch_array($coupons_used_query)) {
                 $had_coupons .= $coupons_used_data['coupcode'] . ",";
                 $couponvals .= $coupons_used_data['paiddisc'] . ",";
             }
             $had_coupons = substr($had_coupons, 0, strlen($had_coupons) - 1);
             $couponvals = substr($couponvals, 0, strlen($couponvals) - 1);
             if (!$had_coupons) {
                 $had_coupons = "0";
                 $couponvals = "0";
             }
             $invoices_update = array("changed_plan" => "1", "hadcoupons" => $had_coupons, "couponvals" => $couponvals);
开发者ID:cozylife,项目名称:tht-reworked,代码行数:67,代码来源:class_upgrade.php

示例3: unsuspend

 public function unsuspend($id, $noemail = 0)
 {
     global $dbh, $postvar, $getvar, $instance;
     unset($where);
     $where[] = array("id", "=", $id, "AND");
     $where[] = array("status", "=", "2", "OR", 1);
     $where[] = array("status", "=", "3", "OR");
     $where[] = array("status", "=", "4", "", 1);
     $users_data = $dbh->select("users", $where);
     if (!$users_data['id']) {
         $error_array['Error'] = "That package doesn't exist or cannot be unsuspended!";
         $error_array['User PID'] = $id;
         main::error($error_array);
         return;
     } else {
         $server = type::packageserver($users_data['pid']);
         $serverfile = self::createServer($users_data['pid']);
         if ($serverfile->unsuspend($users_data['user'], $server) == true) {
             if (!$noemail) {
                 $emaildata = email::emailTemplate("account-unsuspended");
                 email::send($users_data['email'], $emaildata['subject'], $emaildata['content']);
                 $package_server_data = $dbh->select("servers", array("id", "=", type::packageserver($client['pid'])));
                 $admin_notifyunsuspend = email::emailTemplate("notify-admin-of-unsuspension");
                 $notifyunsuspend_array['USER'] = $users_data['user'];
                 $notifyunsuspend_array['SERV_TYPE'] = $package_server_data['type'];
                 $notifyunsuspend_array['SERV_NAME'] = $package_server_data['name'];
                 email::staff($admin_notifyunsuspend['subject'], $admin_notifyunsuspend['content'], $notifyunsuspend_array);
             }
             $dbh->update("users_bak", array("status" => "1"), array("id", "=", $users_data['id']));
             $dbh->update("users", array("status" => "1"), array("id", "=", $users_data['id']));
             main::thtlog("Client Account Unsuspended", "Unsuspended", $users_data['id']);
             return true;
         } else {
             return false;
         }
     }
 }
开发者ID:cozylife,项目名称:tht-reworked,代码行数:37,代码来源:class_server.php


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