<?php

	$extra_sql = "";

	$title = "{TERMS_PAGE_TITLE}";

	$page_content = $db->from('pages')->where('id', 2)->first();
	$seo = json_decode($page_content['page_seo'], true);

		$meta = [
			"title" => $seo['title'],
			"desc" 	=> $seo['desc'],
			"keyw" 	=> $seo['keyw']
		];




	$integration = "";

				foreach($plugins as $plugin){



					if ($plugin['app_id'] !== 1 && $plugin['app_id'] !== 2 && $plugin['app_id'] !== 3 && $plugin['app_id'] !== 4 && $plugin['app_id'] !== 5) {



						@$data = json_decode($plugin['app_data'], true);



						if(@$data['visibility'] == 0){ // Tüm Sayfalar

							@$integration .= $data['code'];

						}elseif(@$data['visibility'] == 1){ // Giriş Yapanlar

							@$integration .= $data['code'];

						}elseif(@$data['visibility'] == 2){

							@$integration .= $data['code'];

						}



					}



				}



	require view("terms");

	$output = ob_get_clean();

	$extra = [

		"{INTEGRATIONS}" => $integration,

		"{TERMS_TEXT}" => htmlspecialchars_decode($page_content['page_content'])

	];

	echo replace($output, $extra);