Updated codebase added notes, new dashboard, search features

This commit is contained in:
Peter Goodhall
2011-06-17 13:52:00 +01:00
parent b18cd1b53e
commit ec190cc61e
108 changed files with 4285 additions and 75 deletions

View File

@@ -1,3 +1,204 @@
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawModeChart);
google.setOnLoadCallback(drawBandChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawModeChart() {
// Create our data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['SSB', <?php echo $total_ssb; ?>],
['CW', <?php echo $total_cw; ?>],
['FM', <?php echo $total_ssb; ?>],
['Digi', <?php echo $total_digi; ?>],
]);
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('modechart_div'));
chart.draw(data, {width: 350, height: 240});
}
function drawBandChart() {
// Create our data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
<?php foreach($total_bands->result() as $row) { ?>
['<?php echo $row->band; ?>', <?php echo $row->count; ?>],
<?php } ?>
]);
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('bandchart_div'));
chart.draw(data, {width: 350, height: 240});
}
</script>
<div id="message" >
<p>You have had <?php echo $todays_qsos; ?> QSOs Today!</p>
</div>
<div class="wrap_content">
Content Here
<div class="dash_left">
<h3>Latest QSOs</h3>
<table class="logbook" width="100%">
<tr class="log_title titles">
<td>Date</td>
<td>Time</td>
<td>Call</td>
<td>Mode</td>
<td>Sent</td>
<td>Recv</td>
<td>Band</td>
</tr>
<?php $i = 0;
foreach ($last_five_qsos->result() as $row) { ?>
<?php echo '<tr class="tr'.($i & 1).'">'; ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?></td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
<td><?php echo strtoupper($row->COL_CALL); ?></td>
<td><?php echo $row->COL_MODE; ?></td>
<td><?php echo $row->COL_RST_SENT; ?></td>
<td><?php echo $row->COL_RST_RCVD; ?></td>
<td><?php echo $row->COL_BAND; ?></td>
</tr>
<?php $i++; } ?>
</table>
<h3>Todays Mapped QSOs</h3>
<div id="map" style="width: 420px; height: 300px"></div>
<noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
However, it seems JavaScript is either disabled or not supported by your browser.
To view Google Maps, enable JavaScript by changing your browser options, and then
try again.
</noscript>
<script type="text/javascript">
//<![CDATA[
if (GBrowserIsCompatible()) {
// Display the map, with some controls
var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(33.137551,0.703125),1);
// arrays to hold copies of the markers and html used by the side_bar
// because the function closure trick doesnt work there
var side_bar_html = "";
var gmarkers = [];
var htmls = [];
var i = 0;
// A function to create the marker and set up the event window
function createMarker(point,name,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
// save the info we need to use later for the side_bar
gmarkers[i] = marker;
htmls[i] = html;
// add a line to the side_bar html
side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '<\/a><br>';
i++;
return marker;
}
// This function picks up the click and opens the corresponding info window
function myclick(i) {
gmarkers[i].openInfoWindowHtml(htmls[i]);
}
// ================================================================
// === Define the function thats going to process the JSON file ===
process_it = function(doc) {
// === Parse the JSON document ===
var jsonData = eval('(' + doc + ')');
// === Plot the markers ===
for (var i=0; i<jsonData.markers.length; i++) {
var marker = createMarker(jsonData.markers[i].point, jsonData.markers[i].label, jsonData.markers[i].html);
map.addOverlay(marker);
}
// put the assembled side_bar_html contents into the side_bar div
document.getElementById("side_bar").innerHTML = side_bar_html;
// === Plot the polylines ===
for (var i=0; i<jsonData.lines.length; i++) {
map.addOverlay(new GPolyline(jsonData.lines[i].points, jsonData.lines[i].colour, jsonData.lines[i].width));
}
}
// ================================================================
// === Fetch the JSON data file ====
GDownloadUrl("/logger/index.php/dashboard/todays_map", process_it);
// ================================================================
}
else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}
// This Javascript is based on code provided by the
// Community Church Javascript Team
// http://www.bisphamchurch.org.uk/
// http://econym.org.uk/gmap/
//]]>
</script>
</div>
<div class="dash_sidebar">
<h3>Overview of QSOs</h3>
<table width="100%">
<tr>
<td>Total QSOs</td>
<td><?php echo $total_qsos; ?></td>
</tr>
<tr>
<td>QSOs This Month</td>
<td><?php echo $month_qsos; ?></td>
</tr>
<tr>
<td>QSOs This Year</td>
<td><?php echo $year_qsos; ?></td>
</tr>
</table>
<h3>QSOs by Mode</h3>
<div id="modechart_div"></div>
<h3>QSOs by Band</h3>
<div id="bandchart_div"></div>
</div>
<div class="clear"></div>
</div>

View File

@@ -1,5 +1,5 @@
<div id="footer">
Developed by Peter Goodhall, <a href="http://www.m3php.com">2E0SQL</a>, Part of <a href="http://www.magicbug.co.uk" title="magicbug" target="_blank">magicbug</a>
</div>
</body>

View File

@@ -4,22 +4,43 @@
<head>
<title>Web Logbook</title>
<link rel="stylesheet" href="<?php echo base_url();?>css/reset.css" type="text/css" />
<link type="text/css" href="<?php echo base_url(); ?>css/flick/jquery-ui-1.8.12.custom.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-ui-1.8.12.custom.min.js"></script>
<script type="text/javascript">
$(function(){
// Accordion
$("#tabs").tabs();
$( "button, input:submit", ".wrap_content" ).button();
});
</script>
<style type="text/css" media="screen" >
body {
background-color: #e6e6e6;
font-family: Arial, "Trebuchet MS", sans-serif;
}
td {
padding: 5px;
td { padding: 1px;}
.tr1 td {
background:none repeat scroll 0 0 #F0FFFF;
}
.partial td, .logbook td { padding: 5px; }
#nav {
background-image: url('/logger/images/nav_bg.gif');
height: 39px;
color: #ffffff;
border-bottom: 1px solid #9bc9ed;
}
.log_title {
background-image: url('/logger/images/grey_bg.png');
background-repeat: repeat-x;
color: #439bf6;
}
/* Nav List CSS */
ul#navlist { font: bold 15px "Trebuchet MS", sans-serif; list-style-type: none; margin: 0; margin-left: 10px; }
ul#navlist li.active { float: left; background-image: none; background-color: #fff; margin: 2px 2px 0 3px; height:34px; text-align:center; }
@@ -28,38 +49,69 @@ ul#navlist li { float: left; margin: 2px 2px 0 3px; height:43px; border-bottom:
#navlist a { float: left; display: block; color: #ebebeb; text-decoration: none; padding-top: 7px; padding-left: 6px; padding-right: 5px; text-align:center; }
#navlist a:hover { }
.wrap_content {
margin: 0 auto;
width: 80%;
border: 1px solid #d7d7d7;
background-color: #ffffff;
}
.wrap_content { margin: 0 auto; width: 780px; border: 1px solid #d7d7d7; background-color: #ffffff; padding-bottom: 5px; }
#footer { margin: 0 auto; width: 780px; text-align: center; padding-top: 5px; padding-bottom: 5px; font-size: 12px; }
#message { margin: 0 auto; width: 770px; border: 1px solid #fcefa1; background-color: #fbfaf3; padding: 5px; margin-top: 5px; margin-bottom: 5px; font-weight: bold; font-size: 12px; }
.clear { clear: both; }
h2 { margin: 0 auto; width: 780px; font-weight: bold; font-size: 23px; margin-top: 5px; margin-bottom: 10px; }
h2 {
margin: 0 auto;
width: 80%;
font-weight: bold;
font-size: 23px;
margin-top: 5px;
margin-bottom: 10px;
h3 {
font-weight: bold; font-size: 16px; margin: 5px;
}
table .titles {
font-weight: bold;
table .titles { font-weight: bold; }
#tabs { margin: 5px; }
/* QSO Logging CSS */
#callsign { text-transform: uppercase; }
.controls { margin: 5px; }
.title { padding-top: 5px; padding-bottom: 5px; color: #0073EA; font-weight: bold; }
#qso_input {
border: 1px solid #dddddd; margin: 5px; padding: 2px;
}
.input_date {
width: 70px;
}
.input_time {
width: 54px;
}
#locator {
width: 47px;
text-transform: uppercase;
}
#country {
border: none;
}
#locator_info {
font-size: 13px;
}
.dash_left { float: left; width: 430px; }
.dash_sidebar { float: right; width: 350px; }
.note { padding: 5px; }
#notes_add { padding: 5px; }
#search_box { padding: 5px; }
</style>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php echo $this->config->item('google_maps_api'); ?>&sensor=true"
type="text/javascript"></script>
</head>
<body>
<body onunload="GUnload()">
<div id="nav">
<ul id="navlist">
<li><a href="<?php echo site_url();?> " title="Dashboard">Dashboard</a></li>
<li><a href="<?php echo site_url('logbook');?>" title="View Log">View Log</a></li>
<li><a href="<?php echo site_url('search');?>" title="Search">Search</a></li>
<li><a href="<?php echo site_url('qso');?>" title="Add QSO">Add QSO</a></li>
<li><a href="<?php echo site_url('notes');?>" title="Notes">Notes</a></li>
</ul>
</div>
<div class="clear"></div>

