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


PHP Invoice::Load方法代码示例

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


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

示例1: Load

 /**
  * Load Order from database
  *
  * @param integer $id
  * @return Order
  */
 public static function Load($id)
 {
     $db = Core::GetDBInstance();
     $dborder = $db->GetRow("SELECT * FROM orders WHERE id=?", array($id));
     if (!$dborder) {
         throw new ApplicationException(sprintf(_("Order with id = '%s' not found in database"), $id));
     }
     $Order = new Order($dborder["userid"]);
     $Order->Description = sprintf(_("%s Order #%s"), CONFIG::$COMPANY_NAME, $id);
     $Order->ID = $id;
     $invoices = $db->Execute("SELECT id FROM invoices WHERE orderid=?", array($id));
     while ($invoice = $invoices->FetchRow()) {
         $Order->Invoices[] = Invoice::Load($invoice['id']);
     }
     return $Order;
 }
开发者ID:rchicoria,项目名称:epp-drs,代码行数:22,代码来源:class.Order.php

示例2: sprintf

			{
				$okmsg = sprintf(_("%d invoices rejected"), $i);
				CoreUtils::Redirect($_SERVER["HTTP_REFERER"]);
			}
		}
		elseif ($post_action == "del")
		{
			//
			// Delete invoices
			//
			$i = 0;
			foreach ((array)$post_id as $k=>$invoiceid)
			{
				try
				{
					Invoice::Load($invoiceid)->Delete();
					$i++;	
				}
				catch(Exception $e)
				{
					if (preg_match('/Domain ID=\d+ not found in database/i', $e->getMessage()))
					{
						$db->Execute('DELETE FROM invoices WHERE id=?', array($invoiceid));
						$i++;
					}
				}
			}
			
			$okmsg = sprintf(_("%d invoices deleted."), $i);
			CoreUtils::Redirect($_SERVER["HTTP_REFERER"]);
		}
开发者ID:rchicoria,项目名称:epp-drs,代码行数:31,代码来源:inv_view.php

示例3: _

<?

	require_once('src/prepend.inc.php');

	if (!$get_id)
	{
		echo _("Cannot find invoice with this ID!");
		exit();
	}	
		
	try
	{
		$Invoice = Invoice::Load($req_id);
		if ($Invoice->UserID != $_SESSION["userid"])
		{
			$errmsg = "You don't have permissions to manage this invoice";
			CoreUtils::Redirect("inv_view.php");
		}
		
		if ($Invoice->OrderID)
			$Order = Order::Load($Invoice->OrderID);
	}
	catch(Exception $e)
	{
		
	}
	
	if (!$Order && !$Invoice)
	{
		$errmsg = _("No payable invoices found");
		CoreUtils::Redirect("index.php");
开发者ID:rchicoria,项目名称:epp-drs,代码行数:31,代码来源:inv_print.php

示例4: array

							
							$invoiceid = $Invoice->ID;			
						}
						catch(Exception $e)
						{
							$errmsg = $e->getMessage();
						}
					}// if check inf
					
					if ($invoiceid)
					{
						$userinfo = $db->GetRow("SELECT * FROM users WHERE id=?", array($Domain->UserID));
						$args = array(
							"domain_name"	=> $Domain->Name, 
							"extension"		=> $Domain->Extension,
							"Invoice"		=> Invoice::Load($invoiceid),
							"expDays"		=> $Domain->DaysBeforeExpiration,
							"client"		=> $userinfo
						);
						mailer_send("renew_notice.eml", $args, $userinfo["email"], $userinfo["name"]);
						$okmsg = _("Notification successfully sent");
						CoreUtils::Redirect("domains_view.php");
					}
					
					break;
			}
		}
	}	


	$display["title"] = _("Domains &nbsp;&raquo;&nbsp; View");
开发者ID:rchicoria,项目名称:epp-drs,代码行数:30,代码来源:domains_view.php

示例5: Exception

<?
	require_once('src/prepend.inc.php');
	include_once("src/class.activecalendar.php");
	set_time_limit(99999999);
	
	if ($get_task == "delete" && $get_id)
	{
		try
		{
			$Invoice = Invoice::Load($get_id);
			if ($Invoice->UserID == $_SESSION["userid"] 
				&& $Invoice->Cancellable 
				&& $Invoice->Status == INVOICE_STATUS::PENDING)
			{
				$Invoice->Delete();
				$okmsg = _("Invoice rejected");
				CoreUtils::Redirect("inv_view.php");
			}
			else
				throw new Exception("invoice cannot be deleted");
		}
		catch (Exception $e)
		{
			$errmsg = $e->getMessage();
		}
	}
	
	// Delete
	if ($_POST)
	{	
		if ($post_action == "pay")
开发者ID:rchicoria,项目名称:epp-drs,代码行数:31,代码来源:inv_view.php

示例6: array

	}
		
	$invoices = array();
	$total = 0;
	$display["rows"] = array();
	
	try
	{
		if (!($_SESSION['orderid'] || $_REQUEST["orderid"]) 
				|| ($_REQUEST["invoices"] && md5(implode($_REQUEST["invoices"])) != $_SESSION["inv_md5"]))
		{
			$_SESSION["inv_md5"] = md5(implode($_REQUEST["invoices"]));
			$Order = new Order($_SESSION["userid"]);
			foreach ((array)$_REQUEST["invoices"] as $invoiceid)
			{
				$Invoice = Invoice::Load($invoiceid);
				if ($Invoice->Status != INVOICE_STATUS::PAID)
					$Order->AddInvoice($Invoice);
			}
			
			$Order->Save();
			$_SESSION['orderid'] = $Order->ID; 
		}
		else
		{
			$Order = Order::Load($req_orderid ? $req_orderid : $_SESSION['orderid']);
		}
	}
	catch (Exception $e)
	{
		$errmsg = $e->getMessage();
开发者ID:rchicoria,项目名称:epp-drs,代码行数:31,代码来源:checkout.php

示例7: array

<?php

include 'src/prepend.inc.php';
$invoices = array();
if (isset($req_orderid)) {
    $Order = Order::Load($req_orderid);
    $invoices = $Order->GetInvoiceList();
} else {
    if (isset($req_invoiceid)) {
        $invoices[] = Invoice::Load($req_invoiceid);
    }
}
$table = array();
foreach ($invoices as $Invoice) {
    $table[] = array('id' => $Invoice->ID, 'description' => $Invoice->Description, 'inv_status' => $Invoice->Status, 'action_status' => $Invoice->ActionStatus, 'action_fail_reason' => $Invoice->ActionFailReason);
}
$display['table'] = $table;
/*
$display['table'] = array(
	array(
		'id' 				=> '23',
		'purpose' 			=> 'dicsydel01x0154.gr domain name registration for 2 year(s)',
		'inv_status' 		=> '1',
		'action_status' 	=> '2',
		'action_fail_reason'=> 'Registry returns mailformed XML'
	),
	array(
		'id' 				=> '5545',
		'purpose' 			=> '1983.ch domain name transfer.',
		'inv_status' 		=> '1',
		'action_status' 	=> '1',
开发者ID:rchicoria,项目名称:epp-drs,代码行数:31,代码来源:order_info.php


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