Ejemplo n.º 1
0
 public function __construct($params = array(), $get_assoc = true, $get_attached = true)
 {
     global $db;
     parent::__construct($params, $get_assoc, $get_attached);
     $this->extra_fields = expUnserialize($this->extra_fields);
     $this->price = $this->getBasePrice();
     $this->user_input_fields = expUnserialize($this->user_input_fields);
     /*if (!empty($this->childProduct))
       {
           foreach($this->childProduct as &$child) 
           {
               $child->expFile = $this->expFile;    
           }
       } */
     if (!empty($this->parent_id)) {
         $parent = new product($this->parent_id, false, true);
         //eDebug($parent->expFile);
         $this->expFile = $parent->expFile;
         //eDebug($this);
     }
     //sort the children by child_rank
     if ($this->hasChildren()) {
         if (isset($this->childProduct)) {
             usort($this->childProduct, array("product", "sortChildren"));
         }
     }
 }
Ejemplo n.º 2
0
 public function __construct($params = null, $get_assoc = true, $get_attached = true)
 {
     global $db;
     parent::__construct($params, $get_assoc, $get_attached);
     $this->timesImplemented = $db->countObjects('optiongroup', 'optiongroup_master_id=' . $this->id);
     if (!empty($this->id)) {
         usort($this->option_master, array("optiongroup_master", "sortOptions"));
     }
 }
Ejemplo n.º 3
0
 public function __construct($params = null, $get_assoc = true, $get_attached = true)
 {
     parent::__construct($params, $get_assoc, $get_attached);
     // set the calculator
     if (!empty($this->calculator_name)) {
         $this->calculator = new $this->calculator_name();
     }
     // grab the config data for this calculator
     $this->configdata = empty($this->config) ? array() : unserialize($this->config);
 }
Ejemplo n.º 4
0
 public function __construct($params = null, $get_assoc = false, $get_attached = false)
 {
     global $db;
     if (is_array($params) || is_numeric($params)) {
         parent::__construct($params, $get_assoc, $get_attached);
     } else {
         $id = $db->selectValue($this->table, 'id', "name='" . $params . "' OR code='" . $params . "'");
         parent::__construct($id);
     }
 }
Ejemplo n.º 5
0
 public function __construct($params = null, $get_assoc = false, $get_attached = false)
 {
     global $db;
     parent::__construct($params, $get_assoc, $get_attached);
     if (!empty($this->state) && $this->state > 0) {
         $stateObj = $db->selectObject('geo_region', 'id=' . $this->state);
         $this->statename = $stateObj->name;
         $this->state_code = $stateObj->code;
     }
 }
Ejemplo n.º 6
0
 public function __construct($params = array(), $get_assoc = false, $get_attached = false)
 {
     parent::__construct($params, $get_assoc, $get_attached);
     // if this object is empty we'll treat it like a top level'
     if (empty($this->id)) {
         global $db;
         $this->lft = $db->min($this->table, 'lft');
         $this->rgt = $db->max($this->table, 'rgt');
     }
 }
Ejemplo n.º 7
0
 public function __construct($params = array())
 {
     global $db;
     if (isset($params['module']) && isset($params['src'])) {
         $id = $db->selectValue($this->table, 'id', "module='" . $params['module'] . "' AND src='" . $params['src'] . "'");
         parent::__construct($id, false, false);
     } else {
         parent::__construct($params, false, false);
     }
 }
Ejemplo n.º 8
0
 function __construct($params = null, $get_assoc = false, $get_attached = false)
 {
     if (is_array($params) && isset($params['pass1'])) {
         $params['password'] = $this->encryptPassword($params['pass1']);
     }
     parent::__construct($params, $get_assoc, $get_attached);
     $this->getUserProfile();
     $this->groups = $this->getGroupMemberships();
     $this->getsToolbar = $this->getsToolbar();
 }
Ejemplo n.º 9
0
 public function __construct($params = null, $get_assoc = true, $get_attached = true)
 {
     parent::__construct($params, $get_assoc, $get_attached);
     // grab the config data for this calculator
     $this->configdata = empty($this->config) ? array() : unserialize($this->config);
     if (file_exists(BASE . 'framework/modules/ecommerce/shippingcalculators/icons/' . $this->classname . '.gif')) {
         $this->icon = PATH_RELATIVE . 'framework/modules/ecommerce/shippingcalculators/icons/' . $this->classname . '.gif';
     } else {
         $this->icon = PATH_RELATIVE . 'framework/modules/ecommerce/shippingcalculators/icons/default.png';
     }
 }
Ejemplo n.º 10
0
 public function __construct($params = null, $get_assoc = true, $get_attached = true)
 {
     parent::__construct($params, $get_assoc, $get_attached);
     if (!empty($this->publish)) {
         $this->publish_date = $this->publish;
     } elseif (!empty($this->edited_at)) {
         $this->publish_date = $this->edited_at;
     } elseif (!empty($this->created_at)) {
         $this->publish_date = $this->created_at;
     }
 }
