<?php
class Stock  extends CI_Controller{
    function __construct() {
        parent::__construct();
        $this->Is_Connected();

      }

      public function Is_Connected()
       {
       if (empty($this->session->userdata('SOCAR_ID_USER')))
        {
         redirect(base_url('Login/'));
        }
       }

   
      public function index()
    { 
    $data['resultat']=$this->Model->getRequete('SELECT req_externe_stock.ID_REQ_EXTERNE_STOCK, req_externe_stock.ARTICLE_ELEMENT, req_externe_stock.QUANTITE_ENTREE_STOCK, req_externe_stock.QUANTITE_ACTUEL, req_externe_stock.QUANTITE_SORTIE, req_externe_document.DATE_DEMANDE FROM `req_externe_stock` JOIN req_externe_document ON req_externe_stock.ID_REQ_EXTERNE = req_externe_document.ID_REQ_EXTERNE WHERE DISPONIBLE = 1');
    $data['title']='Stock interne';
    $this->load->view('Stock_List_View',$data);
    }

    public function listing()
    { 
    $data['resultat']=$this->Model->getRequete('SELECT req_externe_stock.ID_REQ_EXTERNE_STOCK, req_externe_stock.ARTICLE_ELEMENT, req_externe_stock.QUANTITE_ENTREE_STOCK, req_externe_stock.QUANTITE_ACTUEL, req_externe_stock.QUANTITE_SORTIE, req_externe_document.DATE_DEMANDE FROM `req_externe_stock` JOIN req_externe_document ON req_externe_stock.ID_REQ_EXTERNE = req_externe_document.ID_REQ_EXTERNE WHERE DISPONIBLE = 0');
    $data['title']='Stock interne';
    $this->load->view('Stock_List_View',$data);
    }

   








}