本文整理汇总了PHP中VmModel::getModel方法的典型用法代码示例。如果您正苦于以下问题:PHP VmModel::getModel方法的具体用法?PHP VmModel::getModel怎么用?PHP VmModel::getModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VmModel
的用法示例。
在下文中一共展示了VmModel::getModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// Load the helper(s)
$this->loadHelper('html');
$model = VmModel::getModel('country');
$zoneModel = VmModel::getModel('worldzones');
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$country = $model->getData();
$this->assignRef('country', $country);
$this->assignRef('worldZones', $zoneModel->getWorldZonesSelectList());
$this->addStandardEditViewCommands();
} else {
$this->addStandardDefaultViewCommands(true, false);
//First the view lists, it sets the state of the model
$this->addStandardDefaultViewLists($model, 0, 'ASC');
$filter_country = JRequest::getWord('filter_country', false);
$countries = $model->getCountries(false, false, $filter_country);
$this->assignRef('countries', $countries);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmConfig')) {
require JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'config.php';
}
VmConfig::loadConfig();
VmConfig::loadJLang('com_virtuemart_countries');
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel('country');
$zoneModel = VmModel::getModel('worldzones');
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$country = $model->getData();
$this->assignRef('country', $country);
$wzsList = $zoneModel->getWorldZonesSelectList();
$this->assignRef('worldZones', $wzsList);
$this->addStandardEditViewCommands();
} else {
$this->addStandardDefaultViewCommands(true, false);
//First the view lists, it sets the state of the model
$this->addStandardDefaultViewLists($model, 0, 'ASC');
$filter_country = JRequest::getWord('filter_country', false);
$countries = $model->getCountries(false, false, $filter_country);
$this->assignRef('countries', $countries);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例3: display
/**
* Render the view
*/
function display($tpl = null)
{
// Load the helper(s)
$this->loadHelper('html');
$this->loadHelper('html');
$this->loadHelper('currencydisplay');
$this->loadHelper('reportFunctions');
$model = VmModel::getModel();
// $config = JFactory::getConfig();
// $tzoffset = $config->getValue('config.offset');
JRequest::setvar('task', '');
// set period
//$date_presets = $model->getDatePresets();
$this->SetViewTitle('REPORT');
$myCurrencyDisplay = CurrencyDisplay::getInstance();
$this->addStandardDefaultViewLists($model);
$revenueBasic = $model->getRevenue();
if ($revenueBasic) {
$totalReport['revenueTotal_brutto'] = $totalReport['revenueTotal_netto'] = $totalReport['number_of_ordersTotal'] = $totalReport['itemsSoldTotal'] = 0;
foreach ($revenueBasic as &$j) {
vmdebug('VirtuemartViewReport revenue', $j);
$totalReport['revenueTotal_netto'] += $j['order_subtotal_netto'];
$totalReport['revenueTotal_brutto'] += $j['order_subtotal_brutto'];
$totalReport['number_of_ordersTotal'] += $j['count_order_id'];
$j['order_subtotal_netto'] = $myCurrencyDisplay->priceDisplay($j['order_subtotal_netto']);
$j['order_subtotal_brutto'] = $myCurrencyDisplay->priceDisplay($j['order_subtotal_brutto']);
$j['product_quantity'] = $model->getItemsByRevenue($j);
$totalReport['itemsSoldTotal'] += $j['product_quantity'];
}
$totalReport['revenueTotal_netto'] = $myCurrencyDisplay->priceDisplay($totalReport['revenueTotal_netto']);
$totalReport['revenueTotal_brutto'] = $myCurrencyDisplay->priceDisplay($totalReport['revenueTotal_brutto']);
// if ( 'product_quantity'==JRequest::getWord('filter_order')) {
// foreach ($revenueBasic as $key => $row) {
// $created_on[] =$row['created_on'];
// $intervals[] =$row['intervals'];
// $itemsSold[] =$row['product_quantity'];
// $number_of_orders[] =$row['count_order_id'];
// $revenue[] =$row['revenue'];
// }
// if (JRequest::getWord('filter_order_Dir') == 'desc') array_multisort($itemsSold, SORT_DESC,$revenueBasic);
// else array_multisort($itemsSold, SORT_ASC,$revenueBasic);
// }
}
$this->assignRef('report', $revenueBasic);
$this->assignRef('totalReport', $totalReport);
//$itemsSold = $model->getItemsSold($revenueBasic);
//$this->assignRef('itemsSold', $itemsSold);
// I tihnk is to use in a different layout such as product solds
// PATRICK K.
// $productList = $model->getOrderItems();
// $this->assignRef('productList', $productList);
$this->lists['select_date'] = $model->renderDateSelectList();
$this->lists['state_list'] = $model->renderOrderstatesList();
$this->lists['intervals'] = $model->renderIntervalsList();
$this->assignRef('from_period', $model->from_period);
$this->assignRef('until_period', $model->until_period);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
parent::display($tpl);
}
示例4: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
if (!class_exists('vmPSPlugin')) {
require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = vRequest::getCmd('layout', 'default');
$this->SetViewTitle();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields');
$shipment = $model->getShipment();
// Get the payment XML.
$formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmshipment' . DS . $shipment->shipment_element . DS . $shipment->shipment_element . '.xml');
if (file_exists($formFile)) {
$shipment->form = JForm::getInstance($shipment->shipment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$shipment->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushFromForm($shipment->form);
VmTable::bindParameterableToSubField($shipment, $varsToPush);
$shipment->form->bind($shipment->getProperties());
} else {
$shipment->form = null;
}
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if ($this->showVendors()) {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
$this->assignRef('shipment', $shipment);
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true);
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', vmText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$this->shipments = $model->getShipments();
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
foreach ($this->shipments as &$data) {
// Write the first 5 shoppergroups in the list
$data->shipmentShoppersList = shopfunctions::renderGuiList($data->virtuemart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
}
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例5: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
JPlugin::loadLanguage('com_virtuemart', JPATH_ADMINISTRATOR);
$model = VmModel::getModel('Manufacturer');
$manufacturers = $model->getManufacturers(true, true, false);
return JHTML::_('select.genericlist', $manufacturers, $control_name . '[' . $name . ']', '', $name, 'mf_name', $value, $control_name . $name);
}
示例6: display
function display($tpl = null)
{
// Load the helper(s)
$this->loadHelper('html');
$model = VmModel::getModel();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$this->currency = $model->getData();
$this->SetViewTitle('', $this->currency->currency_name);
$this->addStandardEditViewCommands();
} else {
if (JRequest::getWord('format', '') === 'raw') {
$tpl = 'results';
} else {
$this->SetViewTitle();
$this->addStandardDefaultViewCommands();
}
$this->addStandardDefaultViewLists($model, 0, 'ASC');
$this->currencies = $model->getCurrenciesList(JRequest::getWord('search', false));
$this->pagination = $model->getPagination();
}
parent::display($tpl);
if ($tpl === 'results') {
echo $this->AjaxScripts();
}
}
示例7: display
function display($tpl = null)
{
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
JLoader::register('VmImage', JPATH_VM_ADMINISTRATOR . '/helpers/image.php');
$virtuemart_manufacturer_id = JRequest::getInt('virtuemart_manufacturer_id', 0);
$mf_category_id = JRequest::getInt('mf_category_id', 0);
// get necessary models
$model = VmModel::getModel('manufacturer');
if ($virtuemart_manufacturer_id != 0) {
$manufacturer = $model->getManufacturer();
$model->addImages($manufacturer, 1);
$manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"', false);
$document->setTitle(JText::_('COM_VIRTUEMART_MANUFACTURER_DETAILS') . ' ' . strip_tags($manufacturer->mf_name));
$this->assignRef('manufacturerImage', $manufacturerImage);
// $this->assignRef('manufacturerProductsURL', $manufacturerProductsURL);
$this->assignRef('manufacturer', $manufacturer);
$pathway->addItem(strip_tags($manufacturer->mf_name));
$this->setLayout('details');
// vmdebug('$manufacturer',$manufacturer);
} else {
$document->setTitle(JText::_('COM_VIRTUEMART_MANUFACTURER_PAGE'));
$manufacturers = $model->getManufacturers(true, true, true);
$model->addImages($manufacturers, 1);
$this->assignRef('manufacturers', $manufacturers);
$this->setLayout('default');
}
parent::display($tpl);
}
示例8: display
function display($tpl = null)
{
$document = JFactory::getDocument();
$document->setMimeEncoding('application/json');
if ($virtuemart_media_id = vRequest::getInt('virtuemart_media_id')) {
//JResponse::setHeader( 'Content-Disposition', 'attachment; filename="media'.$virtuemart_media_id.'.json"' );
$model = VmModel::getModel('Media');
$image = $model->createMediaByIds($virtuemart_media_id);
// echo '<pre>'.print_r($image,1).'</pre>';
$this->json = $image[0];
//echo json_encode($this->json);
if (isset($this->json->file_url)) {
$this->json->file_root = JURI::root(true) . '/';
$this->json->msg = 'OK';
echo @json_encode($this->json);
} else {
$this->json->msg = '<b>' . vmText::_('COM_VIRTUEMART_NO_IMAGE_SET') . '</b>';
echo @json_encode($this->json);
}
} else {
if (!class_exists('VmMediaHandler')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'mediahandler.php';
}
$start = vRequest::getInt('start', 0);
$type = vRequest::getCmd('mediatype', 0);
$list = VmMediaHandler::displayImages($type, $start);
echo @json_encode($list);
}
jExit();
}
示例9: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
// $this->assignRef('perms', Permissions::getInstance());
$model = VmModel::getModel();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$shoppergroup = $model->getShopperGroup();
$this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
$vendors = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendors);
$this->assignRef('shoppergroup', $shoppergroup);
$this->addStandardEditViewCommands();
} else {
$this->SetViewTitle();
JToolBarHelper::makeDefault();
$this->loadHelper('permissions');
$showVendors = Permissions::getInstance()->check('admin');
$this->assignRef('showVendors', $showVendors);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$shoppergroups = $model->getShopperGroups(false, true);
$this->assignRef('shoppergroups', $shoppergroups);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例10: display
function display($tpl = null) {
// Load the helper(s)
if (!class_exists('VmHTML'))
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php');
$this->SetViewTitle();
$model = VmModel::getModel();
// $stateId = vRequest::getVar('virtuemart_state_id');
// $model->setId($stateId);
$state = $model->getSingleState();
$countryId = vRequest::getInt('virtuemart_country_id', 0);
if(empty($countryId)) $countryId = $state->virtuemart_country_id;
$this->assignRef('virtuemart_country_id', $countryId);
$isNew = (count($state) < 1);
if(empty($countryId) && $isNew){
vmWarn('Country id is 0');
return false;
}
$country = VmModel::getModel('country');
$country->setId($countryId);
$this->assignRef('country_name', $country->getData()->country_name);
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
$this->assignRef('state', $state);
$zoneModel = VmModel::getModel('Worldzones');
$wzsList = $zoneModel->getWorldZonesSelectList();
$this->assignRef('worldZones', $wzsList);
$this->addStandardEditViewCommands();
} else {
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$states = $model->getStates($countryId);
$this->assignRef('states', $states);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例11: save
function save($data = 0)
{
$fileModel = VmModel::getModel('media');
//Now we try to determine to which this media should be long to
$data = array_merge(vRequest::getRequest(), vRequest::get('media'));
//$data['file_title'] = vRequest::getVar('file_title','','post','STRING',JREQUEST_ALLOWHTML);
if (!empty($data['file_description'])) {
$data['file_description'] = JComponentHelper::filterText($data['file_description']);
//vRequest::filter(); vRequest::getHtml('file_description','');
}
/*$data['media_action'] = vRequest::getCmd('media[media_action]');
$data['media_attributes'] = vRequest::getCmd('media[media_attributes]');
$data['file_type'] = vRequest::getCmd('media[file_type]');*/
if (empty($data['file_type'])) {
$data['file_type'] = $data['media_attributes'];
}
$msg = '';
if ($id = $fileModel->store($data)) {
$msg = vmText::_('COM_VIRTUEMART_FILE_SAVED_SUCCESS');
}
$cmd = vRequest::getCmd('task');
if ($cmd == 'apply') {
$redirection = 'index.php?option=com_virtuemart&view=media&task=edit&virtuemart_media_id=' . $id;
} else {
$redirection = 'index.php?option=com_virtuemart&view=media';
}
$this->setRedirect($redirection, $msg);
}
示例12: save
/**
* Handle the save task
*/
function save($data = 0){
vRequest::vmCheckToken();
$model = VmModel::getModel('config');
$data = vRequest::getPost();
if(strpos($data['offline_message'],'|')!==false){
$data['offline_message'] = str_replace('|','',$data['offline_message']);
}
$msg = '';
if ($model->store($data)) {
$msg = vmText::_('COM_VIRTUEMART_CONFIG_SAVED');
// Load the newly saved values into the session.
VmConfig::loadConfig();
}
$redir = 'index.php?option=com_virtuemart';
if(vRequest::getCmd('task') == 'apply'){
$redir = $this->redirectPath;
}
$this->setRedirect($redir, $msg);
}
示例13: save
/**
* Handle the save task
*
* @author RickG
*/
function save($data = 0){
JRequest::checkToken() or jexit( 'Invalid Token' );
$model = VmModel::getModel('config');
$data = JRequest::get('post');
$data['offline_message'] = JRequest::getVar('offline_message','','post','STRING',JREQUEST_ALLOWHTML);
if(strpos($data['offline_message'],'|')!==false){
$data['offline_message'] = str_replace('|','',$data['offline_message']);
}
if ($model->store($data)) {
$msg = JText::_('COM_VIRTUEMART_CONFIG_SAVED');
// Load the newly saved values into the session.
VmConfig::loadConfig();
}
else {
$msg = $model->getError();
}
$redir = 'index.php?option=com_virtuemart';
if(JRequest::getCmd('task') == 'apply'){
$redir = $this->redirectPath;
}
$this->setRedirect($redir, $msg);
}
示例14: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
VmConfig::loadJLang('com_virtuemart');
$model = VmModel::getModel('Vendor');
$vendors = $model->getVendors(true, true, false);
return JHTML::_('select.genericlist', $vendors, $control_name . '[' . $name . ']', '', $name, 'vendor_name', $value, $control_name . $name);
}
示例15: updateOrderItems
function updateOrderItems()
{
vRequest::vmCheckToken();
$model = VmModel::getModel('report');
$model->updateOrderItems();
$this->setRedirect($this->redirectPath, 'Order Items updated');
}