Create Custom ZIP File

	public function download_get(){
		$this->check_login();

		$zip = new ZipArchive();
		$dest = FCPATH . 'uploads' . DIRECTORY_SEPARATOR . 'all_works.zip';
		$dest_url = base_url() . 'uploads/all_works.zip';
		//log_g($dest);

		$open = $zip->open($dest, ZIPARCHIVE::OVERWRITE);
		//log_g($open);
		if($open !== true) {
			$this->failed_response(0, '無法建立壓縮檔');
		}
		
		$root = FCPATH . 'uploads' . DIRECTORY_SEPARATOR . 'members' . DIRECTORY_SEPARATOR;
		//log_g($dest);

		$members = $this->competition_m->get_items(false);
		foreach($members as $member){
			if(isset($member->pdf) == false || $member->pdf == ''){
				continue;
			}

			$member_root = $root . $member->id . DIRECTORY_SEPARATOR . 'competition_2014' . DIRECTORY_SEPARATOR;
			$pdf = $member_root . basename($member->pdf);
			$word = $member_root . basename($member->word);

			$folder = $member->country . '_' . $member->email;
			//$folder = iconv("UTF-8", "BIG-5//TRANSLIT", $member->name);
			//log_g($member_name);
			$zip->addFile($pdf, $folder . '/' . basename($member->pdf));
			$zip->addFile($word, $folder . '/' . basename($member->word));
		}

		$zip->close();

		$this->success_response($dest_url);
	}