Sindbad~EG File Manager
<?php
global $wpdb;
$table_name = $wpdb->prefix . "moz_apps";
$last_app = $wpdb->get_results("SELECT * FROM $table_name ORDER BY time DESC LIMIT 1", ARRAY_A);
?>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close">×</button>
<h4 class="modal-title">Generating now...</h4>
</div>
<div class="modal-body">
<div style="width:100%; text-align:center">
<h1 id="modal_title">Waiting!</h1>
<img id="loading_gif" style="margin:0 auto;" src="<?php echo plugins_url('assets/loading.gif', __FILE__); ?>" width="70" />
<ul id="progress_ul" style="margin-top:20px;">
<li class="progress">Sending data...</li>
</ul>
</div>
</div>
<div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>-->
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-11">
<h3>moZable - Instant Mobile Apps Generator</h3>
</div>
<div class="col-md-1">
<h3>v<?php echo $mozable_version; ?></h3>
</div>
</div>
<div class="row">
<ul class="nav nav-tabs">
<li <?php if (empty($_GET['tab']) || $_GET['tab'] == 'form') : ?>class="active" <?php endif; ?>><a data-toggle="tab" href="#home">App generator</a></li>
<li <?php if (!empty($_GET['tab']) && $_GET['tab'] == 'status') : ?>class="active" <?php endif; ?>><a data-toggle="tab" href="#status">Status</a></li>
<li <?php if (!empty($_GET['tab']) && $_GET['tab'] == 'push') : ?>class="active" <?php endif; ?>><a data-toggle="tab" href="#menu1">Push notifications</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade <?php if (empty($_GET['tab']) || $_GET['tab'] == 'form') : ?>in active<?php endif; ?> container-fluid">
<div class="row">
<div class="col-md-4 configuration_settings">
<form action="#" id="generate_form">
<input type="hidden" name="apps_plugin_version" value="<?php echo $mozable_version; ?>" />
<input type="hidden" name="apps_http_host" value="<?php echo $_SERVER['HTTP_HOST']; ?>" />
<input type="hidden" name="apps_http_user_agent" value="<?php echo $_SERVER['HTTP_USER_AGENT']; ?>" />
<input type="hidden" name="apps_request_uri" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
<input type="hidden" name="apps_server_addr" value="<?php echo $_SERVER['SERVER_ADDR']; ?>" />
<input type="hidden" name="apps_server_software" value="<?php echo $_SERVER['SERVER_SOFTWARE']; ?>" />
<input type="hidden" name="apps_url" id="apps_url" value="<?php echo home_url(); ?>">
<input type="hidden" name="apps_purchase_code" id="purchase_code" value="<?php echo $json["code"]; ?>">
<div class="col-wrap">
<div class="form-group">
<label for="apps_name">App name <span class="description">(required)</span></label>
<input class="form-control" name="apps_name" type="text" id="apps_name" value="<?php if (!empty($last_app)) echo $last_app[0]['name'];
else echo get_bloginfo("name"); ?>" placeholder="My Official App" maxlength="60" />
</div>
<div class="form-group">
<label for="apps_name">Homepage URL:</label>
<br />
<small><?php echo home_url(); ?></small> <input class="" name="apps_append_url" type="text" id="apps_append_url" value="/" />
</div>
<div class="form-group">
<label for="file_icon">
<img src="<?php echo plugins_url('assets/icon.jpg', __FILE__); ?>" id="file_icon_preview" height="100" />
</label>
<input type="file" id="file_icon" style="display:none" />
<label for="file_splashscreen">
<img src="<?php echo plugins_url('assets/splash.jpg', __FILE__); ?>" id="file_splashscreen_preview" height="100" />
</label>
<input type="file" id="file_splashscreen" style="display:none" />
<br />
<small class="form-text text-muted">ICON: 1024x1024px PNG File, no rounded corners, no transparent background.</small> <br />
<small class="form-text text-muted">SPLASH: 2732x2732px PNG file.</small>
<input name="apps_icon" type="hidden" id="file_icon_b64" />
<input name="apps_splashscreen" type="hidden" id="file_splashscreen_b64" />
</div>
<div class="form-group">
</div>
<input type="hidden" name="apps_topbar_color" value="" />
<!--<div class="form-group">
<label for="apps_topbar">Top Bar</label>
<select name="apps_topbar_color" id="topbar_color" class="form-control">
<option value="">No Top Bar</option>
<option value="#d63031" checked="checked">Red</option>
<option value="#00b894">Green</option>
<option value="#0984e3">Blue</option>
<option value="#e84393">Pink</option>
<option value="#fdcb6e">Yellow</option>
<option value="#e17055">Orange</option>
<option value="#000000">Black</option>
</select>
</div>-->
<div class="form-group">
<label for="apps_platform">Platform</label>
<select name="apps_platform" id="apps_platform" class="form-control">
<option value="1">Android</option>
<option value="2" selected="selected">iOS</option>
</select>
</div>
<div class="form-group google_services_file" style="display:none">
<label for="google_services_file">google-services.json (optional to enable push)</label>
<input type="file" id="google_services_file" />
<input name="apps_google_services_file" type="hidden" id="file_google_services_b64" />
<small class="form-text text-muted"><a href="https://www.youtube.com/watch?v=Wp9tELVDgjA&feature=youtu.be" target="_blank">How to get Google-service.json file?</a></small>
</div>
<div class="form-group google_plist_file">
<label for="google_plist_file">GoogleService-info.plist (optional to enable push)</label>
<input type="file" id="google_plist_file" />
<input name="apps_google_plist_file" type="hidden" id="file_google_plist_b64" />
<small class="form-text text-muted"><a href="https://www.youtube.com/watch?v=Wp9tELVDgjA&feature=youtu.be" target="_blank">How to get GoogleService-info.plist file?</a></small>
</div>
<!--<div class="form-group">
<label for="push_notification">Push Notification <span class="description">(optional)</span></label>
<input class="form-control" name="onesignal_app_id" type="text" id="push_notification" value="" placeholder="Paste here your onesignal app id"/>
<small>by <a target="_blank" href="http://onesignal.com">onesignal.com</a></small>
</div>-->
<!--<div class="form-group">
<label for="apps_ionic_version">Version</label>
<select id="apps_ionic_version" class="form-control">
<option value="v1" selected="selected">v1 (stable)</option>
<option value="v2" >v2 (beta)</option>
</select>
<small>See project changelog to understand the differences.</small>
</div>-->
<!-- Advanced fields -->
<div class="form-group">
<label for="apps_version">Cache enable</label><br />
<input type="radio" id="apps_cache_enable" name="apps_cache_enable" value="1" checked="checked"> Yes
<input type="radio" id="apps_cache_enable" name="apps_cache_enable" value="0"> No <br />
<small>Set "yes" only if you have an "admin area" and your users need to save login and password on cookies</small>
</div>
<a href="#" id="advanced_options">Advanced options</a>
<div class="form-group form-advanced" style="display:none">
<label for="apps_version">Version</label>
<input class="form-control" name="apps_version" type="text" id="apps_version" value="<?php if (!empty($last_app)) echo $last_app[0]['version'];
else echo "1.0.0"; ?>" />
<small>Increare version only if you are generating an update of your app.</small>
</div>
<div class="form-group form-advanced" style="display:none">
<label for="packagename">Package Name</label>
<input class="form-control" placeholder="ex. com.yourappname.companyname" name="apps_packagename" type="text" id="packagename" value="<?php if (!empty($last_app)) echo $last_app[0]['packagename'];
else echo "com.mozable.debug.app"; ?>" maxlength="40" />
<small>When you generate a release you must customize your package name. If you generate an app with push notification the package name must be the same in your firebase project.</small>
</div>
<!-- Android fields -->
<div class="form-group form-app-type form-android" style="display:none">
<label for="apps_type">Type</label>
<select name="apps_type" id="apps_type" class="form-control">
<option value="debug">Debug</option>
<option value="release" checked="checked">Release</option>
</select>
</div>
<div class="form-group form-keystore-choose" style="display:none">
<label for="keystore">Keystore</label>
<select id="keystore" class="form-control">
<option value="">Choose...</option>
<option value="new">Create a new keystore</option>
<option value="upload">Upload</option>
</select>
</div>
<!-- Android upload Create New Keystore -->
<div class="form-group form-android form-keystore-new" style="display:none">
<label for="keystore_cn">Create new keystore</label>
<input name="apps_keystore_cn" class="form-control" type="text" id="keystore_cn" value="" placeholder="First and Last name" maxlength="70" />
<input name="apps_keystore_ou" class="form-control" type="text" id="keystore_ou" value="" placeholder="Organizational Unit" maxlength="70" />
<input name="apps_keystore_o" class="form-control" type="text" id="keystore_o" value="" placeholder="Organization name" maxlength="70" />
<input name="apps_keystore_c" class="form-control" type="text" id="keystore_c" value="" placeholder="Country (XX)" maxlength="2" />
<small>All fields are required.</small>
</div>
<!-- Android upload Keystore -->
<div class="form-group form-android form-keystore-upload" style="display:none">
<label for="keystore_file">Keystore file</label>
<input type="file" id="keystore_file" />
<input name="apps_keystore_file" type="hidden" id="file_keystore_b64" />
</div>
<!-- Android upload Keystore Key name -->
<div class="form-group form-android form-keystore-key" style="display:none">
<label for="keystore_key">Keystore key name</label>
<input name="apps_keystore_key" class="form-control" type="text" id="keystore_key" placeholder="Keystore key name" maxlength="60" />
<small>NB: leave blank this if you are creating a new keystore file or if you have uploaded a keystore generated with this plugin.</small>
</div>
<!-- Android upload Keystore Password -->
<div class="form-group form-android form-keystore-password" style="display:none">
<label for="keystore_password">Keystore password</label>
<input name="apps_keystore_password" class="form-control" type="password" id="keystore_password" placeholder="Keystore password" maxlength="60" />
<small>If you are creating new keystore file, choose a password. If you are uploading an existing keystore, insert the correct password of it. </small>
<small>Pay attention: if you wrong key or password, the app will be generated with invalid signature.</small>
</div>
</div>
<button class="btn btn-primary" type="submit" id="submit_form">Generate mobile app</button>
</form>
</div>
<div class="col-md-7 text-center">
<h4 style="text-align:center">Realtime preview</h4>
<?php include($plugin_direcotory . 'realtime_preview.php'); ?>
</div>
</div>
</div>
<div id="status" class="tab-pane fade <?php if (!empty($_GET['tab']) && $_GET['tab'] == 'status') : ?>in active<?php endif; ?>">
<?php include($plugin_direcotory . 'status.php'); ?>
</div>
<div id="menu1" class="tab-pane fade <?php if (!empty($_GET['tab']) && $_GET['tab'] == 'push') : ?>in active<?php endif; ?>">
<?php include($plugin_direcotory . 'push.php'); ?>
</div>
</div>
</div>
</div>
<script>
if (!window.WebSocket) {
alert("Oh no! Your browser doesn't support the websocket. Try with another browser");
}
</script>
<script>
$ = jQuery;
var socket_port = 8559;
var socket_url = "wss://digitalborder.h24hosting.com";
var ajax_url_apps = "<?php echo plugins_url('ajax.php', __FILE__); ?>?type=save_apps";
var admin_url = "<?php echo admin_url() . '?page=moz-plugin'; ?>";
/*$('#apps_ionic_version').change(function() {
if ($(this).val() == "v1") {
socket_port = 8453;
} else {
socket_port = 8559;
}
});*/
$('.close').click(function() {
$('#myModal').modal('toggle');
});
$('#advanced_options').on('click', function() {
$('.form-advanced').toggle();
});
$('body').on('click', '#radio_ios', function() {
$('.form-android').fadeOut();
$('.form-release').fadeOut();
$('.form-keystore-key').fadeOut();
$('.form-keystore-password').fadeOut();
$('.form-keystore-new').fadeOut();
});
$('body').on('click', '#radio_android', function() {
$('.form-android').fadeIn();
});
$('body').on('click', '#radio_debug', function() {
$('.form-release').fadeOut();
$('.form-keystore-key').fadeOut();
$('.form-keystore-password').fadeOut();
$('.form-keystore-new').fadeOut();
});
$('body').on('click', '#radio_release', function() {
$('.form-release').fadeIn();
})
// Clean app name
$('#apps_name').keyup(function() {
appname = $(this).val();
$(this).val(appname.replace(/[^\w\s]/gi, ''));
$('#top_bar_value').html($(this).val());
});
$('#apps_name').trigger('keyup');
$('#apps_platform').change(function() {
if ($(this).val() == 2) {
$('.form-android').fadeOut();
$('.form-keystore-key').fadeOut();
$('.form-keystore-password').fadeOut();
$('.form-keystore-new').fadeOut();
$('.form-keystore-choose').fadeOut();
$('.google_services_file').fadeOut();
$('.google_plist_file').fadeIn();
} else if ($(this).val() == 1) {
$('.form-app-type').fadeIn();
$('.google_plist_file').fadeOut();
$('.google_services_file').fadeIn();
}
});
$('#apps_type').change(function() {
if ($(this).val() == "debug") {
$('.form-release').fadeOut();
$('.form-keystore-key').fadeOut();
$('.form-keystore-password').fadeOut();
$('.form-keystore-new').fadeOut();
$('.form-keystore-upload').fadeOut();
} else if ($(this).val() == "release") {
$('.form-release').fadeIn();
$('.form-keystore-choose').fadeIn();
}
});
$('#keystore').change(function() {
if ($(this).val() == "new") {
$('.form-keystore-upload').hide();
$('.form-keystore-new').fadeIn();
$('.form-keystore-key').fadeIn();
$('.form-keystore-password').fadeIn();
} else if ($(this).val() == "upload") {
$('.form-keystore-new').hide();
$('.form-keystore-upload').fadeIn();
$('.form-keystore-password').fadeIn();
$('.form-keystore-key').fadeIn();
}
});
$('#topbar_color').change(function() {
if ($(this).val() != "") {
$('#topbar_preview').fadeIn();
$('#bar-backgrond').css('background-color', $(this).val())
} else {
$('#topbar_preview').fadeOut();
}
});
$('#packagename').keyup(function() {
$(this).val($(this).val().replace(/[^A-Za-z]+/g, '.'));
})
$('#keystore_cn').keyup(function() {
$(this).val($(this).val().replace(/[^A-Za-z]+/g, '.'));
})
$('#keystore_ou').keyup(function() {
$(this).val($(this).val().replace(/[^A-Za-z]+/g, '.'));
})
$('#keystore_o').keyup(function() {
$(this).val($(this).val().replace(/[^A-Za-z]+/g, '.'));
})
$('#keystore_c').keyup(function() {
$(this).val($(this).val().replace(/[^A-Za-z]+/g, '.'));
})
</script>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists