本文整理汇总了PHP中customer::setCC方法的典型用法代码示例。如果您正苦于以下问题:PHP customer::setCC方法的具体用法?PHP customer::setCC怎么用?PHP customer::setCC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类customer
的用法示例。
在下文中一共展示了customer::setCC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extractClientMail
function extractClientMail()
{
$stmt = $this->pdo->prepare("SELECT k.id,k.firma,k.email,k.land, kd.nummer,kdp.einzelpreis,kdp.menge FROM kontakte as k, kontakte_dokumente as kd, kontakte_dokumente_positionen as kdp WHERE k.land like '%%' and kdp.dokument_id = kd.id and kd.kontakte_id = k.id and kdp.dokument_id IN (SELECT kd.id FROM kontakte_dokumente as kd WHERE kd.typ = 7) ORDER BY k.land");
try {
$stmt->execute();
} catch (Exception $e) {
echo $e->getLine() . " : " . $e->getMessage();
}
$lineOrders = $stmt->fetchAll(PDO::FETCH_ASSOC);
$this->orders = array();
foreach ($lineOrders as $lineOrder) {
$tag = $this->getIndex($lineOrder["nummer"]);
if ($tag !== false) {
$new_product = new product('', $lineOrder["einzelpreis"], $lineOrder["menge"]);
$this->orders[$tag]->addProduct($new_product);
} else {
$new_order = new order($lineOrder['nummer'], '', $lineOrder['firma'], $lineOrder['id']);
$new_order->setCC($lineOrder['land']);
$new_order->setMail($lineOrder['email']);
$new_product = new product('', $lineOrder["einzelpreis"], $lineOrder["menge"]);
$new_order->addProduct($new_product);
array_push($this->orders, $new_order);
}
$this->updatePrice();
}
$this->clients = array();
foreach ($this->orders as $order) {
if ($order->getCC() != 0 && $order->getCC() != NULL) {
$tag = $this->getIndexofClient($order->getCustomer_name(), $this->clients);
if ($tag !== false) {
$this->clients[$tag]->addOrder($order);
} else {
$new_customer = new customer($order->getCustomer_name());
$new_customer->addOrder($order);
$new_customer->setId($order->getCustomer_id());
$new_customer->setCC($order->getCC());
$new_customer->setMail($order->getMail());
array_push($this->clients, $new_customer);
}
}
}
foreach ($this->clients as $client) {
$client->calcAmount();
}
return $this->clients;
}