本文整理汇总了PHP中Result::createURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Result::createURL方法的具体用法?PHP Result::createURL怎么用?PHP Result::createURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result::createURL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _
//set details
if ($_POST['type'] == "subnets") {
$tmp[] = "Share type: subnet";
$tmp[] = $Subnets->transform_to_dotted($object->subnet) . "/{$object->mask}";
$tmp[] = $object->description;
} else {
$tmp[] = "Share type: IP address";
$tmp[] = $Subnets->transform_to_dotted($object->ip_addr);
$tmp[] = $object->description;
}
$share->details = implode("<br>", $tmp);
//set code and timeframe
@($share->code = md5(time()));
$share->validity = date("Y-m-d H:i:s", strtotime("+1 day"));
# set url for printing
$url = $Result->createURL() . create_link("temp_share", $share->code);
?>
<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap-datetimepicker.min.css">
<script type="text/javascript" src="js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".datetimepicker").datetimepicker( { pickDate: true, pickTime: true } );
})
</script>
<!-- header -->
<div class="pHeader"><?php
print _('Create new temporary access');
示例2: Result
# if not install fetch settings etc
if ($_GET['page'] != "install") {
# database object
$Database = new Database_PDO();
# check if this is a new installation
require 'functions/checks/check_db_install.php';
# initialize objects
$Result = new Result();
$User = new User($Database);
$Sections = new Sections($Database);
$Subnets = new Subnets($Database);
$Tools = new Tools($Database);
$Addresses = new Addresses($Database);
$Log = new Logging($Database);
# reset url for base
$url = $Result->createURL();
}
/** include proper subpage **/
if ($_GET['page'] == "install") {
require "app/install/index.php";
} elseif ($_GET['page'] == "upgrade") {
require "app/upgrade/index.php";
} elseif ($_GET['page'] == "login") {
require "app/login/index.php";
} elseif ($_GET['page'] == "temp_share") {
require "app/temp_share/index.php";
} elseif ($_GET['page'] == "request_ip") {
require "app/login/index.php";
} else {
# verify that user is logged in
$User->check_user_session();
示例3: implode
$new_access = json_encode(array_merge($old_access, array_filter($new_access)));
# execute
if (!$Admin->object_modify("settings", "edit", "id", array("id" => 1, "tempAccess" => $new_access))) {
$Result->show("danger", _("Temporary share create error"), true);
} else {
$Result->show("success", _("Temporary share created"), false);
}
# send mail
if (strlen($_POST['email']) > 0) {
# fetch mailer settings
$mail_settings = $Admin->fetch_object("settingsMail", "id", 1);
# initialize mailer
$phpipam_mail = new phpipam_mail($User->settings, $mail_settings);
$phpipam_mail->initialize_mailer();
// generate url
$url = $Result->createURL() . create_link("temp_share", $_POST['code']);
// set subject
$subject = "New ipam share created";
// set html content
$content[] = "<table style='margin-left:10px;margin-top:5px;width:auto;padding:0px;border-collapse:collapse;'>";
$content[] = "<tr><td style='padding:5px;margin:0px;color:#333;font-size:16px;text-shadow:1px 1px 1px white;border-bottom:1px solid #eeeeee;'><font face='Helvetica, Verdana, Arial, sans-serif' style='font-size:16px;'>{$subject}</font></td></tr>";
$content[] = "<tr><td colspan='2'>Hi, new share was created on " . $User->settings->siteTitle . ", available on following address:</td></tr>";
$content[] = "<tr><td colspan='2'><a href='{$url}'><xmp>{$url}</xmp></a></td></tr>";
$content[] = "<tr><td colsapn='2'><br>Details:<br>" . implode("<br>", $tmp) . "<br></td></tr>";
$content[] = "<tr><td style='padding:5px;padding-left:15px;margin:0px;font-style:italic;padding-bottom:3px;text-align:right;color:#ccc;text-shadow:1px 1px 1px white;border-top:1px solid white;'><font face='Helvetica, Verdana, Arial, sans-serif' style='font-size:11px;'>Sent by user " . $User->user->real_name . " at " . date('Y/m/d H:i') . "</font></td></tr>";
//set al content
$content_plain[] = "{$subject}" . "\r\n------------------------------\r\n";
$content_plain[] = "Hi, new share was created on " . $User->settings->siteTitle . ", available on following address:\r\n " . $url;
$content_plain[] = "\r\nDetails: \r\n" . implode("\r\n", $tmp) . "\r\n";
$content_plain[] = "\r\n\r\n" . _("Sent by user") . " " . $User->user->real_name . " at " . date('Y/m/d H:i');
$content[] = "</table>";