Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions DocApp/main/static/js/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

// window.onload = alert(localStorage.getItem("storageName"));
// get the value of number entered in the box
function getValue(){
window.onload = function getValue(){

// console.log("in");
var str = document.getElementById("search_input").value;
var str = localStorage.getItem("storageName");
console.log(str);
if(str != ""){
getTrack(str);
}
Expand Down
48 changes: 46 additions & 2 deletions DocApp/main/static/js/people_data.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@


getPeopleInfo();
// add a dashboard column to the complete data set

function getPeopleInfo(){
var data = $.ajax( {
Expand All @@ -8,24 +11,65 @@ function getPeopleInfo(){
success: function(data) {
var obj = JSON.parse;
var x = data;
// console.log(data);
console.log(data);
// add dashboard text in each row

for( i = 0; i<x.length; i++){
x[i].dashboard = 'view profile'
}

console.log(x);
// ====================================================================================

$.fn.dataTable.ext.errMode = 'none';
$('#example').DataTable( {
var table = $('#example').DataTable( {
data: data,
columns: [
{ data: 'Mobile' },
{data: 'Probability'},
{ data: 'ID' },
{
"data": "dashboard",
"render": function(data, type, row, meta){
if(type === 'display'){

data = '<a href="{% url general_public %}" onclick='+store_it()+'>' + data + '</a>';
}

return data;
}
}
]
} );

$('#example tbody').on( 'click', 'tr', function () {
if ( $(this).hasClass('selected') ) {
$(this).removeClass('selected');
} else {
table.$('tr.selected').removeClass('selected');
$(this).addClass('selected');

var data = $('#example').DataTable().row('.selected').data();
console.log(data);
localStorage.setItem("storageName",data.Mobile);
// alert("Name:" + data.Mobile + "\nJob:" + data[1]);
}
});

// ==============================================================
}


});
return data;
}

function store_it(){
//just get the respective value and then you're done
var feed
if ( $(this).hasClass('Mobile') ) {
feed = 1
}

localStorage.setItem("storageName",'+917083201514');
}
9 changes: 3 additions & 6 deletions DocApp/main/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h3 id="address"><a href="{% url 'logout' %}"> Logout</a></h3>
</div>
</div>
<div class="infobox">
<div class="searchbox">
<div class="searchbox" style="display: none">
<h2 style="padding-top: 2vh;">Search</h2>
<form class="search-form" id="SearchForm">
<input type="text" id="search_input" placeholder="Search " >
Expand All @@ -33,15 +33,12 @@ <h2 style="padding-top: 2vh;">Search</h2>
<div class="heading_child">Heading</div>
<div class="heading_child">Heading</div>
</div> -->
<div class="contentbox">
<div class="contentbox" style="margin-top: 5vh">
<div class="sidebar">
<div class="heading_child">Heading</div>
<ul>
<li><a href="#" >Dashboard</a></li>
<li><a href="{% url 'general_public' %}">People</a></li>
<li><a href="{% url 'hotspots' %}">Hotspots</a></li>
<li><a href="{% url 'maps' %}">Providers</a></li>
<li><a href="{% url 'analysis' %}">Analysis</a></li>
<li><a href="{% url 'general_public' %}" style="background-color: red !important; color: white">Back</a></li>
</ul>
</div>
<div class="workarea">
Expand Down
5 changes: 3 additions & 2 deletions DocApp/main/templates/general_public.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ <h2 style="padding-top: 2vh;">Search</h2>
<div class="heading_child">Heading</div>
<div class="heading_child">Heading</div>
</div> -->
<div class="contentbox">
<div class="contentbox" style="margin-top: 5vh">
<div class="sidebar">
<div class="heading_child">People</div>
<ul>
<li><a href="{% url 'dashboard' %}" >Dashboard</a></li>
<!-- <li><a href="{% url 'dashboard' %}" >Dashboard</a></li> -->
<li><a href="{% url 'general_public' %}">People</a></li>
<li><a href="{% url 'hotspots' %}">Hotspots</a></li>
<li><a href="{% url 'maps' %}">Providers</a></li>
Expand All @@ -52,6 +52,7 @@ <h2 style="padding-top: 2vh;">Search</h2>
<th>Mobile</th>
<th>Probability</th>
<th>ID</th>
<th>View Profile</th>
</tr>
</thead>
</table>
Expand Down