ilch Forum » Ilch CMS 2.X » Allgemein » Tabelle Admincenter horizontal scrollbar

Geschlossen
  1. #1
    User Pic
    MonkeyOnKeyboard Moderator
    Registriert seit
    10.02.2014
    Beiträge
    453
    Beitragswertungen
    22 Beitragspunkte
    Hallo, da ich nicht weiß wohin mit dem Post, schreib ich es hier rein.

    Ich möchte in einem Modul eine horizontal scrollbare Tabelle machen für eine Auswertung .
    Nun die Frage, ist das möglich?

    Die Tabelle soll außerdem so aussehen. an der SQL frage arbeite ich noch...



    Kann jemand helfen?


    verwendete ilch Version: 2.1.x

    betroffene Homepage: www.r1sing.de
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    Nex4T Moderator
    Registriert seit
    28.02.2007
    Beiträge
    3.414
    Beitragswertungen
    213 Beitragspunkte
    Sollte bei Bootstrap automatisch passieren oder nicht, aber ja ist möglich.

    Theoretisch reicht es aus wenn du dies in eine klasse packst und auf die table drückst.
    overflow: scroll; /* Scrollbar are always visible */
    overflow: auto;   /* Scrollbar is displayed as it's needed */


    auto wäre in dem fall der richtige weg.


    Zuletzt modifiziert von Nex4T am 07.03.2020 - 17:46:14
    while(!asleep()) sheep++;
    www.movely.biz
    www.webplant.eu
    0 Mitglieder finden den Beitrag gut.
  3. #3
    User Pic
    MonkeyOnKeyboard Moderator
    Registriert seit
    10.02.2014
    Beiträge
    453
    Beitragswertungen
    22 Beitragspunkte
    ok das geht nur hab ich andere Probleme.

    er nimmt bestimmte variablen nicht. nur den überschriftsnamen.

    <?php
    /**
     * @copyright Ilch 2.0
     * @package ilch
     */
    
    namespace Modules\Recruting\Models;
    
    use Ilch\Date;
    
    class Newcomer extends \Ilch\Model
    {
        /**
         * The Id of the Join.
         *
         * @var int
         */
        protected $id;
    
        /**
         * The Account_ID from the recruit.
         *
         * @var int
         */
        protected $recruit_account_id;
    
        
        /**
         * The Account_ID from the newcomer_driver.
         *
         * @var int
         */
        protected $driver_account_id;
        
        
        /**
         * The Name from the recruit.
         *
         * @var string
         */
        protected $recruit_member_name;
    
        /**
         * The Name from the recruit.
         *
         * @var string
         */
        protected $driver_member_name;
        
    
        /**
         * The clan_id.
         *
         * @var int
         */
        protected $clan_id;
    
        /**
         * joined_at from the recruit.
         *
         * @var /Date
         */
        protected $joined_at;
    
        /**
         * end_date for recruiting time.
         *
         * @var /Date
         */
        protected $end_date;
        
        /**
         * recruiting state.
         *
         * @var /Enum
         */
        protected $is_recruit;
        
        /**
         * communication.
         *
         * @var int
         */
        protected $komunikation;
    
        /**
         * tactical awareness.
         *
         * @var int
         */
        protected $taktisch;
    
        /**
         * light.
         *
         * @var int
         */
        protected $light;
    
        
        /**
         * medium.
         *
         * @var int
         */
        protected $medium;
        
        
        /**
         * heavy.
         *
         * @var int
         */
        protected $heavy;
        
        
        /**
         * td.
         *
         * @var int
         */
        protected $td;
        
        
        /**
         * arty.
         *
         * @var int
         */
        protected $arty;
            
        /**
         * The comment.
         *
         * @var string
         */
        protected $kommentar;
    
        
        protected $avg_komunikation;
        
        /**
         * tactical awareness.
         *
         * @var int
         */
        protected $avg_taktisch;
        
        /**
         * light.
         *
         * @var int
         */
        protected $avg_light;
        
        
        /**
         * medium.
         *
         * @var int
         */
        protected $avg_medium;
        
        
        /**
         * heavy.
         *
         * @var int
         */
        protected $avg_heavy;
        
        
        /**
         * td.
         *
         * @var int
         */
        protected $avg_td;
        
        
        /**
         * arty.
         *
         * @var int
         */
        protected $avg_arty;
        
        protected $anz;
        
        /**
         * Sets the Id of the Join.
         *
         * @param int $id
         * @return $this
         */
        public function setId($id)
        {
            $this->id = (int)$id;
    
            return $this;
        }
    
        /**
         * Gets the Id of the Join.
         *
         * @return int
         */
        public function getId()
        {
            return $this->id;
        }
    
        /**
         * Gets the recruit_account_id.
         *
         * @return int
         */
        public function getRecruit_account_id()
        {
            return $this->recruit_account_id;
        }
    
        /**
         * Sets recruit_account_id.
         *
         * @param int $recruit_account_id
         * @return $this
         */
        public function setRecruit_account_id($recruit_account_id)
        {
            $this->recruit_account_id = $recruit_account_id;
    
            return $this;
        }
    
        
        /**
         * Gets the driver_account_id.
         *
         * @return int
         */
        public function getDriver_account_id()
        {
            return $this->driver_account_id;
        }
        
        /**
         * Sets driver_account_id.
         *
         * @param int $driver_account_id
         * @return $this
         */
        public function setDriver_account_id($driver_account_id)
        {
            $this->driver_account_id = $driver_account_id;
            
            return $this;
        }
        
        
        /**
         * Gets recruit_member_name.
         *
         * @return string
         */
        public function getRecruit_member_name()
        {
            return $this->recruit_member_name;
        }
    
        /**
         * Sets recruit_member_name.
         *
         * @param string $recruit_member_name
         * @return $this
         */
        public function setRecruit_member_name($recruit_member_name)
        {
            $this->recruit_member_name = $recruit_member_name;
    
            return $this;
        }
        
        /**
         * Gets driver_member_name.
         *
         * @return string
         */
        public function getDriver_member_name()
        {
            return $this->driver_member_name;
        }
        
        /**
         * Sets driver_member_name.
         *
         */
        public function setDriver_member_name($driver_member_name)
        {
            $this->driver_member_name = $driver_member_name;
            
            return $this;
        }
    
            
        
        /**
         * Gets Member Clan_ID.
         *
         * @return int
         */
        public function getClan_id()
        {
            return $this->clan_id;
        }
        
        /**
         * Sets The Member Clan_ID.
         *
         * @return $this
         */
        public function setClan_id($clan_id)
        {
            $this->clan_id = $clan_id;
            
            return $this;
        }
    
        /**
         * Sets joined_at.
         *
         * @param \Ilch\Date $joined_at
         * @return $this
         */
        public function setJoined_at($joined_at)
        {
            $this->joined_at = $joined_at;
    
            return $this;
        }
    
        /**
         * Gets joined_at.
         *
         * @return \Ilch\Date
         */
        public function getJoined_at()
        {
            return $this->joined_at;
        }
        
        /**
         * Sets end_date.
         *
         * @param \Ilch\Date $end_date
         * @return $this
         */
        public function setEnd_date($end_date)
        {
            $this->end_date = $end_date;
            
            return $this;
        }
        
        /**
         * Gets end_date.
         *
         * @return \Ilch\Date
         */
        public function getEnd_date()
        {
            return $this->end_date;
        }
        
        
        
        /**
         * 
         * recruitment state
         * 
         * 
         */
        
        public function getIs_recruit()
        {
            return $this->is_recruit;
        }
        
        
        public function setIs_recruit($is_recruit)
        {
            $this->is_recruit = $is_recruit;
            return $this;
        }
        
        
        
        /**
         * 
         * communication
         * 
         */
        
        public function getKommunikation()
        {
            return $this->kommunikation;
        }
        
        public function setKommunikation($kommunikation)
        {
            $this->kommunikation = $kommunikation;
            return $this;
        }
        
        
        /**
         * 
         * tank awareness
         * 
         */
        
        
        public function getTaktisch()
        {
            return $this->taktisch;
        }
        
        public function setTaktisch($taktisch)
        {
            $this->taktisch = $taktisch;
            return $this;
        }
        
        
        /**
         * 
         *  Tank Class votings
         * @return int
         * 
         */
        
        public function getLight()
        {
            return $this->light;
        }
        
        public function setLight($light)
        {
            $this->light = $light;
            return $this;
        }
        
        
        public function getMedium()
        {
            return $this->medium;
        }
        
        public function setMedium($medium)
        {
            $this->medium = $medium;
            return $this;
        }
        
        public function getHeavy()
        {
            return $this->heavy;
        }
        
        public function setHeavy($heavy)
        {
            $this->heavy = $heavy;
            return $this;
        }
        
        
        
        public function getTD()
        {
            return $this->td;
        }
        
        public function setTD($td)
        {
            $this->td = $td;
            return $this;
        }
        
        
        
        public function getArty()
        {
            return $this->arty;
        }
        
        public function setArty($arty)
        {
            $this->arty = $arty;
            return $this;
        }
        
        
        
        /**
         *
         * communication
         *
         */
        
        public function getAVG_Kommunikation()
        {
            return $this->avg_kommunikation;
        }
        
        public function setAVG_Kommunikation($avg_kommunikation)
        {
            $this->avg_kommunikation = $avg_kommunikation;
            return $this;
        }
        
        
        /**
         *
         * tank awareness
         *
         */
        
        
        public function getAVG_Taktisch()
        {
            return $this->avg_taktisch;
        }
        
        public function setAVG_Taktisch($avg_taktisch)
        {
            $this->avg_taktisch = $avg_taktisch;
            return $this;
        }
        
        
        /**
         *
         *  Tank Class votings
         * @return int
         *
         */
        
        public function getAVG_Light()
        {
            return $this->avg_light;
        }
        
        public function setAVG_Light($avg_light)
        {
            $this->avg_light = $avg_light;
            return $this;
        }
        
        
        public function getAVG_Medium()
        {
            return $this->avg_medium;
        }
        
        public function setAVG_Medium($avg_medium)
        {
            $this->avg_medium = $avg_medium;
            return $this;
        }
        
        public function getAVG_Heavy()
        {
            return $this->avg_heavy;
        }
        
        public function setAVG_Heavy($avg_heavy)
        {
            $this->avg_heavy = $avg_heavy;
            return $this;
        }
        
        
        
        public function getAVG_TD()
        {
            return $this->avg_td;
        }
        
        public function setAVG_TD($avg_td)
        {
            $this->avg_td = $avg_td;
            return $this;
        }
        
        
        
        public function getAVG_Arty()
        {
            return $this->avg_arty;
        }
        
        public function setAVG_Arty($avg_arty)
        {
            $this->avg_arty = $avg_arty;
            return $this;
        }
        
        
        
        /**
         * Gets comment.
         *
         * @return string
         */
        public function getKommentar()
        {
            return $this->kommentar;
        }
    
        /**
         * Sets comment.
         *
         * @param string $kommentar
         * @return $this
         */
        public function setKommentar($kommentar)
        {
            $this->kommentar = $kommentar;
    
            return $this;
        }
    
        public function getAnz()
        {
            return $this->anz;
        }
        
        public function setAnz($anz)
        {
            $this->anz = $anz;
            return $this;
        }
        
    }



    public function getNewcomertableByClanID($clan_id) {
            $sql ="
                
    Select
      erg.member_name As rekrut,
      erg.joined_at,
      erg.end_date,
      einzel.driver As driver_member_name,
      einzel.kommunikation As kommunikation,
      einzel.taktisch As taktisch,
      einzel.light As light,
      einzel.medium As medium,
      einzel.heavy As heavy,
      einzel.td As td,
      einzel.arty As arty,
      einzel.kommentar As kommentar,
      durchschn.Avg_kommunikation As Avg_kommunikation,
      durchschn.Avg_taktisch As Avg_taktisch,
      durchschn.Avg_light As Avg_light,
      durchschn.Avg_medium As Avg_medium,
      durchschn.Avg_heavy As Avg_heavy,
      durchschn.Avg_td As Avg_td,
      durchschn.Avg_arty As Avg_arty,
      durchschn.anz As anz,
      erg.recruit_account_id,
      erg.is_recruit
    From
      (Select
        [prefix]_recruting_newcomer.joined_at,
        [prefix]_recruting_newcomer.end_date,
        [prefix]_wargaming_clans_members.member_name,
        [prefix]_recruting_newcomer.recruit_account_id,
        [prefix]_recruting_newcomer.is_recruit
      From
        [prefix]_recruting_newcomer Inner Join
        [prefix]_wargaming_clans_members On
          [prefix]_wargaming_clans_members.member_account_id =
          [prefix]_recruting_newcomer.recruit_account_id
      Where
        [prefix]_recruting_newcomer.clan_id = '".$clan_id."') As erg Left Join
      (Select
        ab.member_name As driver,
        aa.kommunikation,
        aa.taktisch,
        aa.light,
        aa.medium,
        aa.heavy,
        aa.td,
        aa.arty,
        aa.kommentar,
        aa.recruit_account_id As rekrut
      From
        [prefix]_recruting_driver aa Inner Join
        [prefix]_wargaming_clans_members ab On ab.member_account_id =
          aa.driver_account_id) As einzel On einzel.rekrut = erg.recruit_account_id
      Left Join
      (Select
        bb.recruit_account_id,
        Avg(bb.kommunikation) As Avg_kommunikation,
        Avg(bb.taktisch) As Avg_taktisch,
        Avg(bb.light) As Avg_light,
        Avg(bb.medium) As Avg_medium,
        Avg(bb.heavy) As Avg_heavy,
        Avg(bb.td) As Avg_td,
        Avg(bb.arty) As Avg_arty,
        count(*) As anz
      From
        [prefix]_recruting_driver bb
      Group By
        bb.recruit_account_id) As durchschn On durchschn.recruit_account_id =
        erg.recruit_account_id
    Order By
      rekrut,
      driver_member_name;";
          
            
            $entryArray = $this->db()->query($sql);
            
            $drivertable = [];
            
            if (empty($entryArray)) {
                return $drivertable;
            }
            
            foreach ($entryArray as $entries) {
                $entryModel = new NewcomerModel();
                $entryModel->setRecruit_member_name($entries['rekrut']);
                $entryModel->setJoined_at($entries['joined_at']);
                $entryModel->setEnd_date($entries['end_date']);
                $entryModel->setDriver_member_name('driver_member_name');
                $entryModel->setKommunikation('kommunikation');
                $entryModel->setTaktisch('taktisch');
                $entryModel->setLight('light');
                $entryModel->setMedium('medium');
                $entryModel->setHeavy('heavy');
                $entryModel->setTD('td');
                $entryModel->setArty('arty');
                $entryModel->setKommentar('kommentar');
                $entryModel->setAVG_Kommunikation('Avg_kommunikation');
                $entryModel->setAVG_Taktisch('Avg_taktisch');
                $entryModel->setAVG_Light('Avg_light');
                $entryModel->setAVG_Medium('Avg_medium');
                $entryModel->setAVG_Heavy('Avg_heavy');
                $entryModel->setAVG_TD('Avg_td');
                $entryModel->setAVG_Arty('Avg_arty');
                $entryModel->setAnz('anz');
                $entryModel->setRecruit_account_id($entries['recruit_account_id']);
                $entryModel->setIs_recruit($entries['is_recruit']);
                
                $drivertable[] = $entryModel;
            }
            
            return $drivertable;
            
            
            
            
        }







    Da wo die namen drin stehen sollten eigentlich werte sein...

    im, sql direkt geht es nur im ilch nicht
    0 Mitglieder finden den Beitrag gut.
  4. #4
    User Pic
    blackcoder Entwickler
    Registriert seit
    22.05.2014
    Beiträge
    2.401
    Beitragswertungen
    389 Beitragspunkte
    Und wie übergibst du die Werte im Controller an die View?

    Wie nutzt du diese in der View?
    0 Mitglieder finden den Beitrag gut.
  5. #5
    User Pic
    Nex4T Moderator
    Registriert seit
    28.02.2007
    Beiträge
    3.414
    Beitragswertungen
    213 Beitragspunkte
    Jap schick mal die view durch
    while(!asleep()) sheep++;
    www.movely.biz
    www.webplant.eu
    0 Mitglieder finden den Beitrag gut.
  6. #6
    User Pic
    MonkeyOnKeyboard Moderator
    Registriert seit
    10.02.2014
    Beiträge
    453
    Beitragswertungen
    22 Beitragspunkte
    <?php
    /**
     * @copyright Ilch 2.0
     * @package ilch
     */
    
    namespace Modules\Recruting\Controllers\Admin;
    
    use Modules\Recruting\Mappers\Newcomer as NewcomerMapper;
    use Modules\Recruting\Models\Newcomer as NewcomerModel;
    use Modules\wargamingauth\Mappers\User as WGUserMapper;
    
    class Newcomer extends \Ilch\Controller\Admin
    {
        public function init()
        {
            $items = [
                
                [
                    'name' => 'applications',
                    'active' => true,
                    'icon' => 'fa fa-th-list',
                    'url' => $this->getLayout()->getUrl(['controller' => 'index', 'action' => 'index']),
                    [
                        'name' => 'history',
                        'active' => false,
                        'icon' => 'fa fa-folder-open',
                        'url' => $this->getLayout()->getUrl(['controller' => 'applicationshistory', 'action' => 'index'])
                    ]
                    
                ],
                [
                    'name' => 'newcomer',
                    'active' => false,
                    'icon' => 'fa fa-th-list',
                    'url' => $this->getLayout()->getUrl(['controller' => 'newcomer', 'action' => 'index'])
                ],
                [
                    'name' => 'manage',
                    'active' => false,
                    'icon' => 'fa fa-th-list',
                    'url' => $this->getLayout()->getUrl(['controller' => 'clan', 'action' => 'index'])
                ],
                [
                    'name' => 'settings',
                    'active' => false,
                    'icon' => 'fa fa-cogs',
                    'url' => $this->getLayout()->getUrl(['controller' => 'settings', 'action' => 'index'])
                ]
            ];
            
            $this->getLayout()->addMenu
            (
                'menuTeams',
                $items
                );
        }
    
        public function indexAction()
        {
            $newcomerMapper = new NewcomerMapper();
            $wargamingUserMapper = new WGUserMapper();
            
            $this->getLayout()->getAdminHmenu()
            ->add($this->getTranslator()->trans('menuNewcomer'), ['controller' => 'newcomer', 'action' => 'index']);
                    
            if (isset ($_SESSION['user_id'])) {
                $user_id = $_SESSION['user_id'];
            } else {
                $user_id = '';
            }
            
            $where = $wargamingUserMapper->getWGUserbyID($user_id);
            foreach ($where as $userparm) {
                //var_dump($userparm->getClantag());die();
                $clantag = $userparm->getClantag();
                $clan_id = $userparm->getClan_id();
            }
            
            //echo "<hr>";var_dump($wargamingUserMapper->getWGUserbyID($user_id)); die();
            
            $this->getView()->set('wguser', $wargamingUserMapper->getWGUserbyID($user_id));
            $this->getView()->set('newcomer', $newcomerMapper->getRecruitByClanID($clan_id));
            $this->getView()->set('newcomertabelle', $newcomerMapper->getNewcomertableByClanID($clan_id));
           
        }
        
        
    }



    <h1><?=$this->getTrans('newcomertable') ?></h1>
    
        <div class="table-responsive" style="overflow: scroll !important;   /* Scrollbar is displayed as it's needed */">
            <table class="table table-hover table-striped" >
            <?php var_dump($this->get('newcomertabelle'));?>
                <?php foreach ($this->get('newcomertabelle') as $newcomertable) :?>
    				<tr>
    				<td><?php echo $newcomertable->getRecruit_member_name(); ?></td>
    				<td><?php echo  $newcomertable->getJoined_at(); ?></td>
    				<td><?php echo  $newcomertable->getEnd_date(); ?></td>
    				<td><?php echo  $newcomertable->getDriver_member_name(); ?></td>
    				<td><?php echo  $newcomertable->getKommunikation(); ?></td>
    				<td><?php echo  $newcomertable->getTaktisch(); ?></td>
    				<td><?php echo  $newcomertable->getLight(); ?></td>
    				<td><?php echo  $newcomertable->getMedium(); ?></td>
    				<td><?php echo  $newcomertable->getHeavy(); ?></td>
    				<td><?php echo  $newcomertable->getTD(); ?></td>
    				<td><?php echo  $newcomertable->getArty(); ?></td>
    				<td><?php echo  $newcomertable->getKommentar(); ?></td>
    				<td><?php echo  $newcomertable->getAVG_Kommunikation(); ?></td>
    				<td><?php echo  $newcomertable->getAVG_Taktisch(); ?></td>
    				<td><?php echo  $newcomertable->getAVG_Light(); ?></td>
    				<td><?php echo  $newcomertable->getAVG_Medium(); ?></td>
    				<td><?php echo  $newcomertable->getAVG_Heavy(); ?></td>
    				<td><?php echo  $newcomertable->getAVG_TD(); ?></td>
    				<td><?php echo  $newcomertable->getAVG_Arty(); ?></td>
    				<td><?php echo  $newcomertable->getAnz(); ?></td>
    				<td><?php echo  $newcomertable->getRecruit_account_id(); ?></td>
    				<td><?php echo  $newcomertable->getIs_recruit(); ?></td>
    				</tr>
    				<?php endforeach;?>
            </table>
        </div>
    0 Mitglieder finden den Beitrag gut.
  7. #7
    User Pic
    blackcoder Entwickler
    Registriert seit
    22.05.2014
    Beiträge
    2.401
    Beitragswertungen
    389 Beitragspunkte
    Liegt wohl doch am Mapper.
    $entryModel->setEnd_date($entries['end_date']);
    $entryModel->setDriver_member_name('driver_member_name');

    Du speicherst hier den String "driver_member_name", anstatt den Wert $entries['driver_member_name'].
    Das ist auch bei den anderen Werten der Fall.


    Zuletzt modifiziert von blackcoder am 08.03.2020 - 19:46:46
    0 Mitglieder finden den Beitrag gut.
  8. #8
    User Pic
    MonkeyOnKeyboard Moderator
    Registriert seit
    10.02.2014
    Beiträge
    453
    Beitragswertungen
    22 Beitragspunkte
    ZitatZitat geschrieben von blackcoder
    Liegt wohl doch am Mapper.
    $entryModel->setEnd_date($entries['end_date']);
    $entryModel->setDriver_member_name('driver_member_name');

    Du speicherst hier den String "driver_member_name", anstatt den Wert $entries['driver_member_name'].
    Das ist auch bei den den anderen Werten der Fall.


    ach du je.... danke das hab ich ja voll vergessen.
    oh man bin ich blöd.
    danke
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Allgemein

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten