_db= & JFactory::getDBO(); } function getDateFormat($selected){ $this->_db= & JFactory::getDBO(); $sql="select date_format as value, date_format as text from vtiger_date_format where presence=1 order by sortorderid"; $this->_db->setQuery($sql); $rows=$this->_db->loadObjectList(); $class = 'class="inputbox" style="width:240px" '; $name="date_format"; return JHTML::_('select.genericlist', $rows, $name, $class, 'value', 'text', $selected ); } function getCategoryTarget($list){ $category=CommonFunc::getCategoriesTree($list); return CommonFunc::buildSelect($category,'category_target',''); } function getCategoriesTree($list){ $db =& JFactory::getDBO(); if($list) $where = ' WHERE presence = 1 and cf_514id in('.implode(",",$list).')'; else $where = ' WHERE presence = 1 '; $query = 'SELECT *, cf_514id AS value, cf_514 AS text'.' FROM vtiger_cf_514'.$where.' ORDER BY cf_514'; $db->setQuery($query); $rows = $db->loadObjectList(); return $rows; } function buildSelect($list, $name, $selected, $class = 'class="inputbox" style="width:150px " size=10 multiple'){ $catlist = array(); if(count($list)>0) { foreach ($list as $item) { $catlist[] = JHTML::_( 'select.option', $item->value, $item->text); } } return JHTML::_('select.genericlist', $catlist, $name, $class, 'value', 'text', $selected ); } function getCategory() { $category=CommonFunc::getCategoriesTree(null); return CommonFunc::buildSelect($category,'category','class="inputbox" style="width:150px " size=10'); } function getCategory2($selected){ $category=CommonFunc::getCategoriesTree(null); return JHTML::_('select.genericlist', $category, 'category2','class="inputbox" style="width:150px " size=10 multiple', 'value', 'text', $selected ); } function getMoreInfo($moreInfo){ $db =& JFactory::getDBO(); $query = 'SELECT *, cf_642id AS value, cf_642 AS text FROM vtiger_cf_642 ORDER BY cf_642'; $db->setQuery($query); $rows = $db->loadObjectList(); return CommonFunc::buildSelect($rows,'more_info[]',$moreInfo); } function constructSingleArray($var){ if (is_array($var)) { $code = 'array('; foreach ($var as $value) { $code .= $value.','; } $code .= ')'; return $code; } } function constructArray($var){ if (is_array($var)) { $code = 'array('; foreach ($var as $key => $value) { $code .= "'".$key."'=>".$value.','; } $code .= ')'; return $code; } } function constructTwoDimensionalCharIntSingleArray($var){ if (is_array($var)) { $code = "array("; foreach ($var as $key => $secarr) { $code .= "'".$key."'=>array("; foreach($secarr as $seckey => $secvalue) { $code .= $seckey.","; } $code .= "),"; } $code .= ")"; return $code; } } function constructTwoDimensionalArray($var){ if (is_array($var)) { $code = 'array('; foreach ($var as $key => $secarr) { if($key) { $code .= $key.'=>array('; foreach($secarr as $seckey => $secvalue) { $code .= $seckey.'=>'.$secvalue.','; } $code .= '),'; } } $code .= ')'; return $code; } } function constructSingleStringKeyValueArray($var){ $size = sizeof($var); $i=1; if (is_array($var)) { $code = 'array('; foreach ($var as $key => $value) { //fix for signatue quote(') issue $value=mysql_real_escape_string($value); if($i<$size) { $code .= "'".$key."'=>'".$value."',"; } else { $code .= "'".$key."'=>'".$value."'"; } $i++; } $code .= ')'; return $code; } } function constructSingleCharArray($var){ if (is_array($var)) { $code = "array("; foreach ($var as $value) { $code .="'".$value."',"; } $code .= ")"; return $code; } } function constructTwoDimensionalValueArray($var){ if (is_array($var)) { $code = 'array('; foreach ($var as $key => $secarr) { $code .= $key.'=>array('; foreach($secarr as $seckey => $secvalue) { $code .= $secvalue.','; } $code .= '),'; } $code .= ')'; return $code; } } }//end class ?>
All rights reserved © 2009 - Design by Kim May
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
Visitors Counter
Facebook Image