| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- require_once APP_PATH_ROOT . DS . 'superedit-USERS2_WINDYKACJA_STATUS.php';
- function WINDYKACJA_ZESTAWIENIE_NADPLATY_VECTRA() {
- $db = DB::getDB();
- if (!$db) {
- echo '<div class="alert alert-danger">' . "Database Error" . '</div>';
- return;
- }
- $task = V::get('task', '', $_REQUEST);
- if ('zest_month' == $task) {
- $args = array();
- $args['zest_month'] = V::get('zest_month', '', $_REQUEST);
- $zest_month_arr = explode('-', $args['zest_month']);
- if (count($zest_month_arr) != 2) {
- die('Error: date format');
- }
- $args['year'] = intval(array_shift($zest_month_arr));
- $args['month'] = intval(array_shift($zest_month_arr));
- if (intval($args['year']) < 2014) {
- die('Error: year');
- }
- if (intval($args['month']) < 1 || intval($args['month']) > 12) {
- die('Error: month');
- }
- $args['DATE_LIMIT'] = sprintf("%4d-%02d-01", $args['year'], $args['month']);
- $_GET['DATE_LIMIT'] = $args['DATE_LIMIT'];
- WindykacjaView::zestawienie_vectra_nadplaty();
- die();
- }
- ?>
- <div class="jumbotron">
- <div class="container">
- <form class="form-inline" method="POST">
- <input type="hidden" name="HEADER_NOT_INIT" value="YES" />
- <input type="hidden" name="task" value="zest_month" />
- <label for="zest_month">Zestawienie nadpłat klientów Vectra na miesiąc:</label>
- <div class="input-group date" id="fldZestMonth">
- <input type="text" name="zest_month" class="form-control" value="" />
- <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
- </div>
- <button type="submit" id="fldZestMonthBtn" class="btn btn-primary" autocomplete="off">
- Generuj zestawienie
- </button>
- </form>
- </div>
- </div>
- <script type="text/javascript">
- jQuery(document).ready(function () {
- jQuery('#fldZestMonthBtn').on('click', function () {
- jQuery(this).text(jQuery(this).text() + '...').attr('disabled', 'disabled');
- jQuery(this).parent().submit();
- })
- jQuery("#fldZestMonth").datetimepicker({
- format: "YYYY-MM",
- defaultDate: new Date(<?php echo date("Y"); ?>, <?php echo intval(date("m")) - 1; ?>, 1),
- minDate: new Date(2014, 11, 1),
- // maxDate: "<?php echo date("Y"); ?>"
- });
- });
- </script>
- <?php
- }
|