From 19c28b2d51c68d51802b4a653d289a88a00b5d87 Mon Sep 17 00:00:00 2001 From: AndreaChirulescu Date: Sun, 25 Apr 2021 19:44:01 +0200 Subject: removed older icons. Added new ones created by me Modified returnuser function to not allow a user to assign multiple slots to themselves --- assets/images/checkedbox.png | Bin 6656 -> 0 bytes assets/images/checkedbox.png.license | 4 ---- assets/images/free.png | Bin 0 -> 432 bytes assets/images/free.png.license | 4 ++++ assets/images/notavail.png | Bin 0 -> 587 bytes assets/images/notavail.png.license | 4 ++++ assets/images/redicon.png | Bin 28599 -> 0 bytes assets/images/redicon.png.license | 4 ---- assets/images/yours.png | Bin 0 -> 1117 bytes assets/images/yours.png.license | 4 ++++ includes/admin/views/giglog_admin_page.php | 29 +++++++++++++---------------- includes/css/main.css | 26 ++++++++++++++++++++++++++ 12 files changed, 51 insertions(+), 24 deletions(-) delete mode 100644 assets/images/checkedbox.png delete mode 100644 assets/images/checkedbox.png.license create mode 100644 assets/images/free.png create mode 100644 assets/images/free.png.license create mode 100644 assets/images/notavail.png create mode 100644 assets/images/notavail.png.license delete mode 100644 assets/images/redicon.png delete mode 100644 assets/images/redicon.png.license create mode 100644 assets/images/yours.png create mode 100644 assets/images/yours.png.license diff --git a/assets/images/checkedbox.png b/assets/images/checkedbox.png deleted file mode 100644 index 7de92a0..0000000 Binary files a/assets/images/checkedbox.png and /dev/null differ diff --git a/assets/images/checkedbox.png.license b/assets/images/checkedbox.png.license deleted file mode 100644 index 2d950a1..0000000 --- a/assets/images/checkedbox.png.license +++ /dev/null @@ -1,4 +0,0 @@ -SPDX-FileCopyrightText: 2021 Andrea Chirulescu -SPDX-FileCopyrightText: 2021 Harald Eilertsen - -SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/images/free.png b/assets/images/free.png new file mode 100644 index 0000000..e929512 Binary files /dev/null and b/assets/images/free.png differ diff --git a/assets/images/free.png.license b/assets/images/free.png.license new file mode 100644 index 0000000..2d950a1 --- /dev/null +++ b/assets/images/free.png.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2021 Andrea Chirulescu +SPDX-FileCopyrightText: 2021 Harald Eilertsen + +SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/images/notavail.png b/assets/images/notavail.png new file mode 100644 index 0000000..bf02a69 Binary files /dev/null and b/assets/images/notavail.png differ diff --git a/assets/images/notavail.png.license b/assets/images/notavail.png.license new file mode 100644 index 0000000..2d950a1 --- /dev/null +++ b/assets/images/notavail.png.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2021 Andrea Chirulescu +SPDX-FileCopyrightText: 2021 Harald Eilertsen + +SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/images/redicon.png b/assets/images/redicon.png deleted file mode 100644 index 6366d17..0000000 Binary files a/assets/images/redicon.png and /dev/null differ diff --git a/assets/images/redicon.png.license b/assets/images/redicon.png.license deleted file mode 100644 index 2d950a1..0000000 --- a/assets/images/redicon.png.license +++ /dev/null @@ -1,4 +0,0 @@ -SPDX-FileCopyrightText: 2021 Andrea Chirulescu -SPDX-FileCopyrightText: 2021 Harald Eilertsen - -SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/images/yours.png b/assets/images/yours.png new file mode 100644 index 0000000..7dabfc6 Binary files /dev/null and b/assets/images/yours.png differ diff --git a/assets/images/yours.png.license b/assets/images/yours.png.license new file mode 100644 index 0000000..2d950a1 --- /dev/null +++ b/assets/images/yours.png.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2021 Andrea Chirulescu +SPDX-FileCopyrightText: 2021 Harald Eilertsen + +SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 3336fbd..72a34eb 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -422,22 +422,19 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { if (!empty($c)) { - - $vquery0 = "select wpgcl_".$p1." as assigneduser from wpg_concertlogs where wpgcl_concertid=".$c ; - $results = $wpdb->get_results($vquery0); - - foreach ( $results AS $row ) { - $x= $row -> assigneduser; - if ($x !='' and $x!=$hf_username) return ('Taken
Taken by '.$x.'
'); - else - if ($x==$hf_username) //if current user - return ('
-
'); - else //not taken by anyone - return ('
-
'); - - } + $sql = "select * from wpg_concertlogs where wpgcl_concertid=".$c; + $crow = $wpdb->get_results($sql); + $array = array('photo1' => $crow[0]->wpgcl_photo1, 'photo2'=> $crow[0]->wpgcl_photo2, 'rev1' => $crow[0]->wpgcl_rev1, 'rev2'=> $crow[0]->wpgcl_rev2); + + //first check if current slot is taken by current user + if ($array[$p1] == $hf_username) return ('
'); + else //check if slot is taken by another user + if (!empty($array[$p1])) return ('Taken
Taken by '.$array[$p1].'
'); + else //check if other slots for this concert are taken by user + if (in_array($hf_username,$array)) return ('-'); + else //not taken by anyone + return ('
+
'); } else return ('no concert selected'); diff --git a/includes/css/main.css b/includes/css/main.css index 3d26183..1cbc906 100644 --- a/includes/css/main.css +++ b/includes/css/main.css @@ -45,6 +45,32 @@ input[name="assignitem"] } +span.takenbyself +{ + + background: url('/wp-content/plugins/giglogadmin/assets/images/notavail.png'); + + display: block; + + border: none; + + font-size: small; + + padding: none; + + background-image: url('/wp-content/plugins/giglogadmin/assets/images/notavail.png'); + + background-repeat: no-repeat; + + background-size: 25px 25px; + + width: 25px; + + height: 25px; + + vertical-align: center; + +} .assignit { -- cgit v1.2.3