View File

@@ -0,0 +1,70 @@
<h2>Add Note</h2>
<div class="wrap_content">
<?php echo validation_errors(); ?>
<form method="post" action="<?php echo site_url('notes/add'); ?>" name="notes_add" id="notes_add">
<table>
<tr>
<td><label for="title">Title</label></td>
<td><input type="text" name="title" value="" /></td>
</tr>
<tr>
<td><label for="category">Category</label></td>
<td><select name="category">
<option value="General" selected="selected">General</option>
<option value="Antennas">Antennas</option>
<option value="Satellites">Satellites</option>
</select></td>
</tr>
<tr>
<td></td>
<td><textarea name="content" id="markItUp" rows="10" cols="10"></textarea></td>
</tr>
</table>
<div><input type="submit" value="Submit" /></div>
</form>
</div>
<script type="text/javascript">
<!--
$(document).ready(function() {
// Add markItUp! to your textarea in one line
// $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
$('#markItUp').markItUp(mySettings);
// You can add content from anywhere in your page
// $.markItUp( { Settings } );
$('.add').click(function() {
$.markItUp( { openWith:'<opening tag>',
closeWith:'<\/closing tag>',
placeHolder:"New content"
}
);
return false;
});
// And you can add/remove markItUp! whenever you want
// $(textarea).markItUpRemove();
$('.toggle').click(function() {
if ($("#markItUp.markItUpEditor").length === 1) {
$("#markItUp").markItUpRemove();
$("span", this).text("get markItUp! back");
} else {
$('#markItUp').markItUp(mySettings);
$("span", this).text("remove markItUp!");
}
return false;
});
});
-->
</script>
<script type="text/javascript" src="<?php echo base_url(); ?>markitup/jquery.markitup.js"></script>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="<?php echo base_url(); ?>markitup/sets/html/set.js"></script>
<!-- markItUp! skin -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>markitup/skins/markitup/style.css" />
<!-- markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>markitup/sets/html/style.css" />

View File

