403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/ptcfinance/application/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/ptcfinance/application/models/Menu.php
<?php

/* * *************************************************************
 * Catabatic Technology Pvt. Ltd.
 * File Name : Menu.php
 * File Description : Menu Model for managed all menus
 * Created By : Praveen Kumar
 * Created Date: 18-September-2014
 * ************************************************************* */

class Application_Model_Menu extends Zend_Db_Table_Abstract {

    public $data = array();

    function __construct() {
        
    }

    /**
     * getAllHomePageMenuList() method is used to get all quick or tiled menu list
     * @param email string
     * @return object 
     */
    public function getAllHomePageMenuList($menuType = NULL) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from(array("hm" => "hierarchy_menu"), array('hm.id', 'hm.parent_id', 'hm.level', 'hm.url', 'hm.image', 'hm.external_url'))
                // ->join(array('hm'=>'hierarchy_menu'),'tm.hierarchy_menu_id=hm.id',array('hm.id','hm.level','hm.url','hm.image','hm.external_url'))
                ->where('hm.parent_id =?', 0)
                ->where('FIND_IN_SET("'.$menuType.'", hm.hierarchy_menu_type)') // for navigation menu
                ->order('hm.orderOfAppearance');
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllSecondLbQuickMenuList() method is used to get all second lebel quick menu list
     * @param email string
     * @return object 
     */
    public function getAllSecondLbQuickMenuList($quick_link_menu_id) {
        $quick_link_menu_id_arr = @explode(",", @$quick_link_menu_id);
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'level', 'url', 'image', 'external_url'))
                ->where('id IN(?)', $quick_link_menu_id_arr)
                ->order('id');
        //echo $select; die;
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllSecondLbTiledMenuList() method is used to get all second lebel tiled menu list
     * @param email string
     * @return object 
     */
    public function getAllSecondLbTiledMenuList($quick_link_menu_id) {
//        $tiled_link_menu_id_arr = @explode(",", @$quick_link_menu_id);
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'level', 'url', 'image', 'external_url'))
                ->where('parent_id IN(?)', $quick_link_menu_id)
                ->where('status =?',1)
                ->order('orderOfAppearance');
        //echo $select; die;
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllSecondLbFooterMenuList() method is used to get all second lebel tiled menu list
     * @param email string
     * @return object 
     */
    public function getAllSecondLbFooterMenuList($quick_link_menu_id) {
        $footer_link_menu_id_arr = @explode(",", @$quick_link_menu_id);
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'level', 'url', 'image', 'external_url'))
                ->where('id IN(?)', $footer_link_menu_id_arr)
                ->order('id')
                ->limit(7, 0);
        //echo $select; die;
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getMenuListByPageUrl() method is used to get all root menu id
     * @param page_url string
     * @return object 
     */
    public function getMenuListByPageUrl($page_url) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'parent_id', 'url', 'external_url', 'level'))
                ->where('url =?', $page_url);
//                ->where('parent_id != (?)', 0);
        $result = $db->fetchRow($select);
        return $result;
    }

    /**
     * getLastParentIdByParentId() method is used to get all root menu id
     * @param page_url string
     * @return object 
     */
    public function getLastParentIdByParentId($parent_id) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'parent_id', 'url', 'external_url'))
                ->where('id =?', $parent_id);
        $result = $db->fetchRow($select);
        return $result;
    }

    /**
     * getAllFirstLbMenuListById() method is used to get all first label menu list
     * @param menu_id integer
     * @return array 
     */
    public function getAllFirstLbMenuListById($menu_id) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'parent_id', 'level', 'sub_level_name', 'url', 'image', 'external_url'))
                ->where('id =?', $menu_id)
                ->order('orderOfAppearance');
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllMenuList() method is used to get all menu list
     * @param menu_id integer
     * @return array 
     */
    public function getAllMenuList() {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
        ->from("hierarchy_menu", array('id','parent_id','level','sub_level_name','url','image','external_url'))
        ->where('status =?',1)
                ->where('parent_id =?',0);
//        $select = "select id,parent_id,level,url,image,external_url from hierarchy_menu where status='1' and FIND_IN_SET('tiled_menu',hierarchy_menu_type) and id!='10' ";
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllSecondORThirdOrFourthLbMenuListById() method is used to get all first label menu list
     * @param menu_id integer
     * @return array 
     */
    public function getAllSecondORThirdOrFourthLbMenuListById($menu_id) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'parent_id', 'level', 'sub_level_name', 'url', 'image', 'external_url'))
                ->where('status =?', 1)
                ->where('parent_id =?', $menu_id)
                ->order('orderOfAppearance');
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllThirdOrFourthLbMenuListArrayById() method is used to get all third and fourth label menu list
     * @param menu_id integer
     * @return array
     */
    public function getAllThirdOrFourthLbMenuListArrayById($menu_id) {
        $db = Zend_Db_Table::getDefaultAdapter();

        $select = $db->select()
                ->from("hierarchy_menu", array('GROUP_CONCAT(url) as sub_url'))
                ->where('parent_id =?', $menu_id)
                ->order('orderOfAppearance');
        $result = $db->fetchRow($select);
        return $result;
    }

    /**
     * getQuickLinkColumn123DataList() method is used to get all quick or tiled menu list
     * @param email string
     * @return object
     */
    public function getQuickLinkColumn123DataList($type) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from(array("tm" => "tbl_menu"), array('tm.quick_link_menu_id'))
                ->join(array('hm' => 'hierarchy_menu'), 'tm.quick_link_menu_id=hm.id', array('hm.id', 'hm.level', 'hm.url', 'hm.image', 'hm.external_url'))
                ->where('tm.hierarchy_menu_type =?', $type)
                ->order(array('tm.orderOfAppearance', 'hm.level'))
                ->limit(10, 0);
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllParentDetailsArrayById() method is used to get all first label menu list
     * @param menu_id integer
     * @return array 
     */
    public function getAllParentDetailsArrayById($parent_id) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('id', 'parent_id', 'level', 'sub_level_name', 'url', 'image', 'external_url'))
                ->where('status =?', 1)
                ->where('id =?', $parent_id)
                ->order('orderOfAppearance');
        $result = $db->fetchRow($select);
        return $result;
    }

    /**
     * getChildListById() method is used to check state name exists or not in db
     * @param email string
     * @return object 
     */
    public function getChildListById($id) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from("hierarchy_menu", array('count(*) AS total_record'))
                ->where('parent_id = ?', $id);
        $result = $db->fetchOne($select);

        return $result;
    }

    /**
     * getParentUrlByUrl() method is used to get all quick or tiled menu list
     * @param email string
     * @return object
     */
    public function getParentUrlByUrl($page_name) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from(array("hmm" => "hierarchy_menu"))
                ->join(array('hm' => 'hierarchy_menu'), 'hmm.parent_id=hm.id', array('hm.id', 'hm.level', 'hm.url', 'hm.image', 'hm.external_url'))
                ->where('hmm.url =?', $page_name);

        $result = $db->fetchRow($select);
        return $result;
    }

    /**
     * getAllTopMenuList() method is used to get all tiled menu list
     * @param email string
     * @return object
     */
    public function getAllTopMenuList($menuType = null) {
        $tiled_menus = $this->getAllHomePageMenuList($menuType);

        $tiled_menu_list_arr = array();
        foreach ($tiled_menus as $tiled_menus_list) { 
           
            $secondlb_tiled_menus = $this->getAllSecondLbTiledMenuList($tiled_menus_list['id']);
            $secondlb_tiled_menus_list_arr = array();
            foreach ($secondlb_tiled_menus as $secondlb_tiled_menus_list) {
                $secondlb_tiled_menus_list_arr[] = array(
                    'id' => $secondlb_tiled_menus_list['id'],
                    'level_name' => $secondlb_tiled_menus_list['level'],
                    'url' => $secondlb_tiled_menus_list['url'],
                    'external_url' => $secondlb_tiled_menus_list['external_url'],
                    'image' => $secondlb_tiled_menus_list['image']
                );
            }

            $tiled_menu_list_arr[] = array(
                'id' => $tiled_menus_list['id'],
                'hierarchy_menu_id' => @$tiled_menus_list['hierarchy_menu_id'],
                'level_name' => $tiled_menus_list['level'],
                'url' => $tiled_menus_list['url'],
                'external_url' => $tiled_menus_list['external_url'],
                'image' => $tiled_menus_list['image'],
                'secondlb_menu_count' => count($secondlb_tiled_menus_list_arr),
                'secondlb_menu' => $secondlb_tiled_menus_list_arr
            );
        }
//echo '<pre>'; print_r($tiled_menu_list_arr); die;
        return $tiled_menu_list_arr;
    }

    /**
     * getAllHomePageMobileMenuList() method is used to get all quick or tiled menu list
     * @param email string
     * @return object 
     */
    public function getAllHomePageMobileMenuList($type) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()
                ->from(array("tm" => "tbl_menu"), array('tm.hierarchy_menu_id', 'tm.quick_link_menu_id'))
                ->join(array('hm' => 'hierarchy_menu'), 'tm.hierarchy_menu_id=hm.id', array('hm.id', 'hm.level', 'hm.url', 'hm.image', 'hm.external_url'))
                ->where('tm.hierarchy_menu_type =?', $type)
                ->order('tm.mobileOrder');
        $result = $db->fetchAll($select);
        return $result;
    }

    /**
     * getAllTopMobileOrderMenuList() method is used to get all tiled menu list
     * @param email string
     * @return object
     */
    public function getAllTopMobileOrderMenuList() {
        $m_tiled_menus = $this->getAllHomePageMobileMenuList($type = 'tiled_menu');

        $tiled_mobile_menu_list_arr = array();
        foreach ($m_tiled_menus as $m_tiled_menus_list) {

            $m_secondlb_tiled_menus = $this->getAllSecondLbTiledMenuList($m_tiled_menus_list['quick_link_menu_id']);
            $m_secondlb_tiled_menus_list_arr = array();
            foreach ($m_secondlb_tiled_menus as $m_secondlb_tiled_menus_list) {
                $m_secondlb_tiled_menus_list_arr[] = array(
                    'id' => $m_secondlb_tiled_menus_list['id'],
                    'level_name' => $m_secondlb_tiled_menus_list['level'],
                    'url' => $m_secondlb_tiled_menus_list['url'],
                    'external_url' => $m_secondlb_tiled_menus_list['external_url'],
                    'image' => $m_secondlb_tiled_menus_list['image']
                );
            }

            $tiled_mobile_menu_list_arr[] = array(
                'id' => $m_tiled_menus_list['id'],
                'hierarchy_menu_id' => $m_tiled_menus_list['hierarchy_menu_id'],
                'level_name' => $m_tiled_menus_list['level'],
                'url' => $m_tiled_menus_list['url'],
                'external_url' => $m_tiled_menus_list['external_url'],
                'image' => $m_tiled_menus_list['image'],
                'secondlb_menu_count' => count($m_secondlb_tiled_menus_list_arr),
                'secondlb_menu' => $m_secondlb_tiled_menus_list_arr
            );
        }

        return $tiled_mobile_menu_list_arr;
    }
    
    
    

}

Youez - 2016 - github.com/yon3zu
LinuXploit