Class: Product

Source Location: /class_product.php

Class Overview [line 17]

Core
   |
   --Product

Product methods.

Author(s):

  • Elpidio Latorilla

Version:

  • beta 1.0.08

Copyright:

  • 2002,2003 Elpidio Latorilla

Variables

Methods


Inherited Methods

Class: Core

Core::coreFieldNames()
Returns the core field names of the core table in an array.
Core::deleteDBCache()
Deletes data from the database cache based on the id key.
Core::FilesListArray()
Returns a list of filename within a path in array.
Core::getAllDataArray()
Returns all records with the all items from the table.
Core::getAllDataObject()
Returns all records with all items from the table.
Core::getAllItemsArray()
Similar to getAllItemsObject() method but returns the records in an associative array.
Core::getAllItemsObject()
Returns all records with the needed items from the table.
Core::getDBCache()
Gets temporary data from the database cache.
Core::getErrorMsg()
Feturns the value of error_msg, the internal error message.
Core::getLastQuery()
Returns the the last sql query string
Core::getResult()
Feturns the value of result
Core::insertDataFromArray()
Inserts data from an array (passed by reference) into a table.
Core::insertDataFromInternalArray()
Inserts data from the internal array previously filled with data by the setDataArray() method.
Core::isPreLoaded()
Returns the value of is_preloaded that is set by methods that preload large number of data.
Core::LastRecordCount()
Returns the value of rec_count
Core::saveDBCache()
Saves temporary data to a cache in database.
Core::setDataArray()
Points the core data array to the external array that holds the data to be stored.
Core::setRefArray()
Points the reference variable $ref_array to the field names' array.
Core::setSQL()
Sets the internal sql query variable to the sql query.
Core::setTable()
Sets the coretable variable to the name of the database table.
Core::setWhereCondition()
Sets the "where" condition in an update query used with the updateDataFromInternalArray() method.
Core::Transact()
Transaction routine, ADODB transaction. It internally uses the ADODB transaction routine.
Core::updateDataFromArray()
Updates a record with the data from an array (passed by reference) based on the primary key.
Core::updateDataFromInternalArray()
Updates a table using data from an internal array previously filled with data by the setDataArray() method.
Core::_prepSaveArray()
Filters the data array intended for saving, removing the key-value pairs that do not correspond to the table's field names.
Core::_RecordExists()
Checks if a certain database record exists based onthe supplied query condition.


Class Details

Product methods.

Note this class should be instantiated only after a "$db" adodb connector object has been established by an adodb instance

Tags:

[ Top ]


Class Variables

$fld_ocat = array('item_no',
                        'dept_nr',
                        'hit',
                        'artikelname',
                        'bestellnum',
                        'minorder',
                        'maxorder',
                        'proorder')

[line 52]

Field names of care_pharma_ordercatalog or care_med_ordercatalog tables

Type: array

Overrides:

[ Top ]

$fld_prodmain = array('bestellnum',
                              'artikelnum',
                              'industrynum',
                              'artikelname',
                              'generic',
                              'description',
                              'packing',
                              'minorder',
                              'maxorder',
                              'proorder',
                              'picfile',
                              'encoder',
                              'enc_date',
                              'enc_time',
                              'lock_flag',
                              'medgroup',
                              'cave',
                              'status',
                              'history',
                              'modify_id',
                              'modify_time',
                              'create_id',
                              'create_time')

[line 64]

Field names of care_pharma_products_main or care_med_products_main tables

Type: array

Overrides:

[ Top ]

$tb_mmain = 'care_med_products_main'

[line 45]

Table name for medical depot main products

Tags:

  • access - private

Type: mixed

Overrides:

[ Top ]

$tb_mocat = 'care_med_ordercatalog'

[line 41]

Table name for medical depot order catalog

Tags:

  • access - private

Type: mixed

Overrides:

[ Top ]

$tb_molist = 'care_med_orderlist'

[line 37]

Table name for medical depot order lists

Tags:

  • access - private

Type: mixed

Overrides:

[ Top ]

$tb_pmain = 'care_pharma_products_main'

[line 33]

Table name for pharmacy main products

Tags:

  • access - private

Type: mixed

Overrides:

[ Top ]

$tb_pocat = 'care_pharma_ordercatalog'

