descripcion reportes

parent 92fb36e9
{% extends "data_top.html" %}
{% load static %}
{% block content %}
<div class="wrapper">
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-6">
<!-- AREA CHART -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Area Km²</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i
class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i
class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<div class="chart">
<canvas id="areaChart" style="height:250px"></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<!-- DONUT CHART -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Donut Chart</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i
class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i
class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<canvas id="pieChart" style="height:250px"></canvas>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col (LEFT) -->
<div class="col-md-6">
<!-- LINE CHART -->
<!-- BAR CHART -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">Bar Chart</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i
class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i
class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<div class="chart">
<canvas id="barChart" style="height:230px"></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">MAP</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapsexite"><i
class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i
class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<div class="chart">
<img id="satImage" src="{% static 'tmpImages/20180219_TCI_60m.jpg' %}" height="512px"/>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col (RIGHT) -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 2.4.0
</div>
<strong>Copyright &copy; 2014-2016 <a href="https://adminlte.io">Almsaeed Studio</a>.</strong> All rights
reserved.
</footer>
{% endblock %}
{% block scripts %}
<!-- page script -->
<script>
var ctx = document.getElementById("areaChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'Line',
data: {
labels: [{{labels}}],
datasets: [{
label: 'Vegetacion (4)',
data: {{vegetation}},
backgroundColor: [
'rgba(0, 250, 132, 0.5)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
},
{
label: 'No Vegetacion (5)',
data: {{novegetation}},
backgroundColor: [
'rgba(155, 250, 0, 0.5)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
events: ['click'],
onClick: areaChartonClick,
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
function areaChartonClick(e, element) {
console.log(e);
console.log(element);
console.log(element[0]._index);
console.log(myChart);
console.log(myChart.config.data.labels[element[0]._index]);
document.getElementById("satImage").src = "../../static/tmpImages/" + myChart.config.data.labels[element[0]._index] + "_TCI_60m.jpg"
};
</script>
{% endblock %}
...@@ -293,40 +293,6 @@ def delFromCart(request): ...@@ -293,40 +293,6 @@ def delFromCart(request):
product_list = Purchase.objects.filter(user=user, id=request.POST['id']).delete() product_list = Purchase.objects.filter(user=user, id=request.POST['id']).delete()
return HttpResponse(status=204) return HttpResponse(status=204)
##-------------------------------------------------------------------------------
# def L2ASCL_data(request):
# with open("/home/mario/NAS_MarioCh/mario_repsat_test/T15QZD_sclData.json") as f:
# json_data = OrderedDict(json.load(f))
# graphData = dict()
# graphData['type']="line"
# data=dict()
# data['labels'] = [ k for k,v in sorted(json_data.items()) ]
# data['datasets'] = list()
# labels = set()
# for d in json_data:
# labels |= set(json_data[d].keys())
# labels.remove('date')
# labelNames = ["No Data", "Saturated", "Shadows", "Cloud Shadows", "Vegetation",
# "Not-Vegetated", "Whater", "Unclassified", "Cloud Medium Probablilty", "Cloud Hight Probablilty", "Thin Cirrus", "Snow"]
# colors = ["Black", "Red", "DarkGray", "Brown", "Green", "Yellow", "Blue", "Grey", "LightGray", "White", "Aqua", "Pink"]
# for l in labels:
# item = dict()
# item['label'] = labelNames[int(l)]
# if l == "0":
# item['hidden'] = "true"
# item['data'] = [ v[l] * 60*60/1000000. for k,v in sorted(json_data.items()) if l in v]
# item['backgroundColor']=colors[int(l)]
# data['datasets'].append(item)
# graphData['data']=data
## graphData['options']['responsive']=True
## graphData['options']['maintainAspectRatio']=False
# print( json.dumps(graphData).encode("utf-8"))
# return render(request, 'L2ASCL_data.html', {"graphData":json.dumps(graphData).encode("utf-8")})
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
def wsReportImages(request): def wsReportImages(request):
print(request.GET) print(request.GET)
...@@ -659,41 +625,6 @@ def IPN(request): ...@@ -659,41 +625,6 @@ def IPN(request):
# f.write("\n") # f.write("\n")
# f.close() # f.close()
# -----------------------------------------------------------------------
# def Pay3(request):
# VERIFY_URL_PROD = 'https://ipnpb.paypal.com/cgi-bin/webscr'
# VERIFY_URL_TEST = 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr'
#
# # Switch as appropriate
# VERIFY_URL = VERIFY_URL_TEST
#
# # CGI preamble
# print('content-type: text/plain')
# print()
#
# # Read and parse query string
# param_str = sys.stdin.readline().strip()
# params = urllib.parse.parse_qsl(param_str)
#
# # Add '_notify-validate' parameter
# params.append(('cmd', '_notify-validate'))
#
# # Post back to PayPal for validation
#
# headers = {'content-type': 'application/x-www-form-urlencoded',
# 'user-agent': 'Python-IPN-Verification-Script'}
# r = requests.post(VERIFY_URL, params=params, headers=headers, verify=True)
# r.raise_for_status()
#
# # Check return message and take action as needed
# if r.text == 'VERIFIED':
# pass
# elif r.text == 'INVALID':
# pass
# else:
# pass
# return redirect("https://google.com.mx")
# ------------------------------------------------------ # ------------------------------------------------------
def Registration(request): def Registration(request):
#user = User.objects.filter(email=request.POST['email']) #user = User.objects.filter(email=request.POST['email'])
......
...@@ -226,15 +226,22 @@ ...@@ -226,15 +226,22 @@
{% if product.initial_folder %} {% if product.initial_folder %}
href="../reports/{{ product.purchase_id }}" href="../reports/{{ product.purchase_id }}"
{% endif %} {% endif %}
class="btn btn-success btn-sm col-md-6 col-xs-6 col-sm-6 col-lg-6 col-xl-6"> class="btn btn-success btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4">
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
</a> </a>
<a title="Download zip" {% if product.progress == 100 %} <a title="Download zip" {% if product.progress == 100 %}
href="../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip" href="../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
{% else %} {% else %}
href="#" href="#"
{% endif %} class="btn btn-warning btn-sm col-md-6 col-xs-6 col-sm-6 col-lg-6 col-xl-6"> {% endif %} class="btn btn-warning btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4">
<i class="fa fa-file-zip-o"></i> <i class="fa fa-file-zip-o"></i>
</a>
<a title="Download PDF" {% if product.progress == 100 %}
href="{% url 'PDF' product.purchase_id %}"
{% else %}
href="#"
{% endif %} class="btn btn-info btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4">
<i class="fa fa-file-pdf-o"></i>
</a> </a>
<!--a title="View Log" href="#" class="btn btn-info" <!--a title="View Log" href="#" class="btn btn-info"
onclick="openmodal('{{ product.log_info }}')"> onclick="openmodal('{{ product.log_info }}')">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment