From c3f0ebd9679989d31c97d1e0c083f8e0fd8e043b Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 18 Oct 2011 23:06:34 +0100 Subject: [PATCH] Edit functions moved to a popup window --- application/controllers/qso.php | 11 ++++-- application/views/dashboard/index.php | 2 - application/views/layout/mini_footer.php | 2 + application/views/layout/mini_header.php | 17 +++++++++ application/views/messages/message.php | 33 ++++++++++++++++ application/views/qso/edit.php | 10 ++--- application/views/search/main.php | 48 +++++++++++++++++++++++- application/views/view_log/index.php | 15 +++++++- css/popup.css | 29 ++++++++++++++ 9 files changed, 153 insertions(+), 14 deletions(-) create mode 100644 application/views/layout/mini_footer.php create mode 100644 application/views/layout/mini_header.php create mode 100644 application/views/messages/message.php create mode 100644 css/popup.css diff --git a/application/controllers/qso.php b/application/controllers/qso.php index bff08aa2..ac3adfa2 100644 --- a/application/controllers/qso.php +++ b/application/controllers/qso.php @@ -74,15 +74,15 @@ class QSO extends CI_Controller { if ($this->form_validation->run() == FALSE) { - $this->load->view('layout/header'); + $this->load->view('layout/mini_header'); $this->load->view('qso/edit', $data); - $this->load->view('layout/footer'); + $this->load->view('layout/mini_footer'); } else { $this->logbook_model->edit(); $this->session->set_flashdata('notice', 'Record Updated'); - redirect('logbook'); + redirect('qso/edit/'.$this->input->post('id')); } } @@ -93,7 +93,10 @@ class QSO extends CI_Controller { $this->logbook_model->delete($id); $this->session->set_flashdata('notice', 'QSO Deleted Successfully'); - redirect('logbook'); + $data['message_title'] = "Deleted"; + $data['message_contents'] = "QSO Deleted Successfully"; + $this->load->view('messages/message', $data); + } diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index ffe09a76..43bfc33e 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -15,8 +15,6 @@ 'transitionOut' : 'fade', 'type' : 'iframe' }); - - }); diff --git a/application/views/layout/mini_footer.php b/application/views/layout/mini_footer.php new file mode 100644 index 00000000..691287b6 --- /dev/null +++ b/application/views/layout/mini_footer.php @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/application/views/layout/mini_header.php b/application/views/layout/mini_header.php new file mode 100644 index 00000000..7a875feb --- /dev/null +++ b/application/views/layout/mini_header.php @@ -0,0 +1,17 @@ + + + + Web Logbook + + + + + + + + + + + + \ No newline at end of file diff --git a/application/views/messages/message.php b/application/views/messages/message.php new file mode 100644 index 00000000..34314ed2 --- /dev/null +++ b/application/views/messages/message.php @@ -0,0 +1,33 @@ + + +<?php echo $message_title; ?> + + + +
+

+

+ + \ No newline at end of file diff --git a/application/views/qso/edit.php b/application/views/qso/edit.php index af0c832b..3b02c775 100644 --- a/application/views/qso/edit.php +++ b/application/views/qso/edit.php @@ -1,9 +1,9 @@ -

Add QSO

-
- -
-

Delete Delete QSO

+
+

Delete QSO Delete

+

Edit QSO

+
+
diff --git a/application/views/search/main.php b/application/views/search/main.php index 228f1c78..81dce9ef 100644 --- a/application/views/search/main.php +++ b/application/views/search/main.php @@ -14,9 +14,53 @@ i=0; $(document).ready(function(){ $("#callsign").keyup(function(){ if ($(this).val()) { - $('#partial_view').load("logbook/search_result/" + $(this).val()).fadeIn("slow"); + + $('#partial_view').load("logbook/search_result/" + $(this).val(), function() { + // after load trigger your fancybox + $(".editbox").fancybox({ + 'autoDimensions' : false, + 'width' : 700, + 'height' : 550, + 'transitionIn' : 'fade', + 'transitionOut' : 'fade', + 'type' : 'iframe', + }); + }); + } }); }); - \ No newline at end of file + + + + + + + + + \ No newline at end of file diff --git a/application/views/view_log/index.php b/application/views/view_log/index.php index 865e2e50..2fd7f415 100644 --- a/application/views/view_log/index.php +++ b/application/views/view_log/index.php @@ -14,6 +14,19 @@ 'transitionOut' : 'fade', 'type' : 'iframe' }); + + $(".editbox").fancybox({ + 'autoDimensions' : false, + 'width' : 700, + 'height' : 550, + 'transitionIn' : 'fade', + 'transitionOut' : 'fade', + 'type' : 'iframe', + onCleanup : function() { + return window.location.reload(); + } + }); + }); @@ -100,7 +113,7 @@ - diff --git a/css/popup.css b/css/popup.css new file mode 100644 index 00000000..a69a30f1 --- /dev/null +++ b/css/popup.css @@ -0,0 +1,29 @@ +body { font-size: 15px; font-family: Arial, "Trebuchet MS", sans-serif; } +pre { font-family: Courier New; font-size: 11px;} +h2 { margin: 0 auto; font-weight: bold; font-size: 23px; margin-top: 5px; margin-bottom: 10px; } +h3 { font-weight: bold; font-size: 16px; margin: 5px; margin-left: 0px; } +.clear { clear: both; } +.small { font-size: 9px; } +.error { color: #a00; } +p { line-height: 1.7; margin: 0px 0; } + +/* Tables */ +td { padding: 1px;} +.tr1 td { background:none repeat scroll 0 0 #F0FFFF; } +table .titles { font-weight: bold; } + +/* Content Area */ +.wrap_content { background-color: #ffffff; } + +/* Message boxes */ +#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; } +#message p { line-height: 1.7; margin: 0px 0; } + +/* Links */ +a { text-decoration: none; color: #000; } +a:hover { text-decoration: underline; } + +/* Tabs */ +#tabs { margin: 5px; } +.ui-widget-content { border: none; } +.ui-widget-header { background: none; border: none; border-bottom: 1px solid #DDD; } \ No newline at end of file
COL_BAND; ?> COL_COUNTRY; ?>config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>Edit + config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>Edit