commit
ac9e019346
20 changed files with 2249 additions and 0 deletions
-
33.gitignore
-
308mvnw
-
205mvnw.cmd
-
69pom.xml
-
13src/main/java/com/community/hall/HallApplication.java
-
36src/main/java/com/community/hall/config/DBConnection.java
-
14src/main/java/com/community/hall/controller/CommunityController.java
-
164src/main/java/com/community/hall/controller/CommunityHallController.java
-
90src/main/java/com/community/hall/dto/HallRegistration.java
-
169src/main/java/com/community/hall/srervice/CommunityHallService.java
-
99src/main/java/com/community/hall/srervice/DataEntry.java
-
59src/main/java/com/community/hall/srervice/HallDto.java
-
38src/main/resources/application.properties
-
2src/main/resources/static/assets/js/lib/jquery.min.js
-
7src/main/resources/static/assets/js/lib/moment.min.js
-
BINsrc/main/resources/static/assets/media/images/Not-booked.png
-
BINsrc/main/resources/static/assets/media/images/booked.png
-
BINsrc/main/resources/static/assets/media/images/resgister.png
-
930src/main/resources/templates/communityhall.html
-
13src/test/java/com/community/hall/HallApplicationTests.java
@ -0,0 +1,33 @@ |
|||||
|
HELP.md |
||||
|
target/ |
||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||
|
!**/src/main/**/target/ |
||||
|
!**/src/test/**/target/ |
||||
|
|
||||
|
### STS ### |
||||
|
.apt_generated |
||||
|
.classpath |
||||
|
.factorypath |
||||
|
.project |
||||
|
.settings |
||||
|
.springBeans |
||||
|
.sts4-cache |
||||
|
|
||||
|
### IntelliJ IDEA ### |
||||
|
.idea |
||||
|
*.iws |
||||
|
*.iml |
||||
|
*.ipr |
||||
|
|
||||
|
### NetBeans ### |
||||
|
/nbproject/private/ |
||||
|
/nbbuild/ |
||||
|
/dist/ |
||||
|
/nbdist/ |
||||
|
/.nb-gradle/ |
||||
|
build/ |
||||
|
!**/src/main/**/build/ |
||||
|
!**/src/test/**/build/ |
||||
|
|
||||
|
### VS Code ### |
||||
|
.vscode/ |
||||
@ -0,0 +1,308 @@ |
|||||
|
#!/bin/sh |
||||
|
# ---------------------------------------------------------------------------- |
||||
|
# Licensed to the Apache Software Foundation (ASF) under one |
||||
|
# or more contributor license agreements. See the NOTICE file |
||||
|
# distributed with this work for additional information |
||||
|
# regarding copyright ownership. The ASF licenses this file |
||||
|
# to you under the Apache License, Version 2.0 (the |
||||
|
# "License"); you may not use this file except in compliance |
||||
|
# with the License. You may obtain a copy of the License at |
||||
|
# |
||||
|
# https://www.apache.org/licenses/LICENSE-2.0 |
||||
|
# |
||||
|
# Unless required by applicable law or agreed to in writing, |
||||
|
# software distributed under the License is distributed on an |
||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
|
# KIND, either express or implied. See the License for the |
||||
|
# specific language governing permissions and limitations |
||||
|
# under the License. |
||||
|
# ---------------------------------------------------------------------------- |
||||
|
|
||||
|
# ---------------------------------------------------------------------------- |
||||
|
# Apache Maven Wrapper startup batch script, version 3.2.0 |
||||
|
# |
||||
|
# Required ENV vars: |
||||
|
# ------------------ |
||||
|
# JAVA_HOME - location of a JDK home dir |
||||
|
# |
||||
|
# Optional ENV vars |
||||
|
# ----------------- |
||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven |
||||
|
# e.g. to debug Maven itself, use |
||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 |
||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files |
||||
|
# ---------------------------------------------------------------------------- |
||||
|
|
||||
|
if [ -z "$MAVEN_SKIP_RC" ] ; then |
||||
|
|
||||
|
if [ -f /usr/local/etc/mavenrc ] ; then |
||||
|
. /usr/local/etc/mavenrc |
||||
|
fi |
||||
|
|
||||
|
if [ -f /etc/mavenrc ] ; then |
||||
|
. /etc/mavenrc |
||||
|
fi |
||||
|
|
||||
|
if [ -f "$HOME/.mavenrc" ] ; then |
||||
|
. "$HOME/.mavenrc" |
||||
|
fi |
||||
|
|
||||
|
fi |
||||
|
|
||||
|
# OS specific support. $var _must_ be set to either true or false. |
||||
|
cygwin=false; |
||||
|
darwin=false; |
||||
|
mingw=false |
||||
|
case "$(uname)" in |
||||
|
CYGWIN*) cygwin=true ;; |
||||
|
MINGW*) mingw=true;; |
||||
|
Darwin*) darwin=true |
||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home |
||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html |
||||
|
if [ -z "$JAVA_HOME" ]; then |
||||
|
if [ -x "/usr/libexec/java_home" ]; then |
||||
|
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME |
||||
|
else |
||||
|
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME |
||||
|
fi |
||||
|
fi |
||||
|
;; |
||||
|
esac |
||||
|
|
||||
|
if [ -z "$JAVA_HOME" ] ; then |
||||
|
if [ -r /etc/gentoo-release ] ; then |
||||
|
JAVA_HOME=$(java-config --jre-home) |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched |
||||
|
if $cygwin ; then |
||||
|
[ -n "$JAVA_HOME" ] && |
||||
|
JAVA_HOME=$(cygpath --unix "$JAVA_HOME") |
||||
|
[ -n "$CLASSPATH" ] && |
||||
|
CLASSPATH=$(cygpath --path --unix "$CLASSPATH") |
||||
|
fi |
||||
|
|
||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched |
||||
|
if $mingw ; then |
||||
|
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && |
||||
|
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" |
||||
|
fi |
||||
|
|
||||
|
if [ -z "$JAVA_HOME" ]; then |
||||
|
javaExecutable="$(which javac)" |
||||
|
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then |
||||
|
# readlink(1) is not available as standard on Solaris 10. |
||||
|
readLink=$(which readlink) |
||||
|
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then |
||||
|
if $darwin ; then |
||||
|
javaHome="$(dirname "\"$javaExecutable\"")" |
||||
|
javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" |
||||
|
else |
||||
|
javaExecutable="$(readlink -f "\"$javaExecutable\"")" |
||||
|
fi |
||||
|
javaHome="$(dirname "\"$javaExecutable\"")" |
||||
|
javaHome=$(expr "$javaHome" : '\(.*\)/bin') |
||||
|
JAVA_HOME="$javaHome" |
||||
|
export JAVA_HOME |
||||
|
fi |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
if [ -z "$JAVACMD" ] ; then |
||||
|
if [ -n "$JAVA_HOME" ] ; then |
||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
||||
|
# IBM's JDK on AIX uses strange locations for the executables |
||||
|
JAVACMD="$JAVA_HOME/jre/sh/java" |
||||
|
else |
||||
|
JAVACMD="$JAVA_HOME/bin/java" |
||||
|
fi |
||||
|
else |
||||
|
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
if [ ! -x "$JAVACMD" ] ; then |
||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2 |
||||
|
echo " We cannot execute $JAVACMD" >&2 |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
if [ -z "$JAVA_HOME" ] ; then |
||||
|
echo "Warning: JAVA_HOME environment variable is not set." |
||||
|
fi |
||||
|
|
||||
|
# traverses directory structure from process work directory to filesystem root |
||||
|
# first directory with .mvn subdirectory is considered project base directory |
||||
|
find_maven_basedir() { |
||||
|
if [ -z "$1" ] |
||||
|
then |
||||
|
echo "Path not specified to find_maven_basedir" |
||||
|
return 1 |
||||
|
fi |
||||
|
|
||||
|
basedir="$1" |
||||
|
wdir="$1" |
||||
|
while [ "$wdir" != '/' ] ; do |
||||
|
if [ -d "$wdir"/.mvn ] ; then |
||||
|
basedir=$wdir |
||||
|
break |
||||
|
fi |
||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc) |
||||
|
if [ -d "${wdir}" ]; then |
||||
|
wdir=$(cd "$wdir/.." || exit 1; pwd) |
||||
|
fi |
||||
|
# end of workaround |
||||
|
done |
||||
|
printf '%s' "$(cd "$basedir" || exit 1; pwd)" |
||||
|
} |
||||
|
|
||||
|
# concatenates all lines of a file |
||||
|
concat_lines() { |
||||
|
if [ -f "$1" ]; then |
||||
|
# Remove \r in case we run on Windows within Git Bash |
||||
|
# and check out the repository with auto CRLF management |
||||
|
# enabled. Otherwise, we may read lines that are delimited with |
||||
|
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word |
||||
|
# splitting rules. |
||||
|
tr -s '\r\n' ' ' < "$1" |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
log() { |
||||
|
if [ "$MVNW_VERBOSE" = true ]; then |
||||
|
printf '%s\n' "$1" |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
BASE_DIR=$(find_maven_basedir "$(dirname "$0")") |
||||
|
if [ -z "$BASE_DIR" ]; then |
||||
|
exit 1; |
||||
|
fi |
||||
|
|
||||
|
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR |
||||
|
log "$MAVEN_PROJECTBASEDIR" |
||||
|
|
||||
|
########################################################################################## |
||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central |
||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data. |
||||
|
########################################################################################## |
||||
|
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" |
||||
|
if [ -r "$wrapperJarPath" ]; then |
||||
|
log "Found $wrapperJarPath" |
||||
|
else |
||||
|
log "Couldn't find $wrapperJarPath, downloading it ..." |
||||
|
|
||||
|
if [ -n "$MVNW_REPOURL" ]; then |
||||
|
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
||||
|
else |
||||
|
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
||||
|
fi |
||||
|
while IFS="=" read -r key value; do |
||||
|
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) |
||||
|
safeValue=$(echo "$value" | tr -d '\r') |
||||
|
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; |
||||
|
esac |
||||
|
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" |
||||
|
log "Downloading from: $wrapperUrl" |
||||
|
|
||||
|
if $cygwin; then |
||||
|
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") |
||||
|
fi |
||||
|
|
||||
|
if command -v wget > /dev/null; then |
||||
|
log "Found wget ... using wget" |
||||
|
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" |
||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
||||
|
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" |
||||
|
else |
||||
|
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" |
||||
|
fi |
||||
|
elif command -v curl > /dev/null; then |
||||
|
log "Found curl ... using curl" |
||||
|
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" |
||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
||||
|
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" |
||||
|
else |
||||
|
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" |
||||
|
fi |
||||
|
else |
||||
|
log "Falling back to using Java to download" |
||||
|
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" |
||||
|
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" |
||||
|
# For Cygwin, switch paths to Windows format before running javac |
||||
|
if $cygwin; then |
||||
|
javaSource=$(cygpath --path --windows "$javaSource") |
||||
|
javaClass=$(cygpath --path --windows "$javaClass") |
||||
|
fi |
||||
|
if [ -e "$javaSource" ]; then |
||||
|
if [ ! -e "$javaClass" ]; then |
||||
|
log " - Compiling MavenWrapperDownloader.java ..." |
||||
|
("$JAVA_HOME/bin/javac" "$javaSource") |
||||
|
fi |
||||
|
if [ -e "$javaClass" ]; then |
||||
|
log " - Running MavenWrapperDownloader.java ..." |
||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" |
||||
|
fi |
||||
|
fi |
||||
|
fi |
||||
|
fi |
||||
|
########################################################################################## |
||||
|
# End of extension |
||||
|
########################################################################################## |
||||
|
|
||||
|
# If specified, validate the SHA-256 sum of the Maven wrapper jar file |
||||
|
wrapperSha256Sum="" |
||||
|
while IFS="=" read -r key value; do |
||||
|
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; |
||||
|
esac |
||||
|
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" |
||||
|
if [ -n "$wrapperSha256Sum" ]; then |
||||
|
wrapperSha256Result=false |
||||
|
if command -v sha256sum > /dev/null; then |
||||
|
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then |
||||
|
wrapperSha256Result=true |
||||
|
fi |
||||
|
elif command -v shasum > /dev/null; then |
||||
|
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then |
||||
|
wrapperSha256Result=true |
||||
|
fi |
||||
|
else |
||||
|
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." |
||||
|
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." |
||||
|
exit 1 |
||||
|
fi |
||||
|
if [ $wrapperSha256Result = false ]; then |
||||
|
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 |
||||
|
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 |
||||
|
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 |
||||
|
exit 1 |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" |
||||
|
|
||||
|
# For Cygwin, switch paths to Windows format before running java |
||||
|
if $cygwin; then |
||||
|
[ -n "$JAVA_HOME" ] && |
||||
|
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") |
||||
|
[ -n "$CLASSPATH" ] && |
||||
|
CLASSPATH=$(cygpath --path --windows "$CLASSPATH") |
||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] && |
||||
|
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") |
||||
|
fi |
||||
|
|
||||
|
# Provide a "standardized" way to retrieve the CLI args that will |
||||
|
# work with both Windows and non-Windows executions. |
||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" |
||||
|
export MAVEN_CMD_LINE_ARGS |
||||
|
|
||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain |
||||
|
|
||||
|
# shellcheck disable=SC2086 # safe args |
||||
|
exec "$JAVACMD" \ |
||||
|
$MAVEN_OPTS \ |
||||
|
$MAVEN_DEBUG_OPTS \ |
||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ |
||||
|
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ |
||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" |
||||
@ -0,0 +1,205 @@ |
|||||
|
@REM ---------------------------------------------------------------------------- |
||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one |
||||
|
@REM or more contributor license agreements. See the NOTICE file |
||||
|
@REM distributed with this work for additional information |
||||
|
@REM regarding copyright ownership. The ASF licenses this file |
||||
|
@REM to you under the Apache License, Version 2.0 (the |
||||
|
@REM "License"); you may not use this file except in compliance |
||||
|
@REM with the License. You may obtain a copy of the License at |
||||
|
@REM |
||||
|
@REM https://www.apache.org/licenses/LICENSE-2.0 |
||||
|
@REM |
||||
|
@REM Unless required by applicable law or agreed to in writing, |
||||
|
@REM software distributed under the License is distributed on an |
||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
||||
|
@REM KIND, either express or implied. See the License for the |
||||
|
@REM specific language governing permissions and limitations |
||||
|
@REM under the License. |
||||
|
@REM ---------------------------------------------------------------------------- |
||||
|
|
||||
|
@REM ---------------------------------------------------------------------------- |
||||
|
@REM Apache Maven Wrapper startup batch script, version 3.2.0 |
||||
|
@REM |
||||
|
@REM Required ENV vars: |
||||
|
@REM JAVA_HOME - location of a JDK home dir |
||||
|
@REM |
||||
|
@REM Optional ENV vars |
||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands |
||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending |
||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven |
||||
|
@REM e.g. to debug Maven itself, use |
||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 |
||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files |
||||
|
@REM ---------------------------------------------------------------------------- |
||||
|
|
||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' |
||||
|
@echo off |
||||
|
@REM set title of command window |
||||
|
title %0 |
||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' |
||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% |
||||
|
|
||||
|
@REM set %HOME% to equivalent of $HOME |
||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") |
||||
|
|
||||
|
@REM Execute a user defined script before this one |
||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre |
||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending |
||||
|
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* |
||||
|
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* |
||||
|
:skipRcPre |
||||
|
|
||||
|
@setlocal |
||||
|
|
||||
|
set ERROR_CODE=0 |
||||
|
|
||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal |
||||
|
@setlocal |
||||
|
|
||||
|
@REM ==== START VALIDATION ==== |
||||
|
if not "%JAVA_HOME%" == "" goto OkJHome |
||||
|
|
||||
|
echo. |
||||
|
echo Error: JAVA_HOME not found in your environment. >&2 |
||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2 |
||||
|
echo location of your Java installation. >&2 |
||||
|
echo. |
||||
|
goto error |
||||
|
|
||||
|
:OkJHome |
||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init |
||||
|
|
||||
|
echo. |
||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2 |
||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2 |
||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2 |
||||
|
echo location of your Java installation. >&2 |
||||
|
echo. |
||||
|
goto error |
||||
|
|
||||
|
@REM ==== END VALIDATION ==== |
||||
|
|
||||
|
:init |
||||
|
|
||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". |
||||
|
@REM Fallback to current working directory if not found. |
||||
|
|
||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% |
||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir |
||||
|
|
||||
|
set EXEC_DIR=%CD% |
||||
|
set WDIR=%EXEC_DIR% |
||||
|
:findBaseDir |
||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound |
||||
|
cd .. |
||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound |
||||
|
set WDIR=%CD% |
||||
|
goto findBaseDir |
||||
|
|
||||
|
:baseDirFound |
||||
|
set MAVEN_PROJECTBASEDIR=%WDIR% |
||||
|
cd "%EXEC_DIR%" |
||||
|
goto endDetectBaseDir |
||||
|
|
||||
|
:baseDirNotFound |
||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR% |
||||
|
cd "%EXEC_DIR%" |
||||
|
|
||||
|
:endDetectBaseDir |
||||
|
|
||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig |
||||
|
|
||||
|
@setlocal EnableExtensions EnableDelayedExpansion |
||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a |
||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% |
||||
|
|
||||
|
:endReadAdditionalConfig |
||||
|
|
||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" |
||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" |
||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain |
||||
|
|
||||
|
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
||||
|
|
||||
|
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( |
||||
|
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B |
||||
|
) |
||||
|
|
||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central |
||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data. |
||||
|
if exist %WRAPPER_JAR% ( |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Found %WRAPPER_JAR% |
||||
|
) |
||||
|
) else ( |
||||
|
if not "%MVNW_REPOURL%" == "" ( |
||||
|
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
||||
|
) |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ... |
||||
|
echo Downloading from: %WRAPPER_URL% |
||||
|
) |
||||
|
|
||||
|
powershell -Command "&{"^ |
||||
|
"$webclient = new-object System.Net.WebClient;"^ |
||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ |
||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ |
||||
|
"}"^ |
||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ |
||||
|
"}" |
||||
|
if "%MVNW_VERBOSE%" == "true" ( |
||||
|
echo Finished downloading %WRAPPER_JAR% |
||||
|
) |
||||
|
) |
||||
|
@REM End of extension |
||||
|
|
||||
|
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file |
||||
|
SET WRAPPER_SHA_256_SUM="" |
||||
|
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( |
||||
|
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B |
||||
|
) |
||||
|
IF NOT %WRAPPER_SHA_256_SUM%=="" ( |
||||
|
powershell -Command "&{"^ |
||||
|
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ |
||||
|
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ |
||||
|
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ |
||||
|
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ |
||||
|
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ |
||||
|
" exit 1;"^ |
||||
|
"}"^ |
||||
|
"}" |
||||
|
if ERRORLEVEL 1 goto error |
||||
|
) |
||||
|
|
||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will |
||||
|
@REM work with both Windows and non-Windows executions. |
||||
|
set MAVEN_CMD_LINE_ARGS=%* |
||||
|
|
||||
|
%MAVEN_JAVA_EXE% ^ |
||||
|
%JVM_CONFIG_MAVEN_PROPS% ^ |
||||
|
%MAVEN_OPTS% ^ |
||||
|
%MAVEN_DEBUG_OPTS% ^ |
||||
|
-classpath %WRAPPER_JAR% ^ |
||||
|
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ |
||||
|
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* |
||||
|
if ERRORLEVEL 1 goto error |
||||
|
goto end |
||||
|
|
||||
|
:error |
||||
|
set ERROR_CODE=1 |
||||
|
|
||||
|
:end |
||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE% |
||||
|
|
||||
|
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost |
||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending |
||||
|
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" |
||||
|
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" |
||||
|
:skipRcPost |
||||
|
|
||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' |
||||
|
if "%MAVEN_BATCH_PAUSE%"=="on" pause |
||||
|
|
||||
|
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% |
||||
|
|
||||
|
cmd /C exit /B %ERROR_CODE% |
||||
@ -0,0 +1,69 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
<parent> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-parent</artifactId> |
||||
|
<version>3.1.5</version> |
||||
|
<relativePath/> <!-- lookup parent from repository --> |
||||
|
</parent> |
||||
|
<groupId>com.community</groupId> |
||||
|
<artifactId>hall</artifactId> |
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
<name>hall</name> |
||||
|
<description>Demo project for Spring Boot</description> |
||||
|
<properties> |
||||
|
<java.version>17</java.version> |
||||
|
</properties> |
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-thymeleaf</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.oracle.database.jdbc</groupId> |
||||
|
<artifactId>ojdbc8</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-devtools</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.mysql</groupId> |
||||
|
<artifactId>mysql-connector-j</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||
|
<scope>test</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
<configuration> |
||||
|
<image> |
||||
|
<builder>paketobuildpacks/builder-jammy-base:latest</builder> |
||||
|
</image> |
||||
|
</configuration> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.community.hall; |
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
|
||||
|
@SpringBootApplication |
||||
|
public class HallApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(HallApplication.class, args); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.community.hall.config; |
||||
|
|
||||
|
import java.sql.Connection; |
||||
|
import java.sql.DriverManager; |
||||
|
import java.sql.SQLException; |
||||
|
|
||||
|
public class DBConnection { |
||||
|
private static Connection dbcon; |
||||
|
|
||||
|
static String l_sErpUrl = "jdbc:oracle:thin:@10.1.0.14:1521:chncorp"; |
||||
|
static String l_sErpdriver = "oracle.jdbc.driver.OracleDriver"; |
||||
|
|
||||
|
public static Connection getConnection() { |
||||
|
try { |
||||
|
if(dbcon==null) { |
||||
|
Class.forName(l_sErpdriver); |
||||
|
Connection erp_conn = DriverManager.getConnection(l_sErpUrl,"coc","coc"); |
||||
|
System.out.println("erp_conn Con :"+ erp_conn ); |
||||
|
System.out.println("erp_conn Con "); |
||||
|
dbcon=erp_conn; |
||||
|
return erp_conn; |
||||
|
} |
||||
|
else { |
||||
|
return dbcon; |
||||
|
} |
||||
|
|
||||
|
} catch (ClassNotFoundException e) { |
||||
|
e.printStackTrace(); |
||||
|
//throw new SqlExcaptionClass("Sql"); |
||||
|
} catch (SQLException e) { |
||||
|
e.printStackTrace(); |
||||
|
|
||||
|
} |
||||
|
return dbcon; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package com.community.hall.controller; |
||||
|
|
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
@Controller |
||||
|
public class CommunityController { |
||||
|
@RequestMapping("/") |
||||
|
public String getmypage(){ |
||||
|
return "communityhall"; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,164 @@ |
|||||
|
package com.community.hall.controller; |
||||
|
|
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.*; |
||||
|
|
||||
|
import com.community.hall.dto.HallRegistration; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import com.community.hall.srervice.CommunityHallService; |
||||
|
|
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("/Community/api") |
||||
|
public class CommunityHallController { |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private CommunityHallService communityHallService; |
||||
|
|
||||
|
// @RequestMapping(value = "/division", method = RequestMethod.GET) |
||||
|
// public List<?> getDivision(@RequestParam String zone) { |
||||
|
// communityHallService.setZone(zone); |
||||
|
// return communityHallService.getList("zone"); |
||||
|
// } |
||||
|
|
||||
|
@RequestMapping(value = "/getHall", method = RequestMethod.GET) |
||||
|
public List<?> getSelectCommunityHallByZone(@RequestParam String zone) { |
||||
|
communityHallService.setZone(zone); |
||||
|
return communityHallService.getList("communityHall"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "/getHallById", method = RequestMethod.GET) |
||||
|
public List<?> getSelectCommunityHall(@RequestParam String hallId) { |
||||
|
communityHallService.setHallId(hallId); |
||||
|
return communityHallService.getList("hallId"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "/getHallByName", method = RequestMethod.GET) |
||||
|
public List<?> getSelectCommunityHallName(@RequestParam String hallName) { |
||||
|
communityHallService.setHallName(hallName); |
||||
|
return communityHallService.getList("hallName"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "/getHallByMonthAndYear", method = RequestMethod.GET) |
||||
|
public List<?> getCommunityHallByMonthAndYear(@RequestParam String hallId, @RequestParam String fromDay, @RequestParam String toDay) { |
||||
|
communityHallService.setHallId(hallId); |
||||
|
communityHallService.setFromDay(fromDay); |
||||
|
communityHallService.setToDay(toDay); |
||||
|
System.out.println(fromDay+"..."+toDay); |
||||
|
List<HallRegistration> hall = communityHallService.getHallRegistration("MonthAndYear"); |
||||
|
if(hall==null||hall.isEmpty()) { |
||||
|
return null; |
||||
|
} |
||||
|
else{ |
||||
|
List<ResultEntry> output = processInputData(hall); |
||||
|
Collections.sort(output, Comparator.comparing(ResultEntry::getDate)); |
||||
|
return output; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "/getHallByBookingStatus", method = RequestMethod.GET) |
||||
|
public List<?> getSelectCommunityHallIdBookingStatus(@RequestParam String hallId) { |
||||
|
communityHallService.setHallId(hallId); |
||||
|
return communityHallService.getList("BookingStatus"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
private static List<ResultEntry> processInputData(List<HallRegistration> data) { |
||||
|
Map<String, ResultEntry> outputMap = new HashMap<>(); |
||||
|
|
||||
|
for (HallRegistration entry : data) { |
||||
|
String date1 = extractDate(entry.getDATE1()); |
||||
|
String date2 = extractDate(entry.getDATE2()); |
||||
|
String date3 = extractDate(entry.getDATE3()); |
||||
|
|
||||
|
// Add entries to the map, combining if the date already exists |
||||
|
addToOutputMap(outputMap, date1,Integer.parseInt(entry.getMORNINGHALF1()) , Integer.parseInt(entry.getEVENINGHALF1())); |
||||
|
addToOutputMap(outputMap, date2,Integer.parseInt(entry.getMORNINGHALF2()),Integer.parseInt(entry.getEVENINGHALF2())); |
||||
|
addToOutputMap(outputMap, date3, Integer.parseInt(entry.getMORNINGHALF3()), Integer.parseInt(entry.getEVENINGHALF3())); |
||||
|
} |
||||
|
|
||||
|
return new ArrayList<>(outputMap.values()); |
||||
|
} |
||||
|
|
||||
|
private static String extractDate (String dateString){ |
||||
|
if (dateString != null) { |
||||
|
try { |
||||
|
return new SimpleDateFormat("dd").format(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(dateString)); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
/* |
||||
|
* |
||||
|
* Combine morningHalf and eveningHalf if the date already exists |
||||
|
* |
||||
|
* */ |
||||
|
private static void addToOutputMap(Map<String, ResultEntry> outputMap, String date, int morningHalf, int eveningHalf) { |
||||
|
if (date != null) { |
||||
|
ResultEntry existingEntry = outputMap.get(date); |
||||
|
if (existingEntry != null) { |
||||
|
|
||||
|
existingEntry.setMorningHalf(existingEntry.getMorningHalf() + morningHalf); |
||||
|
existingEntry.setEveningHalf(existingEntry.getEveningHalf() + eveningHalf); |
||||
|
} else { |
||||
|
// Add a new entry to the map if the date does not exist |
||||
|
outputMap.put(date, new ResultEntry(date, morningHalf, eveningHalf)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
class ResultEntry { |
||||
|
private String date; |
||||
|
private int morningHalf; |
||||
|
private int eveningHalf; |
||||
|
|
||||
|
public ResultEntry(String date, int morningHalf, int eveningHalf) { |
||||
|
this.date = date; |
||||
|
this.morningHalf = morningHalf; |
||||
|
this.eveningHalf = eveningHalf; |
||||
|
} |
||||
|
|
||||
|
public String getDate() { |
||||
|
return date; |
||||
|
} |
||||
|
|
||||
|
public int getMorningHalf() { |
||||
|
return morningHalf; |
||||
|
} |
||||
|
|
||||
|
public int getEveningHalf() { |
||||
|
return eveningHalf; |
||||
|
} |
||||
|
|
||||
|
public void setMorningHalf(int morningHalf) { |
||||
|
this.morningHalf = morningHalf; |
||||
|
} |
||||
|
|
||||
|
public void setEveningHalf(int eveningHalf) { |
||||
|
this.eveningHalf = eveningHalf; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return "{" + date + ",{" + morningHalf + "," + eveningHalf + "}}"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
@ -0,0 +1,90 @@ |
|||||
|
package com.community.hall.dto; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
@Component |
||||
|
public class HallRegistration { |
||||
|
private String MORNINGHALF1; |
||||
|
private String EVENINGHALF1; |
||||
|
private String MORNINGHALF2; |
||||
|
private String EVENINGHALF2; |
||||
|
private String MORNINGHALF3; |
||||
|
private String EVENINGHALF3; |
||||
|
|
||||
|
private String DATE3; |
||||
|
private String DATE2; |
||||
|
private String DATE1; |
||||
|
|
||||
|
public String getMORNINGHALF1() { |
||||
|
return MORNINGHALF1; |
||||
|
} |
||||
|
|
||||
|
public void setMORNINGHALF1(String MORNINGHALF1) { |
||||
|
this.MORNINGHALF1 = MORNINGHALF1; |
||||
|
} |
||||
|
|
||||
|
public String getEVENINGHALF1() { |
||||
|
return EVENINGHALF1; |
||||
|
} |
||||
|
|
||||
|
public void setEVENINGHALF1(String EVENINGHALF1) { |
||||
|
this.EVENINGHALF1 = EVENINGHALF1; |
||||
|
} |
||||
|
|
||||
|
public String getMORNINGHALF2() { |
||||
|
return MORNINGHALF2; |
||||
|
} |
||||
|
|
||||
|
public void setMORNINGHALF2(String MORNINGHALF2) { |
||||
|
this.MORNINGHALF2 = MORNINGHALF2; |
||||
|
} |
||||
|
|
||||
|
public String getEVENINGHALF2() { |
||||
|
return EVENINGHALF2; |
||||
|
} |
||||
|
|
||||
|
public void setEVENINGHALF2(String EVENINGHALF2) { |
||||
|
this.EVENINGHALF2 = EVENINGHALF2; |
||||
|
} |
||||
|
|
||||
|
public String getMORNINGHALF3() { |
||||
|
return MORNINGHALF3; |
||||
|
} |
||||
|
|
||||
|
public void setMORNINGHALF3(String MORNINGHALF3) { |
||||
|
this.MORNINGHALF3 = MORNINGHALF3; |
||||
|
} |
||||
|
|
||||
|
public String getEVENINGHALF3() { |
||||
|
return EVENINGHALF3; |
||||
|
} |
||||
|
|
||||
|
public void setEVENINGHALF3(String EVENINGHALF3) { |
||||
|
this.EVENINGHALF3 = EVENINGHALF3; |
||||
|
} |
||||
|
|
||||
|
public String getDATE3() { |
||||
|
return DATE3; |
||||
|
} |
||||
|
|
||||
|
public void setDATE3(String DATE3) { |
||||
|
this.DATE3 = DATE3; |
||||
|
} |
||||
|
|
||||
|
public String getDATE2() { |
||||
|
return DATE2; |
||||
|
} |
||||
|
|
||||
|
public void setDATE2(String DATE2) { |
||||
|
this.DATE2 = DATE2; |
||||
|
} |
||||
|
|
||||
|
public String getDATE1() { |
||||
|
return DATE1; |
||||
|
} |
||||
|
|
||||
|
public void setDATE1(String DATE1) { |
||||
|
this.DATE1 = DATE1; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,169 @@ |
|||||
|
package com.community.hall.srervice; |
||||
|
|
||||
|
import java.sql.Connection; |
||||
|
import java.sql.ResultSet; |
||||
|
import java.sql.ResultSetMetaData; |
||||
|
import java.sql.Statement; |
||||
|
import java.util.*; |
||||
|
|
||||
|
import com.community.hall.config.DBConnection; |
||||
|
import com.community.hall.dto.HallRegistration; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
|
||||
|
@Service |
||||
|
public class CommunityHallService extends HallDto{ |
||||
|
|
||||
|
|
||||
|
|
||||
|
public String getDivi(String zone) { |
||||
|
return "select * from tbl_online_division where zone_id ="+zone+" order by divison_id "; |
||||
|
} |
||||
|
|
||||
|
public String getSelectCommunityHall(String zone) { |
||||
|
return "select * from tbl_communityhall Where COMMUNITYHALLZONEID ="+zone; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String getSelectCommunityHallName(String hallName) { |
||||
|
return "select * from tbl_communityhall Where COMMUNITYHALLADDRESS LIKE '"+hallName+"%'"; |
||||
|
} |
||||
|
|
||||
|
public String getSelectCommunityHallRegistration(String hallId, String fromDay ,String toDay){ |
||||
|
return "SELECT COMMUNITYHALLID, DATE1, MORNINGHALF1, EVENINGHALF1, DATE2, MORNINGHALF2, EVENINGHALF2, DATE3, MORNINGHALF3, EVENINGHALF3" + |
||||
|
" FROM TBL_COMMUNITYHALLREGISTRATION WHERE COMMUNITYHALLID = "+hallId+" AND (DATE1 BETWEEN TO_DATE('"+fromDay+"','YYYY-MM-DD') AND TO_DATE('"+toDay+"','YYYY-MM-DD'))"; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public String getSelectCommunityHallId(String hallId) { |
||||
|
return "SELECT communityhallhalfdayrate, communityhallhalfsurcharge," + |
||||
|
" nvl(CLEAN_CHRG_HALF,0)+nvl(PA_SYS_HALF,0)+nvl(EB_HALF,0) pa_eb_half," + |
||||
|
" round((nvl(CLEAN_CHRG_HALF,0)+nvl(PA_SYS_HALF,0)+nvl(EB_HALF,0))*18/100,0) pa_eb_serv_half," + |
||||
|
" communityhalldeposit, communityhallcapacity, communityhalladvance,evemorn_twodaysamount," + |
||||
|
" communityhallfulldayrate," + |
||||
|
" nvl(CLEAN_CHRG_FULL,0) +nvl(PA_SYS_FULL,0)+nvl(EB_FULL,0) pa_eb_full ," + |
||||
|
" round((nvl(CLEAN_CHRG_FULL,0) +nvl(PA_SYS_FULL,0)+nvl(EB_FULL,0))*18/100,0) pa_eb_serv_full," + |
||||
|
" SOUND_SERVICE_AMT,VESSEL_AMT,OTHER_AMT FROM coc.tbl_communityhall where communityhallid=" + hallId; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public List<Map<String, Object>> getList(String type){ |
||||
|
Connection con =DBConnection.getConnection(); |
||||
|
Statement stmt3; |
||||
|
try { |
||||
|
System.out.println(getQuery(type)); |
||||
|
stmt3 = con.createStatement(); |
||||
|
ResultSet rs3 = stmt3.executeQuery(getQuery(type)); |
||||
|
List<Map<String, Object>> rows = new ArrayList<>(); |
||||
|
if ( rows.isEmpty() && rs3==null) { |
||||
|
return rows; |
||||
|
} |
||||
|
while (rs3.next()) { |
||||
|
Map<String, Object> row = new HashMap<>(); |
||||
|
|
||||
|
ResultSetMetaData metaData = rs3.getMetaData(); |
||||
|
int columnCount = metaData.getColumnCount(); |
||||
|
|
||||
|
for (int i = 1; i <= columnCount; i++) { |
||||
|
String columnName = metaData.getColumnName(i); |
||||
|
Object columnValue = rs3.getObject(i); |
||||
|
row.put(columnName, columnValue); |
||||
|
} |
||||
|
|
||||
|
// Add the row to the List |
||||
|
rows.add(row); |
||||
|
} |
||||
|
return rows; |
||||
|
} |
||||
|
catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public String getQuery(String type){ |
||||
|
if(type.equals("zone")){ |
||||
|
return getDivi(getZone()); |
||||
|
} |
||||
|
else if(type.equals("communityHall")){ |
||||
|
return getSelectCommunityHall(getZone()); |
||||
|
} |
||||
|
else if(type.equals("hallId")){ |
||||
|
return getSelectCommunityHallId(getHallId()); |
||||
|
} |
||||
|
else if(type.equals("hallName")){ |
||||
|
return getSelectCommunityHallName(getHallName()); |
||||
|
}else if(type.equals("BookingStatus")){ |
||||
|
return getSelectCommunityHallId(getHallId()); |
||||
|
}else if(type.equals("MonthAndYear")){ |
||||
|
return getSelectCommunityHallRegistration(getHallId(), getFromDay(),getToDay()); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
public List<HallRegistration> getHallRegistration(String type){ |
||||
|
Connection con =DBConnection.getConnection(); |
||||
|
Statement stmt3; |
||||
|
try { |
||||
|
System.out.println(getQuery(type)); |
||||
|
stmt3 = con.createStatement(); |
||||
|
ResultSet rs3 = stmt3.executeQuery(getQuery(type)); |
||||
|
List<HallRegistration> rows = new ArrayList<>(); |
||||
|
if (rs3==null) { |
||||
|
return rows; |
||||
|
} |
||||
|
while (rs3.next()) { |
||||
|
HallRegistration row = new HallRegistration(); |
||||
|
|
||||
|
ResultSetMetaData metaData = rs3.getMetaData(); |
||||
|
int columnCount = metaData.getColumnCount(); |
||||
|
|
||||
|
for (int i = 1; i <= columnCount; i++) { |
||||
|
String columnName = metaData.getColumnName(i); |
||||
|
Object columnValue = rs3.getObject(i); |
||||
|
|
||||
|
switch (columnName) { |
||||
|
case "MORNINGHALF1": |
||||
|
row.setMORNINGHALF1(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "MORNINGHALF2": |
||||
|
row.setMORNINGHALF2(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "MORNINGHALF3": |
||||
|
row.setMORNINGHALF3(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "EVENINGHALF1": |
||||
|
row.setEVENINGHALF1(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "EVENINGHALF2": |
||||
|
row.setEVENINGHALF2(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "EVENINGHALF3": |
||||
|
row.setEVENINGHALF3(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "DATE1": |
||||
|
row.setDATE1(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "DATE2": |
||||
|
row.setDATE2(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
case "DATE3": |
||||
|
row.setDATE3(columnValue!=null?columnValue.toString():null); |
||||
|
break; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
rows.add(row); |
||||
|
} |
||||
|
return rows; |
||||
|
} |
||||
|
catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,99 @@ |
|||||
|
package com.community.hall.srervice; |
||||
|
|
||||
|
public class DataEntry { |
||||
|
private String date1; |
||||
|
private int morningHalf1; |
||||
|
private int eveningHalf1; |
||||
|
private String date2; |
||||
|
private int morningHalf2; |
||||
|
private int eveningHalf2; |
||||
|
private String date3; |
||||
|
private int morningHalf3; |
||||
|
private int eveningHalf3; |
||||
|
|
||||
|
public DataEntry(String date1, int morningHalf1, int eveningHalf1, |
||||
|
String date2, int morningHalf2, int eveningHalf2, |
||||
|
String date3, int morningHalf3, int eveningHalf3) { |
||||
|
this.date1 = date1; |
||||
|
this.morningHalf1 = morningHalf1; |
||||
|
this.eveningHalf1 = eveningHalf1; |
||||
|
this.date2 = date2; |
||||
|
this.morningHalf2 = morningHalf2; |
||||
|
this.eveningHalf2 = eveningHalf2; |
||||
|
this.date3 = date3; |
||||
|
this.morningHalf3 = morningHalf3; |
||||
|
this.eveningHalf3 = eveningHalf3; |
||||
|
} |
||||
|
|
||||
|
public String getDate1() { |
||||
|
return date1; |
||||
|
} |
||||
|
|
||||
|
public void setDate1(String date1) { |
||||
|
this.date1 = date1; |
||||
|
} |
||||
|
|
||||
|
public int getMorningHalf1() { |
||||
|
return morningHalf1; |
||||
|
} |
||||
|
|
||||
|
public void setMorningHalf1(int morningHalf1) { |
||||
|
this.morningHalf1 = morningHalf1; |
||||
|
} |
||||
|
|
||||
|
public int getEveningHalf1() { |
||||
|
return eveningHalf1; |
||||
|
} |
||||
|
|
||||
|
public void setEveningHalf1(int eveningHalf1) { |
||||
|
this.eveningHalf1 = eveningHalf1; |
||||
|
} |
||||
|
|
||||
|
public String getDate2() { |
||||
|
return date2; |
||||
|
} |
||||
|
|
||||
|
public void setDate2(String date2) { |
||||
|
this.date2 = date2; |
||||
|
} |
||||
|
|
||||
|
public int getMorningHalf2() { |
||||
|
return morningHalf2; |
||||
|
} |
||||
|
|
||||
|
public void setMorningHalf2(int morningHalf2) { |
||||
|
this.morningHalf2 = morningHalf2; |
||||
|
} |
||||
|
|
||||
|
public int getEveningHalf2() { |
||||
|
return eveningHalf2; |
||||
|
} |
||||
|
|
||||
|
public void setEveningHalf2(int eveningHalf2) { |
||||
|
this.eveningHalf2 = eveningHalf2; |
||||
|
} |
||||
|
|
||||
|
public String getDate3() { |
||||
|
return date3; |
||||
|
} |
||||
|
|
||||
|
public void setDate3(String date3) { |
||||
|
this.date3 = date3; |
||||
|
} |
||||
|
|
||||
|
public int getMorningHalf3() { |
||||
|
return morningHalf3; |
||||
|
} |
||||
|
|
||||
|
public void setMorningHalf3(int morningHalf3) { |
||||
|
this.morningHalf3 = morningHalf3; |
||||
|
} |
||||
|
|
||||
|
public int getEveningHalf3() { |
||||
|
return eveningHalf3; |
||||
|
} |
||||
|
|
||||
|
public void setEveningHalf3(int eveningHalf3) { |
||||
|
this.eveningHalf3 = eveningHalf3; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,59 @@ |
|||||
|
package com.community.hall.srervice; |
||||
|
|
||||
|
public class HallDto { |
||||
|
private String zone; |
||||
|
private String division; |
||||
|
private String hallId; |
||||
|
private String toDay; |
||||
|
private String fromDay; |
||||
|
|
||||
|
private String hallName; |
||||
|
|
||||
|
public String getHallName() { |
||||
|
return hallName; |
||||
|
} |
||||
|
|
||||
|
public void setHallName(String hallName) { |
||||
|
this.hallName = hallName; |
||||
|
} |
||||
|
|
||||
|
public String getZone() { |
||||
|
return zone; |
||||
|
} |
||||
|
|
||||
|
public void setZone(String zone) { |
||||
|
this.zone = zone; |
||||
|
} |
||||
|
|
||||
|
public String getDivision() { |
||||
|
return division; |
||||
|
} |
||||
|
|
||||
|
public void setDivision(String division) { |
||||
|
this.division = division; |
||||
|
} |
||||
|
|
||||
|
public String getHallId() { |
||||
|
return hallId; |
||||
|
} |
||||
|
|
||||
|
public void setHallId(String hallId) { |
||||
|
this.hallId = hallId; |
||||
|
} |
||||
|
|
||||
|
public String getToDay() { |
||||
|
return toDay; |
||||
|
} |
||||
|
|
||||
|
public void setToDay(String toDay) { |
||||
|
this.toDay = toDay; |
||||
|
} |
||||
|
|
||||
|
public String getFromDay() { |
||||
|
return fromDay; |
||||
|
} |
||||
|
|
||||
|
public void setFromDay(String fromDay) { |
||||
|
this.fromDay = fromDay; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
|
||||
|
#Database connection properties |
||||
|
spring.datasource.url=jdbc:mysql://localhost:3306/community |
||||
|
#spring.datasource.url=jdbc:mysql://localhost:3306/mcc |
||||
|
spring.datasource.username=root |
||||
|
spring.datasource.password=root |
||||
|
#spring.datasource.password=gccroot |
||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
||||
|
|
||||
|
server.port=8067 |
||||
|
|
||||
|
|
||||
|
#Hibernate auto ddl |
||||
|
spring.jpa.hibernate.ddl-auto=update |
||||
|
spring.jackson.serialization.fail-on-empty-beans=false |
||||
|
# |
||||
|
|
||||
|
|
||||
|
|
||||
|
#app.getOtpUrl=https://api.onex-aura.com/api/sms? |
||||
|
app.getOtpUrl=https://tmegov.onex-aura.com/api/sms? |
||||
|
app.erpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice? |
||||
|
#Hibernate |
||||
|
|
||||
|
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect |
||||
|
spring.profiles.active=dev |
||||
|
|
||||
|
#fileHanding |
||||
|
file.upload.directory=${user.dir}/project_uploadDirectory |
||||
|
|
||||
|
server.address=0.0.0.0 |
||||
|
file.fullpath=http://localhost:8068 |
||||
|
#file.fullpath=http://117.232.67.158:8067 |
||||
|
|
||||
|
logging.level.org.hibernate.type=TRACE |
||||
|
logging.level.org.hibernate.SQL=DEBUG |
||||
|
logging.level.org.hibernate.orm.jdbc.bind=TRACE |
||||
|
logging.level.org.hibernate.type.descriptor.sql=TRACE |
||||
2
src/main/resources/static/assets/js/lib/jquery.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
7
src/main/resources/static/assets/js/lib/moment.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
|
After Width: 20 | Height: 20 | Size: 731 B |
|
After Width: 20 | Height: 20 | Size: 298 B |
|
After Width: 20 | Height: 20 | Size: 321 B |
@ -0,0 +1,930 @@ |
|||||
|
<!doctype html> |
||||
|
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html"> |
||||
|
|
||||
|
|
||||
|
<head> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
|
|
||||
|
<meta charset="UTF-8"> |
||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" |
||||
|
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous"> |
||||
|
<script src="assets/js/lib/jquery.min.js"></script> |
||||
|
|
||||
|
|
||||
|
<title>Community Hall Availability</title> |
||||
|
|
||||
|
<style> |
||||
|
body { |
||||
|
background-color: #f8f9fa; |
||||
|
} |
||||
|
|
||||
|
.card { |
||||
|
border-radius: 15px; |
||||
|
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
|
||||
|
.community-hall-title { |
||||
|
color: #007bff; |
||||
|
} |
||||
|
|
||||
|
/* Add your custom styles here */ |
||||
|
|
||||
|
@media (max-width: 576px) { |
||||
|
|
||||
|
/* Small devices (576px and down) */ |
||||
|
.community-hall-title { |
||||
|
font-size: 1.5rem; |
||||
|
} |
||||
|
} |
||||
|
.custom-select { |
||||
|
position: relative; |
||||
|
display: inline-block; |
||||
|
} |
||||
|
|
||||
|
.custom-select select { |
||||
|
appearance: none; |
||||
|
-webkit-appearance: none; |
||||
|
-moz-appearance: none; |
||||
|
padding: 8px; |
||||
|
border: 1px solid #ccc; |
||||
|
border-radius: 4px; |
||||
|
width: 200px; /* Adjust the width as needed */ |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
|
||||
|
.custom-select:after { |
||||
|
content: '\25BC'; /* Unicode character for down arrow */ |
||||
|
position: absolute; |
||||
|
top: 50%; |
||||
|
right: 10px; |
||||
|
transform: translateY(-50%); |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
<div class="container mt-3"> |
||||
|
<div class="card"> |
||||
|
<div class="card-body"> |
||||
|
<form> |
||||
|
<h3 class="community-hall-title-sub">Select Your Community Hall:</h3> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-6 " id="zoneSection"> |
||||
|
<label class="form-label" for="zone">Select Zone<span class="text-danger">*</span></label> |
||||
|
|
||||
|
<select class="form-control text-center" name="zone" id="zone" onchange="getdivision()" required> |
||||
|
<option value="0">....Select zone.... </option> |
||||
|
|
||||
|
<option value="01">01_Thiruvottyur </option> |
||||
|
<option value="02">02-Manali</option> |
||||
|
<option value="03">03-Madhavaram</option> |
||||
|
<option value="04">04-Tondiarpet</option> |
||||
|
<option value="05">05-Royapuram</option> |
||||
|
<option value="06">06-Thiru-vi-ka</option> |
||||
|
<option value="07">07-Ambttur</option> |
||||
|
<option value="08">08-Anna Nagar</option> |
||||
|
<option value="09">09-teynampet</option> |
||||
|
<option value="10">10-Kodambakkam</option> |
||||
|
<option value="11">11-Valasaravakkam</option> |
||||
|
<option value="12">12-Alandaur</option> |
||||
|
<option value="13">13-Adyar</option> |
||||
|
<option value="14">14-perungudi</option> |
||||
|
<option value="15">15-Sholiganallur</option> |
||||
|
|
||||
|
</select> |
||||
|
</div> |
||||
|
<div class="col-12 col-md-6" > |
||||
|
|
||||
|
<label for="divs" class="form-label">Division</label> |
||||
|
<select id="divs" name="divs" class="form-control text-center" onchange="getHall()" required> |
||||
|
<option value="01">....select division....</option> |
||||
|
<!-- Your options go here --> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row mt-3"> |
||||
|
<div class="col-12 col-md-6" id="divisionSection"> |
||||
|
|
||||
|
<label for="hall" class="form-label"> Community Hall *</label> |
||||
|
<select id="hall" name="hall" class="form-control text-center" onchange="changediv()" required> |
||||
|
<option value="">Select Community Hall *:</option> |
||||
|
<!-- Your options go here --> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<div class="row mt-3"> |
||||
|
<div class="col-12"> |
||||
|
<label class="form-label">Select month and Year *</label> |
||||
|
<select id="month" class="form-control text-center" size="1" tabindex="2" required> |
||||
|
<option value="">....Select Month....</option> |
||||
|
<option value="1">January </option> |
||||
|
<option value="2">February</option> |
||||
|
<option value="3">March</option> |
||||
|
<option value="4">April</option> |
||||
|
<option value="5">May</option> |
||||
|
<option value="6">June</option> |
||||
|
<option value="7">July</option> |
||||
|
<option value="8">August</option> |
||||
|
<option value="9">September</option> |
||||
|
<option value="10">October</option> |
||||
|
<option value="11">November</option> |
||||
|
<option value="12">December</option> |
||||
|
</select> |
||||
|
<br> |
||||
|
|
||||
|
<select id="sel_year" class="form-control text-center" size="1" tabindex="3" required> |
||||
|
<option value="">.....Select Year...</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<br> |
||||
|
<div class="row mt-3 justify-content-end"> |
||||
|
<div class="col-12"> |
||||
|
<a class="nav-link" href="/assets/media/images/Community_Centers_list.pdf" |
||||
|
target="Gcc-Community Centers"> List Of Community Centres - Details Of Rent, Gst And |
||||
|
Security Deposit </a> |
||||
|
<input type="button" value="Check" onclick="chk_code()" name="B1" tabindex="5" |
||||
|
class="btn btn-primary" id="Button1" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div id="DETAILS" style="display: none;"> |
||||
|
<div class="row"> |
||||
|
<div class="col-12"> |
||||
|
<div id="legend1" class="textContent"> |
||||
|
<p> |
||||
|
<img src="/assets/media/images/booked.png"> - Blocked, |
||||
|
<img src="/assets/media/images/Not-booked.png"> - Not Booked, |
||||
|
<img src="/assets/media/images/resgister.png"> - Registered, |
||||
|
<input class="avail-date-icon" type="checkbox" disabled=""> - Available<br> |
||||
|
Mor - Morning, Eve - Evening<br><br> |
||||
|
For a full day, select both "Mor" (Morning slot) and "Eve" (Evening Slot). |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="col-12"> |
||||
|
<div align="center" id="" class="table-responsive"> |
||||
|
<table width="80%" border="0" cellpadding="4" cellspacing="0" class="tableBorder"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">1</font> |
||||
|
</b><br> |
||||
|
<input type="checkbox" id="morningHalf01" name="chkbox2m30" class="checkbox"> |
||||
|
<input type="checkbox" id="eveningHalf01" name="chkbox2e30"class="checkbox"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">2</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf02" name="chkbox2m30" class="checkbox"> <input |
||||
|
type="checkbox" id="eveningHalf02" name="chkbox2e30" class="checkbox"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">3</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf03" name="chkbox3m30" class="checkbox"> <input |
||||
|
type="checkbox" id="eveningHalf03" name="chkbox3e30" class="checkbox"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">4</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf04" name="chkbox4m30" class="checkbox"> <input |
||||
|
type="checkbox" id="eveningHalf04" name="chkbox4e30" class="checkbox"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">5</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf05" name="chkbox5m30" class="checkbox"> <input |
||||
|
type="checkbox" id="eveningHalf05" name="chkbox5e30" ><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">6</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf06" name="chkbox6m30"> <input |
||||
|
type="checkbox" id="eveningHalf06" name="chkbox6e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">7</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf07" name="chkbox7m30"> <input |
||||
|
type="checkbox" id="eveningHalf07" name="chkbox7e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">8</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf08" name="chkbox8m30"> <input |
||||
|
type="checkbox" id="eveningHalf08" name="chkbox8e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">9</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf09" name="chkbox9m30"> <input |
||||
|
type="checkbox" id="eveningHalf09" name="chkbox9e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">10</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf10" name="chkbox10m30"> <input |
||||
|
type="checkbox" id="eveningHalf10" name="chkbox10e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">11</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf11" name="chkbox11m30"> <input |
||||
|
type="checkbox" id="eveningHalf11" name="chkbox11e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">12</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf12" name="chkbox12m30"> <input |
||||
|
type="checkbox" id="eveningHalf12" name="chkbox12e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
|
||||
|
|
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">13</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf13" name="chkbox13m30"> <input |
||||
|
type="checkbox" id="eveningHalf13" name="chkbox13e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">14</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf14" name="chkbox14m30"> <input |
||||
|
type="checkbox" id="eveningHalf14" name="chkbox14e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">15</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf15" name="chkbox15m30"> <input |
||||
|
type="checkbox" id="eveningHalf15" name="chkbox15e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">16</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf16" name="chkbox16m30"> <input |
||||
|
type="checkbox" id="eveningHalf16" name="chkbox16e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">17</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf17" name="chkbox17m30"> <input |
||||
|
type="checkbox" id="eveningHalf17" name="chkbox17e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">18</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf18" name="chkbox18m30"> <input |
||||
|
type="checkbox" id="eveningHalf18" name="chkbox18e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">19</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf19" name="chkbox19m30"> <input |
||||
|
type="checkbox" id="eveningHalf19" name="chkbox19e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">20</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf20" name="chkbox20m30"> <input |
||||
|
type="checkbox" id="eveningHalf20" name="chkbox20e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">21</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf21" name="chkbox21m30"> |
||||
|
<input type="checkbox" id="eveningHalf21" name="chkbox21e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">22</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf22" name="chkbo22m30"> <input |
||||
|
type="checkbox" id="eveningHalf22" name="chkbox22e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">23</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf23" name="chkbox23m30"> <input |
||||
|
type="checkbox" id="eveningHalf23" name="chkbox23e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">24</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf24" name="chkbox24m30"> <input |
||||
|
type="checkbox" id="eveningHalf24" name="chkbox24e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">25</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf25" name="chkbox25m30"> <input |
||||
|
type="checkbox" id="eveningHalf25" name="chkbox25e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">26</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf26" name="chkbox26m30"> <input |
||||
|
type="checkbox" id="eveningHalf26" name="chkbox26e30"><br>Mor Eve </div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">27</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf27" name="chkbox27m30"> <input |
||||
|
type="checkbox" id="eveningHalf27" name="chkbox27e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tableRow" width="20%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">28</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf28" name="chkbox28m30"> <input |
||||
|
type="checkbox" id="eveningHalf28" name="chkbox28e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="40%" id="row29"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">29</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf29" name="chkbox29m30"> <input |
||||
|
type="checkbox" id="eveningHalf29" name="chkbox29e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="tableRow" width="40%" id="row30"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">30</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf30" name="chkbox30m30"> <input |
||||
|
type="checkbox" id="eveningHalf30" name="chkbox30e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</tr> |
||||
|
<tr id="row31"> |
||||
|
<td class="tableRow" width="40%"> |
||||
|
<div align="center"> |
||||
|
<b> |
||||
|
<font size="3+">31</font> |
||||
|
</b><br><input type="checkbox" id="morningHalf31" name="chkbox31m30"> <input |
||||
|
type="checkbox" id="eveningHalf31" name="chkbox31e30"><br>Mor Eve |
||||
|
</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
|
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
<!-- Your table with checkboxes goes here --> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="col-12"> |
||||
|
<div align="center" id="availTab" class="table-responsive"> |
||||
|
<table class="table tableBorder"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td align="left" valign="top" class="tableRow"><strong>Community Hall Details |
||||
|
</strong> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td align="right" valign="top" class="tableRow"> |
||||
|
<table border="0" cellpadding="4" cellspacing="0"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td width="23%">HALF DAY RATE</td> |
||||
|
<td width="30%">: |
||||
|
<input type="text" name="halfdayamt" id="halfdayamt" class="bgListTextArea" readonly="true" size="12" fdprocessedid="tekels" value="800.0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td width="18%">SURCHARGES</td> |
||||
|
<td width="29%">: |
||||
|
<input type="text" name="halfdaysurcharge" id="halfdaysurcharge" |
||||
|
class="bgListTextArea" readonly="true" size="12" |
||||
|
fdprocessedid="2nghg"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>FULL DAY RATE</td> |
||||
|
<td>: |
||||
|
<input type="text" name="fulldayamt" id="fulldayamt" |
||||
|
class="bgListTextArea" readonly="true" size="12" |
||||
|
fdprocessedid="vinum" value="1500.0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>SURCHARGES</td> |
||||
|
<td>: |
||||
|
<input type="text" name="fulldaysurcharge" id="fulldaysurcharge" |
||||
|
class="bgListTextArea" readonly="true" size="12" |
||||
|
fdprocessedid="6uydm9"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>ADVANCE</td> |
||||
|
<td>: |
||||
|
<input type="text" name="advanceamt" id="advanceamt" |
||||
|
class="bgListTextArea" readonly="true" size="12" |
||||
|
fdprocessedid="7799zc" value="0.0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>DEPOSIT</td> |
||||
|
<td>: |
||||
|
<input type="text" name="depositeamt" id="depositeamt" |
||||
|
class="bgListTextArea" readonly="true" size="12" |
||||
|
fdprocessedid="td0q6q" value="1500.0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>CAPACITY</td> |
||||
|
<td>: |
||||
|
<input name="capacity" type="text" id="capacity" class="bgListTextArea" |
||||
|
size="12" readonly="true" fdprocessedid="esnsa9" |
||||
|
value="300 Seats"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>RENTAL</td> |
||||
|
<td>:<input name="rental" type="text" id="rental" class="bgListTextArea" |
||||
|
size="12" readonly="true" fdprocessedid="2o3ddc" value="0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>GST</td> |
||||
|
<td>: |
||||
|
<input name="servicetax" type="text" class="bgListTextArea" |
||||
|
size="12" readonly="true" fdprocessedid="1ba8jj" value="0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> </td> |
||||
|
<td> </td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>FULL DAY EB , CLEANING AND PA SYSTEM CHARGES</td> |
||||
|
<td>: |
||||
|
<input name="eb_pa_full_amt" id="eb_pa_full_amt" type="text" |
||||
|
class="bgListTextArea" size="12" readonly="true" |
||||
|
fdprocessedid="gbcxpd" value="0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> GST</td> |
||||
|
<td> <input name="eb_pa_full_serv" id="eb_pa_full_serv" |
||||
|
type="text" class="bgListTextArea" size="12" readonly="true" |
||||
|
fdprocessedid="ujdozo" value="0"></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>HALF DAY EB , CLEANING AND PA SYSTEM CHARGES</td> |
||||
|
<td>: |
||||
|
<input name="eb_pa_half_amt" id="eb_pa_half_amt" type="text" |
||||
|
class="bgListTextArea" size="12" readonly="true" |
||||
|
fdprocessedid="i7hpg" value="0"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> GST</td> |
||||
|
<td> <input name="eb_pa_halft_serv" id="eb_pa_halft_serv" |
||||
|
type="text" class="bgListTextArea" size="12" readonly="true" |
||||
|
fdprocessedid="0tnm04" value="0"></td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
</form> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
|
||||
|
function chk_code() { |
||||
|
// var z = document.getElementById("zone").value; |
||||
|
var h =document.getElementById("hall").value; |
||||
|
var y =document.getElementById("sel_year").value; |
||||
|
var m =document.getElementById("month").value; |
||||
|
var len = m.length; |
||||
|
var ld=getDaysInMonth(y,m); |
||||
|
if(len<2){ |
||||
|
m="0"+m; |
||||
|
} |
||||
|
var fromdate = y+"-"+m+"-01"; |
||||
|
var todate = y+"-"+m+"-"+ld; |
||||
|
$.ajax({ |
||||
|
url: '/Community/api/getHallByMonthAndYear', // Replace with the actual URL to retrieve division data |
||||
|
method: 'GET', |
||||
|
data: { |
||||
|
hallId:h, |
||||
|
fromDay: fromdate , |
||||
|
toDay: todate, |
||||
|
}, |
||||
|
success: function (data) { |
||||
|
setCalendarStatus(data); |
||||
|
displayCheckboxes(ld); |
||||
|
}, |
||||
|
error: function (error) { |
||||
|
} |
||||
|
}); |
||||
|
document.getElementById("DETAILS").style.display = "block"; |
||||
|
} |
||||
|
|
||||
|
function setCalendarStatus(data) { |
||||
|
console.log(data); |
||||
|
|
||||
|
// Create an object to store status information |
||||
|
var statusInformation = {}; |
||||
|
|
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
var currentDate = data[i].date; |
||||
|
var morningHalfValue = data[i].morningHalf; |
||||
|
var eveningHalfValue = data[i].eveningHalf; |
||||
|
console.log(data[i].date); |
||||
|
|
||||
|
// Set the status for morningHalf |
||||
|
var morningHalfCheckbox = document.getElementById("morningHalf" + currentDate); |
||||
|
morningHalfCheckbox.checked = morningHalfValue === 1; |
||||
|
morningHalfCheckbox.disabled = morningHalfValue === 1; |
||||
|
|
||||
|
// Set the status for eveningHalf |
||||
|
var eveningHalfCheckbox = document.getElementById("eveningHalf" + currentDate); |
||||
|
eveningHalfCheckbox.checked = eveningHalfValue === 1; |
||||
|
eveningHalfCheckbox.disabled = eveningHalfValue === 1; |
||||
|
|
||||
|
// Store the status information in the object |
||||
|
statusInformation[currentDate] = { |
||||
|
morningHalf: morningHalfValue, |
||||
|
eveningHalf: eveningHalfValue |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
console.log(statusInformation); |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
function getDaysInMonth(year, month) { |
||||
|
// Adjust the month to be 0-based if your calendar starts with December |
||||
|
const adjustedMonth = (month + 11) % 12; |
||||
|
|
||||
|
const isLeap = (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0); |
||||
|
const daysInMonth = new Date(year, adjustedMonth + 1, 0).getDate(); |
||||
|
|
||||
|
if (adjustedMonth === 1 && isLeap) { |
||||
|
return 29; // February has 29 days in a leap year |
||||
|
} else { |
||||
|
return daysInMonth; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function populateYears() { |
||||
|
var currentYear = new Date().getFullYear(); |
||||
|
var string=""; |
||||
|
for (let i=0;i<2;i++) { |
||||
|
string = string + "<option value=" + currentYear + ">" + currentYear + "</option>"; |
||||
|
currentYear=currentYear+1; |
||||
|
} |
||||
|
document.getElementById("sel_year").innerHTML = string; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// Call the functions to populate months and years |
||||
|
populateYears(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
function getdivision(zone) { |
||||
|
var z = document.getElementById("zone").value; |
||||
|
$.ajax({ |
||||
|
url: '/Community/api/getHall', // Replace with the actual URL to retrieve division data |
||||
|
method: 'GET', |
||||
|
data: { zone: z }, |
||||
|
success: function (data) { |
||||
|
setDivisionAndHall(data) |
||||
|
}, |
||||
|
error: function (error) { |
||||
|
console.error('Error fetching division data:', error); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
var hallIndex=0; |
||||
|
var hallInfo; |
||||
|
function setDivisionAndHall(data) { |
||||
|
var string = ""; |
||||
|
hallInfo=data; |
||||
|
console.log(data); |
||||
|
for (let i = 0; i < data.length; i++) { |
||||
|
|
||||
|
string = string + "<option value=" + data[i].COMMUNITYHALLDIVID + ">" + data[i].COMMUNITYHALLDIVID + "</option>"; |
||||
|
} |
||||
|
document.getElementById("divs").innerHTML = string; |
||||
|
|
||||
|
var hallName = ""; |
||||
|
for (let i = 0; i < data.length; i++) { |
||||
|
|
||||
|
hallName = hallName + "<option value=" + data[i].COMMUNITYHALLCODE + ">" + data[i].COMMUNITYHALLPLACE + "</option>"; |
||||
|
} |
||||
|
document.getElementById("hall").innerHTML = hallName; |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
function getHall() { |
||||
|
var z = document.getElementById("zone").value; |
||||
|
var d = document.getElementById("divs").value; |
||||
|
for(let i=0;i<hallInfo.length;i++){ |
||||
|
if(hallInfo[i].COMMUNITYHALLDIVID==d) |
||||
|
{ |
||||
|
document.getElementById("hall").value=hallInfo[i].COMMUNITYHALLCODE; |
||||
|
setHallAmount(i); |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function changediv() { |
||||
|
var hallValue = document.getElementById("hall").value; |
||||
|
for (let i = 0; i <hallInfo.length; i++) { |
||||
|
if (hallInfo[i].COMMUNITYHALLCODE == hallValue) { |
||||
|
document.getElementById("divs").value = hallInfo[i].COMMUNITYHALLDIVID; |
||||
|
setHallAmount(i); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
var count = 0; |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
var lastClickedIndex = null; |
||||
|
|
||||
|
$(":checkbox").click(function () { |
||||
|
if (!$(this).is(':disabled')) { |
||||
|
var currentIndex = $(":checkbox:enabled").index(this); |
||||
|
|
||||
|
if ($(this).prop("checked")) { |
||||
|
count++; |
||||
|
} else { |
||||
|
count--; |
||||
|
|
||||
|
// Show popup when a checkbox is unchecked |
||||
|
showRemoveConfirmation(currentIndex); |
||||
|
} |
||||
|
|
||||
|
IncrementOrDecHallAmt(); |
||||
|
|
||||
|
if (lastClickedIndex === null || isConsecutive(currentIndex, lastClickedIndex)) { |
||||
|
if ($(":checkbox:checked:enabled").length > 14) { |
||||
|
alert("You can only select checkboxes in sequence."); |
||||
|
$(this).prop("checked", false); |
||||
|
} else { |
||||
|
lastClickedIndex = currentIndex; |
||||
|
} |
||||
|
} else { |
||||
|
alert("Please select checkboxes in sequences of 14 Days."); |
||||
|
$(this).prop("checked", false); |
||||
|
|
||||
|
if (count > 0) { |
||||
|
count--; |
||||
|
IncrementOrDecHallAmt(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
function isConsecutive(currentIndex, lastClickedIndex) { |
||||
|
return Math.abs(currentIndex - lastClickedIndex) === 1; |
||||
|
} |
||||
|
|
||||
|
function showRemoveConfirmation(currentIndex) { |
||||
|
if (confirm("Do you want to remove this checkbox and uncheck subsequent checkboxes?")) { |
||||
|
// Uncheck subsequent checkboxes |
||||
|
$(":checkbox:enabled:gt(" + currentIndex + "):checked").prop("checked", false); |
||||
|
|
||||
|
// Enable previous checkboxes to be unchecked |
||||
|
$(":checkbox:enabled:lt(" + currentIndex + ")").prop("disabled", false); |
||||
|
} else { |
||||
|
// Revert the checkbox state to checked if the user cancels the removal |
||||
|
$(":checkbox:enabled:eq(" + currentIndex + ")").prop("checked", true); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
function setHallAmount(i){ |
||||
|
if (hallInfo && hallInfo.length > i && hallInfo[i]){ |
||||
|
let fa =hallInfo[i].COMMUNITYHALLFULLDAYRATE; |
||||
|
let ha =hallInfo[i].COMMUNITYHALLHALFDAYRATE; |
||||
|
let fs =hallInfo[i].COMMUNITYHALLFULLSURCHARGE; |
||||
|
let hs =hallInfo[i].COMMUNITYHALLHALFSURCHARGE; |
||||
|
let hd =hallInfo[i].COMMUNITYHALLDEPOSIT; |
||||
|
let had =hallInfo[i].COMMUNITYHALLADVANCE; |
||||
|
let hc =hallInfo[i].COMMUNITYHALLCAPACITY; |
||||
|
let eb =hallInfo[i].EB_FULL; |
||||
|
let eh =hallInfo[i].EB_HALF; |
||||
|
let cf =hallInfo[i].CLEAN_CHRG_FULL; |
||||
|
let ch =hallInfo[i].CLEAN_CHRG_HALF; |
||||
|
let r =hallInfo[i].COMMUNITYHALLHALFDAYRATE; |
||||
|
|
||||
|
document.getElementById("fulldayamt").value=fa; |
||||
|
document.getElementById("halfdayamt").value=ha; |
||||
|
document.getElementById("fulldaysurcharge").value=fs; |
||||
|
document.getElementById("halfdaysurcharge").value=fs; |
||||
|
document.getElementById("depositeamt").value=hd; |
||||
|
document.getElementById("advanceamt").value=had; |
||||
|
document.getElementById("capacity").value=hc; |
||||
|
document.getElementById("eb_pa_full_amt").value=eb; |
||||
|
document.getElementById("eb_pa_half_amt").value=eh; |
||||
|
document.getElementById("eb_pa_full_serv").value=cf; |
||||
|
document.getElementById("eb_pa_halft_serv").value=ch; |
||||
|
document.getElementById("rental").value=r; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
else { |
||||
|
console.error("Invalid hallInfo or currentIndex: ", hallInfo, i); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
function IncrementOrDecHallAmt() { |
||||
|
let l = hallInfo[hallIndex].COMMUNITYHALLFULLSURCHARGE; |
||||
|
let f = hallInfo[hallIndex].COMMUNITYHALLFULLDAYRATE; |
||||
|
let m = hallInfo[hallIndex].COMMUNITYHALLHALFDAYRATE; |
||||
|
let n = hallInfo[hallIndex].COMMUNITYHALLHALFSURCHARGE; |
||||
|
if (count > 0 && count % 2 === 0) { |
||||
|
// Count is even and greater than 0 |
||||
|
document.getElementById("fulldayamt").value = f * (count / 2); |
||||
|
document.getElementById("halfdayamt").value = m * (count / 2); |
||||
|
document.getElementById("fulldaysurcharge").value = l * (count / 2); |
||||
|
document.getElementById("halfdaysurcharge").value = n * (count / 2); |
||||
|
} else { |
||||
|
// Count is 0 or odd |
||||
|
document.getElementById("fulldayamt").value = 0; |
||||
|
document.getElementById("halfdayamt").value = 0; |
||||
|
document.getElementById("fulldaysurcharge").value = 0; |
||||
|
document.getElementById("halfdaysurcharge").value = 0; |
||||
|
} |
||||
|
} |
||||
|
function getDaysInMonth(year, month) { |
||||
|
return new Date(year, month, 0).getDate(); |
||||
|
} |
||||
|
function displayCheckboxes(ld) { |
||||
|
for (var i = 1; i <= 31; i++) { |
||||
|
var morningHalf31 = "morningHalf" + i; |
||||
|
var eveningHalf31 = "eveningHalf" + i; |
||||
|
var rowId = "row" + i; |
||||
|
|
||||
|
|
||||
|
// Check if the current day exceeds the last day of the month |
||||
|
if (i > ld) { |
||||
|
// If it does, hide the checkboxes |
||||
|
$("#" + morningHalf31).hide(); |
||||
|
$("#" + eveningHalf31).hide(); |
||||
|
} else { |
||||
|
// If it doesn't, show the checkboxes |
||||
|
$("#" + morningHalf31).show(); |
||||
|
$("#" + eveningHalf31).show(); |
||||
|
} |
||||
|
if (ld === 28) { |
||||
|
$("#row29").hide(); |
||||
|
$("#row30").hide(); |
||||
|
$("#row31").hide(); |
||||
|
|
||||
|
} else { |
||||
|
$("#row29").show(); |
||||
|
$("#row30").show(); |
||||
|
$("#row31").show(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// Show or hide the 31st row based on whether the last day is 31 |
||||
|
$("#row31").toggle(ld === 31); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
</body> |
||||
|
|
||||
|
</html> |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.community.hall; |
||||
|
|
||||
|
import org.junit.jupiter.api.Test; |
||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
|
||||
|
@SpringBootTest |
||||
|
class HallApplicationTests { |
||||
|
|
||||
|
@Test |
||||
|
void contextLoads() { |
||||
|
} |
||||
|
|
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue