function es_af_shortcode($atts) { if (!is_array($atts)) { return ''; } //[email-subscribers-advanced-form id="1"] $id = isset($atts['id']) ? $atts['id'] : '0'; if (!is_numeric($id)) { return "Error in your short code."; } $data = array(); $data = es_af_query::es_af_select($id); if (count($data) == 0) { $error_notice = _e('Error in your shortcode. Record does not exists for this ID.', ES_AF_TDOMAIN); return $error_notice; } $arr = array(); $arr["es_af_title"] = $data[0]['es_af_title']; $arr["es_af_desc"] = $data[0]['es_af_desc']; $arr["es_af_name"] = $data[0]['es_af_name']; $arr["es_af_name_mand"] = $data[0]['es_af_name_mand']; $arr["es_af_email"] = $data[0]['es_af_email']; $arr["es_af_email_mand"] = $data[0]['es_af_email_mand']; $arr["es_af_group"] = $data[0]['es_af_group']; $arr["es_af_group_mand"] = $data[0]['es_af_group_mand']; $arr["es_af_group_list"] = $data[0]['es_af_group_list']; return es_af_form_submuit::es_af_formdisplay($arr); }
} ?> <div class="wrap"> <div id="icon-edit" class="icon32 icon32-posts-post"></div> <h2><?php _e(ES_AF_PLUGIN_DISPLAY, ES_AF_TDOMAIN); ?> </h2> <h3><?php _e('Form Details', ES_AF_TDOMAIN); ?> </h3> <div class="tool-box"> <?php $myData = array(); $myData = es_af_query::es_af_select(0); ?> <form name="frm_es_af_display" method="post"> <table width="100%" class="widefat" id="straymanage"> <thead> <tr> <th class="check-column" scope="col" style="padding: 8px 2px;"><input type="checkbox" name="es_af_checkall" id="es_af_checkall" /></th> <th scope="col"><?php _e('Title', ES_AF_TDOMAIN); ?> </th> <th scope="col"><?php _e('Short Code', ES_AF_TDOMAIN); ?> </th> <th scope="col"><?php
$form['es_af_title'] = isset($_POST['es_af_title']) ? $_POST['es_af_title'] : ''; if ($form['es_af_title'] == '') { $es_af_errors[] = __('Enter title for your form.', ES_AF_TDOMAIN); $es_af_error_found = TRUE; } $form['es_af_desc'] = isset($_POST['es_af_desc']) ? $_POST['es_af_desc'] : ''; $form['es_af_name'] = isset($_POST['es_af_name']) ? $_POST['es_af_name'] : ''; $form['es_af_name_mand'] = isset($_POST['es_af_name_mand']) ? $_POST['es_af_name_mand'] : ''; $form['es_af_email'] = isset($_POST['es_af_email']) ? $_POST['es_af_email'] : ''; $form['es_af_email_mand'] = isset($_POST['es_af_email_mand']) ? $_POST['es_af_email_mand'] : ''; $form['es_af_group'] = isset($_POST['es_af_group']) ? $_POST['es_af_group'] : ''; $form['es_af_group_mand'] = isset($_POST['es_af_group_mand']) ? $_POST['es_af_group_mand'] : ''; $form['es_af_group_list'] = isset($_POST['es_af_group_list']) ? $_POST['es_af_group_list'] : ''; // No errors found, we can add this Group to the table if ($es_af_error_found == FALSE) { $action = es_af_query::es_af_act($form, "ups"); if ($action == "sus") { $es_af_success = __('Details was successfully updated.', ES_AF_TDOMAIN); } elseif ($action == "err") { $es_af_success = __('Oops, unexpected error occurred.', ES_AF_TDOMAIN); $es_af_error_found = TRUE; } } } if ($es_af_error_found == TRUE && isset($es_af_errors[0]) == TRUE) { ?> <div class="error fade"><p><strong><?php echo $es_af_errors[0]; ?> </strong></p></div><?php }