<?php

/* 
 * Author       : Jai K
 * Purpose      : Main file for Masters module related functions
 * Created On   : 2016-12-12 11:37
 */

class Masters extends DB{
    
    function __construct(){
        parent::__construct();
        
    }
    
    
    /*
     * User Module
     */
    function users() {
        
        switch( CMD ) :
            
            case 'USERLIST' :
                // List all services
                
                $query = "SELECT id,name FROM " . TBL_USERS . " ORDER BY id DESC ";
                $results = $this->get_results($query);
                
                return $results;

            break;    
        
            default : 
                throw new Exception('Given command is not found!');
            break;

        endswitch;
                
    }
    
    
    /*
     * Service Menu module
     */
    function services_menu(){
        
                
        switch( CMD ) :

            case 'UPDATE_IT' :
                // Modify the Row
                $args = array(
                    'status'    => 2
                );

                $this->db->update( TBL_SERVICE, $args );



            break;    
        
            default : return 'NOCMD'; break;

        endswitch;
                
            
    }
    
    
    
}