Ejemplo n.º 11
0
 public function __construct($params = null, $get_assoc = false, $get_attached = false)
 {
     global $db;
     if (is_array($params) || is_numeric($params)) {
         parent::__construct($params, $get_assoc, $get_attached);
     } else {
         if (is_numeric($params)) {
             echo "true dude<Br>";
         }
         $id = $db->selectValue($this->table, 'id', "name='" . $params . "' OR iso_code_2letter='" . $params . "' OR iso_code_3letter='" . $params . "'");
         parent::__construct($id, $get_assoc, $get_attached);
     }
 }
Ejemplo n.º 12
0
 public function __construct($params = null, $get_assoc = true, $get_attached = true)
 {
     global $db;
     parent::__construct($params, $get_assoc, $get_attached);
     $this->timesImplemented = $db->countObjects('optiongroup', 'optiongroup_master_id=' . $this->id);
     //sort the options based on the master sort order
     if (!empty($this->id)) {
         foreach ($this->option as &$opt) {
             $om = new option_master($opt->option_master_id);
             $opt->rank = $om->rank;
         }
         usort($this->option, array("optiongroup_master", "sortOptions"));
     }
 }
Ejemplo n.º 13
0
 function __construct($params = null)
 {
     global $db;
     $this->location_data = serialize($params);
     parent::__construct($db->selectValue($this->table, 'id', "location_data='" . $this->location_data . "'"));
     // treat the loc data like an id - if the location data come thru as an objec we need to look up the record
     //         if (!empty($params->src)) {
     //             echo "1";
     //             // if we hav a src, ie this controller has sources
     // parent::__construct($db->selectValue($this->table, 'id', "location_data='".$this->location_data."'"));
     //         } else {
     //             echo "2";
     //             // if we don't have a sourced controller, migh still have a config for it.
     // parent::__construct($db->selectValue($this->table, 'id'));
     //}
     $this->config = expUnserialize($this->config);
 }
Ejemplo n.º 14
0
 function __construct($params = null, $get_assoc = true, $get_attached = true)
 {
     parent::__construct($params, $get_assoc, $get_attached);
     //check to see if this is a completed order and if so, add the items and shipping info
     if (!empty($this->purchased)) {
         // final the cart totals
         //$this->calculateGrandTotal();
         foreach ($this->orderitem as $items) {
             if ($items->product->requiresShipping) {
                 $this->shipping_required = true;
             }
             if ($items->product->requiresBilling) {
                 $this->billing_required = true;
             }
         }
         //$this->shipping_total = 0;
         foreach ($this->getShippingMethods() as $smid) {
             $this->shippingmethods[$smid] = new shippingmethod($smid);
             $this->shippingmethods[$smid]->orderitem = $this->getOrderitemsByShippingmethod($smid);
             $requiresShipping = false;
             foreach ($this->shippingmethods[$smid]->orderitem as $oi) {
                 if ($oi->product->requiresShipping) {
                     $requiresShipping = true;
                 }
             }
             /*if ($requiresShipping == true) {
                   $this->shipping_total += $this->shippingmethods[$smid]->shipping_cost;
               }  */
         }
         // grab our tax zones
         $this->taxzones = taxclass::getCartTaxZones($this);
         /*$this->total = $this->getCartTotal();
           $this->calculateTax();
           $this->grand_total = $this->total + $this->tax + $this->shipping_total;*/
         //$this->calculateGrandTotal();
         if (isset($this->order_status_changes)) {
             usort($this->order_status_changes, array("order", "sortStatuses"));
         }
     }
 }
Ejemplo n.º 15
0
 function __construct($params = array(), $get_assoc = true, $get_attached = false)
 {
     global $db, $user;
     if (!empty($params['id']) || is_numeric($params)) {
         parent::__construct($params, $get_assoc, $get_attached);
         $prodtype = $this->product_type;
         $this->product = new $prodtype($this->product_id, false, true);
     } elseif (isset($params['product_id']) && isset($params['product_type'])) {
         // see if this is an existing item in the cart
         if (isset($params['orderid'])) {
             $order = new order($params['orderid']);
         } else {
             $order = order::getUserCart();
         }
         //adding lookup on price to acocomdate quantity discounts
         $where = 'orders_id=' . $order->id . ' AND product_id=' . $params['product_id'] . ' AND products_price=' . $params['products_price'] . " AND product_type='" . $params['product_type'] . "'";
         $where .= empty($params['options']) ? '' : " AND options='" . $params['options'] . "'";
         $where .= empty($params['user_input_fields']) ? '' : " AND user_input_fields='" . $params['user_input_fields'] . "'";
         $item = $db->selectObject($this->table, $where);
         $this->product = new $params['product_type']($params['product_id'], false, true);
         if (empty($item)) {
             parent::__construct(array('orders_id' => $order->id, 'user_id' => $user->id, 'product_id' => $this->product->id, 'product_type' => $params['product_type'], 'products_name' => $this->product->title, 'products_price' => $this->product->getBasePrice()), $get_assoc, $get_attached);
         } else {
             parent::__construct($item->id, $get_assoc, $get_attached);
             //$this->quantity = $this->product->incrementQuantity($this->quantity);
         }
     } else {
         parent::__construct(null, $get_assoc, $get_attached);
     }
     if (isset($this->options)) {
         $this->opts = expUnserialize($this->options);
     }
     if (!empty($this->user_input_fields)) {
         //$this->user_input_fields = expUnserialize($this->user_input_fields);
     }
 }
Ejemplo n.º 16
0
 public function __construct($params = array(), $get_assoc = true, $get_attached = true)
 {
     global $db;
     parent::__construct($params, $get_assoc, $get_attached);
 }
Ejemplo n.º 17
0
 public function __construct($params = array(), $get_assoc = true, $get_attached = true)
 {
     parent::__construct($params, $get_assoc, $get_attached);
     $this->price = '';
 }
Ejemplo n.º 18
0
 public function __construct($params = null, $get_assoc = false, $get_attached = false)
 {
     parent::__construct($params, $get_assoc, $get_attached);
 }
Ejemplo n.º 19
0
 public function __construct($params = array())
 {
     parent::__construct($params);
     $this->loc = expUnserialize($this->location_data);
 }
Ejemplo n.º 20
0
 /**
  * Class constructor to create a File Class either from a database
  * record or from the File System.
  *
  * Class will either: a) load an existing File Record
  *                    b) modify an existing File Record
  *                    c) create a new File Record
  *
  * This will also handle any File System handling that is needed: copy,
  * move, create, delete, read and write.
  *
  * @access public
  *
  * @uses expRecord::__construct
  *
  * @PHPUnit Not Defined
  *
  * @param mixed $params  - If an INT is given, this assumes that it needs to
  *                         load an existing File Record.
  *                       - If an ARRAY is given, this assumes that the elements
  *                         of the array are values to the File table that need
  *                         to be modified or other processing.
  *                       - If NULL is given, an empty File Object is created
  *
  * @param bool $get_assoc
  * @param bool $get_attached
  * @return \expFile Object@throws void
  *
  */
 public function __construct($params = array(), $get_assoc = false, $get_attached = false)
 {
     // Set 'directory' as the default FILE location
     // This will be redefined if a FILE record is loaded
     // or a path is given to the Class
     //eDebug($params,true);
     $this->directory = UPLOAD_DIRECTORY_RELATIVE;
     // This will pull properties for class properties based upon
     // expRecord table definition
     parent::__construct($params, $get_assoc, $get_attached);
     // If the 'directory' is the same as the default path then a given,
     // or derived, filename can be added to pathing settings
     //if ( $this->directory == UPLOAD_DIRECTORY_RELATIVE ) {
     if (!stristr($this->directory, BASE)) {
         // Place system level web root
         $this->url = URL_FULL . $this->directory . $this->filename;
         // Place system level OS root
         $this->path = BASE . $this->directory . $this->filename;
         // Place system OS relative path
         $this->path_relative = PATH_RELATIVE . $this->directory . $this->filename;
     } else {
         // Otherwise, the URL is not set since we can't use it, nether is
         // RELATIVE, as 'directory' must be an absolute path in this instance
         // Place system level OS root
         $relpath = str_replace(BASE, '', $this->directory);
         $this->path = $this->directory . $this->filename;
         $this->url = URL_FULL . $relpath . $this->filename;
         $this->path_relative = $relpath . $this->filename;
     }
     // If a file location was given, not derived from the database,
     // basic file information is needed
     if (empty($this->id) && !empty($this->filename)) {
         // File info
         $_fileInfo = self::getImageInfo($this->path);
         // Assign info back to class
         $this->is_image = $_fileInfo['is_image'];
         $this->filesize = $_fileInfo['fileSize'];
         if ($_fileInfo['is_image']) {
             $this->mimetype = $_fileInfo['mime'];
             $this->image_width = $_fileInfo[0];
             $this->image_height = $_fileInfo[1];
         }
     }
 }
Ejemplo n.º 21
0
 public function __construct($params = null, $get_assoc = true, $get_attached = true)
 {
     global $db;
     parent::__construct($params, $get_assoc, $get_attached);
     $this->timesImplemented = $db->countObjects('option', 'enable=1 AND option_master_id=' . $this->id);
 }