Wordpress - CHTheme Plugin

A theme builder for a wordpress plugin.

Breifing

The objective was to beautify a mortgage calculator plugin and to make it customizable.

<?php
//Global Variables
global $dupe;

//Includes
include WP_CONTENT_DIR."/plugins/chcTheme/includes/menu.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/change.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/current.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/install.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/new.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/delete.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/prethemes.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/show.php";
include WP_CONTENT_DIR."/plugins/chcTheme/includes/update.php";
include WP_CONTENT_DIR."/plugins/chcTheme/page/index.php";
include WP_CONTENT_DIR."/plugins/chcTheme/page/form.php";

//Menus
add_action('admin_menu', 'chMenu');

//Activation
register_activation_hook(__FILE__, 'chInstall');
?>

Simple HTML Forms

<script type="text/javascript" src="../wp-content/plugins/chcTheme/js/jscolor.js"></script>
<h1>Create A Theme</h1>
    <form name="cmhc" method="post" action="?page=ClickHelp&do=new">
    <?php chForm(); ?>  
    <div class="group">
        <input type="submit" name="chNew" value="Save"/>
    </div>
</div>
</form>

Loading Preset/Saved Themes

<?php
function chThemesDropDown(){
    global $wpdb;
    $table_name = $wpdb->prefix . "chCalculator";
    $sql = $wpdb->get_results("SELECT * FROM " . $table_name . "");  
    foreach ($sql as $row){ 
         echo '<option value="' .$row->id. '">' .$row->title. '</option>';
    }
}
?>

Load Current Theme

<?php
function getCurrentTheme(){
    global $wpdb;
    $table_name = $wpdb->prefix . "chCalculatorCurrentTheme";
    $sql = $wpdb->get_row("SELECT * FROM " . $table_name . " LEFT JOIN wp_chCalculator ON wp_chCalculator.id=" . $table_name . ".tid");
    echo 'Current Theme: ',$sql->title;
}
?>

Picture

CHTheme AdminCP