﻿Perl/CGI Online Log Search Script by JR4PUR
===========================================


Author:
-------
Takeshi Nakata, JR4PUR - webmaster@sevenpence.org
website: http://sevenpence.org/_/


Rules:
------
This software is free software, copyleft.
You can use, modify and distribute the software if you do not delete the following credit.

#Perl/CGI Online Log Search Script by JR4PUR
#Copyleft. April 21, 2010 QSL@JR4PUR
#http://sevenpence.org/_/

You can distribute the modified software freely. (Please remember this software is copyleft)


Summary:
--------
This is an Online Log Search written by Perl.
Please use the software after uploading it in the server where CGI can be used.
You can use the UQF(asc) file As Is exported from Logger32 without changing the file.
This software can be used in the following mode.

CW
SSB
RTTY
AM
FM
SSTV

Please note that you delete "#" in the beginning of the code that you use AM, FM, SSTV. (from 185th line to 225th line)


Environment:
------------
The software has been used in the following environment.

OS: FreeBSD 7.1-RELEASE-p8 i386
Apache: 1.3.42 (Unix) mod_ssl/2.8.31 OpenSSL/0.9.8e
Perl: Perl 5.8.9


Installation:
-------------
Note:
This is just an example. Please upload your software for the environment in your server.
Regarding uploading of CGI, there are a lot of information in the internet. So please refer to the information. 

--- Please confirm the path to Perl ---
You need change the 1st line of your script to adjust to the environment in your server.

Examples:
#!/usr/local/bin/perl
#!/usr/bin/perl
#!/usr/sbin/perl 
#!/usr/lib/perl

--- Uploading of files ---
Please upload the following files by using FTP client in your server.
Please change permission in each file.

onlinelog.html
search.cgi
data.ASC (Please change your file name in order for QSO data not to be watched by third parties. Or, please keep the files in the other folder and make your permission of folders severely)
***.png (Please use your favorite picture)
***.png (Please use your favorite picture)

--- Examples of uploading files ---

./public_html/onlinelog.html            chmod [644] or [604]
             /search.cgi                chmod [755] or [705]
             /data.ASC                  chmod [644] or [604]
             /***.png                   chmod [644] or [604]
             /***.png                   chmod [644] or [604]


./public_html/cgi-bin/onlinelog.html    chmod [644] or [604]
                     /search.cgi        chmod [755] or [705]
                     /data.ASC          chmod [644] or [604]
                     /***.png           chmod [644] or [604]
                     /***.png           chmod [644] or [604]


./public_html/onlinelog.html            chmod [644] or [604]
             /cgi-bin/search.cgi        chmod [755] or [705]
             /data.ASC                  chmod [644] or [604]
             /***.png                   chmod [644] or [604]
             /***.png                   chmod [644] or [604]

Note:
You need to change each path when you upload files in the different folders from "search.cgi" and "online.html".
In the above case, please change "online.html" to "./cgi-bin/search.cgi" in the 6th line.
Please change "search.cgi" in the 254th line to "../online.html".


Choice of BAND:
---------------
You can chose BAND in the 18th line of your script. (The numbers in the BAND do not work unless you make the numbers equal to the name of data)


Choice of QSO data:
-------------------
You can chose name of data in the 23rd line of your script. (You can use the name as you chose)
You can chose data in the 243rd line. (You can use data in "$CALL,$DATE,$UTC,$BAND,$MODE,$RST". If you change name of data, the software dose not work)


Addition of MODE:
-----------------
You cannot take data if the number of words exceeds 5 because each data is divided in the UQF file and the data will be attached to the next "RST report".
But you can use the following codes in the script from 143rd line to 226th line if the number of words is less than 4.
In that case the name of additional MODE dose not work unless the name is matched to UQF file.

# -- Please cut and paste from here --
		print "<tr style=\"background:$STB_COLOR\">\n";
		print "<td style=\"background:$MTB_COLOR\"><center><span style=\"color: $ITEM_COLOR;\"><b>name of additional MODE</b></span></center></td>\n";
			foreach $band (@BANDS){
				print "<td width='39'>\n";
					if ($usedBand{$band,name of additional MODE}){
						print "<center><img src='$QSO_PICT'></center>\n";
					}else{
						print "<center><img src='$NIL_PICT'></center>\n";
					}
				print "</td>\n";
			}
		print "</tr>\n";
# -- to this end --


Use the CSV file:
-----------------
If you use the CSV file exported from Logger32, please change the 18th line of the script as follows:

@BANDS = ('10M', '12M', '15M', '17M', '20M', '30M', '40M', '80M', '160M');

Please change the 106th line and 235th line of the script as follows:

($ADDRESS,$DISTANCE,$ARRL_SECT,$BAND,$CALL,$CNTY,$COMMENT,$CONT,$CONTEST_ID,$CQZ,$APP_LOGGER32_USER_1,$DXCC,$FREQ,$GRIDSQUARE,$IOTA,$ITUZ,$APP_LOGGER32_USER_2,$APP_LOGGER32_USER_3,$MODE,$NAME,$NOTES,$OPERATOR,$PFX,$PROP_MODE,$QSL_RCVD,$QSL_SENT,$QSL_VIA,$QSLMSG,$QSLRDATE,$QSLSDATE,$QSO_DATE,$APP_LOGGER32_QSO_DATE,$QTH,$RST_RCVD,$RST_SENT,$RX_PWR,$SAT_MODE,$SAT_NAME,$SRX,$STATE,$STX,$K_INDEX,$TEN_TEN,$TIME_ON,$TIME_OFF,$TX_PWR,$SFI,$A_INDEX,$eQSL_QSL_SENT,$eQSL_QSL_RCVD,$LOTW_QSL_SENT,$LOTW_QSL_RCVD,$FREQ_RX,$BAND_RX,$CREDIT_SUBMITTED,$CREDIT_GRANTED,$COUNTRY,$APP_LOGGER32_QSO_NUMBER,$APP_LOGGER32_LOTW,$APP_LOGGER32_QSL,$APP_LOGGER32_eQSL) = split(/\,/,$data);

Please change the 140th line of the script as follows:

printf "<th><span style=\"color: $ITEM_COLOR;\"><b>%s</b></span></th>\n", lc$band;

Please change the from 236th line to 243rd line of the script as follows:

$BAND = lc$BAND;
$QSO_DATE =~ s/(\d\d\d\d)(\d\d)(\d\d)/$1-$2-$3/;
@USE_DATA = ($CALL,$QSO_DATE,$BAND,$MODE);

In the data of CSV file exported from Logeer32, double quotation is included. if you do not delete double quotation, the script does not work.
I could delete double quotation by EXCEL through opening CSV files and keeping them in the file. (I could do it in the EXCEL 2003)
If comma is used in the input data, the script may not work.


Immunity from responsibility:
-----------------------------
We do not guarantee that this program will work in all providers and environment of your server.
The author is not responsible for any losses from this program.
The author does not answer any questions on set up of CGI.



73,

Takeshi Nakata, JR4PUR
