function getFormCode($form, $is_widget_form = false)
 {
     ccf_utils::startSession();
     if (empty($form)) {
         return '';
     }
     $admin_options = parent::getAdminOptions();
     $form_key = time();
     $out = '';
     $form_styles = '';
     $style_class = !$is_widget_form ? ' customcontactform' : ' customcontactform-sidebar';
     $form_id = esc_attr('form-' . $form->id . '-' . $form_key);
     if ($form->form_style != 0) {
         $style = parent::selectStyle($form->form_style, '');
         $style_class = $style->style_slug;
     }
     $form_method = empty($form->form_method) ? 'post' : strtolower($form->form_method);
     $form_title = ccf_utils::decodeOption($form->form_title, 1, 1);
     $action = !empty($form->form_action) ? $form->form_action : $_SERVER['REQUEST_URI'];
     $file_upload_form = '';
     //$out .= '<form id="'.$form_id.'" method="'.$form_method.'" action="'.$action.'" class="'.$style_class.'">' . "\n";
     $out .= ccf_utils::decodeOption($form->custom_code, 1, 1) . "\n";
     if (!empty($form_title) && !$is_widget_form) {
         $out .= '<h4 id="h4-' . esc_attr($form->id) . '-' . $form_key . '">' . esc_html($form_title) . '</h4>' . "\n";
     }
     $fields = parent::getAttachedFieldsArray($form->id);
     $hiddens = '';
     $code_type = $admin_options['code_type'] == 'XHTML' ? ' /' : '';
     $add_reset = '';
     foreach ($fields as $field_id) {
         $field = parent::selectField($field_id, '');
         $req = ($field->field_required == 1 or $field->field_slug == 'ishuman') ? '* ' : '';
         $req_long = $field->field_required == 1 ? ' ' . __('(required)', 'custom-contact-forms') : '';
         $input_id = 'id="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '-' . $form_key . '"';
         $field_value = esc_attr(ccf_utils::decodeOption($field->field_value, 1, 1));
         $instructions = empty($field->field_instructions) ? '' : 'title="' . esc_attr($field->field_instructions) . $req_long . '" ';
         $tooltip_class = empty($field->field_instructions) ? '' : 'ccf-tooltip-field';
         if ($admin_options['enable_widget_tooltips'] == 0 && $is_widget_form) {
             $instructions = '';
         }
         if (isset($_SESSION['ccf_fields'][$field->field_slug])) {
             if ($admin_options['remember_field_values'] == 1) {
                 $field_value = esc_attr($_SESSION['ccf_fields'][$field->field_slug]);
             }
         }
         if ($field->field_slug == 'captcha') {
             $out .= '<div>' . "\n" . $this->getCaptchaCode($field, $form->id) . "\n" . '</div>' . "\n";
         } elseif ($field->field_slug == 'recaptcha') {
             $out .= '<div>' . "\n" . $this->getReCaptchaCode($field, $form->id) . "\n" . '</div>' . "\n";
         } elseif ($field->field_slug == 'usaStates') {
             $field->field_value = $field_value;
             $out .= '<div>' . "\n" . $this->getStatesCode($field, $form->id) . "\n" . '</div>' . "\n";
         } elseif ($field->field_slug == 'ishuman') {
             $field->field_value = $field_value;
             $out .= '<div>' . "\n" . $this->getIsHumanCode($field, $form->id) . "\n" . '</div>' . "\n";
         } elseif ($field->field_slug == 'allCountries') {
             $field->field_value = $field_value;
             $out .= '<div>' . "\n" . $this->getCountriesCode($field, $form->id) . "\n" . '</div>' . "\n";
         } elseif ($field->field_slug == 'resetButton') {
             $add_reset = ' <input type="reset" ' . $instructions . ' class="reset-button ' . $field->field_class . ' ' . $tooltip_class . '" value="' . esc_attr($field->field_value) . '" />';
         } elseif ($field->field_type == 'Text') {
             $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="' . esc_attr($field->field_maxlength) . '"';
             $out .= '<div>' . "\n" . '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' . "\n" . '<input class="' . esc_attr($field->field_class) . ' ' . $tooltip_class . '" ' . $instructions . ' ' . $input_id . ' type="text" name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '" value="' . $field_value . '"' . $maxlength . '' . $code_type . '>' . "\n" . '</div>' . "\n";
         } elseif ($field->field_type == 'File') {
             $file_upload_form = ' enctype="multipart/form-data" ';
             $out .= '<div>' . "\n" . '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' . "\n" . '<input class="' . esc_attr($field->field_class) . ' ' . $tooltip_class . '" ' . $instructions . ' ' . $input_id . ' type="file" name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '" value="' . $field_value . '"' . $code_type . '>' . "\n" . '</div>' . "\n";
         } elseif ($field->field_type == 'Date') {
             $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="' . $field->field_maxlength . '"';
             $out .= '<div>' . "\n" . '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' . "\n" . '<input class="' . esc_attr($field->field_class) . ' ccf-datepicker ' . $tooltip_class . '" ' . $instructions . ' ' . $input_id . ' type="text" name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '" value="' . $field_value . '"' . $maxlength . '' . $code_type . '>' . "\n" . '</div>' . "\n";
         } elseif ($field->field_type == 'Hidden') {
             $hiddens .= '<input type="hidden" name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '" value="' . $field_value . '" ' . $input_id . '' . $code_type . '>' . "\n";
         } elseif ($field->field_type == 'Textarea') {
             $out .= '<div>' . "\n" . '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' . "\n" . '<textarea class="' . esc_attr($field->field_class) . ' ' . $tooltip_class . '" ' . $instructions . ' ' . $input_id . ' rows="5" cols="40" name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $field_value . '</textarea>' . "\n" . '</div>' . "\n";
         } elseif ($field->field_type == 'Dropdown') {
             $field_options = '';
             $options = parent::getAttachedFieldOptionsArray($field->id);
             foreach ($options as $option_id) {
                 $option = parent::selectFieldOption($option_id);
                 $option_sel = ($field_value == $option->option_label || $field_value == $option->option_value) && !empty($field_value) ? ' selected="selected"' : '';
                 $option_value = !empty($option->option_value) ? ' value="' . esc_attr($option->option_value) . '"' : '';
                 // Weird way of marking a state dead. TODO: Find another way.
                 $option_value = $option->option_dead == 1 ? ' value="' . CCF_DEAD_STATE_VALUE . '"' : $option_value;
                 $field_options .= '<option' . $option_sel . '' . $option_value . '>' . esc_attr($option->option_label) . '</option>' . "\n";
             }
             if (!empty($options)) {
                 if (!$is_widget_form) {
                     $out .= '<div>' . "\n" . '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' . "\n" . '<select ' . $instructions . ' ' . $input_id . ' name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '" class="' . esc_attr($field->field_class) . ' ' . $tooltip_class . '">' . "\n" . $field_options . '</select>' . "\n" . '</div>' . "\n";
                 } else {
                     $out .= '<div>' . "\n" . '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' . "\n" . '<select class="' . esc_attr($field->field_class) . ' ' . $tooltip_class . '" ' . $instructions . ' ' . $input_id . ' name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . "\n" . $field_options . '</select>' . "\n" . '</div>' . "\n";
                 }
             }
         } elseif ($field->field_type == 'Radio') {
             $field_options = '';
             $options = parent::getAttachedFieldOptionsArray($field->id);
             foreach ($options as $option_id) {
                 $option = parent::selectFieldOption($option_id);
                 $option_sel = ($field_value == $option->option_label || $field_value == $option->option_value) && !empty($field_value) ? ' checked="checked"' : '';
                 $field_options .= '<div><input' . $option_sel . ' class="' . esc_attr($field->field_class) . ' ' . $tooltip_class . '" type="radio" ' . $instructions . ' name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '" value="' . ccf_utils::decodeOption($option->option_value, 1, 1) . '"' . $code_type . '> <label class="select" for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . ccf_utils::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
             }
             $field_label = !empty($field->field_label) ? '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' : '';
             if (!empty($options)) {
                 $out .= '<div>' . "\n" . $field_label . "\n" . $field_options . "\n" . '</div>' . "\n";
             }
         } elseif ($field->field_type == 'Checkbox') {
             $field_options = '';
             $options = parent::getAttachedFieldOptionsArray($field->id);
             $z = 0;
             foreach ($options as $option_id) {
                 $option = parent::selectFieldOption($option_id);
                 $field_value_array = !is_array($field_value) ? array() : $field_value;
                 $option_sel = in_array($option->option_label, $field_value_array) || in_array($option->option_value, $field_value_array) ? ' checked="checked"' : '';
                 $check_value = empty($option->option_value) ? esc_html($option->option_label) : ccf_utils::decodeOption($option->option_value, 1, 1);
                 $field_options .= '<div><input' . $option_sel . ' class="' . esc_attr($field->field_class) . ' ' . $tooltip_class . '" type="checkbox" ' . $instructions . ' name="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '[' . $z . ']" value="' . $check_value . '"' . $code_type . '> <label class="select" for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . ccf_utils::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
                 $z++;
             }
             $field_label = !empty($field->field_label) ? '<label for="' . ccf_utils::decodeOption($field->field_slug, 1, 1) . '">' . $req . ccf_utils::decodeOption($field->field_label, 1, 1) . '</label>' : '';
             if (!empty($options)) {
                 $out .= '<div>' . "\n" . $field_label . "\n" . $field_options . "\n" . '</div>' . "\n";
             }
         }
     }
     if (!empty($file_upload_form)) {
         $out = '<input type="hidden" name="MAX_FILE_SIZE" value="' . intval($admin_options['max_file_upload_size']) * 1000 * 1000 . '" />' . "\n" . $out;
     }
     $out = '<form id="' . $form_id . '" method="' . esc_attr($form_method) . '" action="' . esc_url($action) . '" class="' . esc_attr($style_class) . '"' . $file_upload_form . '>' . "\n" . $out;
     $submit_text = !empty($form->submit_button_text) ? ccf_utils::decodeOption($form->submit_button_text, 1, 0) : __('Submit', 'custom-contact-forms');
     $out .= '<input name="form_page" value="' . esc_url($_SERVER['REQUEST_URI']) . '" type="hidden"' . $code_type . '>' . "\n" . '<input type="hidden" name="fid" value="' . esc_attr($form->id) . '"' . $code_type . '>' . "\n" . $hiddens . "\n" . '<input type="submit" id="submit-' . esc_attr($form->id) . '-' . $form_key . '" class="submit" value="' . $submit_text . '" name="customcontactforms_submit"' . $code_type . '>';
     if (!empty($add_reset)) {
         $out .= $add_reset;
     }
     $out .= "\n" . '</form>';
     if ($form->form_style != 0) {
         $no_border = array('', '0', '0px', '0%', '0pt', '0em');
         $round_border = !in_array($style->field_borderround, $no_border) ? '-moz-border-radius:' . esc_attr($style->field_borderround) . '; -khtml-border-radius:' . esc_attr($style->field_borderround) . '; -webkit-border-radius:' . esc_attr($style->field_borderround) . '; ' : '';
         $round_border_none = '-moz-border-radius:0px; -khtml-border-radius:0px; -webkit-border-radius:0px; ';
         $form_styles .= '<style type="text/css">' . "\n";
         $form_styles .= '#' . $form_id . " { width: " . esc_attr($style->form_width) . "; text-align:left; padding:" . esc_attr($style->form_padding) . "; margin:" . esc_attr($style->form_margin) . "; border:" . esc_attr($style->form_borderwidth) . " " . esc_attr($style->form_borderstyle) . " #" . esc_attr(parent::formatStyle($style->form_bordercolor)) . "; background-color:#" . esc_attr(parent::formatStyle($style->form_backgroundcolor)) . "; font-family:" . esc_attr($style->form_fontfamily) . "; } \n";
         $form_styles .= '#' . $form_id . " div { margin-bottom:6px; background-color:inherit; }\n";
         $form_styles .= '#' . $form_id . " div div { margin:0; background-color:inherit; padding:0; }\n";
         $form_styles .= '#' . $form_id . " h4 { padding:0; background-color:inherit; margin:" . esc_attr($style->title_margin) . " " . esc_attr($style->title_margin) . " " . esc_attr($style->title_margin) . " 0; color:#" . esc_attr(parent::formatStyle($style->title_fontcolor)) . "; font-size:" . esc_attr($style->title_fontsize) . "; } \n";
         $form_styles .= '#' . $form_id . " label { padding:0; background-color:inherit; margin:" . esc_attr($style->label_margin) . " " . esc_attr($style->label_margin) . " " . esc_attr($style->label_margin) . " 0; display:block; color:#" . esc_attr(parent::formatStyle($style->label_fontcolor)) . "; width:" . esc_attr($style->label_width) . "; font-size:" . esc_attr($style->label_fontsize) . "; } \n";
         $form_styles .= '#' . $form_id . " div div input { margin-bottom:2px; line-height:normal; }\n";
         $form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }\n";
         $form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
         $form_styles .= '#' . $form_id . " input[type=text], #" . $form_id . " select { " . $round_border . " color:#" . esc_attr(parent::formatStyle($style->field_fontcolor)) . "; margin:0; width:" . esc_attr($style->input_width) . "; font-size:" . esc_attr($style->field_fontsize) . "; background-color:#" . esc_attr(parent::formatStyle($style->field_backgroundcolor)) . "; border:1px " . esc_attr($style->field_borderstyle) . " #" . esc_attr(parent::formatStyle($style->field_bordercolor)) . "; } \n";
         $form_styles .= '#' . $form_id . " select { " . $round_border_none . " width:" . esc_attr($style->dropdown_width) . "; }\n";
         $form_styles .= '#' . $form_id . " .submit { color:#" . esc_attr(parent::formatStyle($style->submit_fontcolor)) . "; width:" . esc_attr($style->submit_width) . "; height:" . esc_attr($style->submit_height) . "; font-size:" . esc_attr($style->submit_fontsize) . "; } \n";
         if (!empty($style->submit_background)) {
             $form_styles .= '#' . $form_id . " .submit { background:url(" . esc_attr($style->submit_background) . ") " . esc_attr($style->submit_background_repeat) . " top left; border:0; }";
         }
         $form_styles .= '#' . $form_id . " .reset-button { color:#" . esc_attr(parent::formatStyle($style->submit_fontcolor)) . "; width:" . esc_attr($style->submit_width) . "; height:" . esc_attr($style->submit_height) . "; font-size:" . esc_attr($style->submit_fontsize) . "; } \n";
         $form_styles .= '#' . $form_id . " textarea { " . $round_border . " color:#" . esc_attr(parent::formatStyle($style->field_fontcolor)) . "; width:" . esc_attr($style->textarea_width) . "; margin:0; background-color:#" . esc_attr(parent::formatStyle($style->textarea_backgroundcolor)) . "; font-family:" . esc_attr($style->form_fontfamily) . "; height:" . esc_attr($style->textarea_height) . "; font-size:" . esc_attr($style->field_fontsize) . "; border:1px " . esc_attr($style->field_borderstyle) . " #" . esc_attr(parent::formatStyle($style->field_bordercolor)) . "; } \n";
         $form_styles .= '.ccf-tooltip { background-color:#' . esc_attr(parent::formatStyle($style->tooltip_backgroundcolor)) . '; font-family:' . esc_attr($style->form_fontfamily) . '; font-color:#' . esc_attr(parent::formatStyle($style->tooltip_fontcolor)) . '; font-size:' . esc_attr($style->tooltip_fontsize) . '; }' . "\n";
         $form_styles .= '</style>' . "\n";
     }
     return $form_styles . $out;
 }
        function printAdminPage()
        {
            $admin_options = parent::getAdminOptions();
            $show_checkbox_warning = false;
            if ($admin_options['show_install_popover'] == 1) {
                $admin_options['show_install_popover'] = 0;
                $show_checkbox_warning = true;
                ?>
                <script type="text/javascript" language="javascript">
					$j(document).ready(function() {
						$j("#ccf-usage-popover").dialog('open');
					});
				</script>
                <?php 
                update_option(parent::getAdminOptionsName(), $admin_options);
            }
            $this->handleAdminPostRequests();
            if ($_POST['insert_default_content']) {
                ccf_utils::load_module('db/custom-contact-forms-default-db.php');
                $this->action_complete = __('Default content has been inserted!', 'custom-contact-forms');
                new CustomContactFormsDefaultDB();
            } elseif ($_POST['contact_author']) {
                $this->action_complete = __('Your message has been sent!', 'custom-contact-forms');
                $this_url = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $_SERVER['SERVER_NAME'];
                $this->contactAuthor($_POST['name'], $_POST['email'], $this_url, $_POST['message'], $_POST['type'], $_POST['host'], $_POST['ccf-version'], $_POST['wp-version']);
            } elseif ($_GET['clear_tables'] == 1) {
                parent::emptyAllTables();
            }
            $styles = parent::selectAllStyles();
            $style_options = '<option value="0">Default</option>';
            foreach ($styles as $style) {
                $style_options .= '<option value="' . $style->id . '">' . $style->style_slug . '</option>';
            }
            ?>
			<div id="customcontactforms-admin">
			  <div class="plugin-header">
				<h2>
					<?php 
            _e("Custom Contact Forms", 'custom-contact-forms');
            ?>
				</h2>
             	<div class="links">
                	<a href="javascript:void(0)" class="quick-start-button">Quick Start Guide</a> - <a href="javascript:void(0)" class="usage-popover-button">Plugin Usage Manual</a>
              	</div>
              </div>
              <div id="ccf-tabs">
			  <ul id="plugin-nav">
				<li><a href="#forms"><?php 
            _e("Forms", 'custom-contact-forms');
            ?>
</a></li>
                <li><a href="#fields"><?php 
            _e("Fields", 'custom-contact-forms');
            ?>
</a></li>
				<li><a href="#field-options"><?php 
            _e("Field Options", 'custom-contact-forms');
            ?>
</a></li>
				<li><a href="#styles"><?php 
            _e("Styles", 'custom-contact-forms');
            ?>
</a></li>
				<li><a href="#support"><?php 
            _e("Support", 'custom-contact-forms');
            ?>
</a></li>
				<li><a href="#advanced"><?php 
            _e("Advanced", 'custom-contact-forms');
            ?>
</a></li>
				<li><a href="#news"><?php 
            _e("News", 'custom-contact-forms');
            ?>
</a></li>
			  </ul>
			  <a class="genesis" href="http://www.shareasale.com/r.cfm?b=241369&u=481196&m=28169&urllink=&afftrack="><?php 
            _e('Custom Contact Forms works best with any of the 20+ ', 'custom-contact-forms');
            ?>
<span><?php 
            _e('Genesis', 'custom-contact-forms');
            ?>
</span> <?php 
            _e('Wordpress child themes. The', 'custom-contact-forms');
            ?>
 <span><?php 
            _e('Genesis Framework', 'custom-contact-forms');
            ?>
</span> <?php 
            _e('empowers you to quickly and easily build incredible websites with WordPress.', 'custom-contact-forms');
            ?>
</a>
			
			<form class="blog-horizontal-form" method="post" action="http://www.aweber.com/scripts/addlead.pl">
            	<input type="hidden" name="meta_web_form_id" value="1578604781" />
				<input type="hidden" name="meta_split_id" value="" />
				<input type="hidden" name="listname" value="ccf-plugin" />
				<input type="hidden" name="redirect" value="http://www.taylorlovett.com/wordpress-plugins/tutorials-offers-tips/" id="redirect_5832e41084448adb07da67a35dc83c27" />
				<input type="hidden" name="meta_adtracking" value="CCF_-_Wordpress_Plugins_Horizontal" />
				<input type="hidden" name="meta_message" value="1" />
				<input type="hidden" name="meta_required" value="name,email" />
				<span><?php 
            _e('WP Blogging Tips, Downloads, SEO Tricks & Exclusive Tutorials', 'custom-contact-forms');
            ?>
</span>
                <input type="text" name="name" value="Your Name" onclick="value=''" />
                <input type="text" name="email" value="Your Email" onclick="value=''" />
                <input type="submit" value="Sign Up for Free" />
            </form>
			
            <?php 
            if ($show_checkbox_warning) {
                ?>
            <div class="checkbox-warning">
            	<span>ATTENTION:</span> Custom Contact Forms 4.7 changes the way checkbox fields work. In order to make use of checkboxes, as of 4.7, you must attach field options to your checkbox fields. Upon upgrading to version 4.7, your old checkbox fields will not work until you create field options and attach them.
            </div>
            <?php 
            }
            ?>
            
			<?php 
            if (!empty($this->action_complete)) {
                ?>
			<div id="message" class="updated below-h2">
				<p><?php 
                echo $this->action_complete;
                ?>
</p>
			</div>
			<?php 
            }
            ?>
  
              <div id="forms">
			  <div id="create-forms" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Create A Form", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
				  <form id="ccf-create-form" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
                  <input value="forms" name="selected_tab" type="hidden" />
					<ul class="left">
					  <li>
						<label for="object[form_slug]">*
						<?php 
            _e("Form Slug:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="100" name="object[form_slug]" />
						<br />
						<?php 
            _e("This is just a unique way for CCF to refer to your form. Must be unique from other slugs and contain only underscores and alphanumeric characters.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="object[form_title]">
						<?php 
            _e("Form Title:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="200" name="object[form_title]" />
						<?php 
            _e("This text is displayed above the form as the heading.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="object[form_action]">
						<?php 
            _e("Form Style:", 'custom-contact-forms');
            ?>
						</label>
						<select name="object[form_style]" class="form_style_input">
						  <?php 
            echo $style_options;
            ?>
						</select></li>
					  <li>
						<label for="object[submit_button_text]">
						<?php 
            _e("Submit Button Text:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="200" name="object[submit_button_text]" />
					  </li>
					  <li>
						<label for="object[form_email]">
						<?php 
            _e("Form Destination Email:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" name="object[form_email]" />
						<br />
						<?php 
            _e("Will receive all submissions from this form; if left blank it will use the default specified in general settings.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="object[form_email_subject]">
						<?php 
            _e("Form Email Subject:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" name="object[form_email_subject]" />
						<br />
						<?php 
            _e("When submitted and configured accordingly, the form will send an email with this subject.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="object[form_email_name]">
						<?php 
            _e("Form Email Name:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" name="object[form_email_name]" />
						<br />
						<?php 
            _e("When submitted and configured accordingly, the form will send an email with this as the email 'from name'.", 'custom-contact-forms');
            ?>
					  </li>
                    </ul>
                    <ul class="right">
					  <li>
						<label for="object[form_success_message]">
						<?php 
            _e("Form Success Message:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" name="object[form_success_message]" />
						<br />
						<?php 
            _e("Will be displayed in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="object[form_success_title]">
						<?php 
            _e("Form Success Message Title:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" name="object[form_success_title]" />
						<br />
						<?php 
            _e("Will be displayed in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="object[form_thank_you_page]">
						<?php 
            _e("Custom Success URL:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" name="object[form_thank_you_page]" />
						<br />
						<?php 
            _e("If this is filled out, users will be sent to this page when they successfully fill out this form. If it is left blank, a popover showing the form's 'success message' will be displayed on form success.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
					  <label for="form_access"><?php 
            _e('Who Can View This Form:', '');
            ?>
</label>
                            
                            <?php 
            $roles = parent::getRolesArray();
            $i = 0;
            foreach ($roles as $role) {
                if ($i == 3) {
                    echo '<br />';
                }
                ?>
								<div class="role">
								 <input type="checkbox" checked="checked" name="object[form_access][]" value="<?php 
                echo $role;
                ?>
" /> 
								 <?php 
                echo $role;
                ?>
								</div>
								<?php 
                $i++;
            }
            ?>
<br />
							<?php 
            _e('Choose which types of users should be able to view this form.', 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<input type="hidden" name="object_type" value="form" />
						<input type="submit" class="create-button" value="<?php 
            _e("Create Form", 'custom-contact-forms');
            ?>
" name="object_create" />
					  </li>
					  <li class="attach"><span class="ccf-red">*</span> <?php 
            _e('You should go to the form manager to attach fields to this form after you create it.', 'custom-contact-forms');
            ?>
</li>
					</ul>
				  </form>
				</div>
              </div>
              
              <h3 class="manage-h3">
				<?php 
            _e("Manage Forms", 'custom-contact-forms');
            ?>
			  </h3>
			  <form class="ccf-edit-ajax" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
              <input type="hidden" name="selected_tab" value="forms" />
			  <table class="widefat post" id="manage-forms" cellspacing="0">
				<thead>
				  <tr>
					<th scope="col" class="manage-column check-col"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column form-code"><?php 
            _e("Form Display Code", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-slug"><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-slug"><?php 
            _e("Destination Email", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-title"><?php 
            _e("Title", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-button"><?php 
            _e("Button Text", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-style"><?php 
            _e("Style", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-expand"></th>
				  </tr>
				</thead>
				<tbody>
				  <?php 
            $forms = parent::selectAllForms();
            for ($i = 0; $i < count($forms); $i++) {
                $form_methods = '<option>Post</option><option>Get</option>';
                $form_methods = str_replace('<option>' . $forms[$i]->form_method . '</option>', '<option selected="selected">' . $forms[$i]->form_method . '</option>', $form_methods);
                $add_fields = $this->getFieldsForm();
                $this_style = parent::selectStyle($forms[$i]->form_style, '');
                $sty_opt = str_replace('<option value="' . $forms[$i]->form_style . '">' . $this_style->style_slug . '</option>', '<option value="' . $forms[$i]->form_style . '" selected="selected">' . $this_style->style_slug . '</option>', $style_options);
                ?>
				  <tr class="row-form-<?php 
                echo $forms[$i]->id;
                ?>
 <?php 
                if ($i % 2 == 0) {
                    echo 'ccf-evenrow';
                }
                ?>
">
					<td><input type="checkbox" class="object-check" value="1" name="objects[<?php 
                echo $i;
                ?>
][object_do]" /></td>
					<td><span class="ccf-bold">[customcontact form=<?php 
                echo $forms[$i]->id;
                ?>
]</span></td>
					<td><input type="text" class="ccf-width75" name="objects[<?php 
                echo $i;
                ?>
][values][form_slug]" value="<?php 
                echo $forms[$i]->form_slug;
                ?>
" /></td>
					<td><input type="text" name="objects[<?php 
                echo $i;
                ?>
][values][form_email]" value="<?php 
                echo $forms[$i]->form_email;
                ?>
" /></td>
					<td><input type="text" class="ccf-width125" name="objects[<?php 
                echo $i;
                ?>
][values][form_title]" value="<?php 
                echo $forms[$i]->form_title;
                ?>
" /></td>
					<td><input class="ccf-width100" type="text" name="objects[<?php 
                echo $i;
                ?>
][values][submit_button_text]" value="<?php 
                echo $forms[$i]->submit_button_text;
                ?>
" /></td>
					<td><select name="objects[<?php 
                echo $i;
                ?>
][values][form_style]" class="form_style_input">
						<?php 
                echo $sty_opt;
                ?>
					  </select></td>
					<td><input class="object-id" type="hidden" name="objects[<?php 
                echo $i;
                ?>
][object_id]" value="<?php 
                echo $forms[$i]->id;
                ?>
" />
					  <input type="hidden" class="object-type" name="objects[<?php 
                echo $i;
                ?>
][object_type]" value="form" />
					  <span class="form-options-expand"></span>
					</td>
				  </tr>
				  <tr class="row-form-<?php 
                echo $forms[$i]->id;
                ?>
 <?php 
                if ($i % 2 == 0) {
                    echo 'ccf-evenrow';
                }
                ?>
">
					<td class="form-extra-options ccf-center" colspan="8"><table class="form-extra-options-table">
						<tbody>
						  <tr>
							<td class="ccf-bold"><?php 
                _e("Method", 'custom-contact-forms');
                ?>
</td>
							<td class="ccf-bold"><?php 
                _e("Form Action", 'custom-contact-forms');
                ?>
</td>
							<td class="ccf-bold"><?php 
                _e("Email Subject", 'custom-contact-forms');
                ?>
</td>
							<td class="ccf-bold"><?php 
                _e("Email From Name", 'custom-contact-forms');
                ?>
</td>
							<td class="ccf-bold"><?php 
                _e("Success Message Title", 'custom-contact-forms');
                ?>
</td>
							<td class="ccf-bold"><?php 
                _e("Success Message", 'custom-contact-forms');
                ?>
</td>
							<td class="ccf-bold"><?php 
                _e("Custom Success URL", 'custom-contact-forms');
                ?>
</td>
						  </tr>
						  <tr>
							<td><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("The Form Method is the method by which information is transfer through your form. If you aren't an expert with HTML and PHP, leave this as Post.", 'custom-contact-forms');
                ?>
">(?)</a>
							  <select name="objects[<?php 
                echo $i;
                ?>
][values][form_method]">
								<?php 
                echo $form_methods;
                ?>
							  </select></td>
							<td><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("This lets you process your forms through alternate scripts. If you use a service like InfusionSoft or Aweber, set this to be the same form action as the code provided to you by that service, otherwise leave this blank.", 'custom-contact-forms');
                ?>
">(?)</a>
							  <input class="ccf-width100" type="text" name="objects[<?php 
                echo $i;
                ?>
][values][form_action]" value="<?php 
                echo $forms[$i]->form_action;
                ?>
" /></td>
							<td><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("This is the form email subject sent to the destination email address. If left blank, the default from General Settings will be used.", 'custom-contact-forms');
                ?>
">(?)</a>
							  <input class="ccf-width100" type="text" name="objects[<?php 
                echo $i;
                ?>
][values][form_email_subject]" maxlength="250" value="<?php 
                echo $forms[$i]->form_email_subject;
                ?>
" /></td>
							<td><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("This is the from name of the email sent on successful form submission. If left blank, the default from General Settings will be used.", 'custom-contact-forms');
                ?>
">(?)</a>
							  <input class="ccf-width100" type="text" name="objects[<?php 
                echo $i;
                ?>
][values][form_email_name]" maxlength="100" value="<?php 
                echo $forms[$i]->form_email_name;
                ?>
" /></td>
							<td><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("This will be displayed as the header in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms');
                ?>
">(?)</a>
							  <input class="ccf-width100" type="text" name="objects[<?php 
                echo $i;
                ?>
][values][form_success_title]" value="<?php 
                echo $forms[$i]->form_success_title;
                ?>
" /></td>
							<td><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("This will be displayed in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms');
                ?>
">(?)</a>
							  <input type="text" name="objects[<?php 
                echo $i;
                ?>
][values][form_success_message]" class="ccf-width100" value="<?php 
                echo $forms[$i]->form_success_message;
                ?>
" /></td>
							<td><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("If this is filled out, users will be sent to this thank you page when they successfully fill out this form. If it is left blank, a popover showing the form's 'success message' will be displayed on form success.", 'custom-contact-forms');
                ?>
">(?)</a>
							  <input type="text" class="ccf-width100" name="objects[<?php 
                echo $i;
                ?>
][values][form_thank_you_page]" value="<?php 
                echo $forms[$i]->form_thank_you_page;
                ?>
" /></td>
						  </tr>
						  <tr>
							<td colspan="7"><a href="javascript:void(0)" class="toollink" title="<?php 
                _e("The form display code above ([customcontact form=x]) will only work in Wordpress pages and posts. If you want to display this form in a theme file such as page.php, header.php, index.php, category.php, etc, then insert this PHP snippet.", 'custom-contact-forms');
                ?>
">(?)</a> 
							  <label for="theme_code_<?php 
                echo $forms[$i]->id;
                ?>
"><span><?php 
                _e("Code to Display Form in Theme Files:", 'custom-contact-forms');
                ?>
							  </span></label>
							  <input type="text" class="ccf-width225" value="&lt;?php if (function_exists('serveCustomContactForm')) { serveCustomContactForm(<?php 
                echo $forms[$i]->id;
                ?>
); } ?&gt;" name="theme_code_<?php 
                echo $forms[$i]->id;
                ?>
" />
							  <a href="javascript:void(0)" class="toollink" title="<?php 
                _e("This field allows you to insert HTML directly after the starting <form> tag.", 'custom-contact-forms');
                ?>
">(?)</a> 
							  <label for="objects[<?php 
                echo $i;
                ?>
][values][custom_code]"><?php 
                _e("Custom Code:", 'custom-contact-forms');
                ?>
</label>
							  <input name="objects[<?php 
                echo $i;
                ?>
][values][custom_code]" type="text" class="ccf-width100" value="<?php 
                echo $forms[$i]->custom_code;
                ?>
" />
                              <a href="javascript:void(0)" class="toollink" title="<?php 
                _e("Insert the page id's that your form will be used on. This will make it so the plugin will only load JS and CSS files on these select pages. This will improve your site's load time.", 'custom-contact-forms');
                ?>
">(?)</a> 
							   <label for="objects[<?php 
                echo $i;
                ?>
][values][form_pages]"><?php 
                _e("Form Pages:", 'custom-contact-forms');
                ?>
</label>
							  <input name="objects[<?php 
                echo $i;
                ?>
][values][form_pages]" type="text" class="ccf-width75" value="<?php 
                echo $forms[$i]->form_pages;
                ?>
" /></td>
							<input name="objects[<?php 
                echo $i;
                ?>
][values][form_access_update]" type="hidden" value="1" /></td>
							<a href="javascript:void(0)" class="toollink" title="<?php 
                _e("If you want to show this form to only certain types of users, you can uncheck boxes accordingly. To show this form to anyone, check all the boxes. This will only take effect if 'Form Access Capabilities' is enabled in general settings.", 'custom-contact-forms');
                ?>
">(?)</a>&nbsp;
							<label for="form_access">Can View Form:</label>&nbsp;
                            
                            <?php 
                $roles = parent::getRolesArray();
                $access_array = parent::getFormAccessArray($forms[$i]->form_access);
                foreach ($roles as $role) {
                    ?>
								 <input type="checkbox" <?php 
                    if (parent::formHasRole($access_array, $role)) {
                        echo 'checked="checked"';
                    }
                    ?>
 name="objects[<?php 
                    echo $i;
                    ?>
][values][form_access][]" value="<?php 
                    echo $role;
                    ?>
" /> 
								<?php 
                    echo $role;
                }
                ?>
						  </tr>
                          <tr>
							<td colspan="7">
							<div class="fattach">
							<div class="form-detach">
							<label for="detach_object_id"><span>
							  <?php 
                _e("Attached Fields:", 'custom-contact-forms');
                ?>
							  </span></label>
							  <?php 
                $attached_fields = parent::getAttachedFieldsArray($forms[$i]->id);
                if (empty($attached_fields)) {
                    echo '<select class="onObject' . $forms[$i]->id . ' objectTypeForm detach-field detach-object" name="objects[' . $i . '][detach]"><option value="-1">Nothing Attached!</option></select> ';
                } else {
                    echo '<select name="objects[' . $i . '][detach]" class="onObject' . $forms[$i]->id . ' detach-object detach-field objectTypeForm">';
                    foreach ($attached_fields as $attached_field) {
                        $this_field = parent::selectField($attached_field, '');
                        echo ' <option value="' . $this_field->id . '">' . $this_field->field_slug . '</option>';
                    }
                    echo '</select>';
                }
                ?>
							  <span class="form-detach-check">
							  <input type="checkbox" class="detach-check" value="1" name="objects[<?php 
                echo $i;
                ?>
][detach_confirm]" />
							  <span class="detach-lang">(Check to detach field)</span>
							  </span>
							  <br />
							  <span class="ccf-red ccf-bold">*</span>
							  <?php 
                _e("Attach fields in the order you want them displayed.", 'custom-contact-forms');
                ?>
							</div>
							<div class="form-attach">
							<label for="field_id"><span>
							  <?php 
                _e("Attach Field:", 'custom-contact-forms');
                ?>
							  </span></label>
							  <select class="onObject<?php 
                echo $forms[$i]->id;
                ?>
 attach-object attach-field objectTypeForm" name="objects[<?php 
                echo $i;
                ?>
][attach]">
								<?php 
                echo $add_fields;
                ?>
							  </select>
							  <span class="form-attach-check">
							  <input class="attach-check" type="checkbox" name="objects[<?php 
                echo $i;
                ?>
][attach_confirm]" value="1" />
							  <span class="attach-lang">((Check to attach field)</span>
							  </span>
							  <br />
							  <span class="ccf-red ccf-bold">*</span>
							  <?php 
                _e("Attach fixed fields or ones you", 'custom-contact-forms');
                ?>
							  <a href="#create-fields">
							  <?php 
                _e("create", 'custom-contact-forms');
                ?>
							  </a>. </div></div></td>
						  </tr>
						</tbody>
					  </table></td>
				  </tr>
				<?php 
            }
            $remember_check = $admin_options['remember_field_values'] == 0 ? 'selected="selected"' : '';
            $remember_fields = '<option value="1">' . __('Yes', 'custom-contact-forms') . '</option><option ' . $remember_check . ' value="0">' . __('No', 'custom-contact-forms') . '</option>';
            $border_style_options = '<option>solid</option><option>dashed</option>
			<option>grooved</option><option>double</option><option>dotted</option><option>ridged</option><option>none</option>
			<option>inset</option><option>outset</option>';
            ?>
				</tbody>
				
				<tfoot>
				  <tr>
				  <tr>
					<th scope="col" class="manage-column check-col"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column form-code"><?php 
            _e("Form Code", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-slug"><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-slug"><?php 
            _e("Destination Email", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-title"><?php 
            _e("Title", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-button"><?php 
            _e("Button Text", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-style"><?php 
            _e("Style", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column form-expand"></th>
				  </tr>
				  </tr>
				  
				</tfoot>
			  </table>
			  <select class="bulk-dropdown" name="object_bulk_action">
			  <option value="0"><?php 
            _e('Bulk Actions', 'custom-contact-forms');
            ?>
</option>
				<option value="edit"><?php 
            _e('Save', 'custom-contact-forms');
            ?>
</option>
				<option value="delete"><?php 
            _e('Delete', 'custom-contact-forms');
            ?>
</option></select> 
			  <input type="submit" name="object_bulk_apply" class="bulk-apply" value="<?php 
            _e('Apply', 'custom-contact-forms');
            ?>
" /> <img src="<?php 
            echo plugins_url();
            ?>
/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="loading-img" />
			  </form>
              </div>
			  
			  <div id="fields">
            	
			  <div id="create-fields" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Create A Form Field", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
				  <form id="ccf-create-field" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
                  <input type="hidden" name="selected_tab" value="fields" />
					<ul class="left">
					  <li>
						<label for="field_slug">*
						<?php 
            _e("Field Slug:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_slug]" type="text" maxlength="40" />
						<br />
						<?php 
            _e("This is just a unique way for CCF to refer to your field. Must be unique from other slugs and contain only underscores and alphanumeric characters.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_label">
						<?php 
            _e("Field Label:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_label]" type="text" maxlength="100" />
						<br />
						<?php 
            _e("The field label is displayed next to the field and is visible to the user.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_type">*
						<?php 
            _e("Field Type:", 'custom-contact-forms');
            ?>
						</label>
						<select name="object[field_type]" class="field-type-selector">
						  <option>Text</option>
                          <option>Date</option>
                          <option>File</option>
						  <option>Textarea</option>
						  <option>Hidden</option>
						  <option>Checkbox</option>
						  <option>Radio</option>
						  <option>Dropdown</option>
						</select>
					  </li>
					  <li>
						<label for="field_value">
						<?php 
            _e("Initial Value:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_value]" type="text" maxlength="50" />
						<br />
						(
						<?php 
            _e("This is the initial value of the field. If you set the type as checkbox, it is recommend you set this to what the checkbox is implying. For example if I were creating the checkbox \n\t\t\t\t\t\t'Are you human?', I would set the initial value to 'Yes'.", 'custom-contact-forms');
            ?>
						<?php 
            _e("If you set the field type as 'Dropdown' or 'Radio', you should enter the slug of the", 'custom-contact-forms');
            ?>
						<a href="#manage-field-options" title="<?php 
            _e("Create a Field Option", 'custom-contact-forms');
            ?>
"><?php 
            _e("field option", 'custom-contact-forms');
            ?>
</a>
						<?php 
            _e("you would like initially selected.", 'custom-contact-forms');
            ?>
						) </li>
					  <li>
						<label for="field_maxlength">
						<?php 
            _e("Max Length:", 'custom-contact-forms');
            ?>
						</label>
						<input class="ccf-width50" size="10" name="object[field_maxlength]" type="text" maxlength="4" />
						<br />
						<?php 
            _e("0 for no limit; only applies to Text fields", 'custom-contact-forms');
            ?>
					  </li>
                    </ul>
                    <ul class="right">
					  <li>
						<label for="field_required">*
						<?php 
            _e("Required Field:", 'custom-contact-forms');
            ?>
						</label>
						<select name="object[field_required]">
						  <option value="0">
						  <?php 
            _e("No", 'custom-contact-forms');
            ?>
						  </option>
						  <option value="1">
						  <?php 
            _e("Yes", 'custom-contact-forms');
            ?>
						  </option>
						</select>
						<br />
						<?php 
            _e("If a field is required and a user leaves it blank, the plugin will display an error message (which you can customize using 'Field Error') explaining the problem.", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_instructions">
						<?php 
            _e("Field Instructions:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_instructions]" type="text" />
						<br />
						<?php 
            _e("If this is filled out, a tooltip popover displaying this text will show when the field is selected.", 'custom-contact-forms');
            ?>
					  </li>
                      <li>
						<label for="field_class">
						<?php 
            _e("Field Class:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_class]" type="text" />
						<br />
						<?php 
            _e("If you manage your own .css stylesheet, you can use this to attach a class to this field. Leaving this blank will do nothing.", 'custom-contact-forms');
            ?>
					  </li>
                      <li>
						<label for="field_error">
						<?php 
            _e("Field Error:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_error]" type="text" />
						<br />
						<?php 
            _e("If a user leaves this field blank and the field is required, this error message will be shown. A generic default will show if left blank.", 'custom-contact-forms');
            ?>
					  </li>
                      <li class="file-fields">
						<label for="field_max_upload_size">
						<?php 
            _e("Max File Size Allowed:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_max_upload_size]" value="5000" type="text" /> <?php 
            _e('KB', 'custom-contact-forms');
            ?>
						<br />
						<?php 
            _e("If a user tries to upload a file larger than the max upload size, an error message will be displayed.", 'custom-contact-forms');
            ?>
                      </li>
                      <li class="file-fields">
                        <label for="field_allowed_file_extensions">
						<?php 
            _e("Allowed File Extensions for Upload:", 'custom-contact-forms');
            ?>
						</label>
						<input name="object[field_allowed_file_extensions]" type="text" />
						<br />
						<?php 
            _e("If a user tries to upload a file with an extension not in this list, an error will be shown. Separate file extensions with a comma. Ex: doc, jpg, jpeg, txt", 'custom-contact-forms');
            ?>
                      </li>
					  <li>
						<input type="hidden" name="object[user_field]" value="1" />
						<input type="hidden" name="object_type" value="field" />
						<input type="submit" value="<?php 
            _e("Create Field", 'custom-contact-forms');
            ?>
" name="object_create" class="create-button" />
					  </li>
					  <li class="attach"><span class="ccf-red">*</span> <?php 
            _e('If this is a dropdown or radio field, you should go to the field manager below to attach field options after you create it.', 'custom-contact-forms');
            ?>
</li>
					  
					</ul>
				  </form>
				</div>
			  </div>
              
              <h3 class="manage-h3">
				<?php 
            _e("Manage User Fields", 'custom-contact-forms');
            ?>
			  </h3>
			  <form class="ccf-edit-ajax" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
              <input type="hidden" name="selected_tab" value="fields" />
			  <table class="widefat post" id="manage-fields" cellspacing="0">
				<thead>
				  <tr>
					<th scope="col" class="manage-column check-col"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column field-slug"><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-label"><?php 
            _e("Label", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-type"><?php 
            _e("Type", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-value"><?php 
            _e("Initial Value", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-required"><?php 
            _e("Required", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-maxlength"><?php 
            _e("Maxlength", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-expand"></th>
				  </tr>
				</thead>
				<tbody>
				  <?php 
            $fields = parent::selectAllFields();
            for ($i = 0, $z = 0; $i < count($fields); $i++, $z++) {
                if ($fields[$i]->user_field == 0) {
                    $z--;
                    continue;
                }
                $attached_options = parent::getAttachedFieldOptionsArray($fields[$i]->id);
                $field_types = '<option>Text</option><option>Date</option><option>File</option><option>Textarea</option><option>Hidden</option><option>Checkbox</option><option>Radio</option><option>Dropdown</option>';
                $field_types = str_replace('<option>' . $fields[$i]->field_type . '</option>', '<option selected="selected">' . $fields[$i]->field_type . '</option>', $field_types);
                ?>
				<tr class="row-field-<?php 
                echo $fields[$i]->id;
                ?>
 <?php 
                if ($z % 2 == 1) {
                    echo ' ccf-evenrow';
                }
                ?>
">
					<td><input class="object-check" type="checkbox" value="1" name="objects[<?php 
                echo $i;
                ?>
][object_do]" /></td>
					<td><input type="text" name="objects[<?php 
                echo $i;
                ?>
][values][field_slug]" class="ccf-width100" maxlength="50" value="<?php 
                echo $fields[$i]->field_slug;
                ?>
" /></td>
					<td><input type="text" name="objects[<?php 
                echo $i;
                ?>
][values][field_label]" maxlength="100" value="<?php 
                echo $fields[$i]->field_label;
                ?>
" /></td>
					<td><select name="objects[<?php 
                echo $i;
                ?>
][values][field_type]">
						<?php 
                echo $field_types;
                ?>
					  </select></td>
					<td><input type="text" name="objects[<?php 
                echo $i;
                ?>
][values][field_value]" maxlength="50" class="ccf-width75" value="<?php 
                echo $fields[$i]->field_value;
                ?>
" /></td>
					<td><select name="objects[<?php 
                echo $i;
                ?>
][values][field_required]">
						<option value="1">
						<?php 
                _e("Yes", 'custom-contact-forms');
                ?>
						</option>
						<option value="0" <?php 
                if ($fields[$i]->field_required != 1) {
                    echo 'selected="selected"';
                }
                ?>
>
						<?php 
                _e("No", 'custom-contact-forms');
                ?>
						</option>
					  </select></td>
					<td><?php 
                if ($fields[$i]->field_type == 'Dropdown' || $fields[$i]->field_type == 'Radio' || $fields[$i]->field_type == 'Checkbox') {
                    ?>
					  <b>-</b>
					  <?php 
                } else {
                    ?>
					  <input type="text" class="ccf-width50" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_maxlength]" value="<?php 
                    echo $fields[$i]->field_maxlength;
                    ?>
" />
					  <?php 
                }
                ?>
					</td>
					<td><input type="hidden" class="object-type" name="objects[<?php 
                echo $i;
                ?>
][object_type]" value="field" />
					  <input type="hidden" class="object-id" name="objects[<?php 
                echo $i;
                ?>
][object_id]" value="<?php 
                echo $fields[$i]->id;
                ?>
" />
					  <span class="fields-options-expand"></span>
				  </tr>
				  <?php 
                $show_field_options = $fields[$i]->field_type == 'Radio' || $fields[$i]->field_type == 'Dropdown' || $fields[$i]->field_type == 'Checkbox' ? true : false;
                ?>
				  <tr class="row-field-<?php 
                echo $fields[$i]->id;
                ?>
 <?php 
                if ($z % 2 == 1) {
                    echo 'ccf-evenrow';
                }
                ?>
">
					<td class="fields-extra-options" colspan="8">
                      <div class="row-one">
						<a href="javascript:void(0)" class="toollink" title="<?php 
                _e('If this is filled out, a tooltip popover displaying this text will show when the field is selected.', 'custom-contact-forms');
                ?>
">(?)</a>
						<label for="field_instructions">
						<?php 
                _e("Field Instructions:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" class="ccf-width150" name="objects[<?php 
                echo $i;
                ?>
][values][field_instructions]" value="<?php 
                echo $fields[$i]->field_instructions;
                ?>
" />
						<a href="javascript:void(0)" class="toollink" title="<?php 
                _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms');
                ?>
">(?)</a>
					  	<label for="field_class">
						<?php 
                _e("Field Class:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" class="ccf-width100" name="objects[<?php 
                echo $i;
                ?>
][values][field_class]" value="<?php 
                echo $fields[$i]->field_class;
                ?>
" />
						<a href="javascript:void(0)" class="toollink" title="<?php 
                _e('This lets you customize the error message displayed when this field is required and left blank.', 'custom-contact-forms');
                ?>
">(?)</a>
					    <label for="field_error">
						<?php 
                _e("Field Error:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" class="ccf-width200" name="objects[<?php 
                echo $i;
                ?>
][values][field_error]" value="<?php 
                echo $fields[$i]->field_error;
                ?>
" /> 
					  </div>
                      <?php 
                if ($fields[$i]->field_type == 'File') {
                    ?>
                      <div class="row-two">
                      	<a href="javascript:void(0)" class="toollink" title="<?php 
                    _e('If a user tries to upload a file greater than the value in this field, an error will be shown. Upload size is in KB. If this is left blank or set to 0, then there will be no maximum file size for this field.', 'custom-contact-forms');
                    ?>
">(?)</a>
					    <label for="field_max_upload_size"><?php 
                    _e("Max Upload Size", 'custom-contact-forms');
                    ?>
</label>
                        <input type="text" class="ccf-width100" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_max_upload_size]" value="<?php 
                    echo $fields[$i]->field_max_upload_size;
                    ?>
" /><?php 
                    _e('KB', 'custom-contact-forms');
                    ?>
                        <a href="javascript:void(0)" class="toollink" title="<?php 
                    _e('If a user tries to upload a file with an extension not in this list, an error will be shown. If this is left blank, then all file extensions will be accepted. Separate file extensions with a comma. Ex: doc, jpg, jpeg, bmp, gif, txt', 'custom-contact-forms');
                    ?>
">(?)</a>
					    <label for="field_allowed_file_extensions"><?php 
                    _e("Allowed File Extensions", 'custom-contact-forms');
                    ?>
</label>
                        <input type="text" class="ccf-width200" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_allowed_file_extensions]" value="<?php 
                    $exts = unserialize($fields[$i]->field_allowed_file_extensions);
                    echo !empty($exts) ? @implode(', ', $exts) : '';
                    ?>
" />
                      </div>
                      <?php 
                }
                ?>
					  <?php 
                if ($show_field_options) {
                    ?>
					  <div class="fattach">
						<div class="field-detach">
						<span class="ccf-bold">Detach Options:</span>
						<?php 
                    if (empty($attached_options)) {
                        ?>
						<select class="onObject<?php 
                        echo $fields[$i]->id;
                        ?>
 detach-object detach-field-option objectTypeField" name="objects[<?php 
                        echo $i;
                        ?>
][detach]">
						  <option value="-1">Nothing Attached!</option>
						</select>
						<?php 
                    } else {
                        ?>
						<select name="objects[<?php 
                        echo $i;
                        ?>
][detach]" class="onObject<?php 
                        echo $fields[$i]->id;
                        ?>
 detach-object detach-field-option objectTypeField">
						  <?php 
                        foreach ($attached_options as $option_id) {
                            $option = parent::selectFieldOption($option_id);
                            ?>
						  <option value="<?php 
                            echo $option_id;
                            ?>
"><?php 
                            echo $option->option_slug;
                            ?>
</option>
						  <?php 
                        }
                        ?>
						</select>
						<?php 
                    }
                    ?>
						<span class="field-detach-check">
						<input class="detach-check" type="checkbox" name="objects[<?php 
                    echo $i;
                    ?>
][detach_confirm]" value="1" />
							  <span class="detach-lang">(Check to detach option)</span>
						</span><br />
						<span class="ccf-red ccf-bold">*</span>
						<?php 
                    _e("Detach field options you", 'custom-contact-forms');
                    ?>
						<a href="#create-field-options">
						<?php 
                    _e("create", 'custom-contact-forms');
                    ?>
						</a>. </div>
					  <?php 
                    $all_options = $this->getFieldOptionsForm();
                    ?>
					  <div class="field-attach">
						<span class="ccf-bold">Attach Options:</span>
						<?php 
                    if (empty($all_options)) {
                        ?>
						<b>No Field Options to Attach</b>
						<?php 
                    } else {
                        ?>
						<select name="objects[<?php 
                        echo $i;
                        ?>
][attach]" class="onObject<?php 
                        echo $fields[$i]->id;
                        ?>
 attach-object attach-field-option objectTypeField">
						  <?php 
                        echo $all_options;
                        ?>
						</select>
						<span class="field-attach-check">
						<input type="checkbox" class="attach-check" name="objects[<?php 
                        echo $i;
                        ?>
][attach_confirm]" value="1" />
						<?php 
                    }
                    ?>
							  <span class="attach-lang">(Check to attach option)</span>
						</span><br />
						<span class="ccf-red ccf-bold">*</span>
						<?php 
                    _e("Attach field options in the order you want them to display.", 'custom-contact-forms');
                    ?>
					  </div>
					  </div>
					  <?php 
                }
                ?>
					</td>
				  </tr>
				<?php 
            }
            ?>
				</tbody>
				
				<tfoot>
				  <tr>
					<th scope="col" class="manage-column check-col"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column field-slug"><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-label"><?php 
            _e("Label", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-type"><?php 
            _e("Type", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-value"><?php 
            _e("Initial Value", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-required"><?php 
            _e("Required", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-maxlength"><?php 
            _e("Maxlength", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-expand"></th>
				  </tr>
				</tfoot>
			  </table>
			  <select class="bulk-dropdown" name="object_bulk_action">
				<option value="0"><?php 
            _e('Bulk Actions', 'custom-contact-forms');
            ?>
</option>
				<option value="edit"><?php 
            _e('Save', 'custom-contact-forms');
            ?>
</option>
				<option value="delete"><?php 
            _e('Delete', 'custom-contact-forms');
            ?>
</option>
			  </select> <input type="submit" name="object_bulk_apply" class="bulk-apply" value="<?php 
            _e('Apply', 'custom-contact-forms');
            ?>
" /> <img src="<?php 
            echo plugins_url();
            ?>
/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="loading-img" />
			  </form>
              
              <h3 class="manage-h3">
				<?php 
            _e("Manage Fixed Fields", 'custom-contact-forms');
            ?>
			  </h3>
			  <form class="ccf-edit-ajax" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
              <input type="hidden" name="selected_tab" value="fields" />
			  <table class="widefat post" id="manage-fixed-fields" cellspacing="0">
				<thead>
				  <tr>
					<th scope="col" class="manage-column check-col"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column field-slug"><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-label"><?php 
            _e("Label", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-type"><?php 
            _e("Type", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-value"><?php 
            _e("Initial Value", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-value"><?php 
            _e("Required", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-maxlength"><?php 
            _e("Maxlength", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-expand"></th>
					</tr>
				</thead>
				<tbody>
				  <?php 
            $fields = parent::selectAllFields();
            for ($i = 0, $z = 0; $i < count($fields); $i++, $z++) {
                if ($fields[$i]->user_field == 1) {
                    $z--;
                    continue;
                }
                $field_types = '<option>Text</option><option>Textarea</option><option>Hidden</option><option>Checkbox</option>';
                $field_types = str_replace('<option>' . $fields[$i]->field_type . '</option>', '<option selected="selected">' . $fields[$i]->field_type . '</option>', $field_types);
                ?>
				  <tr class="row-field-<?php 
                echo $fields[$i]->id;
                ?>
 <?php 
                if ($z % 2 == 0) {
                    echo 'ccf-evenrow';
                }
                ?>
">
					<td><input class="object-check" type="checkbox" value="1" name="objects[<?php 
                echo $i;
                ?>
][object_do]" /></td>
					<td><?php 
                echo $fields[$i]->field_slug;
                ?>
</td>
					<td><?php 
                if ($fields[$i]->field_slug == 'resetButton') {
                    _e('None', 'custom-contact-forms');
                } else {
                    ?>
					  <input type="text" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_label]" maxlength="100" value="<?php 
                    echo $fields[$i]->field_label;
                    ?>
" />
					  <?php 
                }
                ?>
</td>
					<td><?php 
                echo $fields[$i]->field_type;
                ?>
					<td><?php 
                if ($fields[$i]->field_type != 'Checkbox') {
                    ?>
					  <input type="text" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_value]" class="ccf-width75" maxlength="50" value="<?php 
                    echo $fields[$i]->field_value;
                    ?>
" />
					  <?php 
                } else {
                    echo $fields[$i]->field_value;
                    ?>
					  <?php 
                }
                ?>
					</td>
					<td><?php 
                if ($fields[$i]->field_slug == 'fixedEmail' || $fields[$i]->field_slug == 'emailSubject' || $fields[$i]->field_slug == 'fixedWebsite' || $fields[$i]->field_slug == 'usaStates' || $fields[$i]->field_slug == 'datePicker' || $fields[$i]->field_slug == 'allCountries') {
                    ?>
					  <select name="objects[<?php 
                    echo $i;
                    ?>
][values][field_required]">
						<option value="1">
						<?php 
                    _e("Yes", 'custom-contact-forms');
                    ?>
						</option>
						<option <?php 
                    if ($fields[$i]->field_required != 1) {
                        echo 'selected="selected"';
                    }
                    ?>
 value="0">
						<?php 
                    _e("No", 'custom-contact-forms');
                    ?>
						</option>
					  </select>
					  <?php 
                } else {
                    if ($fields[$i]->field_slug == 'resetButton') {
                        echo '-';
                    } else {
                        _e("Yes", 'custom-contact-forms');
                    }
                }
                ?>
					</td>
					<td><?php 
                if ($fields[$i]->field_type != 'Checkbox' && $fields[$i]->field_slug != 'resetButton' && $fields[$i]->field_slug != 'allCountries' && $fields[$i]->field_slug != 'usaStates') {
                    ?>
					  <input type="text" class="ccf-width50" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_maxlength]" value="<?php 
                    echo $fields[$i]->field_maxlength;
                    ?>
" />
					  <?php 
                } else {
                    _e('None', 'custom-contact-forms');
                }
                ?>
					</td>
					<td><input type="hidden" name="objects[<?php 
                echo $i;
                ?>
][object_type]" value="field" />
					  <input type="hidden" class="object-id" name="objects[<?php 
                echo $i;
                ?>
][object_id]" value="<?php 
                echo $fields[$i]->id;
                ?>
" />
					  <span class="fixed-fields-options-expand"></span>
				  </tr>
				  <tr class="row-field-<?php 
                echo $fields[$i]->id;
                ?>
 <?php 
                if ($z % 2 == 0) {
                    echo 'ccf-evenrow';
                }
                ?>
">
					<td class="fixed-fields-extra-options" colspan="8">
					  <a href="javascript:void(0)" class="toollink" title="<?php 
                _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms');
                ?>
">(?)</a>
					  <label for="field_class">
					  <?php 
                _e('Field Class:', 'custom-contact-forms');
                ?>
					  </label>
					  <input type="text" value="<?php 
                echo $fields[$i]->field_class;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][field_class]" />
					  <?php 
                if ($fields[$i]->field_slug != 'resetButton') {
                    ?>
					  <a href="javascript:void(0)" class="toollink" title="<?php 
                    _e('If this is filled out, a tooltip popover displaying this text will show when the field is selected.', 'custom-contact-forms');
                    ?>
">(?)</a>
					  <label for="field_instructions">
					  <?php 
                    _e("Field Instructions:", 'custom-contact-forms');
                    ?>
					  </label>
					  <input type="text" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_instructions]" class="ccf-width200" value="<?php 
                    echo $fields[$i]->field_instructions;
                    ?>
" />
					  <a href="javascript:void(0)" class="toollink" title="<?php 
                    _e('This lets you customize the error message displayed when this field is required and left blank.', 'custom-contact-forms');
                    ?>
">(?)</a>
					  <label for="field_error">
					  <?php 
                    _e("Field Error:", 'custom-contact-forms');
                    ?>
					  </label>
					  <input type="text" class="ccf-width200" name="objects[<?php 
                    echo $i;
                    ?>
][values][field_error]" value="<?php 
                    echo $fields[$i]->field_error;
                    ?>
" /> 
					  <br />
					  <?php 
                }
                ?>
                      <div class="field_descrip"><?php 
                echo $GLOBALS['ccf_fixed_fields'][$fields[$i]->field_slug];
                ?>
</div></td>
				  </tr>
				<?php 
            }
            ?>
				</tbody>
				
				<tfoot>
				  <tr>
					<th scope="col" class="manage-column check-col"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column field-slug"><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-label"><?php 
            _e("Label", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-type"><?php 
            _e("Type", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-value"><?php 
            _e("Initial Value", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-value"><?php 
            _e("Required", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-maxlength"><?php 
            _e("Maxlength", 'custom-contact-forms');
            ?>
</th>
					<th scope="col" class="manage-column field-expand"></th>
				  </tr>
				</tfoot>
			  </table>
			  <select class="bulk-dropdown" name="object_bulk_action">
				<option value="0"><?php 
            _e('Bulk Actions', 'custom-contact-forms');
            ?>
</option>
				<option value="edit"><?php 
            _e('Save', 'custom-contact-forms');
            ?>
</option>
			  </select> <input type="submit" class="bulk-apply" name="object_bulk_apply" value="<?php 
            _e('Apply', 'custom-contact-forms');
            ?>
" /> <img src="<?php 
            echo plugins_url();
            ?>
/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="loading-img" />
			  </form>
              </div>
              
			  <div id="field-options">
			  <div id="manage-field-options" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Manage Field Options", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
                      <form class="ccf-edit-ajax" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
                      <input type="hidden" name="selected_tab" value="field-options" />
					  <table cellpadding="0" cellspacing="0">
						<thead>
						  <tr>
							<th><input class="checkall" type="checkbox" /></th>
							<th><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
							<th><?php 
            _e("Label", 'custom-contact-forms');
            ?>
</th>
							<th><?php 
            _e("Value", 'custom-contact-forms');
            ?>
</th>
							<th><?php 
            _e("Is Dead", 'custom-contact-forms');
            ?>
</th>
						  </tr>
						</thead>
						<tfoot>
						  <tr>
							<th><input class="checkall" type="checkbox" /></th>
							<th><?php 
            _e("Slug", 'custom-contact-forms');
            ?>
</th>
							<th><?php 
            _e("Label", 'custom-contact-forms');
            ?>
</th>
							<th><?php 
            _e("Value", 'custom-contact-forms');
            ?>
</th>
							<th><?php 
            _e("Is Dead", 'custom-contact-forms');
            ?>
</th>
						  </tr>
						</tfoot>
						<tbody>
                        <?php 
            $options = parent::selectAllFieldOptions(1);
            $option_count = count($options);
            $i = 0;
            foreach ($options as $option) {
                ?>
                        <tr class="row-field_option-<?php 
                echo $option->id;
                ?>
 <?php 
                if ($i % 2 == 1) {
                    echo 'evenrow-field-options';
                }
                ?>
">
                            <td><input type="checkbox" class="object-check" name="objects[<?php 
                echo $i;
                ?>
][object_do]" value="1" /> </td>
							<td><input type="hidden" name="objects[<?php 
                echo $i;
                ?>
][object_type]" value="field_option" />
                            
							<input class="object-id" type="hidden" name="objects[<?php 
                echo $i;
                ?>
][object_id]" value="<?php 
                echo $option->id;
                ?>
" />
							
							<input type="text" maxlength="20" name="<?php 
                ?>
objects[<?php 
                echo $i;
                ?>
][values][option_slug]" value="<?php 
                echo $option->option_slug;
                ?>
" class="ccf-width50" /></td>
                            <td><input type="text" name="objects[<?php 
                echo $i;
                ?>
][values][option_label]" value="<?php 
                echo $option->option_label;
                ?>
" class="ccf-width100" /></td>
                            <td><input type="text" name="objects[<?php 
                echo $i;
                ?>
][values][option_value]" value="<?php 
                echo $option->option_value;
                ?>
" class="ccf-width100" /></td>
                            <td><select name="objects[<?php 
                echo $i;
                ?>
][values][option_dead]"><option value="0"><?php 
                _e('No', 'custom-contact-forms');
                ?>
</option><option <?php 
                if ($option->option_dead == 1) {
                    echo 'selected="selected"';
                }
                ?>
 value="1"><?php 
                _e('Yes', 'custom-contact-forms');
                ?>
</option></select></td>
						  
                        </tr>
                        <?php 
                $i++;
            }
            if (empty($options)) {
                ?>
                        <tr>
                          <td class="ccf-center"><?php 
                _e("No field options have been created.", 'custom-contact-forms');
                ?>
</td>
                        </tr>
                        <?php 
            }
            ?>
						</tbody>
                      </table>
					  <select class="bulk-dropdown" name="object_bulk_action">
					  <option value="0"><?php 
            _e('Bulk Actions', 'custom-contact-forms');
            ?>
</option>
				<option value="edit"><?php 
            _e('Save', 'custom-contact-forms');
            ?>
</option>
				<option value="delete"><?php 
            _e('Delete', 'custom-contact-forms');
            ?>
</option></select> 
					  <input type="submit" class="bulk-apply" name="object_bulk_apply" value="<?php 
            _e('Apply', 'custom-contact-forms');
            ?>
" /> <img src="<?php 
            echo plugins_url();
            ?>
/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="loading-img" />
					  </form>
				</div>
			  </div>
			  
              
			  <div id="create-field-options" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Create A Field Option", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
                      <form id="ccf-create-field-option" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
                      <input type="hidden" name="selected_tab" value="field-options" />
                        <ul>
                          <li>
                            <label for="object[option_slug]">*
                            <?php 
            _e("Option Slug:", 'custom-contact-forms');
            ?>
                            </label>
                            <input maxlength="20" type="text" name="object[option_slug]" />
                            <br />
                            <?php 
            _e("Used to identify this option, solely for admin purposes; must be unique, and contain only letters, numbers, and underscores. Example: 'slug_one'", 'custom-contact-forms');
            ?>
                          </li>
                          <li>
                            <label for="object[option_label]">*
                            <?php 
            _e("Option Label:", 'custom-contact-forms');
            ?>
                            </label>
                            <input type="text" name="object[option_label]" />
                            <br />
                            <?php 
            _e("This is what is shown to the user in the dropdown or radio field. Example: 'United States'", 'custom-contact-forms');
            ?>
                          </li>
                          <li>
                            <label for="object[option_value]">
                            <?php 
            _e("Option Value:", 'custom-contact-forms');
            ?>
                            </label>
                            <input type="text" name="object[option_value]" /> <a href="javascript:void(0)" class="toollink" title="<?php 
            _e("This is the actual value of the option which is not shown to the user. This can be the same thing as the label. An example pairing of label => value is: 'The color green' => 'green' or 'Yes' => '1'.", 'custom-contact-forms');
            ?>
">(?)</a>
                            <br />
                            <?php 
            _e('This is the actual value of the option which is not shown to the user. This can be the same thing as the label. An example pairing of label => value is: "The color green" => "green" or "Yes" => "1".', 'custom-contact-forms');
            ?>
                          </li>
						  <li>
							<label for="object[option_dead]"><?php 
            _e("Is Dead Option:", 'custom-contact-forms');
            ?>
</label>
							<select name="object[option_dead]"><option value="0"><?php 
            _e('No', 'custom-contact-forms');
            ?>
</option><option value="1"><?php 
            _e('Yes', 'custom-contact-forms');
            ?>
</option></select>
							<a href="javascript:void(0)" class="toollink" title="<?php 
            _e("A dead option is something like 'Please Select One'. This is a useful tool for required dropdown fields. If a dead option is submitted by a user for a required dropdown field, then the user will have to go back and fill out the field again.", 'custom-contact-forms');
            ?>
">(?)</a>
						  </li>
                          <li>
							<input name="object_type" type="hidden" value="field_option" />
                            <input type="submit" class="object-action" name="object_create" value="<?php 
            _e("Create Field Option", 'custom-contact-forms');
            ?>
" />
                          
						  </li>
                        </ul>
                      </form>
                  </div>
			  </div>
              </div>
			  
              
			  <div id="styles">
			  <div id="create-styles" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Create A Style for Your Forms", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
				  <p>
					<?php 
            _e("Use this manager to create styles for your forms. Each field is already filled out with nice look defaults. It is recommended you simply input a slug and click create to see the defaults before you start changing values.", 'custom-contact-forms');
            ?>
				  </p>
				  <form id="ccf-create-style" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
                  <input type="hidden" name="selected_tab" value="styles" />
					<ul class="style_left">
					  <li>
						<label for="style_slug">*
						<?php 
            _e("Style Slug:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="30" class="ccf-width75" name="object[style_slug]" />
						<?php 
            _e("(Must be unique)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="title_fontsize">
						<?php 
            _e("Title Font Size:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="1.2em" class="ccf-width75" name="object[title_fontsize]" />
						<?php 
            _e("(ex: 10pt, 10px, 1em)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="title_fontcolor">
						<?php 
            _e("Title Font Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="333333" class="ccf-width75 colorfield" name="object[title_fontcolor]" />
						<?php 
            _e("(ex: FF0000)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="label_width">
						<?php 
            _e("Label Width:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="200px" class="ccf-width75" name="object[label_width]" />
						<?php 
            _e("(ex: 100px or 20%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="label_fontsize">
						<?php 
            _e("Label Font Size:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="1em" class="ccf-width75" name="object[label_fontsize]" />
						<?php 
            _e("(ex: 10px, 10pt, 1em)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="label_fontcolor">
						<?php 
            _e("Label Font Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="333333" class="ccf-width75 colorfield" name="object[label_fontcolor]" />
						<?php 
            _e("(ex: FF0000)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="input_width">
						<?php 
            _e("Text Field Width:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="200px" class="ccf-width75" name="object[input_width]" />
						<?php 
            _e("(ex: 100px or 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="textarea_width">
						<?php 
            _e("Textarea Field Width:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="200px" class="ccf-width75" name="object[textarea_width]" />
						<?php 
            _e("(ex: 100px or 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="textarea_height">
						<?php 
            _e("Textarea Field Height:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="90px" class="ccf-width75" name="object[textarea_height]" />
						<?php 
            _e("(ex: 100px or 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_fontsize">
						<?php 
            _e("Field Font Size:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="1.3em" class="ccf-width75" name="object[field_fontsize]" />
						<?php 
            _e("(ex: 10px, 10pt, 1em", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_fontcolor">
						<?php 
            _e("Field Font Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="333333" class="ccf-width75 colorfield" name="object[field_fontcolor]" />
						<?php 
            _e("(ex: 333333)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_borderstyle">
						<?php 
            _e("Field Border Style:", 'custom-contact-forms');
            ?>
						</label>
						<select class="ccf-width75" name="object[field_borderstyle]">
						  <?php 
            echo str_replace('<option>solid</option>', '<option selected="selected">solid</option>', $border_style_options);
            ?>
						</select>
					  </li>
					  <li>
						<label for="form_margin">
						<?php 
            _e("Form Margin:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="7px" class="ccf-width75" name="object[form_margin]" />
						<?php 
            _e("(ex: 5px or 1em)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="label_margin">
						<?php 
            _e("Label Margin:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="5px" class="ccf-width75" name="object[label_margin]" />
						<?php 
            _e("(ex: 5px or 1em)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="textarea_backgroundcolor">
						<?php 
            _e("Textarea Background Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="f5f5f5" class="ccf-width75 colorfield" name="object[textarea_backgroundcolor]" />
						<?php 
            _e("(ex: FF0000)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="success_popover_fontcolor">
						<?php 
            _e("Success Popover Font Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="333333" class="ccf-width75 colorfield" name="object[success_popover_fontcolor]" />
						<?php 
            _e("(ex: 333333)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="success_popover_title_fontsize">
						<?php 
            _e("Success Popover Title Font Size:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="15px" class="ccf-width75" name="object[success_popover_title_fontsize]" />
						<?php 
            _e("(ex: 12px, 1em, 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="form_backgroundcolor">
						<?php 
            _e("Form Background Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="ffffff" class="ccf-width75 colorfield" name="object[form_backgroundcolor]" />
						<?php 
            _e("(ex: 12px, 1em, 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="tooltip_backgroundcolor">
						<?php 
            _e("Tooltip Background Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="000000" class="ccf-width75 colorfield" name="object[tooltip_backgroundcolor]" />
						<?php 
            _e("(ex: 000000 or black)", 'custom-contact-forms');
            ?>
					  </li>
					</ul>
					<ul class="style_right">
					  <li>
						<label for="input_width">
						<?php 
            _e("Field Border Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="999999" class="ccf-width75 colorfield" name="object[field_bordercolor]" />
						<?php 
            _e("(ex: 100px or 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="form_borderstyle">
						<?php 
            _e("Form Border Style:", 'custom-contact-forms');
            ?>
						</label>
						<select class="ccf-width75" name="object[form_borderstyle]">
						  <?php 
            echo $border_style_options;
            ?>
						</select>
					  </li>
					  <li>
						<label for="form_bordercolor">
						<?php 
            _e("Form Border Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="ffffff" class="ccf-width75 colorfield" name="object[form_bordercolor]" />
						<?php 
            _e("(ex: 000000)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="form_borderwidth">
						<?php 
            _e("Form Border Width:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="0px" class="ccf-width75" name="object[form_borderwidth]" />
						<?php 
            _e("(ex: 1px)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="form_borderwidth">
						<?php 
            _e("Form Width:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="100%" class="ccf-width75" name="object[form_width]" />
						<?php 
            _e("(ex: 100px or 50%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="form_borderwidth">
						<?php 
            _e("Form Font Family:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="120" value="Verdana, tahoma, arial" class="ccf-width75" name="object[form_fontfamily]" />
						<?php 
            _e("(ex: Verdana, Tahoma, Arial)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="submit_width">
						<?php 
            _e("Button Width:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="auto" class="ccf-width75" name="object[submit_width]" />
						<?php 
            _e("(ex: 100px, 30%, auto)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="submit_height">
						<?php 
            _e("Button Height:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="30px" class="ccf-width75" name="object[submit_height]" />
						<?php 
            _e("(ex: 100px or 30%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="submit_fontsize">
						<?php 
            _e("Button Font Size:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="1.1em" class="ccf-width75" name="object[submit_fontsize]" />
						<?php 
            _e("(ex: 10px, 10pt, 1em)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="submit_fontcolor">
						<?php 
            _e("Button Font Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="333333" class="ccf-width75 colorfield" name="object[submit_fontcolor]" />
						<?php 
            _e("(ex: FF0000)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_backgroundcolor">
						<?php 
            _e("Field Background Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="f5f5f5" class="ccf-width75 colorfield" name="object[field_backgroundcolor]" />
						<?php 
            _e("(ex: FF0000)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="form_padding">
						<?php 
            _e("Form Padding:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="8px" class="ccf-width75" name="object[form_padding]" />
						<?php 
            _e("(ex: 5px or 1em)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="title_margin">
						<?php 
            _e("Title Margin:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="5px" class="ccf-width75" name="object[title_margin]" />
						<?php 
            _e("(ex: 5px or 1em)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="title_margin">
						<?php 
            _e("Dropdown Width:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="auto" class="ccf-width75" name="object[dropdown_width]" />
						<?php 
            _e("(ex: 30px, 20%, or auto)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="success_popover_bordercolor">
						<?php 
            _e("Success Popover Border Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="efefef" class="ccf-width75 colorfield" name="object[success_popover_bordercolor]" />
						<?php 
            _e("(ex: FF0000)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="success_popover_fontsize">
						<?php 
            _e("Success Popover Font Size:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="12px" class="ccf-width75" name="object[success_popover_fontsize]" />
						<?php 
            _e("(ex: 12px, 1em, 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="success_popover_height">
						<?php 
            _e("Success Popover Height:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="200px" class="ccf-width75" name="object[success_popover_height]" />
						<?php 
            _e("(ex: 200px, 6em, 50%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="field_borderround">
						<?php 
            _e("Field Border Roundness:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="6px" class="ccf-width75" name="object[field_borderround]" />
						<?php 
            _e("(ex: 6px, or 0px)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="tooltip_fontsize">
						<?php 
            _e("Tooltip", 'custom-contact-forms');
            ?>
						<a href="javascript:void(0)" class="toollink" title="<?php 
            _e("A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.", 'custom-contact-forms');
            ?>
">(?)</a>
						<?php 
            _e("Font Size:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="12px" class="ccf-width75" name="object[tooltip_fontsize]" />
						<?php 
            _e("(ex: 12px, 1em, 100%)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<label for="tooltip_fontcolor">
						<?php 
            _e("Tooltip Font Color:", 'custom-contact-forms');
            ?>
						</label>
						<input type="text" maxlength="20" value="ffffff" class="ccf-width75 colorfield" name="object[tooltip_fontcolor]" />
						<?php 
            _e("(ex: ffffff or white)", 'custom-contact-forms');
            ?>
					  </li>
					  <li>
						<input name="object_type" type="hidden" value="style" />
						<input type="submit" value="<?php 
            _e("Create Style", 'custom-contact-forms');
            ?>
" name="object_create" class="create-button" />
					  </li>
					</ul>
				  </form>
				</div>
			  </div>
			  <a name="manage-styles"></a>
			  <h3 class="manage-h3">
				<?php 
            _e("Manage Form Styles", 'custom-contact-forms');
            ?>
			  </h3>
			  <form class="ccf-edit-ajax" method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
              <input type="hidden" name="selected_tab" value="styles" />
			  <table class="widefat post" id="manage-styles" cellspacing="0">
				<thead>
				  <tr>
					<th scope="col" class="manage-column"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
				  </tr>
				</thead>
				<tbody>
				  <?php 
            $styles = parent::selectAllStyles();
            $i = 0;
            foreach ($styles as $style) {
                ?>
				  <tr class="row-style-<?php 
                echo $style->id;
                ?>
 <?php 
                if ($i % 2 == 0) {
                    echo 'ccf-evenrow';
                }
                ?>
">
					 <td> <label><input type="checkbox" class="object-check" value="1" name="objects[<?php 
                echo $i;
                ?>
][object_do]" /> 
						* <?php 
                _e("Slug:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="30" value="<?php 
                echo $style->style_slug;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][style_slug]" />
						<br />
						<label>
						<?php 
                _e("Font Family:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="120" value="<?php 
                echo $style->form_fontfamily;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][form_fontfamily]" />
						<br />
						<label>
						<?php 
                _e("Textarea Background", 'custom-contact-forms');
                ?>
						<br />
						<?php 
                _e("Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->textarea_backgroundcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][textarea_backgroundcolor]" />
						<br />
						<label>
						<?php 
                _e("Success Popover", 'custom-contact-forms');
                ?>
						<br />
						<?php 
                _e("Border Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->success_popover_bordercolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][success_popover_bordercolor]" />
						<br />
						<label>
						<?php 
                _e("Tooltip", 'custom-contact-forms');
                ?>
						<a href="javascript:void(0)" class="toollink" title="<?php 
                _e("A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.", 'custom-contact-forms');
                ?>
">(?)</a>
						<?php 
                _e("Font Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->tooltip_fontcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][tooltip_fontcolor]" />
					  </td>
					  <td><label>
						<?php 
                _e("Form Width:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->form_width;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][form_width]" />
						<br />
						<label>
						<?php 
                _e("Text Field Width:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->input_width;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][input_width]" />
						<br />
						<label>
						<?php 
                _e("Textarea Width:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->textarea_width;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][textarea_width]" />
						<br />
						<label>
						<?php 
                _e("Textarea Height:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->textarea_height;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][textarea_height]" />
						<br />
						<label>
						<?php 
                _e("Dropdown Width:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->dropdown_width;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][dropdown_width]" />
						<br />
						<label>
						<?php 
                _e("Label Margin:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->label_margin;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][label_margin]" />
						<br />
						<label>
						<?php 
                _e("Success Popover", 'custom-contact-forms');
                ?>
						<br />
						<?php 
                _e("Height:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->success_popover_height;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][success_popover_height]" />
						<br />
					  </td>
					  <td><label>
						<?php 
                _e("Label Width:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->label_width;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][label_width]" />
						<br />
						<label>
						<?php 
                _e("Button Width:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->submit_width;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][submit_width]" />
						<br />
						<label>
						<?php 
                _e("Button Height:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->submit_height;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][submit_height]" />
						<br />
						<label>
						<?php 
                _e("Field Background Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->field_backgroundcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][field_backgroundcolor]" />
						<br />
						<label>
						<?php 
                _e("Title Margin:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->title_margin;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][title_margin]" />
						<br />
						<label>
						<?php 
                _e("Success Popover", 'custom-contact-forms');
                ?>
						<br />
						<?php 
                _e("Title Font Size:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->success_popover_title_fontsize;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][success_popover_title_fontsize]" />
						<label>
						<?php 
                _e("Form Background Color:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" class="colorfield" maxlength="20" value="<?php 
                echo $style->form_backgroundcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][form_backgroundcolor]" />
					  </td>
					  <td><label>
						<?php 
                _e("Title Font Size:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->title_fontsize;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][title_fontsize]" />
						<br />
						<label>
						<?php 
                _e("Label Font Size:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->label_fontsize;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][label_fontsize]" />
						<br />
						<label>
						<?php 
                _e("Field Font Size:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->field_fontsize;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][field_fontsize]" />
						<br />
						<label>
						<?php 
                _e("Button Font Size:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->submit_fontsize;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][submit_fontsize]" />
						<br />
						<label>
						<?php 
                _e("Form Padding:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->form_padding;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][form_padding]" />
						<br />
						<label>
						<?php 
                _e("Success Popover", 'custom-contact-forms');
                ?>
						<br />
						<?php 
                _e("Font Size:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->success_popover_fontsize;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][success_popover_fontsize]" />
						<br />
						<label>
						<?php 
                _e("Tooltip", 'custom-contact-forms');
                ?>
						<a href="javascript:void(0)" class="toollink" title="<?php 
                _e("A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.", 'custom-contact-forms');
                ?>
">(?)</a>
						<?php 
                _e("Background Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->tooltip_backgroundcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][tooltip_backgroundcolor]" />
					  </td>
					  <td><label>
						<?php 
                _e("Title Font Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->title_fontcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][title_fontcolor]" />
						<br />
						<label>
						<?php 
                _e("Label Font Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->label_fontcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][label_fontcolor]" />
						<br />
						<label>
						<?php 
                _e("Field Font Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->field_fontcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][field_fontcolor]" />
						<br />
						<label>
						<?php 
                _e("Button Font Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->submit_fontcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][submit_fontcolor]" />
						<br />
						<label>
						<?php 
                _e("Form Margin:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->form_margin;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][form_margin]" />
						<br />
						<label>
						<?php 
                _e("Success Popover", 'custom-contact-forms');
                ?>
						<br />
						<?php 
                _e("Font Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->success_popover_fontcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][success_popover_fontcolor]" />
						<br />
						<label>
						<?php 
                _e("Tooltip Font Size:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->tooltip_fontsize;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][tooltip_fontsize]" />
					  </td>
					  <td><label>
						<?php 
                _e("Form Border Style:", 'custom-contact-forms');
                ?>
						</label>
						<select name="object[form_borderstyle]">
						  <?php 
                echo str_replace('<option>' . $style->form_borderstyle . '</option>', '<option selected="selected">' . $style->form_borderstyle . '</option>', $border_style_options);
                ?>
						</select>
						<br />
						<label>
						<?php 
                _e("Form Border Width:", 'custom-contact-forms');
                ?>
						</label>
						<input type="text" maxlength="20" value="<?php 
                echo $style->form_borderwidth;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][form_borderwidth]" />
						<br />
						<label>
						<?php 
                _e("Form Border Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->form_bordercolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][form_bordercolor]" />
						<br />
						<label>
						<?php 
                _e("Field Border Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->field_bordercolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][field_bordercolor]" />
						<br />
						<label>
						<?php 
                _e("Field Border Style:", 'custom-contact-forms');
                ?>
						</label>
						<select name="objects[<?php 
                echo $i;
                ?>
][values][field_borderstyle]">
						  <?php 
                echo str_replace('<option>' . $style->field_borderstyle . '</option>', '<option selected="selected">' . $style->field_borderstyle . '</option>', $border_style_options);
                ?>
						</select>
						<br />
						<label>
						<?php 
                _e("Success Popover", 'custom-contact-forms');
                ?>
						<br />
						<?php 
                _e("Title Font Color:", 'custom-contact-forms');
                ?>
						</label>
						<input class="colorfield" type="text" maxlength="20" value="<?php 
                echo $style->success_popover_title_fontcolor;
                ?>
" name="objects[<?php 
                echo $i;
                ?>
][values][success_popover_title_fontcolor]" />
						<br />
						<label>
						<?php 
                _e("Field Border Roundness:", 'custom-contact-forms');
                ?>
						</label>
						<input name="objects[<?php 
                echo $i;
                ?>
][values][field_borderround]" value="<?php 
                echo $style->field_borderround;
                ?>
" type="text" maxlength="20" />
						<br />
						<input type="hidden" name="objects[<?php 
                echo $i;
                ?>
][object_type]" value="style" />
						<input class="object-id" name="objects[<?php 
                echo $i;
                ?>
][object_id]" type="hidden" value="<?php 
                echo $style->id;
                ?>
" />
					  </td>
				  </tr>
				  <?php 
                $i++;
            }
            ?>
				</tbody>
				<tfoot>
				  <tr>
					<th scope="col" class="manage-column"><input type="checkbox" class="checkall" /></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
					<th scope="col" class="manage-column"></th>
				  </tr>
				</tfoot>
			  </table>
			  <select class="bulk-dropdown" name="object_bulk_action">
			  <option value="0"><?php 
            _e('Bulk Actions', 'custom-contact-forms');
            ?>
</option>
				<option value="edit"><?php 
            _e('Save', 'custom-contact-forms');
            ?>
</option>
				<option value="delete"><?php 
            _e('Delete', 'custom-contact-forms');
            ?>
</option></select> 
			  <input type="submit" name="object_bulk_apply" class="bulk-apply" value="<?php 
            _e('Apply', 'custom-contact-forms');
            ?>
" /> <img src="<?php 
            echo plugins_url();
            ?>
/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="loading-img" />
			  </form>
              </div>
              <div id="support">
			  <div id="contact-author" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Report a Bug/Suggest a Feature", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
				  <form method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
                  <input type="hidden" name="selected_tab" value="support" />
					<ul>
					  <li>
						<label for="name">
						<?php 
            _e("Your Name:", 'custom-contact-forms');
            ?>
						</label>
						<input id="name" type="text" name="name" maxlength="100" />
					  </li>
					  <li>
						<label for="email">
						<?php 
            _e("Your Email:", 'custom-contact-forms');
            ?>
						</label>
						<input id="email" type="text" value="<?php 
            echo get_option('admin_email');
            ?>
" name="email" maxlength="100" />
					  </li>
                    </ul>
                    <ul>
                      <li>
						<label for="host">
						<?php 
            _e("Who Hosts Your Website?", 'custom-contact-forms');
            ?>
						</label>
						<input id="host" type="text" name="host" maxlength="150" />
					  </li>
					  <li>
						<label for="type">*
						<?php 
            _e("Purpose of this message:", 'custom-contact-forms');
            ?>
						</label>
						<select id="type" name="type">
						  <option>
						  <?php 
            _e("Bug Report", 'custom-contact-forms');
            ?>
						  </option>
						  <option>
						  <?php 
            _e("Suggest a Feature", 'custom-contact-forms');
            ?>
						  </option>
						  <option>
						  <?php 
            _e("Plugin Question", 'custom-contact-forms');
            ?>
						  </option>
						</select>
					  </li>
                    </ul>
                    <ul>
					  <li>
						<label for="ccf-version">
						<?php 
            _e("Version of Custom Contact Forms?", 'custom-contact-forms');
            ?>
						</label>
						<input id="ccf-version" type="text" name="ccf-version" maxlength="50" />
					  </li>
					  <li>
						<label for="wp-version">
						<?php 
            _e("Version of WordPress?", 'custom-contact-forms');
            ?>
						</label>
						<input id="wp-version" type="text" name="wp-version" maxlength="50" />
					  </li>
					</ul>
                    <ul class="message">
                      <li>
						<label for="message">*
						<?php 
            _e("Your Message:", 'custom-contact-forms');
            ?>
						</label>
						<textarea id="message-textarea" name="message"></textarea>
					  </li>
                    </ul>
					<p>
					  <input type="submit" name="contact_author" value="<?php 
            _e("Send Message", 'custom-contact-forms');
            ?>
" />
					</p>
				  </form>
				</div>
			  </div>
              </div>
              
              <div id="advanced">
			  <div id="custom-html" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Custom HTML Forms (Advanced)", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
				  <p>
					<?php 
            _e("If you know HTML and simply want to use this plugin to process form requests, this feature is for you. \n\t\t\t\t\tThe following HTML is a the framework to which you must adhere. In order for your form to work you MUST do the following: a) Keep the form action/method the same (yes the action is supposed to be empty), b) Include all the hidden fields shown below, c) provide a \n\t\t\t\t\thidden field with a success message or thank you page (both hidden fields are included below, you must choose one or the other and fill in the value part of the input field appropriately.", 'custom-contact-forms');
            ?>
				  </p>
				  <textarea id="custom_html_textarea">
&lt;form method=&quot;post&quot; action=&quot;&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;ccf_customhtml&quot; value=&quot;1&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;success_message&quot; value=&quot;<?php 
            _e("Thank you for filling out our form!", 'custom-contact-forms');
            ?>
&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;thank_you_page&quot; value=&quot;http://www.google.com&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;destination_email&quot; value=&quot;<?php 
            echo $admin_options['default_to_email'];
            ?>
&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;required_fields&quot; value=&quot;field_name1, field_name2&quot; /&gt;

&lt;!-- <?php 
            _e("Paste all this code into a page or post and edit it to your liking. It is recommended you only use this feature if you are experienced with HTML. The destination_email field specifies where emails will be sent on successful submission; you can have the form send to multiple addresses by separating email's with semi-colons (i.e. email@google.com; email2@google.com). The success_message field will add a popover containing the message when the form is completed successfully, the thank_you_page field will force the user to be redirected to that specific page on successful form completion. The required_fields hidden field is optional; to use it separate the field names you want required by commas. Remember to use underscores instead of spaces in field names!", 'custom-contact-forms');
            ?>
 --&gt;

&lt;/form&gt;</textarea>
				</div>
			  </div>
              </div>
              
              <div id="news">
			  <div id="plugin-news" class="postbox">
				<h3 class="hndle"><span>
				  <?php 
            _e("Custom Contact Forms Plugin News", 'custom-contact-forms');
            ?>
				  </span></h3>
				<div class="inside">
				  <?php 
            $this->displayPluginNewsFeed();
            ?>
				</div>
			  </div>
              </div>
              <?php 
            $this->rateMeForm();
            ?>
			  <?php 
            $this->insertUsagePopover();
            ?>
              <?php 
            $this->insertQuickStartPopover();
            ?>
              </div>
			</div>
<?php 
        }