var $table='organizacia';
var $org=array(
'oid'=>false,
'short_name'=>false,
'full_name'=>false,
'tip'=>null,
'otdelen'=>null,
'plat_name'=>null,
'gol_org'=>null,
'sthet_id'=>null,
'inn'=>null,
'kpp'=>null,
'ogrn'=>null,
'date_reg'=>null,
'code_ifns'=>null,
'name_ifns'=>null,
'date_svidet'=>null,
'num_svidet'=>null,
'code_org_vid_svidet'=>null,
'code_nalog_organ'=>null,
'name_nalog_organ'=>null,
'urid_adres'=>null,
'fiz_adres'=>null,
'tel_fiz'=>null,
'tel_urid'=>null,
'fax_fiz'=>null,
'pochta'=>null,
'uchereditel'=>null,
'email'=>null,
'intern'=>null,
'info'=>null,
'code_okato'=>null,
'okpo'=>null,
'koknh'=>null,
'code_okopf'=>null,
'name_okopf'=>null,
'code_okfs'=>null,
'name_okfs'=>null,
'code_okved'=>null,
'name_okved'=>null,
'code_inspekc_poluch'=>null,
'num_pfr'=>null,
'ter_id'=>null,
'num_fss'=>null,
'str_reg'=>null,
'str_mesto'=>null,
'kod_nal'=>null,
'poln_name'=>null,
'rukovod'=>null,
'gl_buch'=>null,
'kassir'=>null,
);
function select($who=null)
{
global $engine;
$engine->db->select($this->org,$this->table,$who);
@$engine->db->info.='org->select(ID:'.$who['id'].')';
if($engine->db->query()) return $this->org=$engine->db->result();
}
function insert($who=array())
{
global $engine;
$engine->db->insert($this->org,$this->table);
@$engine->db->info.='user->select(ID:'.$who['id'].', UL:'.$who['ulogin'].', UP:'.$who['upassword'].')';
if($engine->db->query()) return $engine->db->result();
}
function update($who=array())
{
global $engine;
$engine->db->update($this->org,$this->table,$who);
@$engine->db->info.='org->update(ID:'.$who['id'].')';
if($engine->db->query()) return $engine->db->result();
}
function delete($who=array())
{
global $engine;
$engine->db->delete($this->table,$who);
@$engine->db->info.='user->delete(ID:'.$who['id'].')';
if($engine->db->query()) return $engine->db->result();
}