function uploader() {

			set_time_limit(0);
			
			$this->db->where('preview_picture <>',NULL);
			$this->db->where('preview_picture <>','');
			$products = $this->db->get('shop')->result_array();

			foreach ($products as $product) {

				$product_id = $product['pid'];

				$image = $product['preview_picture'];
				$image_name = pathinfo($image,PATHINFO_FILENAME);
				mkdir("asset/shop/$product_id");

				if (file_exists("asset/shop/RealSize/$image")) {

					$this->db->set('pid',$product_id);
					$this->db->set('shop_id',$product_id);
					$this->db->set('filename',$image);
					$this->db->set('type','picture');
					$this->db->set('format',pathinfo($image,PATHINFO_EXTENSION));
					$this->db->set('main',1);
					$this->db->insert('shop_picture');

					$this->db->set('preview_picture2',$product_id)
							 ->where('pid',$product_id)
							 ->update('shop');

					$ext = pathinfo($image,PATHINFO_EXTENSION);

					copy("asset/shop/RealSize/$image", "asset/shop/$product_id/$product_id.$ext");
					copy("asset/shop/RealSize/$image", "asset/shop/$product_id/{$product_id}_thumb.$ext");

				}

			}

			clear_caches();
			echo 'done';

		}