@@ -0,0 +1,72 @@
<?php foreach ($note->result() as $row) { ?>
<h2>Edit Note - <?php echo $row->title; ?></h2>
<div class="wrap_content">
<?php echo validation_errors(); ?>
<form method="post" action="<?php echo site_url('notes/edit'); ?>/<?php echo $id; ?>" name="notes_add" id="notes_add">
<table>
<tr>
<td><label for="title">Title</label></td>
<td><input type="text" name="title" value="<?php echo $row->title; ?>" /></td>
</tr>
<tr>
<td><label for="category">Category</label></td>
<td><select name="category">
<option value="General" selected="selected">General</option>
<option value="Antennas">Antennas</option>
<option value="Satellites">Satellites</option>
</select></td>
</tr>
<tr>
<td><input type="hidden" name="id" value="<?php echo $id; ?>" /></td>
<td><textarea name="content" id="markItUp" rows="10" cols="10"><?php echo $row->note; ?></textarea></td>
</tr>
</table>
<div><input type="submit" value="Submit" /></div>
</form>
</div>
<?php } ?>
<script type="text/javascript">
<!--
$(document).ready(function() {
// Add markItUp! to your textarea in one line
// $('textarea').markItUp( { Settings }, { OptionalExtraSettings } );
$('#markItUp').markItUp(mySettings);
// You can add content from anywhere in your page
// $.markItUp( { Settings } );
$('.add').click(function() {
$.markItUp( { openWith:'<opening tag>',
closeWith:'<\/closing tag>',
placeHolder:"New content"
}
);
return false;
});
// And you can add/remove markItUp! whenever you want
// $(textarea).markItUpRemove();
$('.toggle').click(function() {
if ($("#markItUp.markItUpEditor").length === 1) {
$("#markItUp").markItUpRemove();
$("span", this).text("get markItUp! back");
} else {
$('#markItUp').markItUp(mySettings);
$("span", this).text("remove markItUp!");
}
return false;
});
});
-->
</script>
<script type="text/javascript" src="<?php echo base_url(); ?>markitup/jquery.markitup.js"></script>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="<?php echo base_url(); ?>markitup/sets/html/set.js"></script>
<!-- markItUp! skin -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>markitup/skins/markitup/style.css" />
<!-- markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>markitup/sets/html/style.css" />

View File

@@ -0,0 +1,22 @@
<h2>Note</h2>
<div class="wrap_content">
<?php
if ($notes->num_rows() > 0)
{
echo "<ul>";
foreach ($notes->result() as $row)
{
echo "<li>";
echo "<a href=\"".site_url()."/notes/view/".$row->id."\">".$row->title."</a>";
echo "</li>";
}
echo "</ul>";
} else {
echo "<p>You have no notes, why not create one!</p>";
}
?>
</div>

View File

@@ -0,0 +1,12 @@
<?php foreach ($note->result() as $row) { ?>
<h2>Note - <?php echo $row->title; ?></h2>
<div class="wrap_content note">
<?php echo nl2br($row->note); ?>
<p>Options:
<ul>
<li><a href="<?php echo site_url('notes/edit'); ?>/<?php echo $row->id; ?>">Edit</a></li>
<li><a href="<?php echo site_url('notes/delete'); ?>/<?php echo $row->id; ?>">Delete</a></li>
</ul></p>
</div>
<?php } ?>

View File

@@ -0,0 +1,75 @@
<h2>Add QSO</h2>
<div class="wrap_content">
<?php echo validation_errors(); ?>
<form method="post" action="<?php echo site_url('qso/edit'); ?>" name="qsos">
<table>
<tr>
<td>Start Date</td>
<td><input type="text" name="time_on" value="<?php echo $COL_TIME_ON; ?>" /></td>
</tr>
<tr>
<td>End Date</td>
<td><input type="text" name="time_off" value="<?php echo $COL_TIME_OFF; ?>" /></td>
</tr>
<tr>
<td>Callsign</td>
<td><input type="text" name="callsign" value="<?php echo $COL_CALL; ?>" /></td>
</tr>
<?php if($COL_FREQ) { ?>
<tr>
<td>Freq</td>
<td><input type="text" name="freq" value="<?php echo $COL_FREQ; ?>" /></td>
</tr>
<?php } ?>
<tr>
<td>Mode</td>
<td><input type="text" name="mode" value="<?php echo $COL_MODE; ?>" /></td>
</tr>
<tr>
<td>Band</td>
<td><input type="text" name="band" value="<?php echo $COL_BAND; ?>" /></td>
</tr>
<tr>
<td>RST Sent</td>
<td><input type="text" name="rst_sent" value="<?php echo $COL_RST_SENT; ?>" /></td>
</tr>
<tr>
<td>RST Recv</td>
<td><input type="text" name="rst_recv" value="<?php echo $COL_RST_RCVD; ?>" /></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="name" value="<?php echo $COL_NAME; ?>" /></td>
</tr>
<tr>
<td>Comment</td>
<td><input type="text" name="comment" value="<?php echo $COL_COMMENT; ?>" /></td>
</tr>
<tr>
<td>Sat Name</td>
<td><input type="text" name="sat_name" value="<?php echo $COL_SAT_NAME; ?>" /></td>
</tr>
<tr>
<td>Sat Mode</td>
<td><input type="text" name="sat_mode" value="<?php echo $COL_SAT_MODE; ?>" /></td>
</tr>
</table>
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<div><input type="submit" value="Submit" /></div>
</form>
</div>

View File

@@ -1,43 +1,113 @@
<h2>Add QSO</h2>
<?php if($notice) { ?>
<div id="message" >
<?php echo $notice; ?>
</div>
<?php } ?>
<div class="wrap_content">
<table>
<tr>
<script type="text/javascript">
setInterval("settime()", 1000);
function settime () {
var curtime = new Date();
var curhour = curtime.getHours();
var curmin = curtime.getMinutes();
var cursec = curtime.getSeconds();
var time = "";
if(curhour == 0) curhour = 24;
time = (curhour > 24 ? curhour - 24 : curhour - 1) + ":" +
(curmin < 10 ? "0" : "") + curmin + ":" +
(cursec < 10 ? "0" : "") + cursec
document.qsos.start_time.value = time;
}
</script>
<table class="logbook" width="100%">
<tr class="log_title titles">
<td>Date</td>
<td><?php echo date('d/m/Y'); ?></td>
</tr>
<tr>
<td>Start Time</td>
<td></td>
</tr>
<tr>
<td>Callsign</td>
<td><input type="text" name="callsign" value="" /></td>
</tr>
<tr>
<td>Time</td>
<td>Call</td>
<td>Mode</td>
<td>Sent</td>
<td>Recv</td>
<td>Band</td>
<td><select name="band">
<option value="160m">160m</option>
<option value="80m">80m</option>
<option value="40m">40m</option>
<option value="30m">30m</option>
<option value="20m">20m</option>
<option value="17m">17m</option>
<option value="15m">15m</option>
<option value="12m">12m</option>
<option value="10m">10m</option>
<option value="6m">6m</option>
<option value="4m">4m</option>
<option value="2m">2m</option>
<option value="70cm">70cm</option>
</select></td>
</tr>
<?php $i = 0;
foreach ($query->result() as $row) { ?>
<?php echo '<tr class="tr'.($i & 1).'">'; ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?></td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
<td><?php echo strtoupper($row->COL_CALL); ?></td>
<td><?php echo $row->COL_MODE; ?></td>
<td><?php echo $row->COL_RST_SENT; ?></td>
<td><?php echo $row->COL_RST_RCVD; ?></td>
<td><?php echo $row->COL_BAND; ?></td>
</tr>
<?php $i++; } ?>
</table>
<?php echo validation_errors(); ?>
<form id="qso_input" method="post" action="<?php echo site_url('qso'); ?>" name="qsos">
<table width="100%">
<tr class="log_title">
<td class="title">Date</td>
<td class="title">Time</td>
<td class="title">Callsign</td>
<?php if($this->config->item('display_freq') == true) { ?>
<td class="title">Freq</td>
<?php } ?>
<td class="title">Mode</td>
<td class="title">Band</td>
<td class="title">RST Sent</td>
<td class="title">RST Recv</td>
<td class="title">QRA</td>
<!-- <td class="title">Name</td> -->
<td class="title">Comment</td>
</tr>
<tr>
<td>RST Sent</td>
<td><input class="input_date" type="text" name="start_date" value="<?php echo date('d-m-Y'); ?>" size="10" /></td>
<td><input class="input_time" type="text" name="start_time" value="" size="7" /></td>
<td><input size="10" id="callsign" type="text" name="callsign" value="" /></td>
<td><select name="mode">
<option value="SSB" <?php if($this->session->userdata('mode') == "" || $this->session->userdata('mode') == "FM") { echo "selected=\"selected\""; } ?>>SSB</option>
<option value="FM" <?php if($this->session->userdata('mode') == "FM") { echo "selected=\"selected\""; } ?>>FM</option>
<option value="CW" <?php if($this->session->userdata('mode') == "CW") { echo "selected=\"selected\""; } ?>>CW</option>
<option value="RTTY" <?php if($this->session->userdata('mode') == "RTTY") { echo "selected=\"selected\""; } ?>>RTTY</option>
<option value="PSK31" <?php if($this->session->userdata('mode') == "PSK31") { echo "selected=\"selected\""; } ?>>PSK31</option>
<option value="PSK63" <?php if($this->session->userdata('mode') == "PSK63") { echo "selected=\"selected\""; } ?>>PSK31</option>
<option value="JT65" <?php if($this->session->userdata('mode') == "JT65") { echo "selected=\"selected\""; } ?>>JT65</option>
<option value="JT65B" <?php if($this->session->userdata('mode') == "JT65B") { echo "selected=\"selected\""; } ?>>JT65B</option>
<option value="JT6M" <?php if($this->session->userdata('mode') == "JT6M") { echo "selected=\"selected\""; } ?>>JT6M</option>
<option value="FSK441" <?php if($this->session->userdata('mode') == "FSK441") { echo "selected=\"selected\""; } ?>>FSK441</option>
</select></td>
<td><select name="band">
<option value="160m" <?php if($this->session->userdata('band') == "160m") { echo "selected=\"selected\""; } ?>>160m</option>
<option value="80m" <?php if($this->session->userdata('band') == "80m") { echo "selected=\"selected\""; } ?>>80m</option>
<option value="40m" <?php if($this->session->userdata('band') == "40m") { echo "selected=\"selected\""; } ?>>40m</option>
<option value="30m" <?php if($this->session->userdata('band') == "30m") { echo "selected=\"selected\""; } ?>>30m</option>
<option value="20m" <?php if($this->session->userdata('band') == "20m") { echo "selected=\"selected\""; } ?>>20m</option>
<option value="17m" <?php if($this->session->userdata('band') == "17m") { echo "selected=\"selected\""; } ?>>17m</option>
<option value="15m" <?php if($this->session->userdata('band') == "15m") { echo "selected=\"selected\""; } ?>>15m</option>
<option value="12m" <?php if($this->session->userdata('band') == "12m") { echo "selected=\"selected\""; } ?>>12m</option>
<option value="10m" <?php if($this->session->userdata('band') == "10m") { echo "selected=\"selected\""; } ?>>10m</option>
<option value="6m" <?php if($this->session->userdata('band') == "6m") { echo "selected=\"selected\""; } ?>>6m</option>
<option value="4m" <?php if($this->session->userdata('band') == "4m") { echo "selected=\"selected\""; } ?>>4m</option>
<option value="2m" <?php if($this->session->userdata('band') == "2m") { echo "selected=\"selected\""; } ?>>2m</option>
<option value="70cm" <?php if($this->session->userdata('band') == "70cm") { echo "selected=\"selected\""; } ?>>70cm</option>
</select></td>
<td><select name="rst_sent">
<option value="51">51</option>
<option value="52">52</option>
@@ -52,10 +122,6 @@
<option value="59+20dB">59+20dB</option>
<option value="59+30dB">59+30dB</option>
</select></td>
</tr>
<tr>
<td>RST Recv</td>
<td><select name="rst_recv">
<option value="51">51</option>
<option value="52">52</option>
@@ -70,11 +136,82 @@
<option value="59+20dB">59+20dB</option>
<option value="59+30dB">59+30dB</option>
</select></td>
</tr>
<tr>
<td>Comment</td>
<td><input id="locator" type="text" name="locator" value="" size="7" /></td>
<!-- <td><input type="text" name="name" value="" /></td> -->
<td><input type="text" name="comment" value="" /></td>
</tr>
</table>
<div class="info">
<input size="20" id="country" type="text" name="country" value="" /> <span id="locator_info"></span>
</div>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Logbook</a></li>
<li><a href="#tabs-2">Satellite</a></li>
<li><a href="#tabs-3">Station</a></li>
</ul>
<div id="tabs-1"><div id="partial_view">Partial Callsign Check</div></div>
<div id="tabs-2">
<table>
<tr>
<td class="title">Sat Name</td>
<td><input type="text" name="sat_name" value="" /></td>
</tr>
<tr>
<td class="title">Sat Mode</td>
<td><input type="text" name="sat_mode" value="" /></td>
</tr>
</table>
</div>
<div id="tabs-3">
<table>
<tr>
<td>Radio</td>
<td><input type="text" name="equipment" value="" /></td>
</tr>
<?php if($this->config->item('display_freq') == true) { ?>
<tr>
<td>Frequnecy</td>
<td><input type="text" name="freq" value="<?php if($this->session->userdata('freq') != null) { echo $this->session->userdata('freq'); } ?>" /></td>
</tr>
<?php } ?>
</table>
</div>
</div>
<div class="controls"><input type="submit" value="Add QSO" /></div>
</form>
<script type="text/javascript">
i=0;
$(document).ready(function(){
$("#locator").keyup(function(){
if ($(this).val()) {
$('#locator_info').load("logbook/bearing/" + $(this).val()).fadeIn("slow");
}
});
$("#callsign").keyup(function(){
if ($(this).val()) {
$('#partial_view').load("logbook/partial/" + $(this).val()).fadeIn("slow");
$.get('logbook/find_dxcc/' + $(this).val(), function(result) {
$('#country').val(result);
});
}
});
});
</script>
</div>

