<commit_before>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
class PrintController extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */

	public function __construct()
	{
		parent::__construct();

		// if ($this->session->userdata('SESS_AKUN_IS_LOGIN') && $this->session->userdata('SESS_AKUN_USER_PRIV') === 1) {
		// 	redirect(base_url('akun/dashboard'));
		// }
		
		$this->output->set_header('Last-Modified:'.gmdate('D,d M Y H:i:s').'GMT');
		$this->output->set_header('Cache-Control:no-store, no-cache, must-revalidate');
		$this->output->set_header('Cache-Control:post-check=0,pre-check=0',false);
		$this->output->set_header('Pragma: no-cache');

		$this->load->model('m_login');
		// $this->load->library('Userauth');
		
	}
	
	public function cetak()
	{
		 $this->load->library("EscPos.php");

		try {
		    // Enter the share name for your USB printer here
			// $connector = new Escpos\PrintConnectors\FilePrintConnector("/dev/usb/lp0");
		    $connector = new  Escpos\PrintConnectors\WindowsPrintConnector("Printer Receipt");
		    /* Print a "Hello world" receipt" */
		    $printer = new Escpos\Printer($connector);
		    $printer->text("Hello World!\n");
		    $printer->cut();

		    /* Close printer */
		    $printer -> close();
		} catch(Exception $e) {
		    echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";

		}
	}
}
<commit_msg>open cash drawer<commit_after>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
class PrintController extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */

	public function __construct()
	{
		parent::__construct();

		// if ($this->session->userdata('SESS_AKUN_IS_LOGIN') && $this->session->userdata('SESS_AKUN_USER_PRIV') === 1) {
		// 	redirect(base_url('akun/dashboard'));
		// }
		
		$this->output->set_header('Last-Modified:'.gmdate('D,d M Y H:i:s').'GMT');
		$this->output->set_header('Cache-Control:no-store, no-cache, must-revalidate');
		$this->output->set_header('Cache-Control:post-check=0,pre-check=0',false);
		$this->output->set_header('Pragma: no-cache');

		$this->load->model('m_login');
		// $this->load->library('Userauth');
		
	}
	
	public function cetak()
	{
		 $this->load->library("EscPos.php");

		try {
		    // Enter the share name for your USB printer here
			// $connector = new Escpos\PrintConnectors\FilePrintConnector("/dev/usb/lp0");
		    $connector = new  Escpos\PrintConnectors\WindowsPrintConnector("Printer Receipt");
		    /* Print a "Hello world" receipt" */
		    $printer = new Escpos\Printer($connector);
		    $printer->text("Hello World!\n");
		    $printer->cut();
		    $printer->pulse();

		    /* Close printer */
		    $printer -> close();
		} catch(Exception $e) {
		    echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";

		}
	}
}

{'fraction_non_alphanumeric': 0.17028985507246377, 'fraction_numerical': 0.003105590062111801, 'mean_word_length': 3.49941792782305, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 50, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7648795', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1260, 'n_words': 259}