Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. public function sing_in(){
  2.  
  3. echo $_FILES['foto_user']['name'];
  4.  
  5. $config["upload_path"] = './uploaded_files';
  6. $config["allowed_types"] = 'gif|jpg|png';
  7.  
  8.  
  9. $this->load->library("upload",$config);
  10.  
  11. if($this->upload->do_upload('foto_user')){
  12.  
  13. echo "upload";
  14.  
  15. }else{
  16. echo $this->upload->display_errors();
  17. }
  18.  
  19.  
  20. }
  21.  
  22. $(document).ready(function(){
  23.  
  24.  
  25. var url ='<?php echo base_url()."index.php/inicio/sing_in";?>';
  26.  
  27.  
  28. $('#sing_form').on("submit",function(e){
  29.  
  30. e.preventDefault();
  31. //console.log("submited");
  32.  
  33.  
  34. $.ajax({
  35. url: url,
  36. method: "POST",
  37. data: new FormData(this),
  38. contentType: false,
  39. cache:false,
  40. processData: false,
  41. success: function(data){
  42. console.log(data);
  43. },error:function(data){
  44. console.log(data)
  45. }
  46. });
  47.  
  48. });
  49.  
  50.  
  51. });
  52.  
  53. /**
  54. *TABLE SING IN
  55. **/
  56. $this->table->set_heading("","Sing in");
  57. $this->table->add_row(form_label("Username: "),form_input('name_user'));
  58. $this->table->add_row(form_label("Password: "),form_password("password_user"));
  59. $this->table->add_row(form_label("Repeat Password: "),form_password("rpassword_user"));
  60. $this->table->add_row(form_label("Department"),generate_dropdown("department",$departments_results));
  61. $this->table->add_row(form_label('Foto'),form_upload("foto_user"));
  62. $this->table->add_row("",form_submit("sing_in","Sing in"));
  63.  
  64. echo '<div id="container_table_sign">';
  65. echo form_open_multipart("",'id="sing_form"','name="sing_form"','method="POST"');
  66. echo $this->table->generate();
  67. echo '</div>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement