<?php defined('BASEPATH') OR exit('No direct script access allowed');
//include APPPATH.'third_party/Braintree.php';
class Noveltie {
// private const ASIGNADO=22;
// private const NOASIGNADO=21;
public $CI;
public $user="";
public $started=false;
public $services = array();
//....
private function __construct(){
$this->CI =& get_instance();
$this->CI->load->helper('url');
$this->CI->load->library('session');
$this->CI->config->item('base_url');
$this->CI->load->database();
$this->user=$this->CI->session->userdata('username-admin');
array_push($this->log,"Class noveltie has been instantiated \n");
}
public function initialize($data){
$this->IdEmpresa = $data["IdCompany"];
$this->fecha = $data["date"];
$this->started = true;
array_push($this->log,"Se inicializo clase Noveltie \n");
array_push($this->log,"No hay una novedad \n");
}
public function getlog( $lines,&$place ){
}
public function createFromArray($datos){
this NOT work..
$this->CI->db->insert("my_table",$datos);
//this work
foreach ( $datos as $llave => $valor ){
$this->CI->db->set($llave,$valor);
}
$this->CI->db->insert("my_table");
}
public function test(){
// var_dump($this->collection);return;
array_push($this->log,"En test \n");
$this->CI->db->set('campo',"phphp");
$this->CI->db->insert("test");
array_push($this->log,$this->CI->db->_error_message()." \n");
array_push($this->log,"En test salida \n");
}
public static function getInstance() {
if (self::$_instance === null) {
self::$_instance = new self();
}
return self::$_instance;
}
}//end of class