diff --git a/application/controllers/awards.php b/application/controllers/awards.php index 2c1055a8..4f765b76 100644 --- a/application/controllers/awards.php +++ b/application/controllers/awards.php @@ -117,4 +117,18 @@ class Awards extends CI_Controller { $this->load->view('layout/footer'); } + public function cq(){ + $this->load->model('cq'); + $zones = array(); + foreach($this->cq->get_zones() as $row){ + array_push($zones, intval($row->COL_CQZ)); + } + $data['cqz'] = $zones; + + // Render page + $data['page_title'] = "Awards - CQ Magazine"; + $this->load->view('layout/header', $data); + $this->load->view('awards/cq/index'); + $this->load->view('layout/footer'); + } } diff --git a/application/models/cq.php b/application/models/cq.php new file mode 100644 index 00000000..1fbafdd2 --- /dev/null +++ b/application/models/cq.php @@ -0,0 +1,21 @@ +db->query( + "select COL_CQZ, count(COL_CQZ) + from TABLE_HRD_CONTACTS_V01 + where COL_CQZ is not null + group by COL_CQZ order by COL_CQZ" + ); + + return $data->result(); + } +} diff --git a/application/models/logbook_model.php b/application/models/logbook_model.php index c3b30f95..1a62bc19 100644 --- a/application/models/logbook_model.php +++ b/application/models/logbook_model.php @@ -938,6 +938,7 @@ class Logbook_model extends CI_Model { 'COL_LOTW_QSL_SENT' => $LOTWQSLSENT, 'COL_LOTW_QSL_RCVD' => $LOTWQSLRCVD, 'COL_DXCC' => $dxcc[0], + 'COL_CQZ' => $dxcc[2], ); // if eQSL username set, default SENT & RCVD to 'N' else leave as null @@ -954,13 +955,13 @@ class Logbook_model extends CI_Model { /* * Check the dxxc_prefixes table and return (dxcc, country) */ - private function check_dxcc_table($call, $date){ + public function check_dxcc_table($call, $date){ $len = strlen($call); // query the table, removing a character from the right until a match for ($i = $len; $i > 0; $i--){ //printf("searching for %s\n", substr($call, 0, $i)); - $dxcc_result = $this->db->select('`call`, `entity`, `adif`') + $dxcc_result = $this->db->select('`call`, `entity`, `adif`, `cqz`') ->where('call', substr($call, 0, $i)) ->where('(start <= ', $date) ->or_where("start = '0000-00-00')", NULL, false) @@ -973,7 +974,7 @@ class Logbook_model extends CI_Model { if ($dxcc_result->num_rows() > 0){ $row = $dxcc_result->row_array(); - return array($row['adif'], $row['entity']); + return array($row['adif'], $row['entity'], $row['cqz']); } } @@ -985,8 +986,8 @@ class Logbook_model extends CI_Model { * a stored procedure which we call */ public function check_dxcc_stored_proc($call, $date){ - $this->db->query("call find_country('".$call."','".$date."', @country, @adif)"); - $res = $this->db->query("select @country as country, @adif as adif"); + $this->db->query("call find_country('".$call."','".$date."', @country, @adif, @cqz)"); + $res = $this->db->query("select @country as country, @adif as adif, @cqz as cqz"); $d = $res->result_array(); // Should only be one result. diff --git a/application/views/awards/cq/index.php b/application/views/awards/cq/index.php new file mode 100644 index 00000000..f5c26711 --- /dev/null +++ b/application/views/awards/cq/index.php @@ -0,0 +1,73 @@ +
+

+ + load->view("awards/nav_bar")?> + +

CQ Zones worked:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" usemap="#CQ" border="0"> + + + +
diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index b69704ef..404f4f0b 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -4,12 +4,7 @@ - + load->view("awards/nav_bar")?> diff --git a/application/views/awards/index.php b/application/views/awards/index.php index 52104683..71b98e51 100644 --- a/application/views/awards/index.php +++ b/application/views/awards/index.php @@ -7,6 +7,7 @@
  • WAB
  • SOTA
  • WACRAL
  • +
  • CQ
  • - \ No newline at end of file + diff --git a/application/views/awards/nav_bar.php b/application/views/awards/nav_bar.php new file mode 100644 index 00000000..4f5b6ab1 --- /dev/null +++ b/application/views/awards/nav_bar.php @@ -0,0 +1,23 @@ + + + + diff --git a/application/views/awards/sota/index.php b/application/views/awards/sota/index.php index 4c46bc66..d6a21999 100644 --- a/application/views/awards/sota/index.php +++ b/application/views/awards/sota/index.php @@ -3,12 +3,7 @@ - + load->view("awards/nav_bar")?>
    @@ -50,4 +45,4 @@ ?>
    - \ No newline at end of file + diff --git a/application/views/awards/wab/index.php b/application/views/awards/wab/index.php index e2b01510..adc61458 100644 --- a/application/views/awards/wab/index.php +++ b/application/views/awards/wab/index.php @@ -3,12 +3,7 @@ - + load->view("awards/nav_bar")?> @@ -50,4 +45,4 @@ ?>
    - \ No newline at end of file + diff --git a/application/views/awards/wacral/index.php b/application/views/awards/wacral/index.php index a25e1492..d38f5eb0 100644 --- a/application/views/awards/wacral/index.php +++ b/application/views/awards/wacral/index.php @@ -3,12 +3,7 @@ - + load->view("awards/nav_bar")?> num_rows() > 0) { ?> @@ -51,4 +46,4 @@

    You have lot logged any WACRAL

    - \ No newline at end of file + diff --git a/images/CQzone.gif b/images/CQzone.gif new file mode 100644 index 00000000..dac2bd69 Binary files /dev/null and b/images/CQzone.gif differ diff --git a/js/jquery.maphilight.min.js b/js/jquery.maphilight.min.js new file mode 100644 index 00000000..5593708d --- /dev/null +++ b/js/jquery.maphilight.min.js @@ -0,0 +1,2 @@ +/*! maphilight 21-10-2015 */ +!function(a){var b,c,d,e,f,g,h,j,k,l,m;if(c=!!document.createElement("canvas").getContext,b=function(){var a=document.createElement("div");a.innerHTML='';var b=a.firstChild;return b.style.behavior="url(#default#VML)",b?"object"==typeof b.adj:!0}(),!c&&!b)return void(a.fn.maphilight=function(){return this});if(c){j=function(a){return Math.max(0,Math.min(parseInt(a,16),255))},k=function(a,b){return"rgba("+j(a.substr(0,2))+","+j(a.substr(2,2))+","+j(a.substr(4,2))+","+b+")"},d=function(b){var c=a('').get(0);return c.getContext("2d").clearRect(0,0,a(b).width(),a(b).height()),c};var n=function(a,b,c,d,e){if(d=d||0,e=e||0,a.beginPath(),"rect"==b)a.rect(c[0]+d,c[1]+e,c[2]-c[0],c[3]-c[1]);else if("poly"==b)for(a.moveTo(c[0]+d,c[1]+e),i=2;i').get(0)},e=function(b,c,d,e,f){var g,h,i,j;for(var k in d)d[k]=parseInt(d[k],10);g='',h=e.stroke?'strokeweight="'+e.strokeWidth+'" stroked="t" strokecolor="#'+e.strokeColor+'"':'stroked="f"',i='',"rect"==c?j=a(''):"poly"==c?j=a(''):"circ"==c&&(j=a('')),j.get(0).innerHTML=g+i,a(b).append(j)},f=function(b){var c=a("
    "+b.innerHTML+"
    ");c.children("[name=highlighted]").remove(),b.innerHTML=c.html()};g=function(a){var b,c=a.getAttribute("coords").split(",");for(b=0;b0)){if(j.hasClass("maphilighted")){var s=j.parent();j.insertBefore(s),s.remove(),a(o).unbind(".maphilight")}k=a("
    ").css({display:"block",backgroundImage:'url("'+this.src+'")',backgroundSize:"contain",position:"relative",padding:0,width:this.width,height:this.height}),n.wrapClass&&(n.wrapClass===!0?k.addClass(a(this).attr("class")):k.addClass(n.wrapClass)),j.before(k).css("opacity",0).css(h).remove(),b&&j.css("filter","Alpha(opacity=0)"),k.append(j),p=d(this),a(p).css(h),p.height=this.height,p.width=this.width,a(o).bind("alwaysOn.maphilight",function(){q&&f(q),c||a(p).empty(),a(o).find("area[coords]").each(function(){var b,f;f=m(this,n),f.alwaysOn&&(!q&&c&&(q=d(j[0]),a(q).css(h),q.width=j[0].width,q.height=j[0].height,j.before(q)),f.fade=f.alwaysOnFade,b=g(this),c?e(q,b[0],b[1],f,""):e(p,b[0],b[1],f,""))})}).trigger("alwaysOn.maphilight").bind("mouseover.maphilight, focus.maphilight",function(b){var d,f,h=b.target;if(f=m(h,n),!f.neverOn&&!f.alwaysOn){if(d=g(h),e(p,d[0],d[1],f,"highlighted"),f.groupBy){var i;i=/^[a-zA-Z][\-a-zA-Z]+$/.test(f.groupBy)?o.find("area["+f.groupBy+'="'+a(h).attr(f.groupBy)+'"]'):o.find(f.groupBy);var j=h;i.each(function(){if(this!=j){var a=m(this,n);if(!a.neverOn&&!a.alwaysOn){var b=g(this);e(p,b[0],b[1],a,"highlighted")}}})}c||a(p).append("")}}).bind("mouseout.maphilight, blur.maphilight",function(a){f(p)}),j.before(p),j.addClass("maphilighted")}})},a.fn.maphilight.defaults={fill:!0,fillColor:"000000",fillOpacity:.2,stroke:!0,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:!0,alwaysOn:!1,neverOn:!1,groupBy:!1,wrapClass:!0,shadow:!1,shadowX:0,shadowY:0,shadowRadius:6,shadowColor:"000000",shadowOpacity:.8,shadowPosition:"outside",shadowFrom:!1}}(jQuery); \ No newline at end of file