<?php require_once 'db.inc.php'; require_once 'facilities.inc.php'; require_once 'swiftmailer/swift_required.php'; $device = new Device(); $devList = $device->GetDevicesbyAge($config->ParameterArray["NewInstallsPeriod"]); // If any port other than 25 is specified, assume encryption and authentication if ($config->ParameterArray['SMTPPort'] != 25) { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort'])->setEncryption('ssl')->setUsername($config->ParameterArray['SMTPUser'])->setPassword($config->ParameterArray['SMTPPassword']); } else { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort']); } $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::NewInstance()->setSubject(__("Recent Data Center Installations Report")); // Set from address try { $message->setFrom($config->ParameterArray['MailFromAddr']); } catch (Swift_RfcComplianceException $e) { $error .= __("MailFrom") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } // Add data center team to the list of recipients try { $message->addTo($config->ParameterArray['FacMgrMail']); } catch (Swift_RfcComplianceException $e) { $error .= __("Facility Manager email address") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } $logo = getcwd() . '/images/' . $config->ParameterArray["PDFLogoFile"]; $logo = $message->embed(Swift_Image::fromPath($logo)->setFilename('logo.png')); $htmlMessage = sprintf("<!doctype html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\"><meta http-equiv=\"expires\" content=\"Mon, 01 Jan 1997 01:00:00 GMT\"><meta http-equiv=\"PRAGMA\" content=\"NO-CACHE\"><title>ITS Data Center Inventory</title></head><body><div id=\"header\" style=\"padding: 5px 0;background: %s;\"><center><img src=\"%s\"></center></div><div class=\"page\"><p><h3>Installations in the Past 7 Days</h3>\n", $config->ParameterArray["HeaderColor"], $logo); $htmlMessage .= sprintf("<p>The following systems have been entered into openDCIM, with an Install Date set to within the past %d days. Please review these entries to determine if follow-up documentation is required.</p>", $config->ParameterArray["NewInstallsPeriod"]);
if (isset($_REQUEST['requestid']) && $_REQUEST['requestid'] > 0) { $req->RequestID = $_REQUEST['requestid']; $req->GetRequest(); $contact->PersonID = $req->RequestorID; $contact->GetPerson(); } $tmpContact->PersonID = $_POST["requestorid"]; $tmpContact->GetPerson(); // If any port other than 25 is specified, assume encryption and authentication if ($config->ParameterArray['SMTPPort'] != 25) { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort'])->setEncryption('ssl')->setUsername($config->ParameterArray['SMTPUser'])->setPassword($config->ParameterArray['SMTPPassword']); } else { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort']); } $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::NewInstance()->setSubject($config->ParameterArray['MailSubject']); // Set from address try { $message->setFrom($config->ParameterArray['MailFromAddr']); } catch (Swift_RfcComplianceException $e) { $error .= __("MailFrom") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } // Add rack requestor to the list of recipients try { $message->addTo($tmpContact->Email); } catch (Swift_RfcComplianceException $e) { $error .= __("Check contact details for") . " <a href=\"usermgr.php?PersonID={$tmpContact->PersonID}\">{$tmpContact->LastName}, {$tmpContact->FirstName}</a>: <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } // Add data center team to the list of recipients try { $message->addTo($config->ParameterArray['MailToAddr']);
<?php require_once 'db.inc.php'; require_once 'facilities.inc.php'; require_once 'swiftmailer/swift_required.php'; // If any port other than 25 is specified, assume encryption and authentication if ($config->ParameterArray['SMTPPort'] != 25) { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort'])->setEncryption('ssl')->setUsername($config->ParameterArray['SMTPUser'])->setPassword($config->ParameterArray['SMTPPassword']); } else { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort']); } $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::NewInstance()->setSubject(__("Data Center Reserved Space Report")); // Set from address try { $message->setFrom($config->ParameterArray['MailFromAddr']); } catch (Swift_RfcComplianceException $e) { $error .= __("MailFrom") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } // Add data center team to the list of recipients try { $message->addTo($config->ParameterArray['FacMgrMail']); } catch (Swift_RfcComplianceException $e) { $error .= __("Facility Manager email address") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } $logo = getcwd() . '/images/' . $config->ParameterArray["PDFLogoFile"]; $logo = $message->embed(Swift_Image::fromPath($logo)->setFilename('logo.png')); $style = "\n<style type=\"text/css\">\n@media print {\n\th2 {\n\t\tpage-break-before: always;\n\t}\n}\n</style>"; $htmlMessage = sprintf("<!doctype html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><title>%s</title>%s</head><body><div id=\"header\" style=\"padding: 5px 0;background: %s;\"><center><img src=\"%s\"></center></div><div class=\"page\"><p>\n", __("Data Center Inventory Reservations"), $style, $config->ParameterArray["HeaderColor"], $logo); $datedList = Device::GetReservationsByDate(); $ownerList = array();
function sendorder() { $check = Validate::factory($_POST)->label('fio', 'ФИО')->label('address', 'адрес')->label('phone', 'телефон')->label('email', 'EMail')->rule('fio', 'not_empty')->rule('address', 'not_empty')->rule('phone', 'not_empty')->rule('phone', 'phone')->rule('email', 'not_empty')->rule('email', 'email'); if ($check->check()) { //$order = ORM::factory('good', $_POST['orderid'])->as_array(); $session = Session::instance(); $_SESSION =& $session->as_array(); $orders = '<b>Наименования:</b><br>'; $price = 0; foreach ($_SESSION['orders'] as $k => $v) { $orders .= $_SESSION['orders'][$k]['name'] . ' (ID: ' . $_SESSION['orders'][$k]['id'] . ') - ' . $_SESSION['orders'][$k]['price'] . ' грн. (' . $_SESSION['orders'][$k]['count'] . ' ' . $_SESSION['orders'][$k]['select'] . ')<br>'; $cof = $_SESSION['orders'][$k]['select'] == 'kg' ? $_SESSION['orders'][$k]['count'] : $_SESSION['orders'][$k]['count'] / 1000; $price += $_SESSION['orders'][$k]['price'] * $cof; } $text = '<b>ФИО:</b> ' . $_POST['fio'] . '<br> <b>Адрес:</b> ' . $_POST['address'] . '<br> <b>Телефон:</b> ' . $_POST['phone'] . '<br> <b>EMail:</b> ' . $_POST['email'] . '<br>' . $orders . '<p><b>Итоговая цена без доставки:</b> ' . $price; $mailer = email::connect(); $message = Swift_Message::NewInstance('Новый заказ', $text, 'text/html', 'utf-8'); $message->setTo('*****@*****.**'); $message->setFrom('*****@*****.**'); $mailer->send($message); Session::instance()->delete('orders'); return TRUE; } else { return strtolower(implode(' и ', $check->errors(''))); } }
require_once 'db.inc.php'; require_once 'facilities.inc.php'; require_once 'swiftmailer/swift_required.php'; $esx = new ESX(); $dev = new Device(); $dept = new Department(); $error = ""; // If any port other than 25 is specified, assume encryption and authentication if ($config->ParameterArray['SMTPPort'] != 25) { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort'])->setEncryption('ssl')->setUsername($config->ParameterArray['SMTPUser'])->setPassword($config->ParameterArray['SMTPPassword']); } else { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort']); } $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::NewInstance()->setSubject(__("Virtual Machine Inventory Exception Report")); // Set from address try { $message->setFrom($config->ParameterArray['MailFromAddr']); $message->SetReplyTo($config->ParameterArray["MailToAddr"]); } catch (Swift_RfcComplianceException $e) { $error .= __("MailFrom") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } // Add people to recipient list try { $message->setTo($config->ParameterArray['MailToAddr']); /* // Add additional recipients below this section using the following examples * // Using addTo() to add recipients iteratively * $message->addTo('*****@*****.**'); * $message->addTo('*****@*****.**', 'Person 2 Name'); */
<?php require_once 'db.inc.php'; require_once 'facilities.inc.php'; require_once 'swiftmailer/swift_required.php'; // If any port other than 25 is specified, assume encryption and authentication if ($config->ParameterArray['SMTPPort'] != 25) { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort'])->setEncryption('ssl')->setUsername($config->ParameterArray['SMTPUser'])->setPassword($config->ParameterArray['SMTPPassword']); } else { $transport = Swift_SmtpTransport::newInstance()->setHost($config->ParameterArray['SMTPServer'])->setPort($config->ParameterArray['SMTPPort']); } $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::NewInstance()->setSubject(__("Data Center Switch Capacity Exceptions Report")); // Set from address try { $message->setFrom($config->ParameterArray['MailFromAddr']); } catch (Swift_RfcComplianceException $e) { $error .= __("MailFrom") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } // Add data center team to the list of recipients try { $message->addTo($config->ParameterArray['FacMgrMail']); } catch (Swift_RfcComplianceException $e) { $error .= __("Facility Manager email address") . ": <span class=\"errmsg\">" . $e->getMessage() . "</span><br>\n"; } $logo = getcwd() . '/images/' . $config->ParameterArray["PDFLogoFile"]; $logo = $message->embed(Swift_Image::fromPath($logo)->setFilename('logo.png')); $htmlMessage = sprintf("<!doctype html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><title>ITS Data Center Inventory</title></head><body><div id=\"header\" style=\"padding: 5px 0;background: %s;\"><center><img src=\"%s\"></center></div><div class=\"page\"><p>\n", $config->ParameterArray["HeaderColor"], $logo); $htmlMessage .= sprintf("<p>The following switches are near full capacity per documentation.</p>"); $devList = Device::GetSwitchesToReport(); $lastDC = null;