Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $data = $_POST;
- class MyDB extends SQLite3 {
- function __construct() {
- $this->open('/var/www/precedentinfo.kg/public_html/forcategory/precedent.db');
- }
- }
- $db = new MyDB();
- if(isset($data['category_submit'])) {
- $email = $data['category_email'];
- $arr = array_keys($data);
- $st = "";
- foreach ($arr as $key) {
- $st .=$key.',';
- }
- $category = substr($st, 15, -17);
- $rows = $db->query("SELECT COUNT(*) as count FROM applicants where applicant_email='$email'");
- $row = $rows->fetchArray();
- $numRows = $row['count'];
- if($email != '' && $numRows==0){
- $ret = $db->query("insert into applicants (applicant_email, applicant_category) values ('$email', '$category')");
- header("Location: http://precedentinfo.kg/");
- }
- else {
- $current = $db->query("select * from applicants where applicant_email = '$email'");
- $current = $current->fetchArray();
- $applicant_category = $current['applicant_category'];
- $category_arr = explode(",", $applicant_category);
- $new_category_arr = explode(",", $category);
- foreach($new_category_arr as $new) {
- if(!(in_array($new, $category_arr))) $applicant_category .= ','.$new;
- }
- $db->query("update applicants set applicant_category = '$applicant_category' where applicant_email = '$email'");
- header("Location: http://precedentinfo.kg/");
- }
- }
- ?>
- <?php
- /**
- * The Header for our theme.
- *
- * @package Betheme
- * @author Muffin group
- * @link http://muffingroup.com
- */
- ?>
- <!DOCTYPE html>
- <?php
- if( $_GET && key_exists('mfn-rtl', $_GET) ):
- echo '<html class="no-js" lang="ar" dir="rtl">';
- else:
- ?>
- <html class="no-js<?php echo mfn_user_os(); ?>" <?php language_attributes(); ?>
- <?php mfn_tag_schema(); ?>>
- <?php endif; ?>
- <!-- head -->
- <head>
- <!-- meta -->
- <meta charset="<?php bloginfo( 'charset' ); ?>" />
- <?php
- if( mfn_opts_get('responsive') ){
- if( mfn_opts_get('responsive-zoom') ){
- echo '<meta name="viewport" content="width=device-width, initial-scale=1" />';
- } else {
- echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />';
- }
- }
- ?>
- <?php do_action('wp_seo'); ?>
- <link rel="shortcut icon" href="<?php mfn_opts_show( 'favicon-img', THEME_URI .'/images/favicon.ico' ); ?>" />
- <?php if( mfn_opts_get('apple-touch-icon') ): ?>
- <link rel="apple-touch-icon" href="<?php mfn_opts_show( 'apple-touch-icon' ); ?>" />
- <?php endif; ?>
- <!-- wp_head() -->
- <?php wp_head(); ?>
- </head>
- <!-- body -->
- <body <?php body_class(); ?>>
- <div class="remodal" data-remodal-id="modal_calendar" role="dialog" aria-labelledby="<?php echo __('Posts by date', 'precedent'); ?>" aria-describedby="<?php echo __('Posts by date', 'precedent'); ?>">
- <button data-remodal-action="close" class="remodal-close" aria-label="<?php echo __('Close', 'precedent'); ?>"></button>
- <div class="remodal-content">
- <?php dynamic_sidebar( 'sidecalendar' ); ?>
- </div>
- </div>
- <div class="remodal" data-remodal-id="modal_subscribe" role="dialog" aria-labelledby="<?php echo __('Subscribe for daily newsletter', 'precedent'); ?>" aria-describedby="<?php echo __('Subscribe for daily newsletter', 'precedent'); ?>">
- <button data-remodal-action="close" class="remodal-close" aria-label="<?php echo __('Close', 'precedent'); ?>"></button>
- <div class="remodal-content">
- <div class="subscribe-content" style="max-width: 1200px;display: flex;justify-content: space-around;flex-wrap:wrap;">
- <div style="display: inline-block; margin-bottom: 50px;">
- <?php dynamic_sidebar( 'subscribe' ); ?>
- </div>
- <div style="float: left;">
- <aside class="widget widget_mailster_signup" style="max-width: 380px;">
- <h3>
- Подписаться на рассылку законопроектов
- </h3>
- <div class="mailster-widget mailster-widget-signup">
- <div class="mailster-form-fields" style="display: flex;">
- <div class="mailster-wrapper mailster-email-wrapper">
- <form method="POST">
- <input type="text" placeholder="Enter email" name="category_email" required>
- <div style="height: 150px;display:block;float: left;overflow-y: scroll">
- <table>
- <tbody>
- <?php
- $ret = $db->query("select * from categories");
- while($row = $ret->fetchArray(SQLITE3_ASSOC) ) {
- echo "<tr>";
- echo "<td><input type='checkbox' name='".$row['category_id']."'></td>";
- echo "<td>".$row['category_name']."</td>";
- echo "</tr>";
- }
- ?>
- </tbody>
- </table>
- </div>
- <div class="mailster-wrapper mailster-submit-wrapper form-submit">
- <input name="category_submit" type="submit" value="подписаться" class="submit-button button" style="margin-top: 20px;" aria-label="подписаться">
- </div>
- </form></div>
- </div>
- </div>
- </div>
- </aside>
- </div>
- </div>
- </div>
- </div>
- <?php if ( !is_user_logged_in() ):?>
- <div class="remodal" data-remodal-id="modal_login_register" role="dialog" aria-labelledby="<?php echo __('Login/Register', 'precedent'); ?>" aria-describedby="<?php echo __('Login/Register', 'precedent'); ?>">
- <button data-remodal-action="close" class="remodal-close" aria-label="<?php echo __('Close', 'precedent'); ?>"></button>
- <div class="remodal-content">
- <div class="login-reg">
- <?php dynamic_sidebar( 'login-or-register' );?>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <div class="remodal" data-remodal-id="modal_contacts" role="dialog" aria-labelledby="<?php echo __('Contacts', 'precedent'); ?>" aria-describedby="<?php echo __('Contacts', 'precedent'); ?>">
- <button data-remodal-action="close" class="remodal-close" aria-label="<?php echo __('Close', 'precedent'); ?>"></button>
- <div class="remodal-content">
- <div class="contacts">
- <?php
- echo do_shortcode('[page-content-sc id="194"]')
- ?>
- </div>
- </div>
- </div>
- <?php do_action( 'mfn_hook_top' ); ?>
- <?php get_template_part( 'includes/header', 'sliding-area' ); ?>
- <?php if( mfn_header_style( true ) == 'header-creative' ) get_template_part( 'includes/header', 'creative' ); ?>
- <!-- #Wrapper -->
- <div id="Wrapper">
- <?php
- // Featured Image | Parallax ----------
- $header_style = '';
- if( mfn_opts_get( 'img-subheader-attachment' ) == 'parallax' ){
- if( mfn_opts_get( 'parallax' ) == 'stellar' ){
- $header_style = ' class="bg-parallax" data-stellar-background-ratio="0.5"';
- } else {
- $header_style = ' class="bg-parallax" data-enllax-ratio="0.3"';
- }
- }
- ?>
- <?php if( mfn_header_style( true ) == 'header-below' ) echo mfn_slider(); ?>
- <!-- #Header_bg -->
- <div id="Header_wrapper" <?php echo $header_style; ?>>
- <!-- #Header -->
- <header id="Header">
- <?php if( mfn_header_style( true ) != 'header-creative' ) get_template_part( 'includes/header', 'top-area' ); ?>
- <?php if( mfn_header_style( true ) != 'header-below' ) echo mfn_slider(); ?>
- </header>
- <?php
- if( ( mfn_opts_get('subheader') != 'all' ) &&
- ( ! get_post_meta( mfn_ID(), 'mfn-post-hide-title', true ) ) &&
- ( get_post_meta( mfn_ID(), 'mfn-post-template', true ) != 'intro' ) ){
- $subheader_advanced = mfn_opts_get( 'subheader-advanced' );
- $subheader_style = '';
- if( mfn_opts_get( 'subheader-padding' ) ){
- $subheader_style .= 'padding:'. mfn_opts_get( 'subheader-padding' ) .';';
- }
- if( is_search() ){
- // Page title -------------------------
- echo '<div id="Subheader" class="search-subheader" style="'. $subheader_style .'">';
- echo '<div class="container">';
- echo '<div class="column one-second">';
- if( trim( $_GET['s'] ) ){
- global $wp_query;
- $total_results = $wp_query->found_posts;
- } else {
- $total_results = 0;
- }
- $translate['search-results'] = mfn_opts_get('translate') ? mfn_opts_get('translate-search-results','results found for:') : __('results found for:','betheme');
- $translate[ 'search-placeholder' ] = mfn_opts_get( 'translate' ) ? mfn_opts_get( 'translate-search-placeholder', 'Enter your search' ) : __( 'Enter your search', 'betheme' );
- echo '<form method="get" id="#search_head" action="'. esc_url( home_url( '/' ) ) .'">';
- echo '<button type="submit" class="search-button icon-search-fine"></button>';
- echo '<input type="text" class="field" name="s" id="s" placeholder="'. $translate['search-placeholder'] .'" value="'.esc_html( $_GET['s']) .'" />';
- echo '<input type="submit" class="submit" value="" style="display:none;" />';
- echo '</form>';
- echo '<div class="clearfix"></div>';
- echo __('Total found', 'precedent'). ' ' . $total_results .' '. _n('material', 'material(s)', $total_results ,'precedent');
- echo '</div>';
- echo '</div>';
- echo '</div>';
- } elseif( ! mfn_slider_isset() || ( is_array( $subheader_advanced ) && isset( $subheader_advanced['slider-show'] ) ) ){
- // Page title -------------------------
- // Subheader | Options
- $subheader_options = mfn_opts_get( 'subheader' );
- if( is_home() && ! get_option( 'page_for_posts' ) && ! mfn_opts_get( 'blog-page' ) ){
- $subheader_show = false;
- } elseif( is_array( $subheader_options ) && isset( $subheader_options[ 'hide-subheader' ] ) ){
- $subheader_show = false;
- } elseif( get_post_meta( mfn_ID(), 'mfn-post-hide-title', true ) ){
- $subheader_show = false;
- } else {
- $subheader_show = true;
- }
- // title
- if( is_array( $subheader_options ) && isset( $subheader_options[ 'hide-title' ] ) ){
- $title_show = false;
- } else {
- $title_show = true;
- }
- // breadcrumbs
- if( is_array( $subheader_options ) && isset( $subheader_options[ 'hide-breadcrumbs' ] ) ){
- $breadcrumbs_show = false;
- } else {
- $breadcrumbs_show = true;
- }
- if( is_array( $subheader_advanced ) && isset( $subheader_advanced[ 'breadcrumbs-link' ] ) ){
- $breadcrumbs_link = 'has-link';
- } else {
- $breadcrumbs_link = 'no-link';
- }
- // Subheader | Print
- if( $subheader_show ){
- echo '<div id="Subheader" style="'. $subheader_style .'">';
- echo '<div class="container">';
- echo '<div class="column one">';
- // Title
- if( $title_show ){
- $title_tag = mfn_opts_get( 'subheader-title-tag', 'h1' );
- echo '<'. $title_tag .' class="title">'. mfn_page_title() .'</'. $title_tag .'>';
- }
- // Breadcrumbs
- if( $breadcrumbs_show ){
- mfn_breadcrumbs( $breadcrumbs_link );
- }
- echo '</div>';
- echo '</div>';
- echo '</div>';
- }
- }
- }
- ?>
- </div>
- <?php
- // Single Post | Template: Intro
- if( get_post_meta( mfn_ID(), 'mfn-post-template', true ) == 'intro' ){
- get_template_part( 'includes/header', 'single-intro' );
- }
- ?>
- <?php do_action( 'mfn_hook_content_before' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement