MMCT TEAM
Server IP : 192.185.129.71  /  Your IP : 3.135.213.128
Web Server : Apache
System : Linux bh-ht-3.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : svymadmin ( 4072)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home4/svymadmin/public_html/vivekaexcel.edu.in/bkp/school/application/models/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home4/svymadmin/public_html/vivekaexcel.edu.in/bkp/school/application/models/Laboratory_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Laboratory_model extends CI_Model {

    public function __construct() {
        parent::__construct();
    }
   
   function insert($table,$data){
      $this->db->insert($table,$data);
      return $this->db->insert_id(); 
   }
   function get($table){
      return $this->db->get($table)->result_array(); 
   }
   
   function  get_experiments(){
     return $this->db->query("SELECT experiments.class_id, experiments.subject_id, class.name as clsname,subject.teacher_id,subject.name as subname,experiments.name,exp_id,description  
     FROM `experiments` JOIN subject on (experiments.subject_id=subject.subject_id) JOIN class on (experiments.class_id=class.class_id)")->result_array();
   }
   function get_experiment_item($id){
      return $this->db->query("SELECT id,experiment_item.item_id,experiments.exp_id,experiment_item.quantity,experiments.name,stock_item.item_name,experiment_item.units  FROM experiment_item
      JOIN stock_item on(experiment_item.item_id=stock_item.item_id) JOIN experiments ON (experiment_item.exp_id=experiments.exp_id) where experiment_item.exp_id=".$id)->result_array();
      
   }
   function get_laboratory_issue(){
       return $this->db->query("SELECT item_issue.id,experiments.name as expname,student.name as studname, item_issue.issue_date as issdate,experiments.class_id , experiments.subject_id, student.student_code, item_issue.status,item_issue.return_date
       FROM `item_issue` JOIN experiments ON item_issue.exp_id = experiments.exp_id JOIN student ON item_issue.student_id=student.student_id")->result_array();
   }
   function get_laboratory_damage(){
       return $this->db->query("SELECT student.name AS studNm,item_name,damage_item.quantity AS quan,fine,student_code,fine_date FROM `damage_item` JOIN student ON damage_item.student_id = student.student_id JOIN stock_item ON damage_item.item_id = stock_item.item_id")->result_array();
   }
   function update($table,$data,$where){
       return $this->db->update($table,$data,$where);
   }
   function get_where($table,$where){
       return  $this->db->get_where($table,$where)->result_array();
   } 
   function delete($table,$col,$id){
       return $this->db->where($col,$id)->delete($table);
   }
   function update_stock_ondamage($quantity,$issued_quantity,$item_id){
         return $this->db->query("UPDATE `stock_item` SET `quantity`= (quantity - ".$quantity."),`issue`= (issue - ".$issued_quantity."),`remaining`=(quantity-issue) WHERE item_id = '".$item_id."'");
   }
   function get_issue($exp_id){
      return $this->db->query("SELECT stock_item.item_id AS id,experiment_item.quantity AS quan, stock_item.remaining AS remain,stock_item.item_type AS type,stock_item.issue as iss FROM `experiment_item` JOIN stock_item ON experiment_item.item_id= stock_item.item_id 
      WHERE experiment_item.exp_id =  '".$exp_id."'")->result_array(); 
   }
   
   
}

MMCT - 2023