function show_form($errors = '') { global $months, $days, $years; // If the form is submitted, get defaults from submitted variables if ($_POST['_submit_check']) { $defaults = $_POST; } else { // Otherwise, set our own defaults: one month from now $default_timestamp = strtotime('+1 month'); $defaults = array('month' => date('n', $default_timestamp), 'day' => date('j', $default_timestamp), 'year' => date('Y', $default_timestamp)); } // If errors were passed in, put them in $error_text (with HTML markup) if ($errors) { print 'You need to correct the following errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; print 'Enter a date and time:'; input_select('month', $defaults, $months); print ' '; input_select('day', $defaults, $days); print ' '; input_select('year', $defaults, $years); print '<br/>'; input_submit('submit', 'Find Tuesdays'); print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
function show_form($errors = '') { if ($errors) { print 'You need to correct the following errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } // the beginning of the form print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; print '<table>'; // the first address print '<tr><th colspan="2">From</th></tr>'; print '<td>Name:</td><td>'; input_text('name_1', $_POST); print '</td></tr>'; print '<tr><td>Street Address:</td><td>'; input_text('address_1', $_POST); print '</td></tr>'; print '<tr><td>City, State, Zip:</td><td>'; input_text('city_1', $_POST); print ', '; input_select('state_1', $_POST, $GLOBALS['us_states']); input_text('zip_1', $_POST); print '</td></tr>'; // the second address print '<tr><th colspan="2">To</th></tr>'; print '<td>Name:</td><td>'; input_text('name_2', $_POST); print '</td></tr>'; print '<tr><td>Street Address:</td><td>'; input_text('address_2', $_POST); print '</td></tr>'; print '<tr><td>City, State, Zip:</td><td>'; input_text('city_2', $_POST); print ', '; input_select('state_2', $_POST, $GLOBALS['us_states']); input_text('zip_2', $_POST); print '</td></tr>'; // Package Info print '<tr><th colspan="2">Package</th></tr>'; print '<tr><td>Height:</td><td>'; input_text('height', $_POST); print '</td></tr>'; print '<tr><td>Width:</td><td>'; input_text('width', $_POST); print '</td></tr>'; print '<tr><td>Length:</td><td>'; input_text('length', $_POST); print '</td></tr>'; print '<tr><td>Weight:</td><td>'; input_text('weight', $_POST); print '</td></tr>'; // form end print '<tr><td colspan="2"><input type="submit" value="Ship Package"></td></tr>'; print '</table>'; print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
/** * Render Meta Box content. * @param WP_Post $post The post object. */ public function render_valores_padrao_meta_box($post) { $postId = $post->ID; // Organizador $organizadores = Organizadores::getInstance()->getAll(); $organizadores = Plib::array_to_key_value(Plib::object_to_array($organizadores), 'id', 'titulo'); $organizadores[''] = ""; echo input_select($postId, 'valor_id_organizador', 'Organizador:', $organizadores); // Confirmação echo input_select($postId, 'valor_confirmacao', 'Confirmação da Inscrição:', array('' => '', 'preinscricao' => 'Pré-inscrição', 'imediata' => 'Imediata', 'pagamento' => 'Após Confirmação do Pagamento', 'posterior' => 'Posteriormente pelo Organizador')); // Tipo de inscrição //echo input_select($postId, 'pago', 'Tipo de Inscrição:', array(''=>'','pago' => 'Paga', 'gratuito' => 'Gratuita')); // Add an nonce field so we can check for it later. wp_nonce_field('myplugin_inner_custom_box', 'myplugin_inner_custom_box_nonce'); }
function show_form($errors = '') { print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; if ($errors) { print '<ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } // Since we're not supplying any defaults of our own, it's OK // to pass $_POST as the defaults array to input_select and // input_text so that any user-entered values are preserved print 'Color: '; input_select('color', $_POST, $GLOBALS['colors']); print '<br/>'; input_submit('submit', 'Select Color'); print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
function show_form($errors = '') { if ($errors) { print 'You need to correct the following errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; print 'Expiration Date: '; input_select('month', $_POST, $GLOBALS['months']); print ' '; input_select('year', $_POST, $GLOBALS['years']); print '<br/>'; input_submit('submit', 'Check Expiration'); // the hidden _submit_check variable and the end of the form print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
function show_form($errors = '') { global $hours, $minutes, $months, $days, $years; // If the form is submitted, get defaults from submitted variables if ($_POST['_submit_check']) { $defaults = $_POST; } else { // Otherwise, set our own defaults: the current time and date parts $defaults = array('hour' => date('g'), 'ampm' => date('a'), 'month' => date('n'), 'day' => date('j'), 'year' => date('Y')); // Because the choices in the minute menu are in five-minute increments, // if the current minute isn't a multiple of five, we need to make it // into one. $this_minute = date('i'); $minute_mod_five = $this_minute % 5; if ($minute_mod_five != 0) { $this_minute -= $minute_mod_five; } $defaults['minute'] = sprintf('%02d', $this_minute); } // If errors were passed in, put them in $error_text (with HTML markup) if ($errors) { print 'You need to correct the following errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; print 'Enter a date and time:'; input_select('hour', $defaults, $hours); print ':'; input_select('minute', $defaults, $minutes); input_select('ampm', $defaults, array('am' => 'am', 'pm' => 'pm')); input_select('month', $defaults, $months); print ' '; input_select('day', $defaults, $days); print ' '; input_select('year', $defaults, $years); print '<br/>'; input_submit('submit', 'Find Meeting'); print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
function show_form($errors = '') { global $db; if ($errors) { print 'You need to correct the following errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } // the beginning of the form print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; print '<table>'; // dish select menu print '<tr><td>Dish:</td><td>'; input_select('dish_name', $_POST, $GLOBALS['dish_names']); print '</td></tr>'; // form end print '<tr><td colspan="2"><input type="submit" value="Search Dishes"></td></tr>'; print '</table>'; print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
function show_form($errors = '') { global $months, $years, $this_year; // If the form is submitted, get defaults from submitted variables if ($_POST['_submit_check']) { $defaults = $_POST; } else { // Otherwise, set our own defaults: the current month and year $defaults = array('year' => date('Y'), 'month' => date('n')); } if ($errors) { print 'You need to correct the following errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; input_select('month', $defaults, $months); input_select('year', $defaults, $years); input_submit('submit', 'Show Calendar'); print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
function show_form($errors = '') { print '<form method="POST" action="' . $_SERVER['SCRIPT_NAME'] . '">'; if ($errors) { print '<ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } // Since we're not supplying any defaults of our own, it's OK // to pass $_POST as the defaults array to input_select and // input_text so that any user-entered values are preserved print 'Dish: '; input_select('dish', $_POST, $GLOBALS['main_dishes']); print '<br/>'; print 'Quantity: '; if (!array_key_exists('quantity', $_POST)) { $_POST['quantity'] = ''; } input_text('quantity', $_POST); print '<br/>'; input_submit('submit', 'Order'); print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>'; }
<?php require '../chap6/formhelpers.php'; $months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December'); $days = array(); for ($i = 1; $i <= 31; $i++) { $days[$i] = $i; } $years = array(); for ($year = date('Y') - 1, $max_year = date('Y') + 5; $year < $max_year; $year++) { $years[$year] = $year; } input_select('month', $_POST, $months); print ' '; input_select('day', $_POST, $days); print ' '; input_select('year', $_POST, $years);
function show_form($errors = '') { // If the form is submitted, get defaults from submitted parameters if (array_key_exists('_submit_check', $_POST)) { $defaults = $_POST; } else { // Otherwise, set our own defaults $defaults = array('dish_name' => '', 'min_price' => '5.00', 'max_price' => '25.00', 'is_spicy' => 'no'); } // If errors were passed in, put them in $error_text (with HTML markup) if (is_array($errors)) { $error_text = '<tr><td>You need to correct the following errors:'; $error_text .= '</td><td><ul><li>'; $error_text .= implode('</li><li>', $errors); $error_text .= '</li></ul></td></tr>'; } else { // No errors? Then $error_text is blank $error_text = ''; } // Jump out of PHP mode to make displaying all the HTML tags easier ?> <form method="POST" action="<?php print $_SERVER['PHP_SELF']; ?> "> <table> <?php print $error_text; ?> <tr><td>Dish Name:</td> <td><?php input_text('dish_name', $defaults); ?> </td></tr> <tr><td>Minimum Price:</td> <td><?php input_text('min_price', $defaults); ?> </td></tr> <tr><td>Maximum Price:</td> <td><?php input_text('max_price', $defaults); ?> </td></tr> <tr><td>Spicy:</td> <td><?php input_select('is_spicy', $defaults, $GLOBALS['spicy_choices']); ?> </td></tr> <tr><td colspan="2" align="center"><?php input_submit('search', 'Search'); ?> </td></tr> </table> <input type="hidden" name="_submit_check" value="1"/> </form> <?php }
function display_form($defaults) { global $subject_options; ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <table> <tr><td> Subject </td> <td> <?php input_select('subject', $defaults, $subject_options); ?> </td> </tr> <tr> <td>Your email </td> <td> <input type="text" name="email" size="30" value="<?php echo htmlspecialchars($defaults['email']); ?> "/> </td> </tr> <tr> <td>Your name </td> <td> <input type="text" name="name" size="30" value="<?php echo htmlspecialchars($defaults['name']); ?> "/> </td> </tr> <tr> <td valign="top">Comments </td> <td><textarea name="comments" cols="40" rows="5"><?php echo htmlspecialchars($defaults['comments']); ?> </textarea> </td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit Comments" /></td> </tr> </table> </form> <?php }
"><label for="name"><?php echo _("Name or location of the ballot"); ?> </label><span class="input"><input type="text" name="name" id="name" value="<?php echo h($ballot->name); ?> "></span></div> <div class="input <?php echo stripes(); ?> "><label for="ngroup"><?php echo _("Group of location"); ?> </label><span class="input"> <? input_select("ngroup", Ngroup::options($period->ngroup()->parent), $ballot->ngroup, 'id="ngroup"'); ?> </span></div> <div class="input <?php echo stripes(); ?> "><label for="opening_hour"><?php echo _("Opening hours"); ?> </label><span class="input"> <select name="opening_hour" id="opening_hour"> <? if ($ballot->opening) { list($hour, $minute, $second) = explode(":", $ballot->opening); } else { $hour = 0;
/** * admins select a voting period * * @return boolean true if the period may be changed */ private function display_edit_period() { $options =& $this->available_periods(); if (!$options) return false; if (@$_GET['edit_period']==$this->id) { form(URI::strip(['edit_period'])."#issue".$this->id); input_select("period", $options, $this->period); ?><br><? input_hidden("issue", $this->id); input_hidden("action", "select_period"); ?> <input type="submit" value="<?=_("apply")?>"> <? form_end(); } else { if ($this->period) { ?><a href="periods.php?ngroup=<?=$this->area()->ngroup?>&hl=<?=$this->period?>"><?=$this->period?></a><? } ?><a href="<?=URI::append(['edit_period'=>$this->id])?>#issue<?=$this->id?>" class="iconlink"><img src="img/edit.png" width="16" height="16" alt="<?=_("edit")?>" title="<?=_("select voting period")?>"></a><? } return true; }
<?php require '../chap6/formhelpers.php'; $midnight_today = mktime(0, 0, 0); $choices = array(); for ($i = 0; $i < 7; $i++) { $timestamp = strtotime("+{$i} day", $midnight_today); //キー $display_date = strftime('%A, %B %d, %Y', $timestamp); //値 $choices[$timestamp] = $display_date; //配列に格納 } input_select('date', $_POST, $choices); //selectの表示
</div> <div class="portlet-body"> <?php foreach ($inputs as $val) { foreach ($val as $key => $value) { switch ($key) { case 'text': echo input_text($value); break; case 'file': echo input_file($value); break; case 'select': echo input_select($value, $array_provincias); break; case 'ckeditor': echo input_ckeditor($value); break; case 'colorpicker': echo input_color_picker($value); break; case 'selecticon': echo input_select_icon($value); break; case 'dropzone_normal': echo input_dropzone($value); break; case 'select_image': echo input_select_image($value, $value['opciones']);
function build_input_form($field_array) { hook_action('build_input_form'); if ($field_array['name']) { if (!isset($field_array['object_id']) or !is_numeric($field_array['object_id'])) { $field_array['object_id'] = '0'; } if (!isset($field_array['nice_name'])) { $field_array['nice_name'] = ''; } if (!isset($field_array['object_type'])) { $field_array['object_type'] = ''; } if (!isset($field_array['description'])) { $field_array['description'] = ''; } if (!isset($field_array['placeholder'])) { $field_array['placeholder'] = ''; } if (!isset($field_array['default_value'])) { $field_array['default_value'] = ''; } if (!isset($field_array['addClass'])) { $field_array['addClass'] = NULL; } if (!isset($field_array['input_type'])) { $field_array['input_type'] = 'text'; } if (!isset($field_array['create_slug'])) { $field_array['create_slug'] = FALSE; } if (!isset($field_array['required'])) { $field_array['required'] = FALSE; } if (!isset($field_array['handle'])) { $field_array['handle'] = TRUE; } if ($field_array['required'] == TRUE) { $field_array['required'] = 'required'; } if (!isset($field_array['input_option'])) { $field_array['input_option'] = array(); } if (!is_array($field_array['input_option'])) { $field_array['input_option'] = array(); } switch ($field_array['input_type']) { case 'text': input_text($field_array); break; case 'email': input_email($field_array); break; case 'hidden': input_hidden($field_array); break; case 'request_uri': input_request_uri($field_array); break; case 'number': input_number($field_array); break; case 'password': input_password($field_array); break; case 'textarea': input_textarea($field_array); break; case 'wysiwyg': echo input_editor($field_array); break; case 'select': input_select($field_array); break; case 'multiimage': input_multiimage($field_array); break; } } }
/** * drop down menu * * @param string $colname * @param mixed $default * @param integer $id * @param boolean $disabled * @param array $column */ protected function edit_select($colname, $default, /** @noinspection PhpUnusedParameterInspection */ $id, $disabled, array $column) { input_select($colname, $column['options'], $default, $disabled, @$column['attributes']); }
<div class="portlet-body"> <div class="form-body"> <?php foreach ($inputs as $val) { foreach ($val as $key => $value) { switch ($key) { case 'text': echo input_text($value); break; case 'file': echo input_file($value); break; case 'select': echo input_select($value, $value['opciones']); break; case 'ckeditor': echo input_ckeditor($value); break; case 'colorpicker': echo input_color_picker($value); break; } } } ?> </div> <div class="row"> <div class="col-sm-6">
echo ' SELECTED'; } echo '>' . t('Current recordings') . '</option>'; echo '<option value="', dupsin_oldrecorded, '"'; if (!$allOn && $schedule->dupin & dupsin_oldrecorded) { echo ' SELECTED'; } echo '>' . t('Previous recordings') . '</option>'; ?> </select></dd> <dt><?php echo t('Preferred Input'); ?> :</dt> <dd><?php input_select($schedule->prefinput, 'prefinput'); ?> </dd> <dt><?php echo t('Internet Reference #'); ?> :</dt> <dd class="commands"><input id="inetref" class="inetref" type="text" name="inetref" value="<?php echo html_entities($schedule->inetref); ?> "><a onclick="lookupMetadata(onMetadata, onMetadataFailure); return false;"><?php echo t("Look up Metadata"); ?> </a></dd> <dt><?php echo t('Season');
<?php require '../chap6/formhelpers.php'; $hours = array(); for ($hour = 1; $hour <= 12; $hour++) { $hours[$hour] = $hour; } $minutes = array(); for ($minute = 0; $minute < 60; $minute += 5) { $formatted_minute = sprintf('%02d', $minute); $minutes[$formatted_minute] = $formatted_minute; } input_select('hour', $_POST, $hours); print ':'; input_select('minute', $_POST, $minutes); input_select('ampm', $_POST, array('am' => 'am', 'pm' => 'pm'));
function show_form($errors = '') { // If the form is submitted, get defaults from submitted parameters if (array_key_exists('_submit_check', $_POST)) { $defaults = $_POST; } else { // Otherwise, set our own defaults: medium size and yes to delivery $defaults = array('name' => '', 'sweet' => 'puff', 'main_dish' => array('cuke'), 'comments' => '', 'delivery' => 'yes', 'size' => 'medium'); } // If errors were passed in, put them in $error_text (with HTML markup) if ($errors) { $error_text = '<tr><td>You need to correct the following errors:'; $error_text .= '</td><td><ul><li>'; $error_text .= implode('</li><li>', $errors); $error_text .= '</li></ul></td></tr>'; } else { // No errors? Then $error_text is blank $error_text = ''; } // Jump out of PHP mode to make displaying all the HTML tags easier ?> <form method="POST" action="<?php print $_SERVER['SCRIPT_NAME']; ?> "> <table> <?php print $error_text; ?> <tr><td>Your Name:</td> <td><?php input_text('name', $defaults); ?> </td></tr> <tr><td>Size:</td> <td><?php input_radiocheck('radio', 'size', $defaults, 'small'); ?> Small <br/> <?php input_radiocheck('radio', 'size', $defaults, 'medium'); ?> Medium <br/> <?php input_radiocheck('radio', 'size', $defaults, 'large'); ?> Large </td></tr> <tr><td>Pick one sweet item:</td> <td><?php input_select('sweet', $defaults, $GLOBALS['sweets']); ?> </td></tr> <tr><td>Pick two main dishes:</td> <td> <?php input_select('main_dish', $defaults, $GLOBALS['main_dishes'], true); ?> </td></tr> <tr><td>Do you want your order delivered?</td> <td><?php input_radiocheck('checkbox', 'delivery', $defaults, 'yes'); ?> Yes </td></tr> <tr><td>Enter any special instructions.<br/> If you want your order delivered, put your address here:</td> <td><?php input_textarea('comments', $defaults); ?> </td></tr> <tr><td colspan="2" align="center"><?php input_submit('save', 'Order'); ?> </td></tr> </table> <input type="hidden" name="_submit_check" value="1"/> </form> <?php }
} display_annotation($proposal); if ($proposal->state != "draft") display_quorum($proposal, $supporters, $is_supporter, $is_valid); ?> <section id="issue"> <? if (Login::$admin) { if ($proposal->allowed_move_to_issue()) { ?> <div class="add"><?=_("Move this proposal to issue")?>: <? form(URI::same()); input_select("issue", $proposal->options_move_to_issue()); input_hidden("action", "move_to_issue"); input_submit(_("move")); form_end(); ?></div> <? } } else { if ($issue->allowed_add_alternative_proposal()) { if (Login::$member and Login::$member->entitled($_SESSION['ngroup'])) { ?> <div class="add"><a href="proposal_edit.php?issue=<?=$proposal->issue?>" class="icontextlink"><img src="img/plus.png" width="16" height="16" alt="<?=_("plus")?>"><?=_("Add alternative proposal")?></a></div> <? } else { ?> <div class="add icontextlink disabled" title="<?=_("You are not logged in, not in this group, not eligible or not verified.")?>"><img src="img/plus.png" width="16" height="16" alt="<?=_("plus")?>"><?=_("Add alternative proposal")?></div>
public function render_meta_box_descricoes($post) { $postId = $post->ID; $this->post_id = $postId; if ($postId != null) { $this->evento = Eventos::getInstance()->getById($postId, false); } ?> <div id="tabs"> <ul class="tabs"> <li><a href="#tabs-descricao">Descrição</a></li> <li><a href="#tabs-realizacao">Realização</a></li> <li><a href="#tabs-inscricao">Inscrição</a></li> <?php if ($this->templateExibir('campos_extras')) { ?> <li><a href="#tabs-dados">Dados Formulário</a></li> <?php } ?> <?php if ($this->evento->pago == 'pago') { ?> <li><a href="#tabs-treinamento">Treinamento</a></li> <?php } ?> <!-- <li><a href="#tabs-mensagens">Mensagens</a></li>--> <?php if ($this->templateExibir('secoes_extras')) { ?> <li><a href="#tabs-sessoesextras">Sessões Extras</a></li> <?php } ?> </ul> <div id="tabs-descricao"> <?php if (TGO_EVENTO_EVENTO_PAI === true) { echo "<div class=fields>"; echo "<h3>Herdar Configurações</h3>"; $eventos = Eventos::getInstance()->getEventosOrfaos($postId); $eventos = PLib::object_to_array($eventos); $eventos = Plib::array_to_key_value($eventos, 'id', 'titulo'); echo input_select($postId, 'id_evento_pai', 'Evento Pai:', $eventos, null, get_post_meta($postId, 'id_evento_pai', true), 'class=ajustes_visuais'); echo "</div>"; } echo "<div class=fields>"; echo "<h3>Chamadas Curtas</h3>"; if ($this->templateExibir('descricao_1')) { echo input_texto($postId, 'descricao_1', 'Descrição Curtíssima', 100); } if ($this->templateExibir('descricao_2')) { echo input_textarea($postId, 'descricao_2', 'Descrição Breve', 3); } echo "</div>"; echo "<div class=fields>"; echo "<h3>Apresentação completa</h3>"; if ($this->templateExibir('descricao_3')) { $value = get_post_meta($postId, 'descricao_3', true); wp_editor($value, 'descricao_3', array('textarea_rows' => get_option('default_post_edit_rows', 20))); } echo "</div>"; ?> </div> <div id="tabs-realizacao"> <?php // Organizador $organizadores = Plib::object_to_array(Organizadores::getInstance()->getAll()); $organizadores = Plib::array_to_key_value($organizadores, 'id', 'titulo'); if (count($organizadores) > 1) { echo "<div class=fields>"; echo "<h3>Organização</h3>"; if ($this->templateExibir('id_organizador')) { echo input_select($postId, 'id_organizador', 'Organizador:', $organizadores, null, $this->templateValorPadrao('id_organizador')); } else { if ($this->templateValorPadrao('id_organizador') != null) { echo input_hidden($postId, 'id_organizador', $this->templateValorPadrao('id_organizador')); } else { $organizadores = array_keys($organizadores); echo input_hidden($postId, 'id_organizador', $organizadores[0]); } } echo "</div>"; } // Instrutor if ($this->templateExibir('id_instrutor')) { $instrutores = Instrutores::getInstance()->getTodosArray(); echo input_select($postId, 'id_instrutor', 'Instrutor/Coordenador:', $instrutores); } echo "<div class=fields>"; echo "<h3>Data e Local</h3>"; echo input_data($postId, 'data', 'Data do Evento:'); echo input_hora($postId, 'hora', 'Hora de Inicio:'); if ($this->templateExibir('data_fim')) { echo input_data($postId, 'data_fim', 'Data Término:'); } echo input_hora($postId, 'hora_fim', 'Hora Término:'); if ($this->templateExibir('id_local')) { Locais::getInstance()->init(); $locais = Plib::object_to_array(Locais::getInstance()->getAll()); $locais = Plib::array_to_key_value($locais, 'id', 'titulo'); echo input_select($postId, 'id_local', 'Local:', $locais); } echo "</div>"; echo "<div class=fields>"; echo "<h3>Medidores de Conversão</h3>"; echo input_texto($postId, 'fb_conversion_track', 'Facebook Conversion Track:', 20); echo input_texto($postId, 'tw_conversion_track', 'Twitter Conversion Track:', 20); echo "</div>"; ?> </div> <div id="tabs-inscricao"> <?php // Data Inicio Inscrições echo "<div class=fields>"; echo "<h3>Inscrições</h3>"; echo input_data($postId, 'data_inicio_inscricoes', 'Inicio das Inscrições:'); echo input_data($postId, 'data_fim_inscricoes', 'Fim das Inscrições:'); // Pago ou Gratuito if ($this->templateExibir('pago')) { echo input_select($postId, 'pago', 'Tipo de Inscrição:', array('pago' => 'Paga', 'gratuito' => 'Gratuita'), null, null, 'class=ajustes_visuais'); } else { if ($this->templateValorPadrao('pago') != null) { echo input_hidden($postId, 'pago', $this->templateValorPadrao('pago')); } } if ($this->templateExibir('confirmacao')) { echo input_select($postId, 'confirmacao', 'Confirmação da Inscrição:', array('preinscricao' => 'Pré-inscrição', 'imediata' => 'Imediata', 'pagamento' => 'Após Confirmação do Pagamento', 'posterior' => 'Posteriormente pelo Organizador'), null); } else { if ($this->templateValorPadrao('confirmacao') != null) { echo input_hidden($postId, 'confirmacao', $this->templateValorPadrao('confirmacao')); } } if ($this->templateExibir('validacao_pessoa')) { echo input_select($postId, 'validacao_pessoa', 'Localizar Cadastro do Inscrito:', array('email' => 'Email', 'cpf' => 'CPF'), null, 'email'); } echo "</div>"; // Vagas if ($this->templateExibir('vagas')) { echo "<div class=fields>"; echo "<h3>Vagas</h3>"; echo input_numero($postId, 'vagas', 'Vagas Disponíveis:'); echo input_checkbox($postId, 'fila_espera', 'Fila de Espera'); echo "</div>"; } // Formas de pagamento echo "<div id=formas_pagamento class=fields>"; echo "<h3>Pagamento</h3>"; // Integração PagSeguro if (Integracoes::getInstance()->hasByServico('PagSeguro')) { echo input_checkbox($postId, 'pago_pagseguro', 'PagSeguro'); $integracoes = Plib::object_to_array(Integracoes::getInstance()->getByServico('PagSeguro')); $integracoes = Plib::array_to_key_value($integracoes, 'id', 'titulo'); echo input_select($postId, 'id_integracao_pagseguro', 'Integração PagSeguro:', $integracoes); } // Integração Cielo if (Integracoes::getInstance()->hasByServico('Cielo')) { echo input_checkbox($postId, 'pago_cielo', 'Cielo'); $integracoes = Plib::object_to_array(Integracoes::getInstance()->getByServico('Cielo')); $integracoes = Plib::array_to_key_value($integracoes, 'id', 'titulo'); echo input_select($postId, 'id_integracao_cielo', 'Integração Cielo:', $integracoes); } // Local de pagamento echo input_checkbox($postId, 'pago_dinheiro', 'Dinheiro'); $locais = Plib::object_to_array(Locais::getInstance()->getAll()); $locais = Plib::array_to_key_value($locais, 'id', 'titulo'); echo input_select($postId, 'id_local_pagamento', 'Local pagamenho Dinheiro:', $locais); echo input_checkbox($postId, 'pago_deposito', 'Depósito Bancário'); echo "</div>"; // Beta if ($this->templateExibir('beta')) { echo input_checkbox($postId, 'beta', 'Beta:'); } // Confirmação da Inscrição: //var_dump($this->evento->confirmacao); // $meta = get_post_meta($postId, 'confirmacao', true); // echo "'$meta'<br>"; //die(); ?> </div> <div id="tabs-dados"> <?php // Campo chave de validação da pessoa // Campos Extra if ($this->templateExibir('campos_extras')) { echo "<div class=fields>"; echo "<h3>Campos Extras</h3>"; echo input_textarea($postId, 'campos_extras', 'Campos Extras:', 10, "Utilizar:<br>nome_unico/Titulo do campo<br>Exemplo:<br>empresa/Empresa em que trabalha"); echo "</div>"; } if ($this->templateExibir('avaliacao')) { $questionarios = Plib::object_to_array(Questionarios::getInstance()->getAll()); $questionarios = Plib::array_to_key_value($questionarios, 'id', 'titulo'); echo input_select($postId, 'id_questionario', 'Questionário de Feedback:', $questionarios); } ?> </div> <!-- <div id="tabs-mensagens">--> <!-- --><?php // if ($this->evento){ // // Incluir formulário parcial de mensagens // Mensagens::getInstance()->setEvento($this->evento->id); // require_once PLUGINPATH. '/view/mensagens/partial_mensagens.php'; // } // ?> <!-- </div>--> <?php if ($this->evento->pago == 'pago') { ?> <div id="tabs-treinamento"> <?php echo "<div class=fields>"; echo "<h3>Treinamento</h3>"; // Publico Alvo if ($this->templateExibir('publico_alvo')) { echo input_textarea($postId, 'publico_alvo', 'Público Alvo', 2); } // Material Didático if ($this->templateExibir('material')) { echo input_textarea($postId, 'material', 'Material Didático oferecido:', 2); } // Certificado if ($this->templateExibir('certificado')) { echo input_textarea($postId, 'certificado', 'Certificado:', 1); } // Duração if ($this->templateExibir('duracao')) { echo input_textarea($postId, 'duracao', 'Duração:', 1); } if ($this->templateExibir('horarios')) { echo input_textarea($postId, 'horarios', 'Horários:', 1); } if ($this->templateExibir('requisitos')) { echo input_textarea($postId, 'requisitos', 'Pré-Requisitos:', 1); } // Valor // if ($this->templateExibir('valor')) // echo input_numero($postId, 'valor', 'Valor:'); echo "</div>"; echo "<div class=fields>"; echo "<h3>Conteúdo</h3>"; // Tópicos if ($this->templateExibir('topicos')) { echo input_textarea($postId, 'topicos', 'Tópicos:', 10, "Utilizar um tópico por linha. Identar com 3 espaços.<br>[v] Video, [a] Arquivo"); } // FAQ if ($this->templateExibir('faq')) { echo input_textarea($postId, 'faq', 'Perguntas Frequentes.:', 10, "Utilizar:<br>- Pergunta<Br>Resposta"); } echo "</div>"; ?> </div> <?php } ?> <?php if ($this->templateExibir('secoes_extras')) { ?> <div id="tabs-sessoesextras"> <?php $postId = $post->ID; // Cada secão if ($this->evento) { $secoes = $this->evento->getSecoesExtras(); if ($secoes != null) { foreach ($secoes as $secao => $titulo) { // var_dump($secoes); echo "<label for='secao_{$secao}'><div><p>{$titulo}</p></div></label>"; $value = get_post_meta($postId, 'secao_' . $secao, true); wp_editor($value, 'secao_' . $secao, array('textarea_rows' => get_option('default_post_edit_rows', 10))); } } } // Secões echo input_textarea($postId, 'secoes_extras', 'Secoes Extras:', 7, "Utilizar:<br>nome_unico/Titulo da seção"); ?> </div> <?php } ?> </div> <script> function ajustesVisuais(){ console.log(this); console.log(); if (jQuery("#pago").val() == "pago") { jQuery("#formas_pagamento").css("display","block"); } else { jQuery("#formas_pagamento").css("display","none"); } }; jQuery(function ($) { $(document ).ready(function() { $("#tabs").tabs(); $(".ajustes_visuais").on("change", function () { ajustesVisuais(); }); ajustesVisuais(); }); }); </script> <?php }
function show_form($errors = '') { global $dish_names; // If the form is submitted, get defaults from submitted variables if ($_POST['_submit_check']) { $defaults = $_POST; } else { // Otherwise, no defaults $defaults = array(); } // If errors were passed in, put them in $error_text (with HTML markup) if ($errors) { $error_text = '<tr><td>You need to correct the following errors:'; $error_text .= '</td><td><ul><li>'; $error_text .= implode('</li><li>', $errors); $error_text .= '</li></ul></td></tr>'; } else { // No errors? Then $error_text is blank $error_text = ''; } // Jump out of PHP mode to make displaying all the HTML tags easier ?> <form method="POST" action="<?php print $_SERVER['PHP_SELF']; ?> "> <table> <?php print $error_text; ?> <tr><td>Customer Name:</td> <td><?php input_text('customer_name', $defaults); ?> </td></tr> <tr><td>Phone Number:</td> <td><?php input_text('phone', $defaults); ?> </td></tr> <tr><td>Favorite Dish:</td> <td><?php input_select('favorite_dish_id', $defaults, $dish_names); ?> </td></tr> <tr><td colspan="2" align="center"><?php input_submit('save', 'Add Customer'); ?> </td></tr> </table> <input type="hidden" name="_submit_check" value="1"/> </form> <?php }