discount_users.php

Go to the documentation of this file.
00001 <?php
00002 
00010 class Discount_Users extends oxAdminDetails
00011 {
00018     public function render()
00019     {
00020         parent::render();
00021 
00022         $soxId = oxConfig::getParameter( "oxid");
00023         $sSelGroup = oxConfig::getParameter( "selgroup");
00024 
00025         // all usergroups
00026         $oGroups = oxNew( 'oxlist' );
00027         $oGroups->init( 'oxgroups' );
00028         $oGroups->selectString( 'select * from oxgroups' );
00029 
00030         $oRoot = new stdClass();
00031         $oRoot->oxgroups__oxid    = new oxField("");
00032         $oRoot->oxgroups__oxtitle = new oxField("-- ");
00033         // rebuild list as we need the "no value" entry at the first position
00034         $aNewList = array();
00035         $aNewList[] = $oRoot;
00036 
00037         foreach ( $oGroups as $val ) {
00038             $aNewList[$val->oxgroups__oxid->value] = new Oxstdclass();
00039             $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxid    = new oxField($val->oxgroups__oxid->value);
00040             $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxtitle = new oxField($val->oxgroups__oxtitle->value);
00041         }
00042 
00043         $this->_aViewData["allgroups2"] = $aNewList;
00044 
00045         if ( isset($soxId) && $soxId != "-") {
00046             $oDiscount = oxNew( "oxdiscount" );
00047             $oDiscount->load( $soxId);
00048 
00049             if ($oDiscount->isDerived())
00050                 $this->_aViewData["readonly"] =  true;
00051         }
00052 
00053         $aColumns = array();
00054         $iAoc = oxConfig::getParameter("aoc");
00055         if ( $iAoc == 1 ) {
00056 
00057             include_once 'inc/discount_groups.inc.php';
00058             $this->_aViewData['oxajax'] = $aColumns;
00059 
00060             return "popups/discount_groups.tpl";
00061         } elseif ( $iAoc == 2 ){
00062 
00063             include_once 'inc/discount_users.inc.php';
00064             $this->_aViewData['oxajax'] = $aColumns;
00065 
00066             return "popups/discount_users.tpl";
00067         }
00068 
00069         return "discount_users.tpl";
00070     }
00071 }

Generated on Thu Dec 4 12:04:55 2008 for OXID eShop CE by  doxygen 1.5.5