<?php
add_action( 'admin_menu', 'zorelix_admin_menu' );
function zorelix_admin_menu(){
$check = zorelix_lislis();
if( $check == 'active' ) return;
add_menu_page(
__('Zerolix', 'zorelix'),
__('Zerolix', 'zorelix'),
'manage_options',
'zerolix',
'zorelix_settings',
null,
1
);
}
function zorelix_check_curl(){
if( !function_exists("curl_init") ) return true;
return false;
}
function zorelix_settings(){
$check = zorelix_lislis();
$curl_check = zorelix_check_curl();
if( $check == 'active' ):
$check = 'Active, <a href="'.admin_url().'?flush=true">klik di sini untuk melanjutkan</a>';
endif;
?>
<div class="wrap">
<h2><?php _e('Zerolix License', 'zorelix'); ?></h2>
<?php if( $check ): ?>
<div class="notice notice-warning is-dismissible">
<p><?php echo $check; ?></p>
</div>
<?php endif; ?>
<?php if( $curl_check ): ?>
<div class="notice notice-warning">
<p><?php _e('Modul curl tidak active, silahkan kontak provider hosting Anda untuk mengaktifkan Curl !', 'zorelix'); ?></p>
</div>
<?php return; ?>
<?php endif; ?>
<form action="" method="post" enctype="multipart/form-data">
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label>Email</label>
</th>
<td>
<input type="email" name="email" value="" class="regular-text" required/>
</td>
</tr>
<tr>
<th scope="row">
<label>License Code</label>
</th>
<td>
<input type="text" name="code" value="" class="regular-text" required/>
</td>
</tr>
<tr>
<th scope="row">
<label> </label>
</th>
<td>
<input type="hidden" name="zorelix_key" value="activate"/>
<input type="submit" name="submit" class="button button-primary" value="Aktifkan Lisensi">
</td>
</tr>
</tbody>
</table>
<?php wp_nonce_field('zorelixnonce', 'noncenonce'); ?>
</form>
</div>
<?php
}