<?php
if ( !defined( 'SMARTY_DIR' ) ) {
	include_once( 'init.php' );
}

if ($_GET["action"] == "delete") {

	$osDB->query('DELETE from ! where userid = ? and id = ?', array( USERTEMPLATE_TABLE, $_SESSION['UserId'], $_GET["id"] ) );
}

$t->assign( 'templates',$osDB->getAll( 'SELECT * FROM ! WHERE userid = ?', array( USERTEMPLATE_TABLE, $_SESSION['UserId'] ) ) );

$t->assign('rendered_page', $t->fetch('mytemplates.tpl') );

$t->display ( 'index.tpl' );

?>