View File

@@ -0,0 +1,22 @@
<h2>Search</h2>
<div class="wrap_content">
<form method="post" action="" id="search_box" name="test">
Callsign: <input type="text" id="callsign" name="callsign" value="" />
</form>
<div id="partial_view"></div>
</div>
<script type="text/javascript">
i=0;
$(document).ready(function(){
$("#callsign").keyup(function(){
if ($(this).val()) {
$('#partial_view').load("logbook/partial/" + $(this).val()).fadeIn("slow");
}
});
});
</script>

View File

@@ -1,9 +1,16 @@
<h2>Logbook</h2>
<?php if($this->session->flashdata('notice')) { ?>
<div id="message" >
<?php echo $this->session->flashdata('notice'); ?>
</div>
<?php } ?>
<div class="wrap_content">
<table width="100%">
<tr class="titles">
<table class="logbook" width="100%">
<tr class="log_title titles">
<td>Date</td>
<td>Time</td>
<td>Call</td>
@@ -13,10 +20,11 @@
<td>Band</td>
<td>Name</td>
<td>Country</td>
<td>Options</td>
</tr>
<?php foreach ($results->result() as $row) { ?>
<tr>
<?php $i = 0; foreach ($results->result() as $row) { ?>
<?php echo '<tr class="tr'.($i & 1).'">'; ?>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('d/m/y', $timestamp); ?></td>
<td><?php $timestamp = strtotime($row->COL_TIME_ON); echo date('H:i', $timestamp); ?></td>
<td><?php echo strtoupper($row->COL_CALL); ?></td>
@@ -26,8 +34,9 @@
<td><?php echo $row->COL_BAND; ?></td>
<td><?php echo substr($row->COL_NAME, 0, 15); ?></td>
<td><?php echo $row->COL_COUNTRY; ?></td>
<td><a href="<?php echo site_url('qso/edit'); ?>/<?php echo $row->COL_PRIMARY_KEY; ?>" >Edit</a></td>
</tr>
<?php } ?>
<?php $i++; } ?>
</table>