Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function sing_in(){
- echo $_FILES['foto_user']['name'];
- $config["upload_path"] = './uploaded_files';
- $config["allowed_types"] = 'gif|jpg|png';
- $this->load->library("upload",$config);
- if($this->upload->do_upload('foto_user')){
- echo "upload";
- }else{
- echo $this->upload->display_errors();
- }
- }
- $(document).ready(function(){
- var url ='<?php echo base_url()."index.php/inicio/sing_in";?>';
- $('#sing_form').on("submit",function(e){
- e.preventDefault();
- //console.log("submited");
- $.ajax({
- url: url,
- method: "POST",
- data: new FormData(this),
- contentType: false,
- cache:false,
- processData: false,
- success: function(data){
- console.log(data);
- },error:function(data){
- console.log(data)
- }
- });
- });
- });
- /**
- *TABLE SING IN
- **/
- $this->table->set_heading("","Sing in");
- $this->table->add_row(form_label("Username: "),form_input('name_user'));
- $this->table->add_row(form_label("Password: "),form_password("password_user"));
- $this->table->add_row(form_label("Repeat Password: "),form_password("rpassword_user"));
- $this->table->add_row(form_label("Department"),generate_dropdown("department",$departments_results));
- $this->table->add_row(form_label('Foto'),form_upload("foto_user"));
- $this->table->add_row("",form_submit("sing_in","Sing in"));
- echo '<div id="container_table_sign">';
- echo form_open_multipart("",'id="sing_form"','name="sing_form"','method="POST"');
- echo $this->table->generate();
- echo '</div>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement