= 0) { $sa = chr($na % 26 + 65) . $sa; $na = floor($na / 26) - 1; } return $sa; } function apc_shortcode( $atts) { $atts = shortcode_atts( array( 'action' => 'list', 'filename' => '' ), $atts, 'apc' ); $filename = $atts['filename']; $action = $atts['action']; global $wpdb; if(!empty($filename) && $action == 'entry'){ if(isset($_POST) && isset($_POST['apc-submit']) && !empty($_POST['apc-submit'])) { include_once('apc-sdk-shortcode-call.php'); } $sql_query = "SELECT head_row FROM ".$wpdb->prefix."apc_shortcodes WHERE `filename` = '".$filename."' "; $sql_result = $wpdb->get_results($sql_query); $html_string = '
'; return $html_string; } else { return "Invalid File."; } } else if($action == 'list' && !empty($filename)) { include_once('apc-sdk-shortcode-listing-call.php'); } else { return 'Invalid File Name.'; } } add_shortcode( 'apc', 'apc_shortcode' );