public function getOrderDetails() { $shippingAddress = new FullAddress(); $shippingAddress->fillFromDbPk($this->address_id); $billingAddress = new FullAddress(); $billingAddress->fillFromDbPk($this->billing_address_id); $customer = new Customer(); $customer->fillFromDbPk($this->customer_id); $click = new Click(); $click->fillFromDbPk($this->click_id); $click->allFIelds = true; $click->loadConnections(); $date = new DateTime(); // DateTime($this->created); return array('orderId' => $this->order_id, 'billFirst' => $billingAddress->fname, 'billLast' => $billingAddress->lname, 'billAddress1' => $billingAddress->address1, 'billAddress2' => $billingAddress->address2, 'billCity' => $billingAddress->city, 'billState' => $billingAddress->state_name, 'billZip' => $billingAddress->zip, 'billCountry' => $billingAddress->country_name, 'billPhone' => $billingAddress->phone, 'billEmail' => $customer->email, 'shipFirst' => $shippingAddress->fname, 'shipLast' => $shippingAddress->lname, 'shipAddress1' => $shippingAddress->address1, 'shipAddress2' => $shippingAddress->address2, 'shipCity' => $shippingAddress->city, 'shipState' => $shippingAddress->state_name, 'shipZip' => $shippingAddress->zip, 'shipCountry' => $shippingAddress->country_name, 'shipPhone' => $shippingAddress->phone, 'shipEmail' => $customer->email, 'orderTotal' => sprintf("%.2f", $this->amount_product + $this->amount_shipping), 'dateOfSale' => $date->format('Y-m-d'), 'timeOfSale' => $date->format('H:i:s'), 'ipAddress' => $this->getip_formatted(), 'aff_id' => $click->aff_id === NULL ? '' : $click->aff_id, 'AFID' => $click->aff_ref === NULL ? $click->AFID : $click->aff_ref, 'SID' => $click->SID === NULL ? '' : $click->SID, 'c1' => $click->c1 === NULL ? '' : $click->c1, 'c2' => $click->c2 === NULL ? '' : $click->c2, 'c3' => $click->c3 === NULL ? '' : $click->c3, 'click_id' => $click->click_id, 'hit_id' => $click->hit_id); }
public function init() { parent::init(); }