Exemplo n.º 1
0
 public static function get_instance()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
                 $product_name = "null";
             }
             if (isset($_GET["product_category"])) {
                 $product_category = $_GET["product_category"];
             } else {
                 $product_category = "null";
             }
             $cont->searchProductByGET($product_name, $product_category);
         } else {
             if ($_GET['function'] == "searchProduct") {
                 $ret['message'] = "Undefined Product name or category";
                 $ret['status_code'] = 404;
                 print json_encode($ret);
             } else {
                 if ($_GET['function'] == "viewAll") {
                     $cont = new controllers();
                     $cont->viewAllByGET();
                 } else {
                     $ret['message'] = "Undefined function";
                     $ret['status_code'] = 404;
                     print json_encode($ret);
                 }
             }
         }
     } else {
         $ret['message'] = "Wrong Method GET";
         $ret['status_code'] = 404;
         print json_encode($ret);
     }
 } else {
     $ret['message'] = "Wrong Method";
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     $this->utils->session();
     // starts session
 }
Exemplo n.º 5
0
 public function __destruct()
 {
     parent::__destruct();
 }