本文整理汇总了PHP中Customers::get_by_customerid方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::get_by_customerid方法的具体用法?PHP Customers::get_by_customerid怎么用?PHP Customers::get_by_customerid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers::get_by_customerid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMessage
/**
* Save the message.
*
* @param $note
* @param $customerID
* @param $domainID
* @param $orderID
* @param $detailID
* @return Boolean
*/
public static function addMessage($note, $customerID, $domainID = NULL, $orderID = NULL, $detailID = NULL, $ispID = NULL)
{
$message = new Messages();
if (!empty($note)) {
$customer = Customers::get_by_customerid($customerID);
$message->dateposted = date('Y-m-d H:i:s');
$message->message = $note;
$message->customer_id = $customerID;
$message->isp_id = $ispID;
$message->domain_id = $domainID;
$message->order_id = $orderID;
$message->detail_id = $detailID;
$message->save();
return $message['message_id'];
}
return false;
}
示例2: ownerGrid
/**
* ownerGrid
* Get the customer/owner information.
* @return array
*/
public static function ownerGrid($domain_id)
{
if (isset($domain_id) && is_numeric($domain_id)) {
$domain = self::find($domain_id, '*', true);
if (!empty($domain[0]['customer_id'])) {
$customer = Customers::get_by_customerid($domain[0]['customer_id'], 'company, firstname, lastname, email');
}
if (isset($customer[0])) {
return array('records' => $customer, 'editpage' => 'customers');
}
}
}
示例3: searchAction
/**
* Search the record for the Select2 JQuery Object by ajax
* @return json
*/
public function searchAction()
{
if ($this->getRequest()->isXmlHttpRequest()) {
$term = $this->getParam('term');
$id = $this->getParam('id');
if (!empty($term)) {
$term = "%{$term}%";
$records = Customers::findbyCustomfield("(firstname LIKE ?) OR (lastname LIKE ?) OR company LIKE ?", array($term, $term, $term));
die(json_encode($records));
}
if (!empty($id)) {
$records = Customers::get_by_customerid($id);
die(json_encode($records));
}
$records = Customers::getAll();
die(json_encode($records));
} else {
die;
}
}
示例4: editAction
/**
* editAction
* Get a record and populate the application form
* @return unknown_type
*/
public function editAction()
{
$form = $this->getForm('/admin/orders/process');
$currency = Shineisp_Registry::getInstance()->Zend_Currency;
$customer = null;
$createInvoiceConfirmText = $this->translator->translate('Are you sure you want to create or overwrite the invoice for this order?');
$id = intval($this->getRequest()->getParam('id'));
$this->view->description = $this->translator->translate("Here you can edit the selected order.");
if (!empty($id) && is_numeric($id)) {
$rs = $this->orders->find($id);
if (!empty($rs)) {
$rs = $rs->toArray();
$rs['setupfee'] = Orders::getSetupfee($id);
$rs['order_date'] = Shineisp_Commons_Utilities::formatDateOut($rs['order_date']);
$rs['expiring_date'] = Shineisp_Commons_Utilities::formatDateOut($rs['expiring_date']);
$rs['received_income'] = 0;
$rs['missing_income'] = $rs['grandtotal'];
$rs['order_number'] = !empty($rs['order_number']) ? $rs['order_number'] : Orders::formatOrderId($rs['order_id']);
$payments = Payments::findbyorderid($id, 'income', true);
if (isset($payments)) {
foreach ($payments as $payment) {
$rs['received_income'] += isset($payment['income']) ? $payment['income'] : 0;
$rs['missing_income'] -= isset($payment['income']) ? $payment['income'] : 0;
}
}
$rs['profit'] = $rs['total'] - $rs['cost'];
$rs['profit'] = $currency->toCurrency($rs['profit'], array('currency' => Settings::findbyParam('currency')));
// set the default income to prepare the payment task
$rs['income'] = $rs['missing_income'];
$rs['missing_income'] = sprintf('%.2f', $rs['missing_income']);
unset($payments);
$parent = Customers::find($rs['customer_id']);
//if customer comes from reseller
if ($parent['parent_id']) {
$rs['customer_parent_id'] = $parent['parent_id'];
} else {
$rs['customer_parent_id'] = $rs['customer_id'];
}
$link = Fastlinks::findlinks($id, $rs['customer_id'], 'Orders');
if (isset($link[0])) {
$rs['fastlink'] = $link[0]['code'];
$rs['visits'] = $link[0]['visits'];
}
$form->populate($rs);
$this->view->id = $id;
$this->view->customerid = $rs['customer_id'];
if (!empty($rs['fastlink'])) {
$this->view->titlelink = "/index/link/id/" . $rs['fastlink'];
}
if (!empty($rs['order_number'])) {
$this->view->title = $this->translator->_("Order nr. %s", $rs['order_number']);
}
$this->view->messages = Messages::getbyOrderId($id);
$createInvoiceConfirmText = $rs['missing_income'] > 0 ? $this->translator->translate('Are you sure you want to create or overwrite the invoice for this order? The order status is: not paid.') : $createInvoiceConfirmText;
$customer = Customers::get_by_customerid($rs['customer_id'], 'company, firstname, lastname, email');
} else {
$this->_helper->redirector('list', 'orders', 'admin');
}
}
$this->view->mex = urldecode($this->getRequest()->getParam('mex'));
$this->view->mexstatus = $this->getRequest()->getParam('status');
// Create the buttons in the edit form
$this->view->buttons = array(array("url" => "#", "label" => $this->translator->translate('Save'), "params" => array('id' => 'submit', 'css' => array('btn btn-success'))), array("url" => "/admin/orders/print/id/{$id}", "label" => $this->translator->translate('Print'), "params" => array('css' => null)), array("url" => "/admin/orders/dropboxit/id/{$id}", "label" => $this->translator->translate('Dropbox It'), "params" => array('css' => null)), array("url" => "/admin/orders/clone/id/{$id}", "label" => $this->translator->translate('Clone'), "params" => array('css' => null)), array("url" => "/admin/orders/sendorder/id/{$id}", "label" => $this->translator->translate('Email'), "params" => array('css' => array('btn btn-danger'))), array("url" => "/admin/orders/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => array('btn btn-danger'))), array("url" => "/admin/orders/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)));
// Check if the order has been invoiced
$invoice_id = Orders::isInvoiced($id);
if ($invoice_id) {
$this->view->buttons[] = array("url" => "/admin/orders/sendinvoice/id/{$invoice_id}", "label" => $this->translator->translate('Email invoice'), "params" => array('css' => array('btn btn-danger')));
$this->view->buttons[] = array("url" => "/admin/invoices/print/id/{$invoice_id}", "label" => $this->translator->translate('Print invoice'), "params" => array('css' => null));
} else {
// Order not invoiced, show button to create a new invoice
$this->view->buttons[] = array("url" => "/admin/orders/createinvoice/id/{$id}", "label" => $this->translator->translate('Invoice'), "params" => array('css' => array('btn btn-danger')), 'onclick' => "return confirm('" . $createInvoiceConfirmText . "')");
}
$this->view->customer = array('records' => $customer, 'editpage' => 'customers');
$this->view->ordersdatagrid = $this->orderdetailGrid();
$this->view->paymentsdatagrid = $this->paymentsGrid();
$this->view->statushistory = StatusHistory::getStatusList($id);
// Get Order status history
$this->view->filesgrid = $this->filesGrid();
$this->view->statushistorygrid = $this->statusHistoryGrid();
$this->view->form = $form;
$this->render('applicantform');
}
示例5: getByCustomerId
/**
* Get ISP by Customer Id
* @param string $email
*/
public static function getByCustomerId($id)
{
$Customer = Customers::get_by_customerid($id);
$isp_id = isset($Customer['isp_id']) ? intval($Customer['isp_id']) : 1;
// TODO: remove fallback to 1
return self::getActiveIspById($isp_id);
}