Ejemplo n.º 1
0
 public function __construct()
 {
     $this->_table_prefix = '#__' . TABLE_PREFIX . '_';
     $this->_db = Jfactory::getDBO();
     $this->_session = JFactory::getSession();
     $this->_order_functions = new order_functions();
     $this->_extra_field = new extra_field();
     $this->_extraFieldFront = new extraField();
     $this->_redhelper = new redhelper();
     $this->_producthelper = new producthelper();
     $this->_shippinghelper = new shipping();
 }
Ejemplo n.º 2
0
 /**
 * Example Search method
 *
 * The sql must return the following fields that are used in a common display
 * routine:
 - title;
 - href:            link associated with the title;
 - browsernav    if 1, link opens in a new window, otherwise in the same window;
 - section        in parenthesis below the title;
 - text;
 - created;
 
 * @param string Target search string
 * @param string matching option, exact|any|all
 * @param string ordering option, newest|oldest|popular|alpha|category
 * @param mixed An array if the search it to be restricted to areas, null if search all
 *
 * @return array Search results
 */
 public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     $result = array();
     // jelenleg semmilyen paramétert nem veszek figyelembe és hozzáférés ellenörzés sincs.
     $db = Jfactory::getDBO();
     // témakorok
     $db->setQuery('select t.megnevezes as title,
       t.id,
       "2" as browsernav,
       "' . JText::_('TEMAKOROK') . '" as section,
       "" as `text`,
       t.letrehozva as created
       from #__temakorok t
       where t.megnevezes like "%' . $text . '%"
       order by t.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_szavazasok&view=szavazasoklist&temakor=' . $res1->id;
         $result[] = $res1;
     }
     // szavazások
     $db->setQuery('select sz.megnevezes as title,
       sz.id,
       "2" as browsernav,
       "' . JText::_('SZAVAZASOK') . '" as section,
       "" as `text`,
       sz.letrehozva as created
       from #__szavazasok sz
       where  sz.megnevezes like "%' . $text . '%"
       order by sz.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
         $result[] = $res1;
     }
     // alternativák
     $db->setQuery('select sz.megnevezes as title,
       sz.id,
       "2" as browsernav,
       "' . JText::_('ALTERNATIVAK') . '" as section,
       "" as `text`,
       sz.letrehozva as created
       from #__szavazasok sz, #__alternativak a
       where  a.szavazas_id = sz.id and a.megnevezes like "%' . $text . '%"
       order by sz.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
         $result[] = $res1;
     }
     return $result;
 }
 public function __construct($params)
 {
     $this->_params = $params;
     $this->_db = Jfactory::getDBO();
     if (JRequest::getCmd('option') == 'com_joomleague') {
         $p = JRequest::getInt('p', $params->get('default_project_id'));
     } else {
         $p = $params->get('default_project_id');
     }
     $this->_project_id = intval($p);
     $this->_project = $this->getProject();
     $this->_round_id = JRequest::getInt('r');
     $this->_division_id = JRequest::getInt('division', 0);
     $this->_team_id = JRequest::getInt('tid', 0);
 }
/**
 * make sure the version table has the proper structure (1.0 import !)
 * if not, update it
 */
