<?php
class Normasorganizacion_model extends Model {
function __construct() {
parent::Model();
}
function SaveForm($form_data, $id_normas_organizacion=NULL) {
if($id_normas_organizacion == NULL) {
$this->db->insert('normas_organizacion', $form_data);
$id_seguridad_personal = $this->db->insert_id();
$this->session->set_userdata('id', $id_normas_organizacion);
}
else {
$this->db->where('id', $id_normas_organizacion);
$this->db->update('normas_organizacion', $form_data);
}
if ($this->db->affected_rows() == '1') {
return TRUE;
}
return FALSE;
}
function get_info($tabla) {
return $this->db->get($tabla);
}
function get_datos($id_general) {
$this->db->where('id_datos_generales', $id_general);
$query = $this->db->get('normas_organizacion');
if ($query->num_rows() > 0) {
return $query->row();
}
}
}
?>