Files
crm.twinpol.com/modules/EcmInsideOrders.cp/EcmProductsEcmInsideOrdersRelation.php
2025-05-12 15:44:39 +00:00

81 lines
2.7 KiB
PHP
Executable File

<?
global $db;
class EcmProductsEcmInsideOrdersRelation{
var $date_entered;
var $date_modified;
var $modified_user_id;
var $assigned_user_id;
var $created_by;
var $ecminsideorder_id;
var $ecmproduct_id;
var $product_code;
var $product_name;
var $product_quantity;
var $product_prod_quantity;
var $product_price;
var $product_total;
var $product_component;
var $product_component_quantity;
var $product_product_id;
var $product_guid;
var $product_position;
var $unformated_numbers;
function EcmProductsEcmInsideOrders(){
}
function retrieve($id){
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmproducts_ecminsideorders where id='".$id."'"));
$this->id=$r['id'];
$this->date_entered=$r['date_entered'];
$this->date_modified=$r['date_modified'];
$this->modified_user_id=$r['modified_user_id'];
$this->assigned_user_id=$r['assigned_user_id'];
$this->created_by=$r['created_by'];
$this->ecminsideorder_id=$r['ecminsideorder_id'];
$this->ecmproduct_id=$r['ecmproduct_id'];
$this->product_code=$r['product_code'];
$this->product_name=$r['product_name'];
$this->product_quantity=$r['product_quantity'];
$this->product_prod_quantity=$r['product_prod_quantity'];
$this->product_price=$r['product_price'];
$this->product_total=$r['product_total'];
$this->product_component=$r['product_component'];
$this->product_component_quantity=$r['product_component_quantity'];
$this->product_product_id=$r['product_product_id'];
$this->product_guid=$r['product_guid'];
$this->product_position=$r['product_position'];
}
function save(){
global $db;
$pq=floatval($this->product_quantity);
$ppq=floatval($this->product_prod_quantity);
$pp=floatval($this->product_price);
$pt=floatval($this->product_total);
$query="insert into ecmproducts_ecminsideorders set
id='".create_guid()."',
date_entered='".$this->date_entered."',
date_modified='".$this->date_modified."',
modified_user_id='".$this->modified_user_id."',
assigned_user_id='".$this->assigned_user_id."',
created_by='".$this->created_by."',
deleted='0',
ecminsideorder_id='".$this->ecminsideorder_id."',
ecmproduct_id='".$this->ecmproduct_id."',
product_code='".$this->product_code."',
product_name='".$this->product_name."',
product_quantity='".$pq."',
product_prod_quantity='".$ppq."',
product_price='".$pp."',
product_total='".$pt."',
product_component='".$this->product_component."',
product_component_quantity='".$this->product_component_quantity."',
product_product_id='".$this->product_product_id."',
product_guid='".$this->product_guid."',
product_position='".$this->product_position."'";
$GLOBALS['db']->query($query);
}
}
?>