public function ajax_add() { $this->form_validation->set_rules('name', 'Name', 'required'); $this->form_validation->set_rules('anio', 'Año', 'required'); $this->form_validation->set_rules('estado', 'Estado', 'required'); if ($this->form_validation->run() == FALSE) { echojson_encode(array("status" => FALSE)); } else { $data = array('nombre' => $this->input->post('name'), 'anio' => $this->input->post('anio'), 'estado' => $this->input->post('estado')); $insert = $this->periodos->save($data); echo json_encode(array("status" => TRUE)); } }
public function ajax_add() { $this->form_validation->set_rules('name', 'Name', 'required'); if ($this->form_validation->run() == FALSE) { /* $data['titulo'] = 'Nueva Eps | Gim Master'; $data['main_content'] = 'Eps/index'; $this->load->view('Layout/template',$data);*/ echojson_encode(array("status" => FALSE)); } else { $data = array('detalleEps' => $this->input->post('name')); $insert = $this->eps->save($data); echo json_encode(array("status" => TRUE)); } }
public function ajax_add() { $this->form_validation->set_rules('nit', 'Nit', 'required'); if ($this->form_validation->run() == FALSE) { /* $data['titulnito'] = 'Nueva institucion | Gim Master'; $data['main_content'] = 'institucion/index'; $this->load->view('Layout/template',$data);*/ echojson_encode(array("status" => FALSE)); } else { $data = array('nit' => $this->input->post('nit'), 'ciudad' => $this->input->post('ciudad'), 'nombreInstitucion' => $this->input->post('nombreInstitucion'), 'telefono1' => $this->input->post('telefono1'), 'telefono2' => $this->input->post('telefono2'), 'direccion' => $this->input->post('direccion'), 'correo' => $this->input->post('correo'), 'url' => $this->input->post('url'), 'dane' => $this->input->post('dane'), 'icfes' => $this->input->post('icfes')); $insert = $this->institucion->save($data); echo json_encode(array("status" => TRUE)); } }
public function ajax_add() { $this->form_validation->set_rules('nombres', 'Nombres', 'required'); if ($this->form_validation->run() == FALSE) { /* $data['titulo'] = 'Nueva alumnos | Gim Master'; $data['main_content'] = 'alumnos/index'; $this->load->view('Layout/template',$data);*/ echojson_encode(array("status" => FALSE)); } else { $data = array('tipoIdentificacion' => $this->input->post('tipoIdentificacion'), 'eps' => $this->input->post('eps'), 'ips' => $this->input->post('ips'), 'estado' => $this->input->post('estado'), 'rh' => $this->input->post('rh'), 'genero' => $this->input->post('genero'), 'nombres' => $this->input->post('nombres'), 'apellidoPaterno' => $this->input->post('apellidoPaterno'), 'apellidoMaterno' => $this->input->post('apellidoMaterno'), 'identificacion' => $this->input->post('identificacion'), 'direccion' => $this->input->post('direccion'), 'telefono' => $this->input->post('telefono'), 'celular' => $this->input->post('celular'), 'convive' => $this->input->post('convive'), 'ianterior' => $this->input->post('ianterior'), 'correo' => $this->input->post('correo'), 'fechaNacimiento' => $this->input->post('fechaNacimiento'), 'fechaRegistro' => $this->input->post('fechaRegistro'), 'ciudad' => $this->input->post('ciudad')); $insert = $this->alumnos->save($data); echo json_encode(array("status" => TRUE)); } }
// Instanciate a new ApnsPHP_Push object $push = new ApnsPHP_Push(ApnsPHP_Abstract::ENVIRONMENT_SANDBOX, 'cert/ck.pem'); // $push->setRootCertificationAuthority('cert/entrust_root_certification_authority.pem'); // $push->setProviderCertificatePassphrase('abcd1234!'); $push->connect(); $message = new ApnsPHP_Message($token_push); $message->setCustomIdentifier("Message-Badge-1"); $message->setBadge(1); $message->setText($msg); $message->setSound(); $push->add($message); $push->send(); $push->disconnect(); // Examine the error message container $aErrorQueue = $push->getErrors(); if (!empty($aErrorQueue)) { $code = 400; /*$payload = [ 'code' => 400, 'message' => $aErrorQueue ];*/ } else { $code = 200; /*$payload = [ 'code' => 200, 'message' => 'Mensaje enviado con exito' ];*/ } } echojson_encode($payload);