• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
images thumbs don't show ???

#1
[eluser]ludo31[/eluser]
Hello ,

I would like to create a Zoom with images so I have image folder in the same level that application :
and inside image folder there is thumbs folder :
so here is the controller about upload :

Code:
// fonction me permettant de telecharger les photos
             public function do_upload()
             {
                
                  $identifiant_chaussure = $this->input->post('identifiant');
                  
                  
                //  echo ('identifiant '.$identifiant_chaussure) ;  exit ;
                  
                
                $config['upload_path'] = './image/';
                $config['allowed_types'] = 'gif|jpg|png';
                $config['max_size']     = '100';
                $config['max_width']  = '1024';
                $config['max_height']  = '768';
                
                $config['encrypt_name'] = true ;
                
                $this->load->library('upload', $config);
        
                if ( ! $this->upload->do_upload())
                {
                        $error = array('error' => $this->upload->display_errors());
                        
                        $this->load->view('image_view', $error);
                }      
                else
                {
                        // $data = array('upload_data' => $this->upload->data());
                        
                        $data = $this->upload->data();
                        
                        
                        
                        // print_r($data);exit ;
                        
                        $this->load->view('upload_success', $data);
                        
                         $source = element('full_path',$data);
                        
                        
                        $config['image_library'] = 'gd2';
                        $config['source_image'] = $source;
                        $config['new_image'] = './image/thumbs/';
                        $config['create_thumb'] = TRUE;
                        $config['maintain_ratio'] = TRUE;
                        $config['width'] = 150;
                        $config['height'] = 150;

                        $this->load->library('image_lib', $config);

                        $this->image_lib->resize();
                        
                        
                        
                        $nom_path = element('file_name',$data);
                        
                       // echo $nom_path ;
                      //  echo ('identifiant '.$identifiant_chaussure) ;  exit ;
                      
                      
                      $this->site_model->ajoutImages($nom_path , $identifiant_chaussure);
                      
                      redirect('site');
                        
                        
                            
                        
                        
                        
  }





so when I try with function to extract information I have that with var_dump
Code:
public function gestionHomme()
        {
            $data['rows'] = $this->client_model->getHomme();
            
             var_dump($data); exit;
          }

I have that

Code:
array
  'rows' =>
    array
      0 =>
        object(stdClass)[20]
          public 'id' => string '62' (length=2)
          public 'nom' => string 'zonezero' (length=8)
          public 'prix' => string '1542000.00' (length=10)
          public 'nom_marques' => string 'Nike' (length=4)
          public 'nom_path' => string 'cc26f6307e8270dae1e948bc89128cab.jpg' (length=36)
          public 'quantite' => string '12' (length=2)
          public 'semelle_interieure' => string '0' (length=1)
          public 'libelle_fermeture' => string 'A enfiler' (length=9)
          public 'libelle_style' => string 'Baskets' (length=7)
          public 'libelle_talon' => string 'plat' (length=4)
          public 'libelle_doublure' => string 'textile' (length=7)
          public 'libelle_semelle' => string 'synthétique' (length=12)
          public 'libelle_dessus' => string 'synthétique' (length=12)
      1 =>
        object(stdClass)[21]
          public 'id' => string '65' (length=2)
          public 'nom' => string 'rambo' (length=5)
          public 'prix' => string '125000.00' (length=9)
          public 'nom_marques' => string 'Nike' (length=4)
          public 'nom_path' => string 'e52cfd1971c4b46d45f911c82a14154c.jpg' (length=36)
          public 'quantite' => string '2' (length=1)
          public 'semelle_interieure' => string '1' (length=1)
          public 'libelle_fermeture' => string 'A enfiler' (length=9)
          public 'libelle_style' => string 'Baskets' (length=7)
          public 'libelle_talon' => string 'plat' (length=4)
          public 'libelle_doublure' => string 'textile' (length=7)
          public 'libelle_semelle' => string 'synthétique' (length=12)
          public 'libelle_dessus' => string 'synthétique' (length=12)

in order to show that the nom_path is correct

so when I try to send in view
Code:
$this->load->view('homme_view',$data);

and in homme_view file whan I try that it works

Code:
<?php if($rows!=null):
         foreach ($rows as $r): ?>
  <img src="&lt;?php echo base_url(); ?&gt;image/&lt;?php echo $r-&gt;nom_path; ?&gt;" alt="jesus" /><br/>

&lt;?php endforeach;endif; ?&gt;

but I try to show the image thumbs it doesn't work

Code:
&lt;?php if($rows!=null):
         foreach ($rows as $r): ?&gt;
  <img src="&lt;?php echo base_url(); ?&gt;image/thumbs/&lt;?php echo $r-&gt;nom_path; ?&gt;" alt="jesus" /><br/>

&lt;?php endforeach;endif; ?&gt;


do you know what's the problem !!

thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.