diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-05-31 03:39:24 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-05-31 03:39:24 +0300 |
| commit | d21f6ba14c8e15a5d0d44f82bea35c9e89eabbb9 (patch) | |
| tree | 74216f87c05181b0ac7a3c252d76a1160799dfc0 /public | |
| parent | 304613216a2dfa4701c50c08dcad1eddaf2919b9 (diff) | |
| download | gyraf1gov-d21f6ba14c8e15a5d0d44f82bea35c9e89eabbb9.tar.gz gyraf1gov-d21f6ba14c8e15a5d0d44f82bea35c9e89eabbb9.tar.bz2 gyraf1gov-d21f6ba14c8e15a5d0d44f82bea35c9e89eabbb9.zip | |
manage petitions; in progress
Diffstat (limited to 'public')
| -rw-r--r-- | public/app/controllers/Office.php | 32 | ||||
| -rw-r--r-- | public/app/models/Content_model.php | 17 | ||||
| -rw-r--r-- | public/app/routes/user.php | 19 | ||||
| -rw-r--r-- | public/app/views/components/own_petitions.php | 89 | ||||
| -rw-r--r-- | public/app/views/user/panel.php | 67 | ||||
| -rw-r--r-- | public/assets/css/class.css | 4 | ||||
| -rw-r--r-- | public/assets/css/overides.css | 60 |
7 files changed, 263 insertions, 25 deletions
diff --git a/public/app/controllers/Office.php b/public/app/controllers/Office.php index a876f6c..83135de 100644 --- a/public/app/controllers/Office.php +++ b/public/app/controllers/Office.php @@ -112,7 +112,6 @@ class Office { - ## ------------------------------------------------------------------------- ## PETITION FORMS ## secretarial support / serve forms for teachers' requests and applications ## ------------------------------------------------------------------------- @@ -265,11 +264,8 @@ class Office { - ## ------------------------------------------------------------------------- - ## - ## PETITION SUBMITS + ## PETITION SUBMIT ## handle submits of forms - ## ## ------------------------------------------------------------------------- @@ -309,11 +305,30 @@ class Office { + + ## LIST PETITIONS ## ------------------------------------------------------------------------- - ## + + + public static function user_petitions() + { + $manager = new App_manager(); // use APP Manager + // to get the requester's user_id + + $list = Content_model::user_petitions( + $manager->getUserToken()->getUser()->getID() // user-id + ); + + Render::json([ + 'success' => true, + 'data' => $list + ]); + } + + + ## TICKET METHODS (create, remove) ## tickets eliminate CSRF attacks - ## ## ------------------------------------------------------------------------- /** create_ticket @@ -369,10 +384,7 @@ class Office { - ## ------------------------------------------------------------------------- - ## ## ADMIN METHODS (insert, updated etc.) - ## ## ------------------------------------------------------------------------- diff --git a/public/app/models/Content_model.php b/public/app/models/Content_model.php index ea19165..2a79159 100644 --- a/public/app/models/Content_model.php +++ b/public/app/models/Content_model.php @@ -53,17 +53,30 @@ class Content_model { /** user petitions * - * get all petitions of a user + * get all petitions of a user; * * @param int $uid: user id * @return array petition records */ public static function user_petitions($uid) { - return Registry::use('database')->runQuery( + $list = Registry::use('database')->runQuery( "SELECT * FROM petition WHERE user_id = :uid", [ ':uid' => $uid ] ); + + $results = []; // re-format results + foreach($list as $key => $rec) { + $results[] = [ + 'id' => $rec['id'], + 'type_id' => $rec['type_id'], + 'subject' => $rec['subject'], + 'signature' => $rec['signature'], + 'protocol' => $rec['protocol'] ?? '', + 'form_structure' => unserialize($rec['form_structure']) + ]; + } + return $results; } diff --git a/public/app/routes/user.php b/public/app/routes/user.php index 12ca7d2..4a09801 100644 --- a/public/app/routes/user.php +++ b/public/app/routes/user.php @@ -88,19 +88,30 @@ if (Auth::is_connected()) { ]); }); - // file of petitions + // request PAGE list-my-petitions // --- -- -- - - - Route::add('/user/petitions', function() { - Render::view('admin/invite'); + Render::view('user/panel',[ + 'is_admin' => Auth::in_admin_group(), + 'content' => 'own_petitions', + 'user' => json_decode(json_encode( + Auth::user_data(), JSON_UNESCAPED_UNICODE + )) + ]); + }); + + // requst RESULTS list my petitions + Route::add('/user/get/petitions', function() { + Office::user_petitions(); }); - // request New petition form + // request NEW petition FORM // --- -- -- - - - Route::add('/petition/([0-9a-z\-_]*)', function($tag) { Office::request_petition($tag); }); - // request existing petition + // request EXISTING PETITION // --- -- -- - - - Route::add('/petition/signature/([0-9a-f]*)', function($signature) { Office::filter_request_petition($signature); diff --git a/public/app/views/components/own_petitions.php b/public/app/views/components/own_petitions.php new file mode 100644 index 0000000..8ea0f23 --- /dev/null +++ b/public/app/views/components/own_petitions.php @@ -0,0 +1,89 @@ + <!-- title bar --> + <div class="title-bar"> + <div><h5>Διαχείριση Αιτήσεων και Δοικητικών Εγγράφων</h5></div> + <div> + <!-- Button trigger modal --> + <a type="button" class="btn pull-right" href="/admin/edit_lesson"> + <i class="fas fa-plus"></i> Νέο Μάθημα + </a> + </div> +</div> + +<div class="manage"> + <div class="row"> + <div class="col-md-12"> + + <div id="petitions"> + + <table id="dt-petitions" class="table table-responsive dt-table" style="width:100%"> + <thead> + <!--<th class="dt-id">α/α</th>--> + <th class="dt-title">Τίτλος</th> + <th class="dt-protocol">Αρ.Πρωτόκολλου</th> + <th class="dt-signature">Signature</th> + <th class="dt-datepost">Ημερ. Καταχώρισης</th> + <th class="dt-actions"></th> + </thead> + </table> + + </div> + + </div> + </div> +</div><!-- /manage --> + + + + +<?php if ($is_admin) : ?> + +<!-- MODAL for set protocol number --> +<!-- NOTE: tabindex="-1" removed, ref:https://github.com/select2/select2-bootstrap-theme/issues/41 --> +<div class="modal fade" id="managePetition" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog modal-lg" role="document"> + <div class="modal-content"> + + <form method="post" action=""> + + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">Απόδωση αριθμού πρψτόκολλου</h4> + <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> + </div><!-- /modal-header --> + + <!-- modal-body --> + <div class="modal-body"> + + <div class="row form-group"> + <label class="control-label col-sm-12" for="protocol">Τίτλος</label> + <div class="col-sm-12"> + <input class="form-control form-control-sm" type="text" name="protocol" value="" required=""> + </div> + </div> + + <div class="row form-group"><!-- hiddens --> + <input type="hidden" name="id" value="0"><!-- petition-id --> + <input type="hidden" name="signature" value=""><!-- signature --> + </div> + + </div><!-- /modal body --> + + <div class="modal-footer"> + <div class="row" style="width: 50%;"> + <div class="form-actions"> + <div class="col-4"> + <button type="button" class="btn btn-default js-modal-close col-sm-12" data-bs-dismiss="modal">Κλείσιμο</button> + </div> + <div class="col-8"> + <button class="btn btn-success col-sm-12" type="submit">Καταχώριση</button> + </div> + </div> + </div> + </div><!-- /modal-footer --> + + </form><!-- /form --> + + </div> + </div> +</div> + +<?php endif; ?>
\ No newline at end of file diff --git a/public/app/views/user/panel.php b/public/app/views/user/panel.php index 01a3777..80f4071 100644 --- a/public/app/views/user/panel.php +++ b/public/app/views/user/panel.php @@ -55,13 +55,68 @@ </div> </div> -</body> -<!-- scripts - * handle show petition request +<?php if (($is_admin) && ($content == 'admin_petitions')) : ?> + + <!-- MODAL for set protocol number --> + <div class="modal fade" id="managePetition" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog modal-lg" role="document"> + <div class="modal-content"> + + <form method="post" action=""> + + <div class="modal-header"> + <h4 class="modal-title" id="myModalLabel">Ενημέρωση αριθμού πρωτόκολλου</h4> + <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> + </div><!-- /modal-header --> + + <!-- modal-body --> + <div class="modal-body"> + + <div class="row form-group"> + <label class="control-label col-sm-12" for="protocol">Τίτλος</label> + <div class="col-sm-12"> + <input class="form-control form-control-sm" type="text" name="protocol" value="" required=""> + </div> + </div> + + <div class="row form-group"><!-- hiddens --> + <input type="hidden" name="id" value="0"><!-- petition-id --> + <input type="hidden" name="signature" value=""><!-- signature --> + </div> + + </div><!-- /modal body --> + + <div class="modal-footer"> + <div class="row" style="width: 50%;"> + <div class="form-actions"> + <div class="col-4"> + <button type="button" class="btn btn-default js-modal-close col-sm-12" data-bs-dismiss="modal">Κλείσιμο</button> + </div> + <div class="col-8"> + <button class="btn btn-success col-sm-12" type="submit">Καταχώριση</button> + </div> + </div> + </div> + </div><!-- /modal-footer --> + + </form><!-- /form --> + + </div> + </div> + </div> + +<?php endif; ?> + + </body> + + + <!-- scripts + * handle show petition request + + if admin: + * modal + give protocol-number + --> - if admin: - * modal + give protocol-number ---> </html> diff --git a/public/assets/css/class.css b/public/assets/css/class.css index e016622..7fe88c7 100644 --- a/public/assets/css/class.css +++ b/public/assets/css/class.css @@ -38,7 +38,7 @@ --form-layer-bgr: #dddb; /* form layer background */ --select2-arrow-top: -1px; --background-image: url(/assets/media/spring-04.jpg); /* main background */ - --menu-hover-bgr: #def; + --menu-hover-bgr: #efefa6 /* <-- spring-04 ; default: #def */; } @@ -49,7 +49,7 @@ select, select option { font-weight: 400; font-size: 1rem; } -body { padding: 1em 0; background: var(--background-image); background-size: cover; } +body { padding: 0; background: var(--background-image); background-size: cover; } .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { font-weight: 400; }; diff --git a/public/assets/css/overides.css b/public/assets/css/overides.css index c3d1285..110b35b 100644 --- a/public/assets/css/overides.css +++ b/public/assets/css/overides.css @@ -206,6 +206,64 @@ ul.select2-selection__rendered { margin-bottom: 0; } /* select2: ul */ .central-form .content .info p { color: #334; } +/** cc photo sources +https://www.flickr.com/photos/31176607@N05/34285736050/ +https://www.flickr.com/photos/138748077@N02/45718622541/ +https://www.flickr.com/photos/ralf_wimmer/27036520782/ +https://www.flickr.com/photos/138748077@N02/34389004555/ +https://www.flickr.com/photos/85654079@N08/27486851781/ +https://www.flickr.com/photos/138748077@N02/25537545436/ +https://www.flickr.com/photos/usfwsmtnprairie/27843236814/ +https://www.flickr.com/photos/virtualwayfarer/33297675331/ +https://www.flickr.com/photos/dainismatisons/21671368390/ +https://www.flickr.com/photos/dainismatisons/30357980091/ +https://www.flickr.com/photos/virtualwayfarer/33297672771/ +https://www.flickr.com/photos/harquail/36634758421/ +https://www.flickr.com/photos/ky0ncheng/36263938554/ = PD +https://www.flickr.com/photos/felixcarlos/26204414328/ = PD +https://www.flickr.com/photos/skeyndor/33582112104/ = PD +https://www.flickr.com/photos/vlash/31130383278/ +https://www.flickr.com/photos/clickphotos310/37074201823/ +https://www.flickr.com/photos/fredericgombert/27794236359/ +https://www.flickr.com/photos/mgaloseau/17277356452/ +https://www.flickr.com/photos/17316292@N00/13695205855/ +https://www.flickr.com/photos/138748077@N02/26898426412/ +https://www.flickr.com/photos/kk_photographics/18709114915/ +https://www.flickr.com/photos/112072356@N06/14882252902/ + +https://www.flickr.com/photos/thomashawk/3408348383/ +https://www.flickr.com/photos/pedrobiondi/30834642176/ +https://www.flickr.com/photos/pedrobiondi/30238995904/ +https://www.flickr.com/photos/devcentre/806657950/ + +https://www.flickr.com/photos/145089467@N08/46658195125/ +https://www.flickr.com/photos/mara_earthlight/3590205222/ +https://www.flickr.com/photos/fdecomite/16806041639/ +https://www.flickr.com/photos/zivturner/3397599628/ +https://www.flickr.com/photos/docsearls/12114022885/ + +https://www.flickr.com/photos/rastone-freebies/44877503371/ ! +https://www.flickr.com/photos/fototexture/16647404351/ +https://www.flickr.com/photos/maheanuu/40844488773/ +https://www.flickr.com/photos/icstefanescu/29852682958/ +https://www.flickr.com/photos/eltsulolli/41797500361/ +https://www.flickr.com/photos/collisionconf/41115414074/ +https://www.flickr.com/photos/153317420@N04/40375386294/ + +https://www.flickr.com/photos/youngsabroad/26305344342/ ! +https://www.flickr.com/photos/138402863@N02/23445581921/ ! +https://www.flickr.com/photos/78423546@N06/43429924691/ = PD +https://www.flickr.com/photos/78423546@N06/42135640880/ = PD +https://www.flickr.com/photos/78423546@N06/52780304947/ = PD +https://www.flickr.com/photos/tomcollinsphoto/40178410432/ ! +https://www.flickr.com/photos/164417177@N06/44004978630/ ? +https://www.flickr.com/photos/94284791@N05/39229046194/ ! +https://www.flickr.com/photos/hoanghaithinh/45678059161/ +https://www.flickr.com/photos/mauritf/1949203617/ +https://www.flickr.com/photos/theqspeaks/16014303086/ ? +https://www.flickr.com/photos/twinxamot/3238897814/ ? +https://www.flickr.com/photos/ronduong/39336013514/ ! +https://www.flickr.com/photos/luzyamor/25301247527/ +https://www.flickr.com/photos/tomcollinsphoto/40178410432/ +https://www.flickr.com/photos/129030830@N02/37032688484/ +https://www.flickr.com/photos/drtonygeorge/1474585836/ ! +*/ /** themes * --- -- -- - - - @@ -218,7 +276,7 @@ ul.select2-selection__rendered { margin-bottom: 0; } /* select2: ul */ :root { --background-image: url(/assets/media/summer-05.jpg); --bs-heading-color: #132; - --menu-hover-bgr: #bbf0f4; + --menu-hover-bgr: #efefa6; } .central-form .content-form { background: #dddb; } .central-form .content-form { border: 1px solid #dddb } |
