summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/images/checkedbox.pngbin6656 -> 0 bytes
-rw-r--r--assets/images/free.pngbin0 -> 432 bytes
-rw-r--r--assets/images/free.png.license (renamed from assets/images/checkedbox.png.license)0
-rw-r--r--assets/images/notavail.pngbin0 -> 587 bytes
-rw-r--r--assets/images/notavail.png.license (renamed from assets/images/redicon.png.license)0
-rw-r--r--assets/images/redicon.pngbin28599 -> 0 bytes
-rw-r--r--assets/images/yours.pngbin0 -> 1117 bytes
-rw-r--r--assets/images/yours.png.license4
-rw-r--r--includes/admin/views/giglog_admin_page.php29
-rw-r--r--includes/css/main.css26
10 files changed, 43 insertions, 16 deletions
diff --git a/assets/images/checkedbox.png b/assets/images/checkedbox.png
deleted file mode 100644
index 7de92a0..0000000
--- a/assets/images/checkedbox.png
+++ /dev/null
Binary files differ
diff --git a/assets/images/free.png b/assets/images/free.png
new file mode 100644
index 0000000..e929512
--- /dev/null
+++ b/assets/images/free.png
Binary files differ
diff --git a/assets/images/checkedbox.png.license b/assets/images/free.png.license
index 2d950a1..2d950a1 100644
--- a/assets/images/checkedbox.png.license
+++ b/assets/images/free.png.license
diff --git a/assets/images/notavail.png b/assets/images/notavail.png
new file mode 100644
index 0000000..bf02a69
--- /dev/null
+++ b/assets/images/notavail.png
Binary files differ
diff --git a/assets/images/redicon.png.license b/assets/images/notavail.png.license
index 2d950a1..2d950a1 100644
--- a/assets/images/redicon.png.license
+++ b/assets/images/notavail.png.license
diff --git a/assets/images/redicon.png b/assets/images/redicon.png
deleted file mode 100644
index 6366d17..0000000
--- a/assets/images/redicon.png
+++ /dev/null
Binary files differ
diff --git a/assets/images/yours.png b/assets/images/yours.png
new file mode 100644
index 0000000..7dabfc6
--- /dev/null
+++ b/assets/images/yours.png
Binary files 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 <andrea.chirulescu@gmail.com>
+SPDX-FileCopyrightText: 2021 Harald Eilertsen <haraldei@anduin.net>
+
+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 ('<span class="takenby">Taken</span><div class="takenby">Taken by '.$x.'</div>');
- else
- if ($x==$hf_username) //if current user
- return ('<form class="unassignit" method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="unassignitem" value=""/>
- </form>');
- else //not taken by anyone
- return ('<form method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="assignitem" value=""/>
- </form>');
-
- }
+ $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 ('<form class="unassignit" method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="unassignitem" value="Your"/></form>');
+ else //check if slot is taken by another user
+ if (!empty($array[$p1])) return ('<span class="takenby">Taken</span><div class="takenby">Taken by '.$array[$p1].'</div>');
+ else //check if other slots for this concert are taken by user
+ if (in_array($hf_username,$array)) return ('<span class="taken_by_self">-</span>');
+ else //not taken by anyone
+ return ('<form method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="assignitem" value=""/>
+ </form>');
}
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
{