<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class QR extends MY_Controller{
	public function index(){
		$this->load->library("ciqrcode");
		$get = $this->input->get();
		
		$content = $this->input->get('CONTENT');
		
		$level_array = array("L", "M", "Q", "H");
		$level = in_array($this->input->get('LEVEL'), $level_array)? $get['LEVEL']:$level_array[count($level_array) - 1];
		
		if($content != ""){
			header("Content-Type: image/png");
			$this->ciqrcode->generate(array(
				'data' => $content,
				'level' => $level,
			));
		}
	}
}