[line 29]

Table name for pharmacy order catalog

Tags:

  • access - private

Type: mixed

Overrides:

[ Top ]

$tb_polist = 'care_pharma_orderlist'

[line 25]

Table name for pharmay order lists

Tags:

  • access - private

Type: mixed

Overrides:

[ Top ]


Class Methods

Product

Product Product( )

[line 91]

Constructor

Parameters:

[ Top ]

ActualOrderCatalog

mixed ActualOrderCatalog( int $dept_nr, [string $type = ''])

[line 164]

Returns the actual order catalog of a department.

The returned adodb record object contains rows of arrays. Each array contains catalog data with index keys as outlined in the $fld_ocat array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $dept_nr - Department number
  • string $type - Determines the final table name

[ Top ]

DeleteCatalogItem

boolean DeleteCatalogItem( int $item_nr, string $type)

[line 198]

Deletes a catalog item based on its item number key.

Tags:

  • access - public

Parameters:

  • int $item_nr - Item number
  • string $type - Determines the final table name

[ Top ]

DeleteOrder

boolean. DeleteOrder( int $order_nr, string $type)

[line 149]

Deletes an order.

Tags:

  • access - public

Parameters:

  • int $order_nr - Order number
  • string $type - Determines the final table name

[ Top ]

OrderDrafts

mixed OrderDrafts( int $dept_nr, string $type)

[line 233]

Returns all orders of a department marked as draft or are still unsent.

The returned adodb record object contains rows of arrays. Each array contains order data with the following index keys:

  • order_nr = order's primary key number
  • dept_nr = department number
  • order_date = date of ordering
  • order_time = time of ordering
  • articles = ordered articles
  • extra1 = extra notes
  • extra2 = extra notes
  • validator = validator's name
  • ip_addr = IP address of the workstation that send the order
  • priority = priority level
  • status = record's status
  • history = record's history
  • modify_id = name of user
  • modify_time = modify time stamp in yyyymmddhhMMss format
  • create_id = name of use
  • create_time = creation time stamp in yyyymmddhhMMss format
  • sent_datetime = date and time sent in yyyy-mm-dd hh:MM:ss format
  • process_datetime = date and time processed in yyyy-mm-dd hh:MM:ss format

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $dept_nr - Department number
  • string $type - Determines the final table name

[ Top ]

PendingOrders

mixed PendingOrders( string $type)

[line 259]

Returns all pending orders or orders with "acknowledge and print" status.

These orders are marked in the table as "pending" or "ack_print". For detailed structure of the returned data, see OrderDrafts() method.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $type - Determines the final table name

[ Top ]

ProductExists

boolean ProductExists( [int $nr = 0], [string $type = ''])

[line 278]

Checks if the product exists based on its primary key number.

Tags:

  • access - public

Parameters:

  • int $nr - Item number
  • string $type - Determines the final table name

[ Top ]

SaveCatalogItem

boolean SaveCatalogItem( array &$data, string $type)

[line 185]

Saves (inserts) an item in the order catalog.

The data must be passed by reference with associative array. Data must have the index keys as outlined in the $fld_ocat array.

Tags:

  • access - public

Parameters:

  • array &$data - Data to save
  • string $type - Determines the final table name

[ Top ]

useOrderCatalog

boolean. useOrderCatalog( string $type)

[line 116]

Sets the core object to point to either care_pharma_ordercatalog or care_med_ordercatalog table and field names.

The table is determined by the parameter content.

Tags:

  • access - public

Parameters:

  • string $type - Determines the final table name

[ Top ]

useOrderList

boolean. useOrderList( string $type)

[line 101]

Sets the core object to point to either care_pharma_orderlist or care_med_orderlist table and field names.

The table is determined by the parameter content.

Tags:

  • access - public

Parameters:

  • string $type - Determines the final table name

[ Top ]

useProduct

boolean. useProduct( string $type)

[line 133]

Sets the core object to point to either care_pharma_products_main or care_med_products_main table and field names.

The table is determined by the parameter content.

Tags:

  • access - public

Parameters:

  • string $type - Determines the final table name

[ Top ]


Documentation generated on Sun, 16 Nov 2003 01:02:59 +0100 by phpDocumentor 1.2.3