Ejemplo n.º 1
0
 /**
  * 	Remove listing
  * 		@param 
  */
 public function RemoveListing($plan_id = 0)
 {
     if (!$this->IsLoggedIn() && empty($plan_id)) {
         return false;
     }
     Customers::SetListingsForCustomer(Session::Get('session_account_id'), $plan_id, 1, '-');
     Session::Set('session_customer_plans', Customers::GetListingsForCustomer(Session::Get('session_account_id')));
     return true;
 }
                        $message .= 'Payment Processing Gross Price: ' . $total . "<br />\n";
                        write_log($message);
                        break;
                    }
                    $sql = 'UPDATE ' . TABLE_ORDERS . ' SET
								status = 2,
								transaction_number = \'' . $transaction_number . '\',
								payment_date = \'' . date('Y-m-d H:i:s') . '\',
								status_changed = \'' . date('Y-m-d H:i:s') . '\',
								payment_type = 1,
								payment_method = ' . $payment_method . '
							WHERE order_number = \'' . $order_number . '\'';
                    if (database_void_query($sql)) {
                        // update customer orders/listings amount
                        Customers::SetOrdersForCustomer($result[0]['customer_id'], '+');
                        Customers::SetListingsForCustomer($result[0]['customer_id'], $result[0]['advertise_plan_id'], $result[0]['listings_amount'], '+');
                        // send email to customer
                        if (Orders::SendOrderEmail($order_number, 'completed', $result[0]['customer_id'])) {
                            write_log($sql, _ORDER_PLACED_MSG);
                        } else {
                            write_log($sql, _ORDER_ERROR);
                        }
                    } else {
                        write_log($sql, mysql_error());
                    }
                } else {
                    write_log($sql, 'Error: no records found. ' . mysql_error());
                }
                break;
            case 'Updated':
                // 3 updated already
Ejemplo n.º 3
0
 /**
  *	After-Delete record
  */
 public function AfterDeleteRecord()
 {
     // $this->curRecordId - currently deleted record
     if ($this->order_status == 2 || $this->order_status == 3 || $this->order_status == 4) {
         // update customer orders/listings amount
         Customers::SetOrdersForCustomer($this->order_customer_id, '-');
         if ($this->order_status == 2 || $this->order_status == 3) {
             Customers::SetListingsForCustomer($this->order_customer_id, $this->order_advertise_plan_id, $this->order_listings, '-');
         }
     }
 }