<?php 

function uploads_cb() {
	$post = new post;
	$session = session::getInstance();
	$my_uploads = $post->get_post_by_meta_data(['type' => 'image_library', 'user_id' => $session->id]);
	$table = new table("my-uploads", $my_uploads);
	$table->set_display_columns([
		"sn" => "SN",
		"posted_on" => "Date Created",
		"user_id" => "Library User",
		"ref" => "Library Ref",
		"files" => "Number of Files"
	]);
	$table->set_dynamic_columns([
		"user_id" => "_tf_get_fullname_id",
		"files" => "_tf_serialized_array_count"
	]);
	$table->set_action_links([
		"View Library" => 'view-upload-library'
	]);
	$table->set_action_access([
		"View Library" => 'view_upload_library'
	]);
	// $table->set_action_callback([
	// 	"Delete Ticket" => "delete_support_ticket"
	// ]);
	$table->set_action_args([
		"View Library" => ["id" => "id"],
	]);
	?>
	<div class="row">
		<div class="col-md-12">
			<div class="panel">
				<div class="panel-heading">
					<h3>My Upload libraries</h3>
				</div>
				<div class="panel-body">
					<div id="my-libraries">
						<?php $table->display(); ?>
					</div>
				</div>
			</div>
		</div>
	</div>
	<?php
}