<?php
/**
 * Controller for handle get optin form data
 *
 * @package wp-video-attention
 * @author InstaProduct
 * @link http://insta-product.com/
 */

if ( ! class_exists( 'IPVisc_Ajax_Getoptin' ))
{
  class IPVisc_Ajax_Getoptin
  {
    /**
     * Execution get optin form process
     *
     * @return void
     */
    public function exec()
    {
      if ( ! empty( $_POST['html'] ))
      {
        $html = str_replace( "'", '"', $_POST['html'] );
        $data = IPVisc_Form::parse( $html );
        echo json_encode( array(
          'status'    => 1,
          'data'      => $data
        ) );
        die();
      }
      echo json_encode( array(
        'status'  => 0
      ) );
      die();
    }
  }
}
