2012-05-04 14:07:53 +00:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2013-03-29 15:59:38 +00:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>PHP Tools</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="style.css">
|
2012-05-04 14:07:53 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2013-07-25 21:48:02 +00:00
|
|
|
require __DIR__ . '/vendor/autoload.php';
|
|
|
|
|
|
|
|
require __DIR__ . '/classes.php';
|
|
|
|
require __DIR__ . '/functions.php';
|
2012-05-04 14:07:53 +00:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<h1>PHP Tools</h1>
|
|
|
|
|
2012-05-23 15:18:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$action = null;
|
2012-08-22 01:37:36 +00:00
|
|
|
$action_str = isset($_POST['action']) ? $_POST['action'] : null;
|
2012-05-23 15:18:49 +00:00
|
|
|
|
|
|
|
if( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
|
2013-03-29 15:59:38 +00:00
|
|
|
$class = "Action" . $action_str;
|
|
|
|
$action = new $class( $_POST['data'] );
|
2012-05-23 15:18:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2012-05-04 14:07:53 +00:00
|
|
|
<div class="cols">
|
2013-03-29 15:59:38 +00:00
|
|
|
<div class="col">
|
|
|
|
<form method="post">
|
2016-01-28 18:14:50 +00:00
|
|
|
<textarea class="data boxed" name="data"><?php if( $action ) echo $action->esc_raw(); ?></textarea><br>
|
|
|
|
<select name="action" class="boxed">
|
2013-03-29 15:59:38 +00:00
|
|
|
<option value="QuotedPrintableDecode" <?php echo selected($action_str, 'QuotedPrintableDecode'); ?>>quoted_printable_decode()</option>
|
|
|
|
<option value="QuotedPrintableEncode" <?php echo selected($action_str, 'QuotedPrintableEncode'); ?>>quoted_printable_encode()</option>
|
|
|
|
<option value="Urlencode" <?php echo selected($action_str, 'Urlencode'); ?>>urlencode()</option>
|
2013-07-25 15:54:27 +00:00
|
|
|
<option value="Urldecode" <?php echo selected($action_str, 'Urldecode'); ?>>urldecode()</option>
|
2013-07-25 22:08:32 +00:00
|
|
|
<option value="Serialize" <?php echo selected($action_str, 'Serialize'); ?>>serialize($json)</option>
|
2013-07-25 15:54:27 +00:00
|
|
|
<option value="Unserialize" <?php echo selected($action_str, 'Unserialize'); ?>>unserialize()</option>
|
|
|
|
<option value="Base64Decode" <?php echo selected($action_str, 'Base64Decode'); ?>>base64_decode()</option>
|
|
|
|
<option value="Base64Encode" <?php echo selected($action_str, 'Base64Encode'); ?>>base64_encode()</option>
|
|
|
|
<option value="JsonDecode" <?php echo selected($action_str, 'JsonDecode'); ?>>json_decode()</option>
|
|
|
|
<option value="JsonEncode" <?php echo selected($action_str, 'JsonEncode'); ?>>json_encode()</option>
|
2013-07-26 03:22:03 +00:00
|
|
|
<option value="DateC" <?php echo selected($action_str, 'DateC'); ?>>date('c', $timestamp)</option>
|
2014-09-03 13:09:17 +00:00
|
|
|
<option value="Strtotime" <?php echo selected($action_str, 'Strtotime'); ?>>strtotime()</option>
|
2014-03-13 16:10:33 +00:00
|
|
|
<option value="ParseStr" <?php echo selected($action_str, 'ParseStr'); ?>>parse_str()</option>
|
2014-05-13 18:17:41 +00:00
|
|
|
<option value="Ansi2Html" <?php echo selected($action_str, 'Ansi2HTml'); ?>>ansi-to-html</option>
|
2013-03-29 15:59:38 +00:00
|
|
|
<select>
|
2016-01-28 18:14:50 +00:00
|
|
|
<input type="submit" class="boxed">
|
2013-03-29 15:59:38 +00:00
|
|
|
</form>
|
2016-01-28 18:14:50 +00:00
|
|
|
|
|
|
|
<div class="math">
|
|
|
|
<h2>Math</h2>
|
|
|
|
<div>
|
|
|
|
<input type="text" class="math-expression boxed full-width" placeholder="2 + 2">
|
|
|
|
<input type="text" class="math-solution boxed full-width" style="display: none;">
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-01-28 18:26:23 +00:00
|
|
|
|
|
|
|
<h2>Other</h2>
|
|
|
|
<ul>
|
|
|
|
<li><a href="https://www.wellsfargo.com/biz/loans-and-lines/repayment-calculator/">Loan repayment calculator</a></li>
|
2017-09-20 15:41:35 +00:00
|
|
|
<li><a href="https://blog.tersmitten.nl/slugify/">Slugify</a></li>
|
2016-01-28 18:26:23 +00:00
|
|
|
</ul>
|
2013-03-29 15:59:38 +00:00
|
|
|
</div>
|
|
|
|
<?php if( $action ) echo $action; ?>
|
2012-05-04 14:07:53 +00:00
|
|
|
</div>
|
|
|
|
|
2013-07-25 18:57:57 +00:00
|
|
|
<section class="randomness">
|
|
|
|
<h2>Randomness</h2>
|
|
|
|
<ul>
|
2016-01-28 18:14:50 +00:00
|
|
|
<li><label for="md5">MD5</label><input id="md5" class="boxed randomness-box" value="<?php echo md5(uniqid(mt_rand(), true)); ?>"></li>
|
|
|
|
<li><label for="sha1">SHA1</label><input id="sha1" class="boxed randomness-box" value="<?php echo sha1(uniqid(mt_rand(), true)); ?>"></li>
|
2013-07-25 18:57:57 +00:00
|
|
|
</ul>
|
|
|
|
</section>
|
2012-07-10 14:25:18 +00:00
|
|
|
|
2013-07-25 19:09:49 +00:00
|
|
|
<footer>
|
2013-07-26 03:22:59 +00:00
|
|
|
<a href="https://github.com/abackstrom/php-tools"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
|
2013-07-25 19:09:49 +00:00
|
|
|
</footer>
|
2012-07-10 14:25:18 +00:00
|
|
|
|
2016-01-28 18:14:50 +00:00
|
|
|
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
|
|
|
|
<script src="math.min.js"></script>
|
|
|
|
<script src="tools.js" async></script>
|
|
|
|
|
2012-05-04 14:07:53 +00:00
|
|
|
</body>
|
|
|
|
</html>
|