• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP logInfo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中logInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP logInfo函数的具体用法?PHP logInfo怎么用?PHP logInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: init

function init()
{
    global $system;
    global $params;
    global $BD;
    global $labels;
    global $dbParams;
    global $usuario;
    global $requiereLogueo;
    global $noVerificarCambioPass;
    global $nivel;
    global $urlVolver;
    // Leo las propiedades de los archivos de configuracion
    $system = obtProperties("system.properties");
    $labels = obtProperties("labels.properties");
    $dbParams = obtProperties("bd.properties");
    // Consigo la conexion con la base de datos
    $BD = new BDCon($dbParams);
    // Leo los parametros de configuracion de la base de datos
    $params = Parametro::obtTodos($BD);
    $usuario = new Usuario();
    // Cargo la sesion, si es que hay
    $usuario->cargarSesion($BD);
    if ($requiereLogueo && (!$usuario->logueado() || !$usuario->tieneAcceso($nivel))) {
        logInfo("Intento de acceso a '" . $system["URL_BASE"] . $urlVolver . "'." . "Redirrecionado a '" . $system["URL_SINACCESO"] . "'.");
        redirect($system["URL_SINACCESO"]);
        return false;
    }
    if (!$noVerificarCambioPass && $usuario->getCambiarPass() == 'S') {
        redirect($system["URL_CAMBIAR"]);
    }
    return true;
}
开发者ID:agusarias,项目名称:baseweb,代码行数:33,代码来源:util.php


示例2: logMessage

function logMessage($logLevel)
{
    if ($logLevel == 'info') {
        return logInfo();
    } elseif ($logLevel == 'error') {
        return logError();
    } else {
        return "[UNK], '{$logLevel}' is unknown.";
    }
}
开发者ID:anthony87burns,项目名称:codeup-web-exercises,代码行数:10,代码来源:logger.php