function _checkVersionTable()
{
    $db = Jfactory::getDBO();
    $res = $db->getTableFields('#__joomleague_version');
    $cols = array_keys(reset($res));
    if (!in_array('major', $cols)) {
        $query = ' ALTER TABLE #__joomleague_version ADD `major` INT NOT NULL ,
				ADD `minor` INT NOT NULL ,
				ADD `build` INT NOT NULL ,
				ADD `count` INT NOT NULL ,
				ADD `revision` VARCHAR(128) NOT NULL ,
				ADD `file` VARCHAR(255) NOT NULL';
        $db->setQuery($query);
        if (!$db->query()) {
            echo JText::_('Failed updating version table');
        }
    }
}
Ejemplo n.º 5
0
 /**
  * rekord sorozat beolvasása az adatbázisból
  * @JRequest filter, order, limit, limitstart
  * @return array of records
  */
 public function getItems($state)
 {
     $db = Jfactory::getDBO();
     $query = $this->getListQuery($state);
     $limit = 100000;
     $limitstart = $state->limitstart;
     if ($limit == '') {
         $limit = 20;
     }
     if ($limit == 0) {
         $limit = 20;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     $db->setQuery($query, $limitstart, $limit);
     return $db->loadObjectList();
 }
Ejemplo n.º 6
0
 /**
  * rekord sorozat beolvasása az adatbázisból
  * @JRequest filter, order, limit, limitstart
  * @return array of records
  */
 public function getItems($state)
 {
     $db = Jfactory::getDBO();
     $query = $this->getListQuery($state);
     $limit = JRequest::getvar('limit', 20);
     $limitstart = JRequest::getvar('limitstart', 0);
     if ($limit == '') {
         $limit = 20;
     }
     if ($limit == 0) {
         $limit = 20;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     $db->setQuery($query, $limitstart, $limit);
     return $db->loadObjectList();
 }
Ejemplo n.º 7
0
 /**
  * Post-flight extension installer method.
  *
  * This method runs after all other installation code.
  *
  * @param	$type
  * @param	$parent
  *
  * @return	void
  * @since	1.0.3
  */
 function postflight($type, $parent)
 {
     // Display a move files and folders to parent.
     jimport('joomla.filesystem.folder');
     $srcBase = JPATH_PLUGINS . '/editors/arkeditor/layouts/joomla/';
     $dstBase = JPATH_SITE . '/layouts/joomla/';
     $folders = JFolder::folders($srcBase);
     $manifest = $parent->getParent()->getManifest();
     $attributes = $manifest->attributes();
     $method = $attributes->method ? (string) $attributes->method : false;
     foreach ($folders as $folder) {
         if ($method != 'upgrade') {
             if (JFolder::exists($dstBase . $folder)) {
                 JFolder::delete($dstBase . $folder);
             }
         }
         JFolder::copy($srcBase . $folder, $dstBase . $folder, null, true);
     }
     if ($type == 'install') {
         //update $db
         $db = Jfactory::getDBO();
         $toolbars = base64_encode('{"back":[[ "Templates" ],[ "Cut","Copy","Paste","PasteText","PasteFromWord" ] ,["SelectAll","SpellChecker", "Scayt" ] ,["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat" ] ,[ "NumberedList","BulletedList","Outdent","Indent","-","Blockquote","CreateDiv","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","BidiLtr","BidiRtl" ],[ "Link","Document","Unlink","Anchor" ],	[ "Image","Flash","Table","Smiley","SpecialChar","PageBreak","Iframe" ],[ "Styles","Format","Font","FontSize" ],[ "TextColor","BGColor" ],[ "Maximize", "ShowBlocks","-","About" ]],"front":[[ "Templates" ],[ "Cut","Copy","Paste","PasteText","PasteFromWord"] ,["Bold","Italic","Underline","Strike","RemoveFormat" ],  [ "NumberedList","BulletedList","Outdent","Indent","Blockquote"],[ "Link","Document","Unlink","Anchor" ],[ "Image","Table","SpecialChar","PageBreak","Iframe"],["Styles","Format" ],[ "Maximize", "ShowBlocks","About" ]],"inline" :[["Sourcedialog","Bold","NumberedList","BulletedList"],["PasteText","Image","Link","Document"],["Format"],["Readmore"],["Save"],["Versions"],["Close"] ],"title":[["Save"],["Cut","Copy","PasteText"],["Undo"],["Close"]],"image":[["Save"],["Image"],["Link","Document"],["Close"]],"mobile":[["Bold"],["Link"],["Image"],["Save"],["Versions"],["Close"]]}');
         $query = $db->getQuery(true);
         $query->select('params')->from('#__extensions')->where('folder = ' . $db->quote('editors'))->where('element = ' . $db->quote('arkeditor'));
         $db->setQuery($query);
         $params = $db->loadResult();
         if ($params === false) {
             throw new Exception('Failed to retrieve parameters from Editor');
         }
         if (!$params) {
             $params = '{}';
         }
         $params = new JRegistry($params);
         $params->set('toolbars', $toolbars);
         $query->clear()->update('#__extensions')->set('params= ' . $db->quote($params->toString()))->where('folder = ' . $db->quote('editors'))->where('element = ' . $db->quote('arkeditor'));
         $db->setQuery($query);
         if (!$db->query()) {
             throw new Exception('Failed to update parameters for Editor');
         }
     }
 }
 public function __construct($params)
 {
     $this->_params = $params;
     $this->_db = Jfactory::getDBO();
     //		$this->_division_id   	= JRequest::getVar('jlamdivisionid',0,'default','POST');
     /*
     if (JRequest::getCmd('option') == 'com_joomleague') {
     	$p = JRequest::getInt('p', $params->get('default_project_id'));
     }
     else {
     	$p = $params->get('default_project_id');
     }
     */
     //$this->_project_id 		= intval($p);
     /*
     $this->_project_id 		= JRequest::getInt('p');
     $this->_project 		= $this->getProject();
     $this->_round_id   		= JRequest::getInt('r');
     $this->_division_id   	= JRequest::getInt('division',0);
     $this->_team_id   		= JRequest::getInt('tid',0);
     */
     /*
         echo 'project int -> <pre>'.print_r(JRequest::getInt('p'),true).'</pre><br>';
     echo 'project var -> <pre>'.print_r(JRequest::getVar('p'),true).'</pre><br>';
     echo 'project view -> <pre>'.print_r(JRequest::getVar('view'),true).'</pre><br>';
     echo 'project tid -> <pre>'.print_r(JRequest::getVar('tid'),true).'</pre><br>';	
     
     echo 'get -> <pre>'.print_r($_GET,true).'</pre><br>';	
     echo 'post -> <pre>'.print_r($_POST,true).'</pre><br>';	
     echo 'request -> <pre>'.print_r($_REQUEST,true).'</pre><br>';
     */
     if ($this->_project_id) {
         JRequest::setVar('jlamseason', $this->getSeasonId());
         JRequest::setVar('jlamleague', $this->getLeagueId());
         JRequest::setVar('jlamproject', $this->_project_id);
         JRequest::setVar('jlamdivisionid', $this->_division_id);
     }
 }
Ejemplo n.º 9
0
 function getProgram()
 {
     $database = Jfactory::getDBO();
     if (empty($this->_attribute)) {
         $this->_attribute = $this->getTable("guruPrograms");
         $this->_attribute->load($this->_id);
     }
     $data = JRequest::get('post');
     if (!$this->_attribute->bind($data)) {
         $this->setError($item->getErrorMsg());
         return false;
     }
     if (!$this->_attribute->check()) {
         $this->setError($item->getErrorMsg());
         return false;
     }
     $sql = "SELECT sum(lt.time) AS course_time \r\n\t\t\t  FROM `#__guru_task` as lt \r\n\t\t\t  LEFT JOIN `#__guru_mediarel` lm on lt.id=lm.media_id \r\n\t\t\t  LEFT JOIN `#__guru_days` as ld on lm.type_id=ld.id\r\n\t\t\t  WHERE type='dtask' and ld.pid=" . $this->_id;
     $database->setQuery($sql);
     $database->query();
     $result = $database->loadResult();
     $hours = intval($result / 60);
     $minutes = $result % 60;
     $this->_attribute->duration = $hours . ":" . $minutes;
     switch ($this->_attribute->level) {
         case "0":
             $this->_attribute->level = JText::_('GURU_LEVEL_BEGINER');
             break;
         case "1":
             $this->_attribute->level = JText::_('GURU_LEVEL_INTERMEDIATE');
             break;
         case "2":
             $this->_attribute->level = JText::_('GURU_LEVEL_ADVANCED');
             break;
     }
     return $this->_attribute;
 }
function Joom_CompleteBreadcrumbs($catid, $id, $func = '')
{
    $config = Joom_getConfig();
    $mainframe =& JFactory::getApplication('site');
    $database =& Jfactory::getDBO();
    $user =& JFactory::getUser();
    $pathway =& $mainframe->getPathway();
    // Sonderfaelle zuerst
    switch ($func) {
        case 'userpanel':
            $pathway->addItem(JText::_('JGS_USER_PANEL'));
            break;
        case 'uploadhandler':
        case 'showupload':
            $pathway->addItem(JText::_('JGS_USER_PANEL'), 'index.php?option=com_joomgallery&func=userpanel' . _JOOM_ITEMID);
            $pathway->addItem(JText::_('JGS_NEW_PICTURE'));
            break;
        case 'showusercats':
            $pathway->addItem(JText::_('JGS_USER_PANEL'), 'index.php?option=com_joomgallery&func=userpanel' . _JOOM_ITEMID);
            $pathway->addItem(JText::_('JGS_CATEGORIES'));
            break;
        case 'newusercat':
            $pathway->addItem(JText::_('JGS_USER_PANEL'), 'index.php?option=com_joomgallery&func=userpanel' . _JOOM_ITEMID);
            $pathway->addItem(JText::_('JGS_NEW_CATEGORY'));
            break;
        case 'showfavourites':
            if ($user->get('id') && $config->jg_usefavouritesforzip != 1) {
                $pathway->addItem(JText::_('JGS_FAV_MY'));
            } else {
                $pathway->addItem(JText::_('JGS_ZIP_MY'));
            }
            break;
        case 'createzip':
            $pathway->addItem(JText::_('JGS_ZIP_DOWNLOAD'));
            break;
    }
    if ($func != '' && $func != 'viewcategory' && $func != 'detail') {
        return;
    }
    // falls keine catid vorhanden
    if ($catid == 0 || $func == 'detail') {
        if ($id != 0) {
            $database->setQuery(" SELECT \n                              a.id,\n                              a.imgtitle,\n                              a.catid\n                            FROM \n                              #__joomgallery AS a, \n                              #__joomgallery_catg AS cc\n                            WHERE \n                                     a.catid = cc.cid \n                              AND a.id       = '{$id}' \n                              AND cc.access <= '" . $user->get('aid') . "'\n                          ");
            if (!($row = $database->loadObject())) {
                return false;
            }
            $catid = $row->catid;
        } else {
            return false;
        }
    }
    // catid ist hier auf jeden Fall gesetzt
    // id's und Namen aller uebergeordneten Kategorien aus der Datenbank holen
    $cat_ids = array($catid);
    $cat_names = array();
    while ($catid != 0) {
        $database->setQuery(" SELECT \n                            name,\n                            parent,\n                            cid \n                          FROM \n                            #__joomgallery_catg\n                          WHERE \n                                      cid = '{$catid}' \n                            AND published = '1' \n                            AND access    <= '" . $user->get('aid') . "'\n                      ");
        if (!($cat_row = $database->loadObject())) {
            $catid = 0;
        } else {
            $catid = $cat_row->parent;
        }
        if ($catid != 0) {
            array_unshift($cat_ids, $catid);
        }
        array_unshift($cat_names, $cat_row->name);
    }
    // Breadcrumbs mit Kategorien vervollstaendigen
    for ($i = 0; $i < count($cat_names); $i++) {
        $pathway->addItem($cat_names[$i], 'index.php?option=com_joomgallery&func=viewcategory&catid=' . $cat_ids[$i] . _JOOM_ITEMID);
    }
    // eventuell Bildnamen hinzufuegen
    if (isset($row->id)) {
        $pathway->addItem($row->imgtitle, 'index.php?option=com_joomgallery&func=detail&id=' . $row->id . _JOOM_ITEMID);
    }
}
Ejemplo n.º 11
0
 /**
  * Adds attendees numbers to rows
  *
  * @param $data reference to event rows
  * @return false on error, $data on success
  */
 static function getAttendeesNumbers(&$data)
 {
     // Make sure this is an array and it is not empty
     if (!is_array($data) || !count($data)) {
         return false;
     }
     // Get the ids of events
     $ids = array();
     foreach ($data as $event) {
         $ids[] = $event->id;
     }
     $ids = implode(",", $ids);
     $db = Jfactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('COUNT(id) as total, SUM(waiting) as waitinglist, event');
     $query->from('#__jem_register');
     $query->where('event IN (' . $ids . ')');
     $query->group('event');
     $db->setQuery($query);
     $res = $db->loadObjectList('event');
     foreach ($data as $k => $event) {
         if (isset($res[$event->id])) {
             $data[$k]->waiting = $res[$event->id]->waitinglist;
             $data[$k]->regCount = $res[$event->id]->total - $res[$event->id]->waitinglist;
         } else {
             $data[$k]->waiting = 0;
             $data[$k]->regCount = 0;
         }
         $data[$k]->available = $data[$k]->maxplaces - $data[$k]->regCount;
     }
     return $data;
 }
Ejemplo n.º 12
0
 function onAfterProcess($params, &$formModel)
 {
     if ($params->get('notification_ajax', 0) == 1) {
         return;
     }
     $user =& JFactory::getUser();
     $userid = $user->get('id');
     $notify = JRequest::getInt('fabrik_notification', 0);
     if ($userid == 0) {
         return;
     }
     $label = '';
     foreach ($formModel->_data as $k => $v) {
         if (strstr($k, 'title')) {
             $label = $v;
             break;
         }
     }
     $why = JRequest::getInt('rowid') == 0 ? 'author' : 'editor';
     $this->process($notify, $why, $label);
     // add entry indicating the form has been updated this record will then be used by the cron plugin to
     // see which new events have been generated and notify subscribers of said events.
     $db =& Jfactory::getDBO();
     $event = JRequest::getInt('rowid') == 0 ? $db->Quote(JText::_('RECORD_ADDED')) : $db->Quote(JText::_('RECORD_UPDATED'));
     $date = JFactory::getDate();
     $date = $db->Quote($date->toMySQL());
     $ref = $this->getRef();
     $msg = $notify ? JText::_('PLG_CRON_NOTIFICATION_ADDED') : JText::_('PLG_CRON_NOTIFICATION_REMOVED');
     $app =& JFactory::getApplication();
     $app->enqueueMessage($msg);
     $db->setQuery("INSERT INTO #__fabrik_notification_event (`reference`, `event`, `user_id`, `date_time`) VALUES ({$ref}, {$event}, {$userid}, {$date})");
     $db->query();
 }
Ejemplo n.º 13
0
 public function plgRedform_integrationRedevent(&$subject, $config = array())
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     $this->_db =& Jfactory::getDBO();
 }
Ejemplo n.º 14
0
    /**
      * @param array (form array) CSAK MÓDOSÍTÁS felvitel nincs
      *  user_id, user_name, user_username, user_email, user_psw, user_psw2
      *  fcsop_1, terszerv_fcsop1_1, terszerv_fcsop1_2,......  
      *  fcsop_2, terszerv_fcsop2_1, terszerv_fcsop2_2,......  
      * 
      *  fcsop_1, fcsop_2 ... tartalma felhcsop_id
      *  terszerv_###_1, terszerv_###_2 ... tartalma tervesz_id  (### fcsop_id)
      *  hilrlevelemail_####   (### fcsop_id)
      * @return true vagy false
      */
    public function save($data) {
		
        //DBG echo 'model save rutin ';
        //DBG echo '<pre>'; print_r($data); echo '</pre>';       
        
	   $manager = false;
       $hirlevelKezelo = false;       
       $db = Jfactory::getDBO();
       // user_terhat rekordok törlése
       $db->setQuery('delete from #__tny_felh_terhat where felh_id='.$db->quote($data['user_id']));
       if ($db->query()) {
         // user terhat rekordok tárolása
         for ($fcsi = 1; $fcsi < 20; $fcsi++) {
           // van "fcsop_$fcsi" adat a $data -ban?
           if (isset($data["fcsop_$fcsi"])) {
			   $fcsop = $data["fcsop_$fcsi"];
               // fcsop rekord beolvasása
               $db->setQuery('select * from #__tny_felhcsoportok where fcsop_id='.$db->quote($fcsop));
               $felhCsop = $db->loadObject();
               if ($felhCsop->jog_felhasznalok == 1) $manager = true;
               if ($felhCsop->jog_hirlevel == 1) $hirlevelKezelo = true;
               //DBG echo '<p>Van fcsop '.$fcsi.' fcsop='.$fcsop.'</p>';
               for ($fthi = 1; $fthi < 200; $fthi++) {
                 // ha van "terszerv_$fcsop_$thi" adat a tömbben akkor rekord kiirás
                 if (isset($data['terszerv_'.$fcsop.'_'.$fthi])) {
                     //DBG echo '<p>van terszerv adat </p>';
                     $db->setQuery('insert into #__tny_felh_terhat
                     values ('.$db->quote($data['user_id']).',
                             '.$db->quote($fcsop).',
                             '.$db->quote($data['terszerv_'.$fcsop.'_'.$fthi]).',
                             '.$db->quote($data['commentemail_'.$fcsop]).'
                            )');
                     //DBG echo '<p>'.$db->getQuery().'</p>';       
                     if (!$db->query()) {
                        $this->setError($db->getErrorMsg());
                        return false;
                     }        
                 } 
               }    
           }    
         }
       } else {
           $this->setError($db->getErrorMsg());
           return false;
       } 

       // Joomla usergroup besorolás kezelése
       // 10 usergroupba mindenképpen tartozik   
       // ha hírlevél kezelõ akkor 11 usergroupba is tartozik
       // ha felhasználó kezelõ akkor 6 usergroupba is tartozik
       $db->setQuery('delete from #__user_usergroup_map where user_id='.$db->quote($data['user_id']).' and (group_id=6 or group_id=11 or group_id=10)');
       $db->query();
       $db->setQuery('insert into #__user_usergroup_map values ('.$db->quote($data['user_id']).',10)');
       $db->query(); 
       if ($manager) {
           $db->setQuery('insert into #__user_usergroup_map values ('.$db->quote($data['user_id']).',6)');
           $db->query(); 
       }
       if ($hirlevelKezelo) {
           $db->setQuery('insert into #__user_usergroup_map values ('.$db->quote($data['user_id']).',11)');
           $db->query(); 
       }
       return true;
    }
 /**
  * return round roundcode
  * 
  * @param int $round_id
  * @return int roundcode
  */
 function _getRoundcode($round_id)
 {
     if (empty($this->_roundcodes)) {
         $db = Jfactory::getDBO();
         $query = ' SELECT r.roundcode, r.id ' . ' FROM #__joomleague_round AS r ' . ' WHERE r.project_id = ' . $this->_projectid;
         $db->setQuery($query);
         $this->_roundcodes = $db->loadAssocList('id');
     }
     if (!isset($this->_roundcodes[$round_id])) {
         JError::raiseWarning(0, JText::_('COM_JOOMLEAGUE_RANKING_ERROR_UNKOWN_ROUND_ID') . ': ' . $round_id);
         return false;
     }
     return $this->_roundcodes[$round_id];
 }
Ejemplo n.º 16
0
<?php
   
   // itt most rejtett divisionokba létre kell hozni a lehetséges popup listboxokat
   // div.id="helpMezonev", select.id=""
   //  - területi szervezetek
   //  - kategoriák
   //  - cimkék
   //  - nem

   // főmenüből is van inditva  JSession::checkToken() or die( 'Invalid Token' );
   $db = Jfactory::getDBO();

   if (JRequest::getVar('task') == 'szures') {
       echo '<h2>Kapcsolatok szűrés</h2>';
   }
   if (JRequest::getVar('task') == 'groupedit') {
       echo '<h2>Csoportos módosítás - szűrés</h2>
   	   <p>Alakitsa ki azt a listát amit modósítani akar!</p>';
   }
   if (JRequest::getVar('task') == 'szurtexport') {
       echo '<h2>Exportálás CSV fájlba - szűrés</h2>
	   <p>Alakitsa ki azt a listát amit exportálni akar!</p>';
   }
   if (JRequest::getVar('task') == 'hirlevel') {
       echo '<h2>Hírlevél küldés - szűrés</h2>
	   <p>Alakitsa ki azt a listát akinek hírlevelet akar küldeni!</p>';
   }

?>
<script language="javascript" type="text/javascript">
Joomla.submitbutton = function(task) {
Ejemplo n.º 17
0
    /**
     * átlag fogyás beirása a termék rekordba
     * @JRequest integer termek_id
     * @Jrequest integer atlagfogyas
     */
    public function atlagfogyas()
    {
        JSession::checkToken('get') or die('Invalid Token');
        $db = Jfactory::getDBO();
        $termek_id = JRequest::getVar('termek_id', 0);
        $atlagfogyas = JRequest::getvar('atlagfogyas', 0);
        if ($termek_id > 0) {
            $db->setQuery('update #__keszlet_termek
			set fogyas = ' . $db->quote($atlagfogyas) . '
			where id = ' . $db->quote($termek_id));
            if ($db->query()) {
                $this->message->txt = 'Átlag fogyás tárolva';
                $this->message->class = 'alert-info';
            } else {
                $this->message->txt = $model->getError();
                $this->message->class = 'alert-error';
            }
        }
        $this->browser();
    }
 /**
  * @param string: an iso3 country code, e.g AUT
  * @return string: a country name
  */
 public static function getCountryName($iso3)
 {
     $db = Jfactory::getDBO();
     $lang = JFactory::getLanguage();
     $extension = "com_joomleague_countries";
     $source = JPATH_ADMINISTRATOR . '/components/' . $extension;
     $lang->load("{$extension}", JPATH_ADMINISTRATOR, null, false, false) || $lang->load($extension, $source, null, false, false) || $lang->load($extension, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load($extension, $source, $lang->getDefault(), false, false);
     $query = "SELECT name from #__joomleague_countries\n    where alpha3 like '" . $iso3 . "'";
     $db->setQuery($query);
     $res = $db->loadResult();
     //$countries=Countries::getCountries();
     if ($res) {
         //return JText::_($countries[$iso3]['name']);
         return JText::_($res);
     }
 }
Ejemplo n.º 19
0
 function _getList()
 {
     $check = $this->_chkextension();
     if (!$check) {
         return;
     }
     $list = "";
     $query = "SELECT id,name FROM #__xipt_profiletypes  ";
     $db = Jfactory::getDBO();
     $db->setQuery($query);
     $list = $db->loadObjectList();
     return $list;
 }
Ejemplo n.º 20
0
 /**
  * Finds image type definition by name and type
  * @param string $name
  * @param string $type
  * @param JeproshopOrderModelOrder $order
  */
 public static function getByNameNType($name, $type = null, $order = null)
 {
     if (!isset(self::$images_types_name_cache[$name . '_' . $type . '_' . $order])) {
         $db = Jfactory::getDBO();
         $query = "SELECT " . $db->quoteName('image_type_id') . ", " . $db->quoteName('name') . ", ";
         $query .= $db->quoteName('width') . ", " . $db->quoteName('height') . ", " . $db->quoteName('products');
         $query .= ", " . $db->quoteName('categories') . ", " . $db->quoteName('manufacturers') . ", ";
         $query .= $db->quoteName('suppliers') . ", " . $db->quoteName('scenes') . " FROM " . $db->quoteName('#__jeproshop_image_type');
         $query .= "\tWHERE " . $db->quoteName('name') . " LIKE " . $db->quote($db->escape($name));
         $query .= !is_null($type) ? " AND " . $db->quoteName($db->escape($type)) . " = 1" : "";
         $query .= !is_null($order) ? " ORDER BY " . $db->quoteName($db->escape($order)) . " ASC" : "";
         $db->setQuery($query);
         self::$images_types_name_cache[$name . '_' . $type . '_' . $order] = $db->loadObject();
     }
     return self::$images_types_name_cache[$name . '_' . $type . '_' . $order];
 }
Ejemplo n.º 21
0
 function unInstallWS()
 {
     //Read the script file and execute
     jimport('joomla.filesystem.file');
     jimport('joomla.filesystem.folder');
     $sql = JFile::read(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jws' . DS . 'jws_files' . DS . 'scripts' . DS . 'database' . DS . 'ws_drop.sql');
     $db =& Jfactory::getDBO();
     $db->setQuery($sql);
     $db->query();
     echo "<br /> DB tables uninstalled..<br />";
     //backup files.
     echo "<br /> Deleting Created files..<br />";
     JFile::delete(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'views' . DS . 'user' . DS . 'view.html.php');
     JFile::move(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'views' . DS . 'user' . DS . 'view.html.php.jws', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'views' . DS . 'user' . DS . 'view.html.php');
     JFile::delete(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'views' . DS . 'user' . DS . 'tmpl' . DS . 'form.php');
     JFile::move(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'views' . DS . 'user' . DS . 'tmpl' . DS . 'form.php.jws', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'views' . DS . 'user' . DS . 'tmpl' . DS . 'form.php');
     JFile::delete(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'controller.php');
     JFile::move(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'controller.php.jws', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'controller.php');
     JFile::delete(JPATH_SITE . DS . 'standalone.php');
     JFolder::delete(JPATH_SITE . DS . 'api');
 }
Ejemplo n.º 22
0
    static function showRentHistory($option, $rows, $pageNav, $params)
    {
        global $my, $Itemid, $mosConfig_live_site, $mainframe, $booklibrary_configuration;
        $session = JFactory::getSession();
        $acl = JFactory::getACL();
        $arr = $session->get("array", "default");
        $doc = JFactory::getDocument();
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/booklibrary.css');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        // for 1.6
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        if ($option == 'com_booklibrary') {
            $user = Jfactory::getuser();
            $db = Jfactory::getDBO();
            $query = "SELECT * FROM #__booklibrary_lend_request AS b WHERE b.status=0";
            $db->setQuery($query);
            $current_user_rent_request_array = $db->loadObjectList();
            $check_for_show_rent_request = 0;
            if (isset($current_user_rent_request_array)) {
                $check_for_show_rent_request = 1;
            }
            if ($booklibrary_configuration['cb_mybook']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo "<span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=show_my_books&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBBOOKS_TT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_edit']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=showmybooks&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBEDIT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_history']['show']) {
                $params->def('show_history', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_history']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_history_registrationlevel', 1);
                }
                if ($params->get('show_history')) {
                    if ($params->get('show_history_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'>\n\t\t\t\t\t\t\t\t\t\t<a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=com_booklibrary&task=rent_history_books&name=' . $user->name . '&user='******'&is_show_data=1') . "'>" . _BOOKLIBRARY_MY_LEND_HISTORY . "</a></span>";
                        }
                        //echo "<div style=\" border:1px solid black; padding: 10px; text-align:center; \">you dont have rent_history_lable</div>";
                    }
                }
            }
            if ($booklibrary_configuration['cb_rent']['show']) {
                $params->def('show_rent', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_rent']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_rent_registrationlevel', 1);
                }
                if ($params->get('show_rent')) {
                    if ($params->get('show_rent_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=rent_requests_cb_books&is_show_data=1') . "'>" . _BOOKLIBRARY_LEND_REQUESTS . "</a></span>";
                        }
                    }
                }
            }
            ?>
            <style type="text/css">
                .row0 {background-color:#F9F9F9;}
            </style><br/><br/><br/><?php 
        }
        ?>
        <?php 
        //---------------------------------------------------------------------------- view
        //echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=com_booklibrary&task=show_my_books&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBBOOKS_TT . "</a></span>";
        ?>

        <?php 
        if ($rows) {
            ?>
            <form class="g" action="index.php" method="get" name="adminForm" id="adminForm">
                <table cellpadding="4" cellspacing="0" border="0" width="100%" class="basictable my_table my_table-bordered
                       my_table-hover bl_all_categories_show_my_book_lend_history">
                    <tr>
                        <th align = "center" width="30">#</th>         
                        <th align = "center" class="title" width="5%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_LABEL_BOOKID;
            ?>
</th>
                        <th align = "center" class="title" width="40%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_LABEL_TITLE;
            ?>
</th>
                        <th align = "center" class="title" width="20%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_ORDER_LEND_FROM;
            ?>
</th>
                        <th align = "center" class="title" width="20%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_ORDER_LEND_UNTIL;
            ?>
</th>
                        <th align = "center" class="title" width="20%" nowrap="nowrap"><?php 
            echo _BOOKLIBRARY_SHOW_LEND_RETURN;
            ?>
</th>
                    </tr>


                    <?php 
            $numb = 0;
            //echo "<br/><pre>". print_r($rows,true)."</pre>";exit;
            for ($i = 0, $n = count($rows); $i < $n; $i++) {
                $row = $rows[$i];
                $book = $row->id;
                $title = $row->title;
                $numb++;
                ?>
                        <tr>	
                            <td align="center"><?php 
                echo $numb;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->bookid;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->title;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->lend_from;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->lend_until;
                ?>
</td>
                            <td align="center"><?php 
                echo $row->lend_return;
                ?>
</td>
                        </tr>
            <?php 
            }
            ?>

                    <tr class="for_paginator">
                        <td colspan="6" align="center" id="pagenavig">
                            <?php 
            $paginations = $arr;
            if ($paginations && $pageNav->total > $pageNav->limit) {
                echo $pageNav->getPagesLinks();
            }
            ?>
                        </td>
                    </tr>
                </table>
            </form> <?php 
        }
        //else echo "<div style=\"text-align:center;\">HISTORY IS EMPTY</div>"
        ?>
        <?php 
    }
Ejemplo n.º 23
0
 public function getBaseUserByUsername($apikey, $secret)
 {
     $auth = new Auth($apikey, $secret);
     if ($auth->isAuthenticate()) {
         if (isset($_GET['username'])) {
             $username = $_GET['username'];
         } else {
             if (isset($_POST['username'])) {
                 $username = $_POST['username'];
             }
         }
     } else {
         $result = WebserviceHelper::constructResult(500, 'APIKey and secret key does not match', "getUserById");
         return $result->asXML();
     }
     if (!isset($username)) {
         $result = WebserviceHelper::constructResult(500, 'One of the required fields is not set', "getBaseUserById");
         return $result->asXML();
     }
     $db =& Jfactory::getDBO();
     //$sql = "select userid from jos_users_apikey where apikey = '$apikey' AND secretkey='$secret'";
     $sql = "SELECT u.username FROM jos_users u LEFT JOIN `jos_users_apikey` uapi ON ( u.id = uapi.userid )" . " WHERE `apikey` = '{$apikey}' AND `secretkey` = '{$secret}'";
     $db->setQuery($sql);
     $user_name = $db->loadResult();
     $sql = "select id from #__users where username='******'";
     $db->setQuery($sql);
     $userid = $db->loadResult();
     //$user = & JFactory::getUser($userid);
     $sql = "select * from #__users where id=" . $userid;
     $db->setQuery($sql);
     $user = $db->loadObject();
     $string = XMLSerializer::generateValidXmlFromObj($user, 'user_data');
     $result = WebserviceHelper::constructResultData(200, 'User Object Loaded', $string, "getUserById");
     return $result->asXML();
 }
Ejemplo n.º 24
0
 function getQuizById()
 {
     $db = Jfactory::getDBO();
     $query = "select * from #__guru_quiz where id=" . intval($this->_id) . " limit 1";
     $db->setQuery($query);
     $db->query();
     $result = $db->loadObject();
     return $result;
 }
Ejemplo n.º 25
0
 function OnAfterGetEstimate($plg_targetfiels)
 {
     $userlist = array();
     if (!$plg_targetfiels) {
         return array();
     }
     foreach ($plg_targetfiels as $key => $value) {
         if ($key == 'group') {
             $query = "SELECT memberid from #__community_groups_members AS grusers LEFT JOIN #__community_groups AS grps ON grps.id=grusers.groupid  WHERE grusers.groupid IN('{$value}') AND grps.published=1 GROUP BY grusers.memberid";
             //die;
             $db = Jfactory::getDBO();
             $db->setQuery($query);
             $userlist = $db->loadColumn();
         }
     }
     return $userlist;
 }
Ejemplo n.º 26
0
 function _getList()
 {
     $check = $this->_chkextension();
     if (!$check) {
         return;
     }
     $list = "";
     $query = "SELECT id,title FROM #__social_profiles  ORDER BY title";
     $db = Jfactory::getDBO();
     $db->setQuery($query);
     $list = $db->loadObjectList();
     return $list;
 }
 function getSchemaAway($schemaaway)
 {
     $db =& Jfactory::getDBO();
     $bildpositionen = array();
     $position = 1;
     if ($schemaaway) {
         $query = " SELECT extended" . " FROM #__joomleague_rosterposition " . " WHERE name LIKE '" . $schemaaway . "'" . " AND short_name = 'AWAY_POS'";
         $db->setQuery($query);
         $res = $db->loadResult();
         $xmlfile = JPATH_COMPONENT_ADMINISTRATOR . DS . 'assets' . DS . 'extended' . DS . 'rosterposition.xml';
         $jRegistry = new JRegistry();
         $jRegistry->loadString($res, 'ini');
         for ($a = 0; $a < 11; $a++) {
             $bildpositionen[$schemaaway][$a]['gast']['oben'] = $jRegistry->get('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_TOP');
             $bildpositionen[$schemaaway][$a]['gast']['links'] = $jRegistry->get('COM_JOOMLEAGUE_EXT_ROSTERPOSITIONS_' . $position . '_LEFT');
             $position++;
         }
         return $bildpositionen;
     } else {
         return false;
     }
 }
Ejemplo n.º 28
0
 public static function getAmountQuizzes($id)
 {
     $db = Jfactory::getDBO();
     $sql = "SELECT \tquizzes_ids FROM #__guru_quizzes_final WHERE qid=" . $id;
     $db->setQuery($sql);
     $db->query();
     $result = $db->loadColumn();
     @($result_qids = explode(",", trim($result["0"], ",")));
     if (isset($result_qids[0]) && $result_qids[0] != "") {
         $query = "select count(id) from #__guru_questions_v3 where qid IN (" . implode(",", $result_qids) . ")";
         $db->setQuery($query);
         $db->query();
         $result = $db->loadResult();
         return $result;
     }
 }
Ejemplo n.º 29
0
 public function getArticles()
 {
     $db =& Jfactory::getDBO();
     if (isset($_GET['catid'])) {
         $catid = $_GET['catid'];
     } else {
         if (isset($_POST['catid'])) {
             $catid = $_POST['catid'];
         }
     }
     if (isset($catid)) {
         $sql = "select c.id, c.title, c.introtext, c.fulltext, c.catid, c.created_by, c.images, c.urls, c.hits," . " u.name, u.username, u.email, u.usertype, cc.title as cat_title" . " from #__content c left join #__categories cc on (c.catid = cc.id) left join #__users u on (c.created_by = u.id)" . " where catid = " . $catid;
         $db->setQuery($sql);
         $objectList = $db->loadObjectList();
         if (!empty($objectList)) {
             $string = XMLSerializer::generateValidXmlFromArray($objectList, 'articles_data');
             $result = WebserviceHelper::constructResultData(200, 'Articles Listed', $string, "getArticles");
             return $result->asXML();
         } else {
             $result = WebserviceHelper::constructResult(200, 'No Articles associated to the category id', "getArticles");
             return $result->asXML();
         }
     } else {
         $result = WebserviceHelper::constructResult(500, 'No category id specified', "getArticles");
         return $result->asXML();
     }
 }
Ejemplo n.º 30
0
    /**
    * Example Search method
    *
    * The sql must return the following fields that are used in a common display
    * routine:
    - title;
    - href:            link associated with the title;
    - browsernav    if 1, link opens in a new window, otherwise in the same window;
    - section        in parenthesis below the title;
    - text;
    - created;
    
    * @param string Target search string
    * @param string matching option, exact|any|all
    * @param string ordering option, newest|oldest|popular|alpha|category
    * @param mixed An array if the search it to be restricted to areas, null if search all
    *
    * @return array Search results
    */
    public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
    {
        $user = JFactory::getUser();
        $result = array();
        // jelenleg semmilyen paramétert nem veszek figyelembe
        $db = Jfactory::getDBO();
        // témakorok
        $db->setQuery('select t.megnevezes as title,
          t.id,
          "2" as browsernav,
          "' . JText::_('TEMAKOROK') . '" as section,
          "" as `text`,
          t.letrehozva as created
          from #__temakorok t
		  left outer join #__tagok ta 
		    on ta.temakor_id = t.id and ta.user_id = "' . $user->id . '"
          where t.megnevezes like "%' . $text . '%" and
		    ((t.lathatosag = 0) or
			 (t.lathatosag = 1 and "' . $user->id . '" > 0) or
			 (ta.user_id is not null)
			)
          order by t.id DESC');
        $res = $db->loadObjectList();
        foreach ($res as $res1) {
            $res1->href = 'index.php?option=com_szavazasok&view=szavazasoklist&temakor=' . $res1->id;
            $result[] = $res1;
        }
        // szavazások
        $db->setQuery('select sz.megnevezes as title,
          sz.id,
          "2" as browsernav,
          "' . JText::_('SZAVAZASOK') . '" as section,
          "" as `text`,
          sz.letrehozva as created
          from #__szavazasok sz
		  left outer join #__temakorok t on t.id = sz.temakor_id
		  left outer join #__tagok ta 
		    on ta.temakor_id = t.id and ta.user_id = "' . $user->id . '"
          where  sz.megnevezes like "%' . $text . '%" and
		    ((t.lathatosag = 0) or
			 (t.lathatosag = 1 and "' . $user->id . '" > 0) or
			 (ta.user_id is not null)
			)
          order by sz.id DESC');
        $res = $db->loadObjectList();
        foreach ($res as $res1) {
            $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
            $result[] = $res1;
        }
        // alternativák
        $db->setQuery('select sz.megnevezes as title,
          sz.id,
          "2" as browsernav,
          "' . JText::_('ALTERNATIVAK') . '" as section,
          "" as `text`,
          sz.letrehozva as created
          from #__szavazasok sz
		  inner join #__alternativak a on a.szavazas_id = sz.id
		  left outer join #__temakorok t on t.id = sz.temakor_id
		  left outer join #__tagok ta 
		    on ta.temakor_id = t.id and ta.user_id = "' . $user->id . '"
          where  a.megnevezes like "%' . $text . '%" and
		    ((t.lathatosag = 0) or
			 (t.lathatosag = 1 and "' . $user->id . '" > 0) or
			 (ta.user_id is not null)
			)
          order by sz.id DESC');
        $res = $db->loadObjectList();
        foreach ($res as $res1) {
            $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
            $result[] = $res1;
        }
        return $result;
    }