<?php
// This script and data application were generated by AppGini 5.81
// Download AppGini for free from https://bigprof.com/appgini/download/

	$currDir=dirname(__FILE__);
	include("$currDir/defaultLang.php");
	include("$currDir/language.php");
	include("$currDir/lib.php");
	@include("$currDir/hooks/billeteries.php");
	include("$currDir/billeteries_dml.php");

	// mm: can the current member access this page?
	$perm=getTablePermissions('billeteries');
	if(!$perm[0]) {
		echo error_message($Translation['tableAccessDenied'], false);
		echo '<script>setTimeout("window.location=\'index.php?signOut=1\'", 2000);</script>';
		exit;
	}

	$x = new DataList;
	$x->TableName = "billeteries";

	// Fields that can be displayed in the table view
	$x->QueryFieldsTV = array(
		"`billeteries`.`idbilleterie`" => "idbilleterie",
		"IF(    CHAR_LENGTH(`gestion_transactions1`.`link_in`), CONCAT_WS('',   `gestion_transactions1`.`link_in`), '') /* Link fin */" => "link_out",
		"`billeteries`.`facture`" => "facture",
		"if(`billeteries`.`date`,date_format(`billeteries`.`date`,'%d/%m/%Y'),'')" => "date",
		"IF(    CHAR_LENGTH(`produits_services1`.`produit_service`), CONCAT_WS('',   `produits_services1`.`produit_service`), '') /* Service */" => "service",
		"IF(    CHAR_LENGTH(`clients1`.`prenom`) || CHAR_LENGTH(`clients1`.`nom`), CONCAT_WS('',   `clients1`.`prenom`, '   ', `clients1`.`nom`), '') /* Client */" => "passager",
		"IF(    CHAR_LENGTH(`gds1`.`gds`), CONCAT_WS('',   `gds1`.`gds`), '') /* GDS */" => "gds",
		"IF(    CHAR_LENGTH(`compagnies1`.`nom_compagnie`) || CHAR_LENGTH(`type_compagnie1`.`type_compangie`), CONCAT_WS('',   `compagnies1`.`nom_compagnie`, '   |   ', `type_compagnie1`.`type_compangie`), '') /* Compagnie */" => "compagnie",
		"IF(    CHAR_LENGTH(`items1`.`item`), CONCAT_WS('',   `items1`.`item`), '') /* Parcours */" => "parcours",
		"IF(    CHAR_LENGTH(`produits_services2`.`produit_service`), CONCAT_WS('',   `produits_services2`.`produit_service`), '') /* D&#233;signation */" => "nature_transaction",
		"`billeteries`.`billet`" => "billet",
		"`billeteries`.`dossier`" => "dossier",
		"REPLACE(FORMAT(`billeteries`.`prix_achat`, 0), ',', ' ')" => "prix_achat",
		"REPLACE(FORMAT(`billeteries`.`prix_vente`, 0), ',', ' ')" => "prix_vente",
		"`billeteries`.`qts`" => "qts",
		"REPLACE(FORMAT(`billeteries`.`commission`, 0), ',', ' ')" => "commission",
		"REPLACE(FORMAT(`billeteries`.`frais_service`, 0), ',', ' ')" => "frais_service",
		"REPLACE(FORMAT(`billeteries`.`frais_assurance`, 0), ',', ' ')" => "frais_assurance",
		"`billeteries`.`mtva`" => "mtva",
		"`billeteries`.`tva`" => "tva",
		"`billeteries`.`tht`" => "tht",
		"REPLACE(FORMAT(`billeteries`.`net_compagnie`, 0), ',', ' ')" => "net_compagnie",
		"`billeteries`.`net_a_payer`" => "net_a_payer",
		"`billeteries`.`account`" => "account",
		"`billeteries`.`reste_a_payer`" => "reste_a_payer",
		"`billeteries`.`agent`" => "agent",
		"`billeteries`.`groupe`" => "groupe",
		"`billeteries`.`observations`" => "observations",
	);
	// mapping incoming sort by requests to actual query fields
	$x->SortFields = array(
		1 => '`billeteries`.`idbilleterie`',
		2 => '`gestion_transactions1`.`link_in`',
		3 => 3,
		4 => '`billeteries`.`date`',
		5 => '`produits_services1`.`produit_service`',
		6 => 6,
		7 => '`gds1`.`gds`',
		8 => 8,
		9 => '`items1`.`item`',
		10 => '`produits_services2`.`produit_service`',
		11 => 11,
		12 => 12,
		13 => '`billeteries`.`prix_achat`',
		14 => '`billeteries`.`prix_vente`',
		15 => '`billeteries`.`qts`',
		16 => '`billeteries`.`commission`',
		17 => '`billeteries`.`frais_service`',
		18 => '`billeteries`.`frais_assurance`',
		19 => '`billeteries`.`mtva`',
		20 => '`billeteries`.`tva`',
		21 => '`billeteries`.`tht`',
		22 => '`billeteries`.`net_compagnie`',
		23 => '`billeteries`.`net_a_payer`',
		24 => '`billeteries`.`account`',
		25 => '`billeteries`.`reste_a_payer`',
		26 => 26,
		27 => 27,
		28 => 28,
	);

	// Fields that can be displayed in the csv file
	$x->QueryFieldsCSV = array(
		"`billeteries`.`idbilleterie`" => "idbilleterie",
		"IF(    CHAR_LENGTH(`gestion_transactions1`.`link_in`), CONCAT_WS('',   `gestion_transactions1`.`link_in`), '') /* Link fin */" => "link_out",
		"`billeteries`.`facture`" => "facture",
		"if(`billeteries`.`date`,date_format(`billeteries`.`date`,'%d/%m/%Y'),'')" => "date",
		"IF(    CHAR_LENGTH(`produits_services1`.`produit_service`), CONCAT_WS('',   `produits_services1`.`produit_service`), '') /* Service */" => "service",
		"IF(    CHAR_LENGTH(`clients1`.`prenom`) || CHAR_LENGTH(`clients1`.`nom`), CONCAT_WS('',   `clients1`.`prenom`, '   ', `clients1`.`nom`), '') /* Client */" => "passager",
		"IF(    CHAR_LENGTH(`gds1`.`gds`), CONCAT_WS('',   `gds1`.`gds`), '') /* GDS */" => "gds",
		"IF(    CHAR_LENGTH(`compagnies1`.`nom_compagnie`) || CHAR_LENGTH(`type_compagnie1`.`type_compangie`), CONCAT_WS('',   `compagnies1`.`nom_compagnie`, '   |   ', `type_compagnie1`.`type_compangie`), '') /* Compagnie */" => "compagnie",
		"IF(    CHAR_LENGTH(`items1`.`item`), CONCAT_WS('',   `items1`.`item`), '') /* Parcours */" => "parcours",
		"IF(    CHAR_LENGTH(`produits_services2`.`produit_service`), CONCAT_WS('',   `produits_services2`.`produit_service`), '') /* D&#233;signation */" => "nature_transaction",
		"`billeteries`.`billet`" => "billet",
		"`billeteries`.`dossier`" => "dossier",
		"REPLACE(FORMAT(`billeteries`.`prix_achat`, 0), ',', ' ')" => "prix_achat",
		"REPLACE(FORMAT(`billeteries`.`prix_vente`, 0), ',', ' ')" => "prix_vente",
		"`billeteries`.`qts`" => "qts",
		"REPLACE(FORMAT(`billeteries`.`commission`, 0), ',', ' ')" => "commission",
		"REPLACE(FORMAT(`billeteries`.`frais_service`, 0), ',', ' ')" => "frais_service",
		"REPLACE(FORMAT(`billeteries`.`frais_assurance`, 0), ',', ' ')" => "frais_assurance",
		"`billeteries`.`mtva`" => "mtva",
		"`billeteries`.`tva`" => "tva",
		"`billeteries`.`tht`" => "tht",
		"REPLACE(FORMAT(`billeteries`.`net_compagnie`, 0), ',', ' ')" => "net_compagnie",
		"`billeteries`.`net_a_payer`" => "net_a_payer",
		"`billeteries`.`account`" => "account",
		"`billeteries`.`reste_a_payer`" => "reste_a_payer",
		"`billeteries`.`agent`" => "agent",
		"`billeteries`.`groupe`" => "groupe",
		"`billeteries`.`observations`" => "observations",
	);
	// Fields that can be filtered
	$x->QueryFieldsFilters = array(
		"`billeteries`.`idbilleterie`" => "ID",
		"IF(    CHAR_LENGTH(`gestion_transactions1`.`link_in`), CONCAT_WS('',   `gestion_transactions1`.`link_in`), '') /* Link fin */" => "Link fin",
		"`billeteries`.`facture`" => "N&#176; Facture",
		"`billeteries`.`date`" => "Date",
		"IF(    CHAR_LENGTH(`produits_services1`.`produit_service`), CONCAT_WS('',   `produits_services1`.`produit_service`), '') /* Service */" => "Service",
		"IF(    CHAR_LENGTH(`clients1`.`prenom`) || CHAR_LENGTH(`clients1`.`nom`), CONCAT_WS('',   `clients1`.`prenom`, '   ', `clients1`.`nom`), '') /* Client */" => "Client",
		"IF(    CHAR_LENGTH(`gds1`.`gds`), CONCAT_WS('',   `gds1`.`gds`), '') /* GDS */" => "GDS",
		"IF(    CHAR_LENGTH(`compagnies1`.`nom_compagnie`) || CHAR_LENGTH(`type_compagnie1`.`type_compangie`), CONCAT_WS('',   `compagnies1`.`nom_compagnie`, '   |   ', `type_compagnie1`.`type_compangie`), '') /* Compagnie */" => "Compagnie",
		"IF(    CHAR_LENGTH(`items1`.`item`), CONCAT_WS('',   `items1`.`item`), '') /* Parcours */" => "Parcours",
		"IF(    CHAR_LENGTH(`produits_services2`.`produit_service`), CONCAT_WS('',   `produits_services2`.`produit_service`), '') /* D&#233;signation */" => "D&#233;signation",
		"`billeteries`.`billet`" => "N&#176;BILLET",
		"`billeteries`.`dossier`" => "N&#176; Dossier",
		"`billeteries`.`prix_achat`" => "PRIX D\'ACHAT",
		"`billeteries`.`prix_vente`" => "PRIX DE VENTE (prix unitaire)",
		"`billeteries`.`qts`" => "QTS",
		"`billeteries`.`commission`" => "COMMISSION",
		"`billeteries`.`frais_service`" => "FRAIS DE SERVICE",
		"`billeteries`.`frais_assurance`" => "FRAIS ASSURANCES",
		"`billeteries`.`mtva`" => "Montant TVA",
		"`billeteries`.`tva`" => "TVA",
		"`billeteries`.`tht`" => "NET POUR MAREGA VOYAGE",
		"`billeteries`.`net_compagnie`" => "NET COMPAGNIES",
		"`billeteries`.`net_a_payer`" => "NET A PAYER",
		"`billeteries`.`account`" => "ACCOMPTE",
		"`billeteries`.`reste_a_payer`" => "RESTE A PAYER",
		"`billeteries`.`agent`" => "Agent",
		"`billeteries`.`groupe`" => "Groupe",
		"`billeteries`.`observations`" => "Observations",
	);

	// Fields that can be quick searched
	$x->QueryFieldsQS = array(
		"`billeteries`.`idbilleterie`" => "idbilleterie",
		"IF(    CHAR_LENGTH(`gestion_transactions1`.`link_in`), CONCAT_WS('',   `gestion_transactions1`.`link_in`), '') /* Link fin */" => "link_out",
		"`billeteries`.`facture`" => "facture",
		"if(`billeteries`.`date`,date_format(`billeteries`.`date`,'%d/%m/%Y'),'')" => "date",
		"IF(    CHAR_LENGTH(`produits_services1`.`produit_service`), CONCAT_WS('',   `produits_services1`.`produit_service`), '') /* Service */" => "service",
		"IF(    CHAR_LENGTH(`clients1`.`prenom`) || CHAR_LENGTH(`clients1`.`nom`), CONCAT_WS('',   `clients1`.`prenom`, '   ', `clients1`.`nom`), '') /* Client */" => "passager",
		"IF(    CHAR_LENGTH(`gds1`.`gds`), CONCAT_WS('',   `gds1`.`gds`), '') /* GDS */" => "gds",
		"IF(    CHAR_LENGTH(`compagnies1`.`nom_compagnie`) || CHAR_LENGTH(`type_compagnie1`.`type_compangie`), CONCAT_WS('',   `compagnies1`.`nom_compagnie`, '   |   ', `type_compagnie1`.`type_compangie`), '') /* Compagnie */" => "compagnie",
		"IF(    CHAR_LENGTH(`items1`.`item`), CONCAT_WS('',   `items1`.`item`), '') /* Parcours */" => "parcours",
		"IF(    CHAR_LENGTH(`produits_services2`.`produit_service`), CONCAT_WS('',   `produits_services2`.`produit_service`), '') /* D&#233;signation */" => "nature_transaction",
		"`billeteries`.`billet`" => "billet",
		"`billeteries`.`dossier`" => "dossier",
		"REPLACE(FORMAT(`billeteries`.`prix_achat`, 0), ',', ' ')" => "prix_achat",
		"REPLACE(FORMAT(`billeteries`.`prix_vente`, 0), ',', ' ')" => "prix_vente",
		"`billeteries`.`qts`" => "qts",
		"REPLACE(FORMAT(`billeteries`.`commission`, 0), ',', ' ')" => "commission",
		"REPLACE(FORMAT(`billeteries`.`frais_service`, 0), ',', ' ')" => "frais_service",
		"REPLACE(FORMAT(`billeteries`.`frais_assurance`, 0), ',', ' ')" => "frais_assurance",
		"`billeteries`.`mtva`" => "mtva",
		"`billeteries`.`tva`" => "tva",
		"`billeteries`.`tht`" => "tht",
		"REPLACE(FORMAT(`billeteries`.`net_compagnie`, 0), ',', ' ')" => "net_compagnie",
		"`billeteries`.`net_a_payer`" => "net_a_payer",
		"`billeteries`.`account`" => "account",
		"`billeteries`.`reste_a_payer`" => "reste_a_payer",
		"`billeteries`.`agent`" => "agent",
		"`billeteries`.`groupe`" => "groupe",
		"`billeteries`.`observations`" => "observations",
	);

	// Lookup fields that can be used as filterers
	$x->filterers = array('link_out' => 'Link fin', 'service' => 'Service', 'passager' => 'Client', 'gds' => 'GDS', 'compagnie' => 'Compagnie', 'parcours' => 'Parcours', 'nature_transaction' => 'D&#233;signation', );

	$x->QueryFrom = "`billeteries` LEFT JOIN `gestion_transactions` as gestion_transactions1 ON `gestion_transactions1`.`idgtransaction`=`billeteries`.`link_out` LEFT JOIN `produits_services` as produits_services1 ON `produits_services1`.`idps`=`billeteries`.`service` LEFT JOIN `clients` as clients1 ON `clients1`.`idclient`=`billeteries`.`passager` LEFT JOIN `gds` as gds1 ON `gds1`.`idgds`=`billeteries`.`gds` LEFT JOIN `compagnies` as compagnies1 ON `compagnies1`.`idcompagnie`=`billeteries`.`compagnie` LEFT JOIN `type_compagnie` as type_compagnie1 ON `type_compagnie1`.`idtypecompagnie`=`compagnies1`.`type` LEFT JOIN `items` as items1 ON `items1`.`iditem`=`billeteries`.`parcours` LEFT JOIN `produits_services` as produits_services2 ON `produits_services2`.`idps`=`billeteries`.`nature_transaction` ";
	$x->QueryWhere = '';
	$x->QueryOrder = '';

	$x->AllowSelection = 1;
	$x->HideTableView = ($perm[2]==0 ? 1 : 0);
	$x->AllowDelete = $perm[4];
	$x->AllowMassDelete = true;
	$x->AllowInsert = $perm[1];
	$x->AllowUpdate = $perm[3];
	$x->SeparateDV = 1;
	$x->AllowDeleteOfParents = 0;
	$x->AllowFilters = 1;
	$x->AllowSavingFilters = 1;
	$x->AllowSorting = 1;
	$x->AllowNavigation = 1;
	$x->AllowPrinting = 1;
	$x->AllowPrintingDV = 1;
	$x->AllowCSV = 1;
	$x->RecordsPerPage = 10;
	$x->QuickSearch = 1;
	$x->QuickSearchText = $Translation["quick search"];
	$x->ScriptFileName = "billeteries_view.php";
	$x->RedirectAfterInsert = "billeteries_view.php?SelectedID=#ID#";
	$x->TableTitle = "SUIVI DES TRANSACTIONS";
	$x->TableIcon = "resources/table_icons/document_copies.png";
	$x->PrimaryKey = "`billeteries`.`idbilleterie`";
	$x->DefaultSortField = '`billeteries`.`date`';
	$x->DefaultSortDirection = 'desc';

	$x->ColWidth   = array(  150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150);
	$x->ColCaption = array("Date", "Service", "GDS", "Compagnie", "Parcours", "PRIX D'ACHAT", "PRIX DE VENTE (prix unitaire)", "QTS", "COMMISSION", "FRAIS DE SERVICE", "FRAIS ASSURANCES", "Montant TVA", "TVA", "NET POUR MAREGA VOYAGE", "NET COMPAGNIES", "NET A PAYER", "ACCOMPTE", "RESTE A PAYER", "Agent", "Groupe");
	$x->ColFieldName = array('date', 'service', 'gds', 'compagnie', 'parcours', 'prix_achat', 'prix_vente', 'qts', 'commission', 'frais_service', 'frais_assurance', 'mtva', 'tva', 'tht', 'net_compagnie', 'net_a_payer', 'account', 'reste_a_payer', 'agent', 'groupe');
	$x->ColNumber  = array(4, 5, 7, 8, 9, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27);

	// template paths below are based on the app main directory
	$x->Template = 'templates/billeteries_templateTV.html';
	$x->SelectedTemplate = 'templates/billeteries_templateTVS.html';
	$x->TemplateDV = 'templates/billeteries_templateDV.html';
	$x->TemplateDVP = 'templates/billeteries_templateDVP.html';

	$x->ShowTableHeader = 1;
	$x->TVClasses = "";
	$x->DVClasses = "";
	$x->HighlightColor = '#FFF0C2';
	$x->HasCalculatedFields = false;

	// mm: build the query based on current member's permissions
	$DisplayRecords = $_REQUEST['DisplayRecords'];
	if(!in_array($DisplayRecords, array('user', 'group'))) { $DisplayRecords = 'all'; }
	if($perm[2]==1 || ($perm[2]>1 && $DisplayRecords=='user' && !$_REQUEST['NoFilter_x'])) { // view owner only
		$x->QueryFrom.=', membership_userrecords';
		$x->QueryWhere="where `billeteries`.`idbilleterie`=membership_userrecords.pkValue and membership_userrecords.tableName='billeteries' and lcase(membership_userrecords.memberID)='".getLoggedMemberID()."'";
	}elseif($perm[2]==2 || ($perm[2]>2 && $DisplayRecords=='group' && !$_REQUEST['NoFilter_x'])) { // view group only
		$x->QueryFrom.=', membership_userrecords';
		$x->QueryWhere="where `billeteries`.`idbilleterie`=membership_userrecords.pkValue and membership_userrecords.tableName='billeteries' and membership_userrecords.groupID='".getLoggedGroupID()."'";
	}elseif($perm[2]==3) { // view all
		// no further action
	}elseif($perm[2]==0) { // view none
		$x->QueryFields = array("Not enough permissions" => "NEP");
		$x->QueryFrom = '`billeteries`';
		$x->QueryWhere = '';
		$x->DefaultSortField = '';
	}
	// hook: billeteries_init
	$render=TRUE;
	if(function_exists('billeteries_init')) {
		$args=array();
		$render=billeteries_init($x, getMemberInfo(), $args);
	}

	if($render) $x->Render();

	// column sums
	if(strpos($x->HTML, '<!-- tv data below -->')) {
		// if printing multi-selection TV, calculate the sum only for the selected records
		if(isset($_REQUEST['Print_x']) && is_array($_REQUEST['record_selector'])) {
			$QueryWhere = '';
			foreach($_REQUEST['record_selector'] as $id) {   // get selected records
				if($id != '') $QueryWhere .= "'" . makeSafe($id) . "',";
			}
			if($QueryWhere != '') {
				$QueryWhere = 'where `billeteries`.`idbilleterie` in ('.substr($QueryWhere, 0, -1).')';
			}else{ // if no selected records, write the where clause to return an empty result
				$QueryWhere = 'where 1=0';
			}
		}else{
			$QueryWhere = $x->QueryWhere;
		}

		$sumQuery = "select REPLACE(FORMAT(sum(`billeteries`.`prix_achat`), 0), ',', ' '), REPLACE(FORMAT(sum(`billeteries`.`prix_vente`), 0), ',', ' '), REPLACE(FORMAT(sum(`billeteries`.`commission`), 0), ',', ' '), REPLACE(FORMAT(sum(`billeteries`.`frais_service`), 0), ',', ' '), REPLACE(FORMAT(sum(`billeteries`.`frais_assurance`), 0), ',', ' '), sum(`billeteries`.`tva`), sum(`billeteries`.`tht`), REPLACE(FORMAT(sum(`billeteries`.`net_compagnie`), 0), ',', ' '), sum(`billeteries`.`net_a_payer`), sum(`billeteries`.`account`), sum(`billeteries`.`reste_a_payer`) from {$x->QueryFrom} {$QueryWhere}";
		$res = sql($sumQuery, $eo);
		if($row = db_fetch_row($res)) {
			$sumRow = '<tr class="success">';
			if(!isset($_REQUEST['Print_x'])) $sumRow .= '<td class="text-center"><strong>&sum;</strong></td>';
			$sumRow .= '<td class="billeteries-date"></td>';
			$sumRow .= '<td class="billeteries-service"></td>';
			$sumRow .= '<td class="billeteries-gds"></td>';
			$sumRow .= '<td class="billeteries-compagnie"></td>';
			$sumRow .= '<td class="billeteries-parcours"></td>';
			$sumRow .= "<td class=\"billeteries-prix_achat text-right\">{$row[0]}</td>";
			$sumRow .= "<td class=\"billeteries-prix_vente text-right\">{$row[1]}</td>";
			$sumRow .= '<td class="billeteries-qts"></td>';
			$sumRow .= "<td class=\"billeteries-commission text-right\">{$row[2]}</td>";
			$sumRow .= "<td class=\"billeteries-frais_service text-right\">{$row[3]}</td>";
			$sumRow .= "<td class=\"billeteries-frais_assurance text-right\">{$row[4]}</td>";
			$sumRow .= '<td class="billeteries-mtva"></td>';
			$sumRow .= "<td class=\"billeteries-tva text-right\">{$row[5]}</td>";
			$sumRow .= "<td class=\"billeteries-tht text-right\">{$row[6]}</td>";
			$sumRow .= "<td class=\"billeteries-net_compagnie text-right\">{$row[7]}</td>";
			$sumRow .= "<td class=\"billeteries-net_a_payer text-right\">{$row[8]}</td>";
			$sumRow .= "<td class=\"billeteries-account text-right\">{$row[9]}</td>";
			$sumRow .= "<td class=\"billeteries-reste_a_payer text-right\">{$row[10]}</td>";
			$sumRow .= '<td class="billeteries-agent"></td>';
			$sumRow .= '<td class="billeteries-groupe"></td>';
			$sumRow .= '</tr>';

			$x->HTML = str_replace('<!-- tv data below -->', '', $x->HTML);
			$x->HTML = str_replace('<!-- tv data above -->', $sumRow, $x->HTML);
		}
	}

	// hook: billeteries_header
	$headerCode='';
	if(function_exists('billeteries_header')) {
		$args=array();
		$headerCode=billeteries_header($x->ContentType, getMemberInfo(), $args);
	}  
	if(!$headerCode) {
		include_once("$currDir/header.php"); 
	}else{
		ob_start(); include_once("$currDir/header.php"); $dHeader=ob_get_contents(); ob_end_clean();
		echo str_replace('<%%HEADER%%>', $dHeader, $headerCode);
	}

	echo $x->HTML;
	// hook: billeteries_footer
	$footerCode='';
	if(function_exists('billeteries_footer')) {
		$args=array();
		$footerCode=billeteries_footer($x->ContentType, getMemberInfo(), $args);
	}  
	if(!$footerCode) {
		include_once("$currDir/footer.php"); 
	}else{
		ob_start(); include_once("$currDir/footer.php"); $dFooter=ob_get_contents(); ob_end_clean();
		echo str_replace('<%%FOOTER%%>', $dFooter, $footerCode);
	}
?>