示例3: logInfo

	/**
	 * logInfo
	 * to help debugging Payment notification for example
	 * Keep it for compatibilty
	 */
	protected function logInfo ($text, $type = 'message', $doLog=false) {
		if (!class_exists( 'VmConfig' )) require(JPATH_COMPONENT_ADMINISTRATOR .'/helpers/config.php');
		VmConfig::loadConfig();
		if ((isset($this->_debug) and $this->_debug) OR $doLog) {
			$oldLogFileName= 	VmConfig::$logFileName;
			VmConfig::$logFileName =$this->getLogFileName() ;
			logInfo($text, $type);
			VmConfig::$logFileName =$oldLogFileName;
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:15,代码来源:vmpsplugin.php


示例4: parseUrlReal

    exit;
}
///Parse the URL and retrieve the PageID of the request page if its valid
$pageId = parseUrlReal($pageFullPath, $pageIdArray);
///Means that the requested URL is not valid.
if ($pageId === false) {
    define("TEMPLATE", getPageTemplate(0));
    $pageId = parseUrlReal("home", $pageIdArray);
    $TITLE = CMS_TITLE;
    $MENUBAR = '';
    $CONTENT = "The requested URL was not found on this server.<br />{$_SERVER['SERVER_SIGNATURE']}" . "<br /><br />Click <a href='" . $urlRequestRoot . "'>here </a> to return to the home page";
    templateReplace($TITLE, $MENUBAR, $ACTIONBARMODULE, $ACTIONBARPAGE, $BREADCRUMB, $SEARCHBAR, $PAGEKEYWORDS, $INHERITEDINFO, $CONTENT, $FOOTER, $DEBUGINFO, $ERRORSTRING, $WARNINGSTRING, $INFOSTRING, $STARTSCRIPTS, $LOGINFORM);
    exit;
}
///If it reaches here, means the page requested is valid. Log the information for future use.
logInfo(getUserEmail($userId), $userId, $pageId, $pageFullPath, getPageModule($pageId), $action, $_SERVER['REMOTE_ADDR']);
///The URL points to a file. Download permissions for the file are handled inside the download() function in download.lib.php
if (isset($_GET['fileget'])) {
    require_once $sourceFolder . "/download.lib.php";
    $action = "";
    if (isset($_GET['action'])) {
        $action = $_GET['action'];
    }
    download($pageId, $userId, $_GET['fileget'], $action);
    exit;
}
///Check whether the user has the permission to use that action on the requested page.
$permission = getPermissions($userId, $pageId, $action);
///Gets the page-specific template for that requested page
define("TEMPLATE", getPageTemplate($pageId));
///Gets the page title of the requested page
开发者ID:ksb1712,项目名称:pragyan,代码行数:31,代码来源:index.php


示例5: logMessage

<?php

function logMessage($logLevel, $message)
{
    $fileDate = date('Y-m-d');
    $filename = "log-{$fileDate}.log";
    $logDate = date('Y-m-d H:i:s');
    $string = $logDate . ' [' . $logLevel . '] ' . $message . PHP_EOL;
    if (file_exists($filename)) {
        file_put_contents($filename, $string, FILE_APPEND);
    } else {
        file_put_contents($filename, $string);
    }
}
logMessage("INFO", "This is an info message.");
logMessage("ERROR", "This is an error message.");
function logInfo($message)
{
    $logLevel = "INFO";
    logMessage($logLevel, $message);
}
logInfo("Today is Monday.");
function logError($message)
{
    $logLevel = "ERROR";
    logMessage($logLevel, $message);
}
logError("logError() && logInfo() functions are useless.");
开发者ID:j-beere,项目名称:Codeup_Exercises,代码行数:28,代码来源:logger.php


示例6: logMessage

<?php

function logMessage($logLevel, $message)
{
    $date = date("Y-m-d H:i:s");
    $string_to_append = PHP_EOL . "{$date} [{$logLevel}] {$message}";
    $file = 'log-YYYY-MM-DD.log';
    $handle = fopen($file, 'a');
    fwrite($handle, $string_to_append);
    fclose($handle);
}
function logInfo($info)
{
    logMessage("INFO", "{$info}");
}
function logError($info)
{
    logMessage("ERROR", $info);
}
// logMessage("INFO", "This is an info message.");
// logMessage("ERROR", "This is an ERRORRRRRRRR message.");
logInfo("woot it worked");
logError("woot its now messed up");
开发者ID:sprov03,项目名称:Codeup-Web-Exercises,代码行数:23,代码来源:logger.php


示例7: webhook

 public function webhook()
 {
     header("Content-type: text/html; charset=utf-8");
     $appId = C('PAYMENT_APP_ID');
     $appSecret = C('PAYMENT_APP_SECRET');
     $jsonStr = file_get_contents("php://input");
     logInfo('ReturnJson:' . $jsonStr);
     //$jsonStr = file_get_contents(dirname(__FILE__)."/refund_json111.txt");
     $msg = json_decode($jsonStr);
     // webhook字段文档: http://beecloud.cn/doc/php.php#webhook
     // 验证签名
     $sign = md5($appId . $appSecret . $msg->timestamp);
     if ($sign != $msg->sign) {
         // 签名不正确
         logWarn('Signature incorrect.');
         exit;
     }
     // 此处需要验证购买的产品与订单金额是否匹配:
     // 验证购买的产品与订单金额是否匹配的目的在于防止黑客反编译了iOS或者Android app的代码,
     // 将本来比如100元的订单金额改成了1分钱,开发者应该识别这种情况,避免误以为用户已经足额支付。
     // Webhook传入的消息里面应该以某种形式包含此次购买的商品信息,比如title或者optional里面的某个参数说明此次购买的产品是一部iPhone手机,
     // 开发者需要在客户服务端去查询自己内部的数据库看看iPhone的金额是否与该Webhook的订单金额一致,仅有一致的情况下,才继续走正常的业务逻辑。
     // 如果发现不一致的情况,排除程序bug外,需要去查明原因,防止不法分子对你的app进行二次打包,对你的客户的利益构成潜在威胁。
     // 如果发现这样的情况,请及时与我们联系,我们会与客户一起与这些不法分子做斗争。而且即使有这样极端的情况发生,
     // 只要按照前述要求做了购买的产品与订单金额的匹配性验证,在你的后端服务器不被入侵的前提下,你就不会有任何经济损失。
     if ($msg->transactionType == "PAY") {
         //messageDetail 参考文档
         switch ($msg->channelType) {
             case "WX":
                 $this->commonPayCallbackProcess($msg);
                 break;
             case "ALI":
                 $this->commonPayCallbackProcess($msg);
                 break;
             case "UN":
                 break;
         }
     } else {
         if ($msg->transactionType == "REFUND") {
             $this->refundCallbackProcess($msg);
         }
     }
     //处理消息成功,不需要持续通知此消息返回success
     echo 'success';
 }
开发者ID:Conscivirus-producer,项目名称:starball,代码行数:45,代码来源:PaymentController.class.php


示例8: logMessage

<?php

function logMessage($logLevel, $message)
{
    $today = date("Y-m-d");
    $filename = 'log-' . $today . 'log';
    $todayLog = date("Y-m-d h:i:s");
    $handle = fopen($filename, 'a');
    fwrite($handle, $todayLog . ' ' . $logLevel . ' ' . $message . PHP_EOL);
    fclose($handle);
}
function logInfo($message)
{
    logMessage("INFO", $message);
}
function logError($message)
{
    logMessage("ERROR", $message);
}
// logMessage("INFO", "This is an info message.");
logInfo("This is an info message");
// logMessage("ERROR", "This is an error message.");
logError("This is an error message");
开发者ID:sshaikh210,项目名称:Codeup-Web-Exercises,代码行数:23,代码来源:logger.php


示例9: logInfo

 /**
  * logInfo
  * to help debugging Payment notification for example
  * Keep it for compatibilty
  */
 protected function logInfo($text, $type = 'message', $doLog = false)
 {
     if (!class_exists('VmConfig')) {
         require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
     }
     VmConfig::loadConfig();
     if (isset($this->_debug) and $this->_debug or $doLog) {
         $oldLogFileName = VmConfig::$logFileName;
         VmConfig::$logFileName = $this->getLogFileName();
         logInfo($text, $type);
         VmConfig::$logFileName = $oldLogFileName;
     }
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:18,代码来源:vmpsplugin.php


示例10: createGameObject

/**
* This method creates a game object that is good for one game session. Everytime a game object is created, it is all random.
* The twitter users, their tweet, all random. 
*
* NOTE: This method logs a bunch of stuff in a new live log html file called "gameSelectionLogs.html". This is done 
*       because even though the game object is created there is a minor glitch in creation of the game object. Some 
*       Tweets do not work when doing json_decode ("enigma-bug"). Sometiumes it works sometimes it doesnt. 
*
* @return gameObject :: A json form string that could be converted into json in JS easily.
*/
function createGameObject()
{
    // Get random 10 Twitter Users
    $twitterUsers = getRandomTwitterUsers(10);
    // Get Connection Link
    $link = getConnection();
    $correct = array();
    $incorrect = array();
    $userKeys = array();
    foreach ($twitterUsers as $user) {
        // Select a random number between 1 and 200
        $rand = mt_rand(1, 200);
        logInfo("gameSelectionLogs.html", "Grabbing Tweet Number: " . $rand . " for Twitter User: " . $user . " from the DB.");
        $query = "SELECT TwitterResp FROM Tweets WHERE Number = " . (string) $rand . " AND TwitterHandle = \"" . $user . "\";";
        $res = mysqli_query($link, $query);
        $row = $res->fetch_array();
        // Get the textual tweet response form the DB
        $twitterResp = $row[0];
        // Convert that text to associative array
        $twitterRespJson = json_decode($twitterResp, true, 200000);
        // Creating a new user variable jsut in case the last one fails
        $newUser = $user;
        // If it fails...
        while ($twitterRespJson == null) {
            logError("gameSelectionLogs.html", "Conversion of Tweet Response text from DB to JSON in PHP failed.");
            logInfo("gameSelectionLogs.html", "Finding a new random Twitter User for the game...");
            // Get new random twitter user
            $newUser = getRandomTwitterUsers(1);
            $newUser = $newUser[0];
            // Select a random number between 1 and 200
            $rand = mt_rand(1, 200);
            logInfo("gameSelectionLogs.html", "Grabbing Tweet Number: " . $rand . " for Twitter User: " . $newUser . " from the DB.");
            $query = "SELECT TwitterResp FROM Tweets WHERE Number = " . (string) $rand . " AND TwitterHandle = \"" . $newUser . "\";";
            $res = mysqli_query($link, $query);
            $row = $res->fetch_array();
            // Grab the Twitter Response as text from the DB
            $twitterResp = $row[0];
            $twitterRespJson = json_decode($twitterResp, true, 20000);
        }
        logSuccess("gameSelectionLogs.html", "User: " . $newUser . " with Tweet Number: " . $rand . " has been selected for the game.");
        // If Everything went OK
        if ($twitterResp != "") {
            $response = $twitterRespJson;
            $userObj = array('name' => $response['user']['name'], 'handle' => '@' . $response['user']['screen_name'], 'profilePicURL' => str_replace("_normal", "", $response['user']['profile_image_url']), 'followURL' => "https://twitter.com/intent/follow?screen_name=" . '@' . $response['user']['screen_name']);
            //var_dump($userObj);
            $tweetObj = array('tweetID' => $response['id'], 'tweetDate' => $response['created_at'], 'tweetHTML' => getTweetHTML($response), 'tweetText' => $response['text'], 'numOfRetweets' => $response['retweet_count'], 'numOfFavorites' => $response['favorite_count']);
            $unit = array('userInfo' => $userObj, 'tweetInfo' => $tweetObj);
            array_push($userKeys, $response['user']['screen_name']);
            $correct[$response['user']['screen_name']] = $unit;
        }
    }
    logInfo("gameSelectionLogs.html", "'Correct' part of the game object has been COMPLETED. Starting the construction of 'incorrect' part of the game object.");
    $incorrect = array();
    // Variable to log the final Game Layout.
    $gameObjectLog = "";
    foreach ($correct as $unit) {
        $rand = $rand = mt_rand(0, count($userKeys) - 1);
        // Swap that random number with the last user in the userKeys array
        if (count($userKeys) != 0) {
            $temp = $userKeys[count($userKeys) - 1];
            $userKeys[count($userKeys) - 1] = $userKeys[$rand];
            $userKeys[$rand] = $temp;
        }
        // get random tweet user
        $randomTwitterUser = array_pop($userKeys);
        $gameObjectLog = $gameObjectLog . '<b>' . substr($unit['userInfo']['handle'], 1) . '</b> has <b>' . $randomTwitterUser . '\'s</b> tweet infront of him/her in the game. <br>';
        // Select that random tweet from the correct part of game object and add in current incorrect unit
        $incorrect[substr($unit['userInfo']['handle'], 1)]['userInfo'] = $correct[substr($unit['userInfo']['handle'], 1)]['userInfo'];
        $incorrect[substr($unit['userInfo']['handle'], 1)]['tweetInfo'] = $correct[$randomTwitterUser]['tweetInfo'];
    }
    // Game object construction
    $gameObject = array('correct' => $correct, 'incorrect' => $incorrect);
    logSuccess("gameSelectionLogs.html", "Game Object Creation Successful. <br><u>GAME INFO:</u><br>" . $gameObjectLog);
    logInfo("gameSessionObjects.txt", json_encode($gameObject));
    return json_encode($gameObject);
}
开发者ID:vreddi,项目名称:twitterGame,代码行数:86,代码来源:gameObject.php


示例11: chdir

<?php

/**
 * DESCRIPCION
 * 
 * @author Agustin Arias <[email protected]>
 */
chdir("..");
include_once 'util/includes.php';
include_once 'util/util.php';
$usuario = new Usuario();
$username = $_POST["username"] ? $_POST["username"] : 'aarias';
$pass = $_POST["pass"] ? $_POST["pass"] : '';
if ($usuario->login($username, $pass, $BD)) {
    logInfo("Login. Usuario: {$username}");
    $ret["e"] = "OK";
} else {
    logInfo("Fallo login. Usuario: {$username}");
    $ret["e"] = "ERROR";
    $ret["error"] = "<B>Lo sentimos.</B> La combinaci&oacute;n de usuario y contrase&ntilde;a no es correcta.";
}
echo json_encode($ret);
开发者ID:agusarias,项目名称:baseweb,代码行数:22,代码来源:Login.php


示例12: testLogShoppingList

 protected function testLogShoppingList()
 {
     $shoppingList = session('shoppingList');
     logInfo('shoppingList  totalItemCount:' . $shoppingList['totalItemCount'] . ',totalAmount:' . $shoppingList['totalAmount']);
     $shoppingListItems = session('shoppingListItems');
     logInfo('shoppingListItems:');
     foreach ($shoppingListItems as $value) {
         logInfo('itemId:' . $value['itemId'] . ',itemSize:' . $value['itemSize'] . ',itemName:' . $value['itemName'] . ',brandName:' . $value['brandName'] . ',itemImage:' . $value['itemImage'] . ',itemColor:' . $value['itemColor'] . ',sizeDescription:' . $value['sizeDescription'] . ',price:' . $value['price'] . ',quantity:' . $value['quantity']);
     }
 }
开发者ID:Conscivirus-producer,项目名称:starball,代码行数:10,代码来源:BaseController.class.php


示例13: _processCommand

 protected function _processCommand()
 {
     $this->repoPath = $this->reposPath . DIRECTORY_SEPARATOR . $this->repoName;
     if ($this->gitCommand == 'git-annex-shell') {
         if (!$this->config->gitAnnexEnabled()) {
             Exception::throwException(30002, [$this->gitCommand, $this->user['name']]);
         }
     } else {
         logInfo("find-shell: executing git command '{$this->gitCommand} {$this->repoPath} by " . $this->user['name'] . ".", $this->config->commonLogFile());
         $this->_runCommand($this->gitCommand, array($this->repoPath));
     }
 }
开发者ID:johnnyeven,项目名称:operation.php.shell,代码行数:12,代码来源:FindShell.php


示例14: date_default_timezone_set

date_default_timezone_set("America/Chicago");
function logMessage($logLevel, $message)
{
    $todaysDate = date("Y-m-d");
    $todaysDateTime = date("h:i:s A");
    $filename = "log-{$todaysDate}.log";
    $handle = fopen($filename, 'a');
    $formattedMessage = $todaysDate . " " . $todaysDateTime . " " . $logLevel . " " . $message . PHP_EOL;
    fwrite($handle, $formattedMessage);
    fclose($handle);
}
function logInfo($message)
{
    logMessage("INFO", $message);
}
function logError($message)
{
    logMessage("ERROR", $message);
}
function logWarning($message)
{
    logMessage("WARNING", $message);
}
function logCritical($message)
{
    logMessage("CRITICAL", $message);
}
logInfo("This is an INFO message.");
logError("This is an ERROR message.");
logWarning("This is a WARNING message.");
logCritical("This is a CRITICAL message.");
开发者ID:ZeshanNSegal,项目名称:Codeup-Web-Exercises,代码行数:31,代码来源:logger.php


示例15: logInfo

///       local DB for the Game Object.
///
/// Author: Vishrut Reddi
/// MidnightJabber (c) 2015 - 2016
// Got it from: https://github.com/themattharris/tmhOAuth
require 'tmhOAuth.php';
//Connect Connection Script
include "connection.php";
// To log data
include "logger.php";
// Use the data from http://dev.twitter.com/apps to fill out this info
// notice the slight name difference in the last two items)
// Log a new session start
logInfo('tweetylogs.txt', 'New Session Starting.');
logInfo('info.txt', 'New Session Starting.');
logInfo('tweetylogs.html', '<b>New Session Starting</b>');
insertTweetInDB();
//getTweet('@katyperry', 200);
/**
* This method retreives all the Twitter user handles from the local DB (midnight_tweety).
* All the handles exist inside the table 'TwitterUsers'.
*
* NOTE: Each handle has '@' infront of it.
*       Each handle is a string and not an object containing a string.
*
* @return JSON OBJ {"result": [ __Array_of_handles__]}
*/
function getAllTwitterUsers()
{
    $query = "SELECT TwitterHandle FROM TwitterUsers ORDER BY UserID;";
    // Execute the query
开发者ID:vreddi,项目名称:twitterGame,代码行数:31,代码来源:refreshData.php


示例16: sendSubscriptionMail

 public function sendSubscriptionMail()
 {
     $res = array("status" => "0");
     $itemId = I('itemId');
     $itemSubscription = D('ItemSubscription', 'Logic');
     $subscriptionList = $itemSubscription->queryByItemId($itemId);
     $item = D('Item', 'Logic')->findById($itemId);
     $userInfo['userName'] = '顾客';
     $sentSbuscriptions = array();
     foreach ($subscriptionList as $subscription) {
         if ($subscription['status'] == '1') {
             //状态为1的已经发了邮件
             continue;
         }
         $userInfo['email'] = $subscription['email'];
         if (sendMailNewVersion($item, "itemSubscription", $userInfo)) {
             array_push($sentSbuscriptions, $subscription['subscriptionId']);
         }
     }
     if (!empty($sentSbuscriptions)) {
         logInfo('fk222');
         $itemSubscription->batchUpdateStatus($sentSbuscriptions);
         $res['status'] = '1';
     }
     echo json_encode($res);
 }
开发者ID:Conscivirus-producer,项目名称:starball,代码行数:26,代码来源:ItemController.class.php


示例17: sendMailNewVersion


//.........这里部分代码省略.........
        $address = parseAddressCode($address);
        $template = "";
        $template = $template . "<p>尊敬的" . $userInfo["userName"] . ":</p>";
        $template = $template . "<p>非常感谢您对StarBall.Kids的支持,您的订单下单时间为" . date('y-m-d H:i:s', time()) . ",您的订单号码为" . $mailContent["orderNumber"] . "。</p>";
        $template = $template . "<p>我们正在打包您的包裹。当您的包裹开始邮寄时,您将会收到另一封邮件,包含您的包裹追踪号码。您可以登录快递公司官方网站,输入您的包裹追踪号码进而跟踪您的商品。</p>";
        $template = $template . "<p>您的订单详情: </p>";
        $currency = C('CURRENCY');
        $tableContent = "";
        $tableContent = $tableContent . "<table width='600' cellpadding='0' cellspacing='0' style='border: 1px #F2F2F2 solid; background-color: #F8F8F8'><tbody>\n\t\t<tr><td>描述</td><td>数量</td><td>尺寸</td><td>价钱(" . $currency[$mailContent['currency']] . ")</td></tr>";
        foreach ($mailContent['orderItems'] as $orderItem) {
            $tableContent = $tableContent . "<tr><td>" . $orderItem['itemName'] . "</td><td>" . $orderItem['quantity'] . "</td><td>" . $orderItem['sizeDescription'] . "</td><td>" . $orderItem['price'] . "</td></tr>";
        }
        $tableContent = $tableContent . "<tr><td>商品总计</td><td>-</td><td>-</td><td>" . $mailContent['totalAmount'] . "</td></tr>";
        $tableContent = $tableContent . "<tr><td>运费</td><td>-</td><td>-</td><td>" . $mailContent['shippingFee'] . "</td></tr>";
        $tableContent = $tableContent . "<tr><td>礼品包装费用</td><td>-</td><td>-</td><td>" . $mailContent['giftPackageFee'] . "</td></tr>";
        $tableContent = $tableContent . "<tr><td>总金额</td><td>-</td><td>-</td><td>" . $mailContent['totalFee'] . "</td></tr>";
        $tableContent = $tableContent . "</tbody></table>";
        $template = $template . $tableContent;
        if ($mailContent['addtionalGreetings'] != '') {
            $template = $template . "<p>礼品包装祝福信息:" . $mailContent['addtionalGreetings'] . "</p>";
        }
        $template = $template . "<p>您提供的收货地址:</p>";
        $template = $template . "<p>" . $address['address'] . "<p>";
        if ($address['postCode'] != '') {
            $template = $template . " " . $address['postCode'];
        }
        if ($address['city'] != '') {
            $template = $template . " " . $address['city'];
        }
        if ($address['province'] != '') {
            $template = $template . ' ' . $address['province'];
        }
        $template = $template . ' ' . $address['country'] . '<br></p>';
        $template = $template . "收货人姓名:" . $address['contactName'] . ' 电话:' . $address['phone'];
        $template = $template . "<p><img src='http://7xr7p7.com2.z0.glb.qiniucdn.com/1660857294.jpg' width='80' height='51'></p>";
        $template = $template . "<p>StarBall.Kids是一家来自香港的婴幼儿品牌集合店,主营进口婴幼儿童服装,这里有世界各地的大牌潮牌衣服供您选择。</p>";
        $template = $template . "<p>联系我们:邮件([email protected])</p>";
        $mail->Subject = 'StarballKids支付成功通知-订单号' . $mailContent["orderNumber"];
        $mail->Body = $template;
    } elseif ($type == "delivered") {
        $address = D('ShippingAddress', 'Logic')->getDefaultAddress($mailContent['userId']);
        $address = parseAddressCode($address);
        $mail->Subject = 'StarballKids发货通知-订单号' . $mailContent["orderNumber"];
        $template = "";
        $template = $template . "<p>尊敬的" . $userInfo["userName"] . ":</p>";
        $template = $template . "<p>很高兴的通知您,您的订单" . $mailContent["orderNumber"] . "已经发货了。</p>";
        $template = $template . "<p>您的订单详情:</p>";
        $currency = C('CURRENCY');
        $tableContent = "";
        $tableContent = $tableContent . "<table width='600' cellpadding='0' cellspacing='0' style='border: 1px #F2F2F2 solid; background-color: #F8F8F8'><tbody>\n\t\t<tr><td>描述</td><td>数量</td><td>尺寸</td><td>价钱(" . $currency[$mailContent['currency']] . ")</td></tr>";
        foreach ($mailContent['orderItems'] as $orderItem) {
            $tableContent = $tableContent . "<tr><td>" . $orderItem['itemName'] . "</td><td>" . $orderItem['quantity'] . "</td><td>" . $orderItem['sizeDescription'] . "</td><td>" . $orderItem['price'] . "</td></tr>";
        }
        $tableContent = $tableContent . "<tr><td>商品总计</td><td>-</td><td>-</td><td>" . $mailContent['totalAmount'] . "</td></tr>";
        $tableContent = $tableContent . "<tr><td>运费</td><td>-</td><td>-</td><td>" . $mailContent['shippingFee'] . "</td></tr>";
        $tableContent = $tableContent . "<tr><td>礼品包装费用</td><td>-</td><td>-</td><td>" . $mailContent['giftPackageFee'] . "</td></tr>";
        $tableContent = $tableContent . "<tr><td>总金额</td><td>-</td><td>-</td><td>" . $mailContent['totalFee'] . "</td></tr>";
        $tableContent = $tableContent . "</tbody></table>";
        $template = $template . $tableContent;
        $template = $template . "<p>您可以登录快递公司的官方网站,输入您的包裹追踪号码来跟踪您的商品。</p>";
        $template = $template . "<p>您的快递公司:" . $mailContent["expressName"] . "</p>";
        $template = $template . "<p>您的包裹追踪号码:" . $mailContent["expressNumber"] . "</p>";
        $template = $template . "<p>您提供的收货地址:</p>";
        $template = $template . "<p>" . $address['address'];
        if ($address['city'] != '') {
            $template = $template . " " . $address['city'];
        }
        if ($address['province'] != '') {
            $template = $template . ' ' . $address['province'];
        }
        $template = $template . ' ' . $address['country'] . '<br></p>';
        $template = $template . "<p>有关于商品退换货事宜,请查看官网 www.starballkids.com 主页下方的退换政策了解详情。或联系我们的客服微信 starballkidshk. 我们会在第一时间给您回复并处理相关事宜。</p>";
        $template = $template . "<p>非常感谢您选择StarBall.Kids,相信是一次愉快的购物体验。希望很快再见到您,谢谢光临。</p>";
        $template = $template . "<p><img src='http://7xr7p7.com2.z0.glb.qiniucdn.com/1660857294.jpg' width='80' height='51'></p>";
        $template = $template . "<p>StarBall.Kids是一家来自香港的婴幼儿品牌集合店,主营进口婴幼儿童服装,这里有世界各地的大牌潮牌衣服供您选择。</p>";
        $template = $template . "<p>联系我们:邮件([email protected])</p>";
        $mail->Body = $template;
        $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
    } else {
        if ($type == 'itemSubscription') {
            $mail->Subject = 'StarballKids到货通知';
            $template = "";
            $template = $template . "<p>尊敬的顾客:</p>";
            $template = $template . "<p>很高兴的通知您,您喜爱的商品 " . $mailContent['name'] . " 现货已登陆StarBall.Kids官方网站。库存有限,立即行动吧。</p>";
            $template = $template . "<p>点击下方链接进行购买</p>";
            $template = $template . "<p>http://www.starballkids.com/Starball/Item/index/itemId/" . $mailContent['itemId'] . ".html</p>";
            $template = $template . "<p>我们的官方网站 www.starballkids.com 还有更多选择,欢迎浏览购买,相信会是一次愉快的购物体验。感谢您对StarBall.Kids的支持。</p>";
            $template = $template . "<p><img src='http://7xr7p7.com2.z0.glb.qiniucdn.com/1660857294.jpg' width='80' height='51'></p>";
            $template = $template . "<p>StarBall.Kids是一家来自香港的婴幼儿品牌集合店,主营进口婴幼儿童服装,这里有世界各地的大牌潮牌衣服供您选择。</p>";
            $mail->Body = $template;
            $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
        }
    }
    if (!$mail->send()) {
        //echo 'Message could not be sent.';
        logInfo('Mailer Error: ' . $mail->ErrorInfo);
        return false;
    }
    return true;
}
开发者ID:Conscivirus-producer,项目名称:starball,代码行数:101,代码来源:function.php


示例18: cancelSingleOrderItem

 public function cancelSingleOrderItem()
 {
     $orderItemLogic = D("OrderItem", "Logic");
     $res = array("status" => "0", "needOpenNewWindow" => 'false');
     $id = I("post.cancelId", "");
     if ($id == "") {
         echo json_encode($res);
         return;
     }
     //找到支付成功的bill记录
     $orderItem = D('OrderItem', 'Logic')->getOrderItemById($id);
     $order = D('Order', 'Logic')->findByOrderId($orderItem['orderId']);
     $orderNumber = $order['orderNumber'];
     $orderBill = D('OrderBill', 'Logic')->findOrderSuccessPayBill($orderNumber);
     //向第三方支付发起退款请求
     $data = array();
     $appSecret = C('PAYMENT_APP_SECRET');
     $data["app_id"] = C('PAYMENT_APP_ID');
     $data["timestamp"] = time() * 1000;
     $data["app_sign"] = md5($data["app_id"] . $data["timestamp"] . $appSecret);
     //bill_no为支付成功的支付单号
     $data["bill_no"] = $orderBill['billNumber'];
     //商户退款单号,格式为:退款日期(8位) + 流水号(3~24 位)。请自行确保在商户系统中唯一,且退款日期必须是发起退款的当天日期,同一退款单号不可重复提交,否则会造成退款单重复。流水号可以接受数字或英文字符,建议使用数字,但不可接受“000”
     $data["refund_no"] = date("Ymd") . $data["timestamp"];
     $data["refund_fee"] = intval($orderItem['price'] * 100);
     //选择渠道类型(WX、WX_APP、WX_NATIVE、WX_JSAPI、ALI、ALI_APP、ALI_WEB、ALI_QRCODE、UN、UN_APP、UN_WEB)
     $data["channel"] = $orderBill['channel'];
     //选填 optional
     $data["optional"] = json_decode(json_encode(array("tag" => "msgtoreturn")));
     //创建退款的数据库记录,t_orderbill
     $billData['orderNumber'] = $orderNumber;
     $billData['billNumber'] = $data["bill_no"];
     $billData['refundNumber'] = $data["refund_no"];
     //只有退单个商品时才有值
     $billData['orderItemId'] = $orderItem['id'];
     $billData['totalAmount'] = $data["refund_fee"] / 100;
     $billData['channel'] = $data["channel"];
     $billData['type'] = 'REFUND';
     $billData['status'] = 'N';
     D('OrderBill', 'Logic')->createBill($billData);
     //$this->createOrderBill($data, $orderNumber, $data["channel"], 'REFUND');
     if (C('IS_DEV') == 'false') {
         //本地测试不用向第三方发送请求
         Vendor("beecloud.autoload");
         $result = \beecloud\rest\api::refund($data);
         if ($result->result_code != 0 || $result->result_msg != "OK") {
             echo json_encode($result->err_detail);
             logInfo('errorDetail:' . $result->err_detail);
             exit;
         }
     }
     if (D('OrderItem', 'Logic')->cancelSingleOrderItem($id)) {
         $res["status"] = "1";
     }
     if ($result->url != '') {
         $res["url"] = $result->url;
         $res["needOpenNewWindow"] = 'true';
     }
     echo json_encode($res);
 }
开发者ID:Conscivirus-producer,项目名称:starball,代码行数:60,代码来源:OrderController.class.php


示例19: renderCustomfieldsFE


//.........这里部分代码省略.........
                                     $productCustom->text = tsmText::sprintf($productCustom->customfield_value, $price);
                                 } else {
                                     $productCustom->text = $trValue . ' ' . $price;
                                 }
                             }
                         }
                         $customfields[$selectList[$customfield->virtuemart_custom_id]]->display = JHtml::_($selectType, $customfields[$selectList[$customfield->virtuemart_custom_id]]->options, $customfields[$selectList[$customfield->virtuemart_custom_id]]->customProductDataName, $class, 'virtuemart_customfield_id', 'text', $default->customfield_value, $idTag);
                         //*/
                     } else {
                         if ($type == 'M') {
                             $customfield->display = VirtueMartModelCustomfields::displayCustomMedia($customfield->customfield_value, 'product', $customfield->width, $customfield->height);
                         } else {
                             $customfield->display = tsmText::_($customfield->customfield_value);
                         }
                     }
                 }
                 break;
                 // Property
             // Property
             case 'P':
                 //$customfield->display = vmText::_ ('COM_VIRTUEMART_'.strtoupper($customfield->customfield_value));
                 $attr = $customfield->customfield_value;
                 $lkey = 'COM_VIRTUEMART_' . strtoupper($customfield->customfield_value) . '_FE';
                 $trValue = tsmText::_($lkey);
                 $options[] = array('value' => 'product_length', 'text' => tsmText::_('COM_VIRTUEMART_PRODUCT_LENGTH'));
                 $options[] = array('value' => 'product_width', 'text' => tsmText::_('COM_VIRTUEMART_PRODUCT_WIDTH'));
                 $options[] = array('value' => 'product_height', 'text' => tsmText::_('COM_VIRTUEMART_PRODUCT_HEIGHT'));
                 $options[] = array('value' => 'product_weight', 'text' => tsmText::_('COM_VIRTUEMART_PRODUCT_WEIGHT'));
                 $dim = '';
                 if ($attr == 'product_length' or $attr == 'product_width' or $attr == 'product_height') {
                     $dim = $product->product_lwh_uom;
                 } else {
                     if ($attr == 'product_weight') {
                         $dim = $product->product_weight_uom;
                     }
                 }
                 if (!isset($product->{$attr})) {
                     logInfo('customfield.php: case P, property ' . $attr . ' does not exists. virtuemart_custom_id: ' . $customfield->virtuemart_custom_id);
                     break;
                 }
                 $val = $product->{$attr};
                 if ($customfield->round != '') {
                     $val = round($val, $customfield->round);
                 }
                 if ($lkey != $trValue and strpos($trValue, '%1') !== false) {
                     $customfield->display = tsmText::sprintf($customfield->customfield_value, $val, $dim);
                 } else {
                     if ($lkey != $trValue) {
                         $customfield->display = $trValue . ' ' . $val;
                     } else {
                         $customfield->display = tsmText::_('COM_VIRTUEMART_' . strtoupper($customfield->customfield_value)) . ' ' . $val . $dim;
                     }
                 }
                 break;
             case 'Z':
                 if (emp 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP logMessage函数代码示例发布时间:2022-05-15
下一篇:
PHP logIO函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap