<commit_before><?php

$test_data = (object) array(
    array(
    	'id' => 23,
    	'firstname' => 'Sally',
    	'lastname' => 'Mally',
    	'created' => '2011-01-18 11:12:44',
    	'product_sales' => 52.00,
    	'event_sales' => 43.98
    ),
    array(
    	'id' => 57,
    	'firstname' => 'Billy',
    	'lastname' => 'Mister',
    	'created' => '1985-09-12 08:08:53',
    	'product_sales' => 52.00,
    	'event_sales' => 43.98
    ),
    array(
    	'id' => 82,
    	'firstname' => 'Tammy',
    	'lastname' => 'Wilkson',
    	'created' => '1969-06-14 05:09:32',
    	'product_sales' => 52.00,
    	'event_sales' => 43.98
    )
);

include_once('hyper_table.php');

$table = new hyper_table();
$table->set_info($test_data);
$table->set_table(array(
    'id' => 'table_id',
    'class' => 'table_class',
    'style' => '',
    'border' => '5',
    'padding' => '10',
    'spacing' => '1'
));
$table->set_header(array(
	'columns' => array(
		array(
			'title' => ''
		),
		array(
			'dbval' => 'firstname',
			'title' => 'First Name',
			'style' => 'width:140px;',
			'atag' => array(
				'href' => 'http://www.hello.com',
				'title' => 'title firstname',
				'class' => 'a_firstname'
			)
		),
        array(
        	'dbval' => 'lastname',
			'title' => 'Last Name',
			'class' => 'last_class',
			'style' => 'width:180px;'
		),
		array(
			'dbval' => 'created',
			'title' => 'Date'
		),
		array(
			'title' => 'buttons',
			'value' => '<img id="{{firstname}}" src="https://www.google.com/images/srpr/logo3w.png" />'
		),
		array(
			'style' => 'width: 100px;'
		)
	)
));
$table->set_body(array(
	'even_class' => 'odd',
	'odd_class' => 'even',
	'funcs' => array(
		'created' => function($date) {
			return date('F j, Y, g:i a', strtotime($date));
		},
		'firstname' => function($firstname,$table) {
			return $firstname.' {{lastname}}'." ".($table->replace_data('{{product_sales}}') + $table->replace_data('{{event_sales}}'));
		}
	)
));

echo $table->generate();

?><commit_msg>Made changes to example to test for different variations.<commit_after><?php

$test_data = (object) array(
    array(
    	'id' => 23,
    	'firstname' => 'Sally',
    	'lastname' => 'Mally',
    	'created' => '2011-01-18 11:12:44',
    	'product_sales' => 26.52,
    	'event_sales' => 102.87
    ),
    array(
    	'id' => 57,
    	'firstname' => 'Billy',
    	'lastname' => 'Mister',
    	'created' => '1985-09-12 08:08:53',
    	'product_sales' => 52.00,
    	'event_sales' => 43.98
    ),
    array(
    	'id' => 82,
    	'firstname' => 'Tammy',
    	'lastname' => 'Wilkson',
    	'created' => '1969-06-14 05:09:32',
    	'product_sales' => 72.65,
    	'event_sales' => 5.96
    )
);

include_once('hyper_table.php');

$table = new hyper_table();
$table->set_info($test_data);
$table->set_table(array(
    'id' => 'table_id',
    'class' => 'table_class',
    'style' => '',
    'border' => '5',
    'padding' => '10',
    'spacing' => '1'
));
$table->set_header(array(
	'columns' => array(
		array(
			'title' => ''
		),
		array(
			'dbval' => 'firstname',
			'title' => 'First Name',
			'style' => 'width:140px;',
			'atag' => array(
				'href' => 'http://www.hello.com',
				'title' => 'title firstname',
				'class' => 'a_firstname'
			)
		),
        array(
        	'dbval' => 'lastname',
			'title' => 'Last Name',
			'class' => 'last_class',
			'style' => 'width:180px;'
		),
		array(
			'dbval' => 'created',
			'title' => 'Date'
		),
		array(
			'value' => '<img id="{{id}}" src="https://www.google.com/images/srpr/logo3w.png" />'
		),
		array(
			'title' => 'Empty',
			'style' => 'width: 100px;'
		)
	)
));
$table->set_body(array(
	'even_class' => 'odd',
	'odd_class' => 'even',
	'funcs' => array(
		'created' => function($date) {
			return date('F j, Y, g:i a', strtotime($date));
		},
		'firstname' => function($firstname,$table) {
			return $firstname.' {{lastname}}'." ".($table->replace_data('{{product_sales}}') + $table->replace_data('{{event_sales}}'));
		}
	)
));

echo $table->generate();

?>
{'fraction_non_alphanumeric': 0.24681170292573143, 'fraction_numerical': 0.043010752688172046, 'mean_word_length': 2.952569169960474, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 115, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '2292565', 'n_tokens_mistral': 1879, 'n_tokens_neox': 1629, 'n_words': 280}