images = array( 'vertical' => array( 'width' => 100, 'height' => 425, 'quality' => 98, 'web_location' => '/images/categories/vertical_name/' ) ); $this->img_tag_attr = array(); // ----------------------------------------------------- // set path based on unix or windows foreach($this->images as $image_size=>$image_info) { $this->images[$image_size]['path'] = Config::$path_to_www; $this->images[$image_size]['path'] .= (Config::$location == 'remote') ? $this->images[$image_size]['web_location'] : str_replace('/', '\\', $this->images[$image_size]['web_location']); // ----------------------------------------------------- $this->img_tag_attr[$image_size] = 'width="'.$image_info['width'].'" height="'.$image_info['height'].'"'; } $this->dbTableName = Config::$db_tables['inventory_categories']; } function get_RecordSet($title='', $status_web='all', $where_add='', $order_by='name', $limit='') { $title .= ' Categories::get_RecordSet'; // build query and pass to $Database::get_RecordSet $select = "*"; $from = $this->dbTableName; $where = ""; $where_started = FALSE; switch($status_web) { case 'all': break; case 'active': $where .= "status_web='$status_web'"; $where_started = TRUE; break; case 'inactive': $where .= "status_web='$status_web'"; $where_started = TRUE; break; } if($where_add != '') { $where .= ($where_started) ? " AND " : ""; $where .= $where_add; } return(Database::get_RecordSet($select, $from, $where, $order_by, $limit, $title)); } function generate_select($arg_array)//($Forms, $name, $RS, $show_all_option=FALSE, $onchange='', $top_option='', $selected='', $css='') { foreach($arg_array as $arg=>$val) { $$arg = $val; //echo '
'.$arg.'=>'.$val; } $options = array(); while($record = $RS->FetchRow()) { $options[$record['id']] = $record['name']; } if(isset($show_all_option) && $show_all_option) { $options['all'] = 'show all'; } return($Forms->generate_select_formfield($name, $options, $top_option, $selected, $onchange, $css)); } } ?>