<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="row">
        <!--<div class="col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3">
          <br /><br /><br />
          <div class="jumbotron">
            <table class="table" style="font-size: 24px;">
              <thead>
                <tr>
                  <td colspan="2"><strong>ŞEYMA X DEERCASE</strong></td>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>Toplam Satış (KDV Dahil)</td>
                  <td><label class="label label-default"><?php echo number_format ($total_seyma, 2); ?>₺</label></td>
                </tr>
                <tr>
                  <td>Toplam Sipariş</td>
                  <td><label class="label label-default"><?php echo $total_orders; ?></label></td>
                </tr>
                <tr>
                  <td>Kazanç (%30)</td>
                  <td><label class="label label-success"><?php echo number_format ($percent_thirty, 2); ?>₺</label></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>-->
        <div class="col-xs-12 col-sm-3">
          <br /><br /><br />
          <div class="jumbotron">
            <table class="table" style="font-size: 24px;">
              <thead>
                <tr>
                  <td colspan="2"><strong>ŞEYMA X DEERCASE(17-31 OCAK)</strong></td>
                </tr>
              </thead>
              <tbody>
              	<tr>
                  <td>Satış (KDV Hariç)</td>
                  <td><label class="label label-default">23.293,20₺</label></td>
                </tr>
              	<tr>
                  <td>Satış (KDV Dahil)</td>
                  <td><label class="label label-default">27.485,98₺</label></td>
                </tr>
              	<tr>
                  <td>Kazanç %30 (KDV Hariç)</td>
                  <td><label class="label label-success">6.987,96₺</label></td>
                </tr>
                <tr>
                  <td>Kazanç %30 (KDV Dahil)</td>
                  <td><label class="label label-default">8.245,79₺</label></td>
                </tr>
                <tr>
                  <td>Ödeme Tarihi:</td>
                  <td><label class="label label-default">01.01.0001</label></td>
                </tr>
                <tr>
                  <td>Ödeme Durumu:</td>
                  <td><label class="label label-success">Ödendi</label></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <div class="col-xs-12 col-sm-3">
          <br /><br /><br />
          <div class="jumbotron">
            <table class="table" style="font-size: 24px;">
              <thead>
                <tr>
                  <td colspan="2"><strong>ŞEYMA X DEERCASE(ŞUBAT)</strong></td>
                </tr>
              </thead>
              <tbody>
              	<tr>
                  <td>Satış (KDV Hariç)</td>
                  <td><label class="label label-default">28.279,64₺</label></td>
                </tr>
              	<tr>
                  <td>Satış (KDV Dahil)</td>
                  <td><label class="label label-default">33.369,98₺</label></td>
                </tr>
              	<tr>
                  <td>Kazanç %30 (KDV Hariç)</td>
                  <td><label class="label label-success">8.483,89₺</label></td>
                </tr>
                <tr>
                  <td>Kazanç %30 (KDV Dahil)</td>
                  <td><label class="label label-default">10.010,99₺</label></td>
                </tr>
                <tr>
                  <td>Ödeme Tarihi:</td>
                  <td><label class="label label-default">01.01.0001</label></td>
                </tr>
                <tr>
                  <td>Ödeme Durumu:</td>
                 <td><label class="label label-success">Ödendi</label></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <div class="col-xs-12 col-sm-3">
          <br /><br /><br />
          <div class="jumbotron">
            <table class="table" style="font-size: 24px;">
              <thead>
                <tr>
                  <td colspan="2"><strong>ŞEYMA X DEERCASE(MART)</strong></td>
                </tr>
              </thead>
              <tbody>
              	<tr>
                  <td>Satış (KDV Hariç)</td>
                  <td><label class="label label-default">38.461,93₺</label></td>
                </tr>
              	<tr>
                  <td>Satış (KDV Dahil)</td>
                  <td><label class="label label-default">45.385,08₺</label></td>
                </tr>
              	<tr>
                  <td>Kazanç %30 (KDV Hariç)</td>
                  <td><label class="label label-success">11.538,58₺</label></td>
                </tr>
                <tr>
                  <td>Kazanç %30 (KDV Dahil)</td>
                  <td><label class="label label-default">13.615,52₺</label></td>
                </tr>
                <tr>
                  <td>Ödeme Tarihi:</td>
                  <td><label class="label label-default">01.01.0001</label></td>
                </tr>
                <tr>
                  <td>Ödeme Durumu:</td>
                  <td><label class="label label-success">Ödendi</label></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <div class="col-xs-12 col-sm-3">
          <br /><br /><br />
          <div class="jumbotron">
            <table class="table" style="font-size: 24px;">
              <thead>
                <tr>
                  <td colspan="2"><strong>ŞEYMA X DEERCASE(1-17 NİSAN)</strong></td>
                </tr>
              </thead>
              <tbody>
              	<tr>
                  <td>Satış (KDV Hariç)</td>
                  <td><label class="label label-default">29.762,69₺</label></td>
                </tr>
              	<tr>
                  <td>Satış (KDV Dahil)</td>
                  <td><label class="label label-default">35.119,97₺</label></td>
                </tr>
              	<tr>
                  <td>Kazanç %30 (KDV Hariç)</td>
                  <td><label class="label label-success">8.928,81₺</label></td>
                </tr>
                <tr>
                  <td>Kazanç %30 (KDV Dahil)</td>
                  <td><label class="label label-default">10.535,99₺</label></td>
                </tr>
                <tr>
                  <td>Ödeme Tarihi:</td>
                  <td><label class="label label-default">01.01.0001</label></td>
                </tr>
                <tr>
                  <td>Ödeme Durumu:</td>
                  <td><label class="label label-danger">Ödenmedi</label></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
        <div class="col-xs-12 col-sm-12">
          <br /><br /><br />
          <div class="jumbotron">
            <table class="table" style="font-size: 24px;">
              <thead>
                <tr>
                  <td colspan="2"><strong>ŞEYMA X DEERCASE(TOPLAM)</strong></td>
                </tr>
              </thead>
              <tbody>
              	<tr>
                  <td>Satış (KDV Hariç)</td>
                  <td><label class="label label-default">119.797,43₺</label></td>
                </tr>
              	<tr>
                  <td>Satış (KDV Dahil)</td>
                  <td><label class="label label-default">141.360,97₺</label></td>
                </tr>
              	<tr>
                  <td>Kazanç %30 (KDV Hariç)</td>
                  <td><label class="label label-success">35.939,23₺</label></td>
                </tr>
                <tr>
                  <td>Kazanç %30 (KDV Dahil)</td>
                  <td><label class="label label-default">42.408,29₺</label></td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
      <!--<div class="pull-right">
        <button type="submit" id="button-shipping" form="form-order" formaction="<?php echo $shipping; ?>" formtarget="_blank" data-toggle="tooltip" title="<?php echo $button_shipping_print; ?>" class="btn btn-info"><i class="fa fa-truck"></i></button>
        <button type="submit" id="button-invoice" form="form-order" formaction="<?php echo $invoice; ?>" formtarget="_blank" data-toggle="tooltip" title="<?php echo $button_invoice_print; ?>" class="btn btn-info"><i class="fa fa-print"></i></button>
        <button type="button" id="button-delete" form="form-order" formaction="<?php echo $delete; ?>" data-toggle="tooltip" title="<?php echo $button_delete; ?>" class="btn btn-danger"><i class="fa fa-trash-o"></i></button>
      </div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if ($error_warning) { ?>
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <?php if ($success) { ?>
    <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-list"></i> <?php echo $text_list; ?></h3>
        <span class="pull-right">
          Bu sayfada ki siparişlerin toplamı: <b><?= $total_price; ?></b>
        </span>
      </div>
      <div class="panel-body">
      <a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
        Arama Filtresini Göster / Gizle
      </a>
        <div class="well collapse" id="collapseExample">
          <div class="row">
            <div class="col-sm-4">
              <div class="form-group">
                <label class="control-label" for="input-order-id"><?php echo $entry_order_id; ?></label>
                <input type="text" name="filter_order_id" value="<?php echo $filter_order_id; ?>" placeholder="<?php echo $entry_order_id; ?>" id="input-order-id" class="form-control" />
              </div>

              <div class="form-group">
                <label class="control-label" for="input-email">Mail</label>
                <input type="text" name="filter_email" value="<?php echo $filter_email; ?>" placeholder="Mail" id="input-email" class="form-control" />
              </div>

              <div class="form-group">
                <label class="control-label" for="input-filter_telephone">Telefon</label>
                <input type="text" name="filter_telephone" value="<?php echo $filter_telephone; ?>" placeholder="Telefon" id="input-filter_telephone" class="form-control" />
              </div>

              <div class="form-group">
                <label class="control-label" for="input-customer"><?php echo $entry_customer; ?></label>
                <input type="text" name="filter_customer" value="<?php echo $filter_customer; ?>" placeholder="<?php echo $entry_customer; ?>" id="input-customer" class="form-control" />
              </div>
            </div>

            <div class="col-sm-4">
              <div class="form-group">
                <label class="control-label" for="input-order-status"><?php echo $entry_order_status; ?></label>
                <select name="filter_order_status" id="input-order-status" class="form-control">
                  <option value="*"></option>
                  <?php if ($filter_order_status == '0') { ?>
                  <option value="0" selected="selected"><?php echo $text_missing; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_missing; ?></option>
                  <?php } ?>
                  <?php foreach ($order_statuses as $order_status) { ?>
                  <?php if ($order_status['order_status_id'] == $filter_order_status) { ?>
                  <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
                  <?php } else { ?>
                  <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
                  <?php } ?>
                  <?php } ?>
                </select>
              </div>

              <div class="form-group">
                <label class="control-label" for="input-order-zone">Şehir</label>
                <select name="filter_order_zone" id="input-order-zone" class="form-control">
                  <option value="*"></option>
                  <?php foreach ($zones as $zone) { ?>
                  <?php if ($zone['zone_id'] == $filter_order_zone) { ?>
                  <option value="<?php echo $zone['zone_id']; ?>" selected="selected"><?php echo $zone['name']; ?></option>
                  <?php } else { ?>
                  <option value="<?php echo $zone['zone_id']; ?>"><?php echo $zone['name']; ?></option>
                  <?php } ?>
                  <?php } ?>
                </select>
              </div>

              <div class="form-group">
                <label class="control-label" for="input-order-payment">Ödeme Yöntemi</label>
                <select name="filter_order_payment" id="input-order-payment" class="form-control">
                  <option value="*"></option>
                  <?php foreach ($paymnet_methods as $paymnet_method) { ?>
                  <?php if ($paymnet_method['payment_code'] == $filter_order_payment) { ?>
                  <option value="<?php echo $paymnet_method['payment_code']; ?>" selected="selected"><?php echo $paymnet_method['payment_method']; ?></option>
                  <?php } else { ?>
                  <option value="<?php echo $paymnet_method['payment_code']; ?>"><?php echo $paymnet_method['payment_method']; ?></option>
                  <?php } ?>
                  <?php } ?>
                </select>
              </div>

              <div class="form-group">
                <label class="control-label" for="input-total"><?php echo $entry_total; ?></label>
                <input type="text" name="filter_total" value="<?php echo $filter_total; ?>" placeholder="<?php echo $entry_total; ?>" id="input-total" class="form-control" />
              </div>
            </div>
            <div class="col-sm-4">
              <div class="form-group">
                <label class="control-label" for="input-date-added"><?php echo $entry_date_added; ?></label>
                <div class="input-group date">
                  <input type="text" name="filter_date_added" value="<?php echo $filter_date_added; ?>" placeholder="<?php echo $entry_date_added; ?>" data-date-format="YYYY-MM-DD" id="input-date-added" class="form-control" />
                  <span class="input-group-btn">
                  <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                  </span></div>
              </div>
              <div class="form-group">
                <label class="control-label" for="input-date-modified"><?php echo $entry_date_modified; ?></label>
                <div class="input-group date">
                  <input type="text" name="filter_date_modified" value="<?php echo $filter_date_modified; ?>" placeholder="<?php echo $entry_date_modified; ?>" data-date-format="YYYY-MM-DD" id="input-date-modified" class="form-control" />
                  <span class="input-group-btn">
                  <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                  </span></div>
              </div>
              <button type="button" id="button-filter" class="btn btn-primary pull-right"><i class="fa fa-filter"></i> <?php echo $button_filter; ?></button>
            </div>
          </div>
        </div>
        <form method="post" action="" enctype="multipart/form-data" id="form-order">
          <div class="table-responsive">
            <table class="table table-bordered table-hover">
              <thead>
                <tr>
                  <td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
                  <td class="text-right"><?php if ($sort == 'o.order_id') { ?>
                    <a href="<?php echo $sort_order; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_order_id; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_order; ?>"><?php echo $column_order_id; ?></a>
                    <?php } ?></td>
                  <td class="text-left"><?php if ($sort == 'customer') { ?>
                    <a href="<?php echo $sort_customer; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_customer; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_customer; ?>"><?php echo $column_customer; ?></a>
                    <?php } ?></td>
                    <td class="text-left">
                    <a >Kaç Kere Sipariş Verdi ?</a>
                    </td>
                 <td class="text-left"><?php if ($sort == 'product_name') { ?>
                    <a href="<?php echo $sort_product_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_product_name; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_status; ?>"><?php echo $column_product_name; ?></a>
                    <?php } ?></td>
                  <td class="text-left"><?php if ($sort == 'order_status') { ?>
                    <a href="<?php echo $sort_status; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_status; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_status; ?>"><?php echo $column_status; ?></a>
                    <?php } ?></td>
                  <td class="text-right"><?php if ($sort == 'o.total') { ?>
                    <a href="<?php echo $sort_total; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_total; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_total; ?>"><?php echo $column_total; ?></a>
                    <?php } ?></td>
                  <td class="text-left"><?php if ($sort == 'o.date_added') { ?>
                    <a href="<?php echo $sort_date_added; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_date_added; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_date_added; ?>"><?php echo $column_date_added; ?></a>
                    <?php } ?></td>
                  <td class="text-left"><?php if ($sort == 'o.date_modified') { ?>
                    <a href="<?php echo $sort_date_modified; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_date_modified; ?></a>
                    <?php } else { ?>
                    <a href="<?php echo $sort_date_modified; ?>"><?php echo $column_date_modified; ?></a>
                    <?php } ?></td>
                </tr>
              </thead>
              <tbody>
                <?php if ($orders) { ?>
                <?php foreach ($orders as $order) { ?>
                <tr>
                  <td class="text-center"><?php if (in_array($order['order_id'], $selected)) { ?>
                    <input type="checkbox" name="selected[]" value="<?php echo $order['order_id']; ?>" checked="checked" />
                    <?php } else { ?>
                    <input type="checkbox" name="selected[]" value="<?php echo $order['order_id']; ?>" />
                    <?php } ?>
                    <input type="hidden" name="shipping_code[]" value="<?php echo $order['shipping_code']; ?>" /></td>
                  <td class="text-right"><?php echo $order['order_id']; ?></td>
                  <td class="text-left"><?php echo $order['customer']; ?>
                  </td>
                  <td class="text-left"> <?php if (isset($order['total_customer_orders'])) { ?>
                   <?php if ($order['total_customer_orders'] == '0') { ?>
                      Müşteri Üye Değil
                    <?php } else { ?>
                    <?php echo $order['total_customer_orders']; ?>
                     <?php } ?>
                    <?php } ?></td>
                  <td class="text-left"><?php echo $order['product_name']; ?></td>
                  <td class="text-left"><?php echo $order['order_status']; ?></td>
                  <td class="text-right"><?php echo $order['price']; ?></td>
                  <td class="text-left"><?php echo $order['date_added']; ?></td>
                  <td class="text-left"><?php echo $order['date_modified']; ?></td>
                </tr>
                <?php } ?>
                <?php } else { ?>
                <tr>
                  <td class="text-center" colspan="8"><?php echo $text_no_results; ?></td>
                </tr>
                <?php } ?>
              </tbody>
            </table>
          </div>
        </form>
        <div class="row">
          <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
          <div class="col-sm-6 text-right"><?php echo $results; ?></div>
        </div>
      </div>
    </div>
  </div>
  <script type="text/javascript"><!1--
$('#button-filter').on('click', function() {
	url = 'index.php?route=sale/seyma_orders&token=<?php echo $token; ?>';

	var filter_order_id = $('input[name=\'filter_order_id\']').val();

	if (filter_order_id) {
		url += '&filter_order_id=' + encodeURIComponent(filter_order_id);
	}

	var filter_email = $('input[name=\'filter_email\']').val();

	if (filter_email) {
		url += '&filter_email=' + encodeURIComponent(filter_email);
	}

	var filter_telephone = $('input[name=\'filter_telephone\']').val();

	if (filter_telephone) {
		url += '&filter_telephone=' + encodeURIComponent(filter_telephone);
	}

	var filter_customer = $('input[name=\'filter_customer\']').val();

	if (filter_customer) {
		url += '&filter_customer=' + encodeURIComponent(filter_customer);
	}

	var filter_order_status = $('select[name=\'filter_order_status\']').val();

	if (filter_order_status != '*') {
		url += '&filter_order_status=' + encodeURIComponent(filter_order_status);
	}

	var filter_order_zone = $('select[name=\'filter_order_zone\']').val();

	if (filter_order_zone != '*') {
		url += '&filter_order_zone=' + encodeURIComponent(filter_order_zone);
	}

	var filter_order_payment = $('select[name=\'filter_order_payment\']').val();

	if (filter_order_payment != '*') {
		url += '&filter_order_payment=' + encodeURIComponent(filter_order_payment);
	}

	var filter_total = $('input[name=\'filter_total\']').val();

	if (filter_total) {
		url += '&filter_total=' + encodeURIComponent(filter_total);
	}

	var filter_date_added = $('input[name=\'filter_date_added\']').val();

	if (filter_date_added) {
		url += '&filter_date_added=' + encodeURIComponent(filter_date_added);
	}

	var filter_date_modified = $('input[name=\'filter_date_modified\']').val();

	if (filter_date_modified) {
		url += '&filter_date_modified=' + encodeURIComponent(filter_date_modified);
	}

	location = url;
});
//--><!--</script>
  <script type="text/javascript"><!1--
$('input[name=\'filter_customer\']').autocomplete({
	'source': function(request, response) {
		$.ajax({
			url: 'index.php?route=customer/customer/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
			dataType: 'json',
			success: function(json) {
				response($.map(json, function(item) {
					return {
						label: item['name'],
						value: item['customer_id']
					}
				}));
			}
		});
	},
	'select': function(item) {
		$('input[name=\'filter_customer\']').val(item['label']);
	}
});
//--><!--</script>
  <script type="text/javascript"><!1--
$('input[name^=\'selected\']').on('change', function() {
	$('#button-shipping, #button-invoice').prop('disabled', true);

	var selected = $('input[name^=\'selected\']:checked');

	if (selected.length) {
		$('#button-invoice').prop('disabled', false);
	}

	for (i = 0; i < selected.length; i++) {
		if ($(selected[i]).parent().find('input[name^=\'shipping_code\']').val()) {
			$('#button-shipping').prop('disabled', false);

			break;
		}
	}
});

$('#button-shipping, #button-invoice').prop('disabled', true);

$('input[name^=\'selected\']:first').trigger('change');

// IE and Edge fix!
$('#button-shipping, #button-invoice').on('click', function(e) {
	$('#form-order').attr('action', this.getAttribute('formAction'));
});

$('#button-delete').on('click', function(e) {
	$('#form-order').attr('action', this.getAttribute('formAction'));
	
	if (confirm('<?php echo $text_confirm; ?>')) {
		$('#form-order').submit();
	} else {
		return false;
	}
});
//--><!--</script>
  <script src="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
  <link href="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" media="screen" />
  <script type="text/javascript"><!1--
$('.date').datetimepicker({
	pickTime: false
});
//--><!--</script>--></div>
  </div>
</div>







<?php echo $footer; ?> 