From 7bd7504c1ab4b5956f50ddff4ca7212fb856d97e Mon Sep 17 00:00:00 2001 From: DumiduM Date: Sun, 8 Jul 2018 23:17:04 +0530 Subject: [PATCH] chat updated --- adminAddKanna.php | 503 +++++++++++++++++++++++++++++++++++++ adminChat.php | 102 ++++++++ adminhome.php | 22 +- chatNew.php | 333 ++++++++++++++++++++++++ chatNewAdmin.php | 333 ++++++++++++++++++++++++ configChat.php | 18 ++ css/style.css | 278 +++++++++++++++++++- css/style_Chat.css | 73 ++++++ getTable - Copy.php | 95 +++++++ getTablekanna.php | 127 ++++++++++ handlers/messages.php | 81 ++++++ handlers/messagesAdmin.php | 71 ++++++ indexSChat.php | 102 ++++++++ indexSChatAdmin.php | 102 ++++++++ 14 files changed, 2226 insertions(+), 14 deletions(-) create mode 100644 adminAddKanna.php create mode 100644 adminChat.php create mode 100644 chatNew.php create mode 100644 chatNewAdmin.php create mode 100644 configChat.php create mode 100644 css/style_Chat.css create mode 100644 getTable - Copy.php create mode 100644 getTablekanna.php create mode 100644 handlers/messages.php create mode 100644 handlers/messagesAdmin.php create mode 100644 indexSChat.php create mode 100644 indexSChatAdmin.php diff --git a/adminAddKanna.php b/adminAddKanna.php new file mode 100644 index 0000000..cf110fb --- /dev/null +++ b/adminAddKanna.php @@ -0,0 +1,503 @@ +alert('error2');"; + } + else{ + $name = $_SESSION['login_user']; + // echo ""; + } + + $Schedule_check="0"; + ?> + + + + +
+ + + + +
+ + + + + + e-Farmer + + + + + + + + + + + + + +
+
+ + + +
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+ +
+ + + + + + + + + + + + + + + +
+
+ +
+ + + + +
+
+ + + + \ No newline at end of file diff --git a/adminChat.php b/adminChat.php new file mode 100644 index 0000000..7b23d91 --- /dev/null +++ b/adminChat.php @@ -0,0 +1,102 @@ + + + + + + + Chat Room + + + + + + + + + + + +
+
+
+
+ +
+
+

+ + +
+
+ +
+ +
+ + + + + + + + + diff --git a/adminhome.php b/adminhome.php index f5004d6..1458403 100644 --- a/adminhome.php +++ b/adminhome.php @@ -68,7 +68,7 @@ - + @@ -510,5 +510,25 @@ function getTable(str){
+ \ No newline at end of file diff --git a/chatNew.php b/chatNew.php new file mode 100644 index 0000000..82f3b52 --- /dev/null +++ b/chatNew.php @@ -0,0 +1,333 @@ + +alert('error2');"; + } + else{ + $name = $_SESSION['login_user']; + // echo ""; + } + + $Schedule_check="0"; +?> + + + + + + + + +
+ + +


+ + + + +
+ + + + + + + + e-Farmer + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/chatNewAdmin.php b/chatNewAdmin.php new file mode 100644 index 0000000..5475c8f --- /dev/null +++ b/chatNewAdmin.php @@ -0,0 +1,333 @@ + +alert('error2');"; + } + else{ + $name = $_SESSION['login_user']; + // echo ""; + } + + $Schedule_check="0"; +?> + + + + + + + + +
+ + +


+ + + + +
+ + + + + + + + e-Farmer + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + diff --git a/configChat.php b/configChat.php new file mode 100644 index 0000000..075ec2b --- /dev/null +++ b/configChat.php @@ -0,0 +1,18 @@ +getMessage(); +} + + + +?> \ No newline at end of file diff --git a/css/style.css b/css/style.css index 9242433..a0be935 100644 --- a/css/style.css +++ b/css/style.css @@ -119,21 +119,273 @@ img.background{ -.mapdiv{ - width:100%; - margin: auto; + + + +/*=============================================================================================>maleeesha*/ + + + + +*{ + padding: 0px; + margin: 0px; +} + +body{ + background-image: url(pic1.jpg); +} + +h1{ + /*font-family: Monotype Corsiva; + font-size: 48px;*/ +} + +#wrapper{ + width: 1000px; + height: 838px; + margin: 10px auto; + background: #f1f1f1; + padding: 20px; +} + +.chat_wrapper{ + width: 70%; + margin: 10px auto; + background: #ffffff; +} + +#chat{ + min-height: 600px; + height: 600px; + overflow: auto; + border: 1px solid #b3b3b3; + padding: 10px; + /*font-family: Bookman Old Style; + font-size: 20px;*/ +} + +.textarea{ + width: 97%; + border: 1px solid#b3b3b3; + outline: none; + padding: 10px; + margin-top: 10px; + /*font-family: Bookman Old Style; + font-size: 20px;*/ +} + +.single-message{ + padding: 5px 5px 5px 5px; + border-bottom: 1px solid #b3b3b3; + +} + +.single-message span{ + float: right; +} + +/*second edit begin*/ +.navbar{ + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + background-color: #23282e; +/* font-family: verdana; + font-size: 20px;*/ + font-weight: 200; +} + +.navbttn{ + float: right; +} + +.navbttn a { + display: block; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +.navbttn a:hover { + background-color: #4f5b69; +} +/*2nd edit end*/ + +/*1st edit begin */ +.nav-side-menu { + overflow: auto; +/* font-family: verdana; + font-size: 20px;*/ + font-weight: 200; + background-color: #2e353d; + position: fixed; + top: 0px; + width: 430px; + height: 100%; + color: #e1ffff; } +.Logo { + background-color: #23282e; + height: 200px; + width: 200px; + padding-left: 110px; + margin-top: 10px; + padding-top: 10px; -.mapdiv path { - fill: #036057; - stroke: #073833; - stroke-width:2px; - transition: fill 2.0s; +} +.Logo1{ + background-color: #23282e; + margin: 0 auto; +} + +.nav-side-menu .brand { + background-color: #23282e; + line-height: 50px; + display: block; + text-align: center; + font-size: 50px; + height: 2%; +} + +.nav-side-menu .toggle-btn { + display: none; +} +.nav-side-menu ul, +.nav-side-menu li { + list-style: none; + padding-bottom: 10px; + padding-top: 10px; + margin: 0px; + line-height: 35px; + cursor: pointer; + +} +.nav-side-menu ul :not(collapsed) .arrow:before, +.nav-side-menu li :not(collapsed) .arrow:before { +/* font-family: FontAwesome;*/ + content: "\f078"; + display: inline-block; + padding-left: 10px; + padding-right: 10px; + vertical-align: middle; + float: right; +} +.nav-side-menu ul .active, +.nav-side-menu li .active { + border-left: 3px solid #d19b3d; + background-color: #4f5b69; +} +.nav-side-menu ul .sub-menu li.active, +.nav-side-menu li .sub-menu li.active { + color: #d19b3d; +} +.nav-side-menu ul .sub-menu li.active a, +.nav-side-menu li .sub-menu li.active a { + color: #d19b3d; +} +.nav-side-menu ul .sub-menu li, +.nav-side-menu li .sub-menu li { + background-color: #181c20; + border: none; + line-height: 28px; + border-bottom: 1px solid #23282e; + margin-left: 0px; +} +.nav-side-menu ul .sub-menu li:hover, +.nav-side-menu li .sub-menu li:hover { + background-color: #020203; +} +.nav-side-menu ul .sub-menu li:before, +.nav-side-menu li .sub-menu li:before { + /*font-family: FontAwesome;*/ + content: "\f105"; + display: inline-block; + padding-left: 10px; + padding-right: 10px; + vertical-align: middle; +} +.nav-side-menu li { + padding-left: 0px; + border-left: 3px solid #2e353d; + border-bottom: 1px solid #23282e; } -.mapdiv :hover { - fill:#16ba8b; +.nav-side-menu li a { + text-decoration: none; + color: #e1ffff; } -.mapdiv{ - width: 50%; -} \ No newline at end of file +.nav-side-menu li a i { + padding-left: 10px; + width: 20px; + padding-right: 20px; +} +.nav-side-menu li:hover { + border-left: 3px solid #d19b3d; + background-color: #4f5b69; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -o-transition: all 1s ease; + -ms-transition: all 1s ease; + transition: all 1s ease; +} + +#exit { + background-color: #23282e; + text-align: center; + margin-top: 390px; + padding-bottom: 10px; + padding-top: 10px; +} + + + +#mainpage{ + background-color: #23282e; +} + + +@media (max-width: 767px) { + .nav-side-menu { + position: relative; + width: 100%; + margin-bottom: 10px; + } + .nav-side-menu .toggle-btn { + display: block; + cursor: pointer; + position: absolute; + right: 10px; + top: 10px; + z-index: 10 !important; + padding: 3px; + background-color: #ffffff; + color: #000; + width: 40px; + text-align: center; + } + .brand { + text-align: left !important; + font-size: 22px; + padding-left: 20px; + line-height: 50px !important; + } +} +@media (min-width: 767px) { + .nav-side-menu .menu-list .menu-content { + display: block; + } + #main { + width:calc(100% - 300px); + float: right; + } +} + +body { + margin: 0px; + padding: 0px; +} + +/*1st edit End*/ diff --git a/css/style_Chat.css b/css/style_Chat.css new file mode 100644 index 0000000..f67aeb9 --- /dev/null +++ b/css/style_Chat.css @@ -0,0 +1,73 @@ +*{ + padding: 0px; + margin: 0px; +} + + + +#wrapper{ + width: 1000px; + height: 838px; + margin: 10px auto; + background: #f1f1f1; + padding: 20px; +} + +.chat_wrapper{ + width: 70%; + margin: 10px auto; + background: #ffffff; +} + +#chat{ + min-height: 600px; + height: 600px; + overflow: auto; + border: 1px solid #b3b3b3; + padding: 10px; + font-family: Bookman Old Style; + font-size: 20px; +} + +.textarea{ + width: 97%; + border: 1px solid#b3b3b3; + outline: none; + padding: 10px; + margin-top: 10px; + font-family: Bookman Old Style; + font-size: 20px; +} + +.single-message{ + padding: 5px 5px 5px 5px; + border-bottom: 1px solid #b3b3b3; + +} + +.single-message span{ + float: right; +} + + + +#exit { + background-color: #23282e; + text-align: center; + margin-top: 390px; + padding-bottom: 10px; + padding-top: 10px; +} + + + +#mainpage{ + background-color: #23282e; +} + +body { + margin: 0px; + padding: 0px; +} + +/*1st edit End*/ diff --git a/getTable - Copy.php b/getTable - Copy.php new file mode 100644 index 0000000..c5d6119 --- /dev/null +++ b/getTable - Copy.php @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + SB Admin - Start Bootstrap Template + + + + + + + + + + + + + +
+
+

+ + + + + + + + + + + +
YALA
+ + + +
+
+ +
+
+ + + + + + + + + + + + + + + +
MAHA
UplandLowland
+ + + +
+
+ + + \ No newline at end of file diff --git a/getTablekanna.php b/getTablekanna.php new file mode 100644 index 0000000..855226c --- /dev/null +++ b/getTablekanna.php @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + SB Admin - Start Bootstrap Template + + + + + + + + + + + + + +
+
+

+ + + + + + + + + + + +
YALA
+ + + +
+
+ +
+
+ + + + + + + + + + + +
MAHA
+ + + +
+
+ + + \ No newline at end of file diff --git a/handlers/messages.php b/handlers/messages.php new file mode 100644 index 0000000..c14306d --- /dev/null +++ b/handlers/messages.php @@ -0,0 +1,81 @@ +prepare("INSERT INTO messages SET user=?, message=?"); + $run = $query->execute([$_SESSION['login_user'],$_REQUEST['message']]); + //echo "test"; + + if( $run ) + { + echo 1; + exit; + } + + break; + + case "getMessages": + //echo "working"; + + + + $query = $db->prepare("SELECT * FROM messages where user=? or user = 'admin'"); + //$query = $db->prepare("SELECT id,message,date FROM messages"); + + $run = $query->execute([$_SESSION['login_user']]); + + $rs = $query->fetchAll(PDO::FETCH_OBJ); + + //$dateShow = ''; + + + + //echo var_dump($rs); + $chat = ''; + foreach ($rs as $message) + { + if ($message->user == $_SESSION['login_user']){ + $chat .= '
'.$message->user.' :- '.$message->message.'        '.date('m.d h:i a', strtotime($message->date)).'
'; + } + else if ($message->user == 'admin'){ + $chat .= '
'.$message->user.' :- '.$message->message.'        '.date('m.d h:i a', strtotime($message->date)).'
'; + } + } + //echo $dateShow; + echo $chat; + + break; +} +?> + + diff --git a/handlers/messagesAdmin.php b/handlers/messagesAdmin.php new file mode 100644 index 0000000..8d28ff1 --- /dev/null +++ b/handlers/messagesAdmin.php @@ -0,0 +1,71 @@ +prepare("INSERT INTO messages SET user='admin', message=?"); + $run = $query->execute([$_REQUEST['message']]); + //echo "test"; + + if( $run ) + { + echo 1; + exit; + } + + break; + + case "getMessages": + //echo "working"; + + + + $query = $db->prepare("SELECT * FROM messages where user=? or user = 'admin'"); + //$query = $db->prepare("SELECT id,message,date FROM messages"); + + $run = $query->execute([$_SESSION['login_user']]); + + $rs = $query->fetchAll(PDO::FETCH_OBJ); + + //$dateShow = ''; + + + + //echo var_dump($rs); + $chat = ''; + foreach ($rs as $message) + { + if ($message->user == $_SESSION['login_user']){ + $chat .= '
'.$message->user.' :- '.$message->message.'        '.date('m.d h:i a', strtotime($message->date)).'
'; + } + else if ($message->user == 'admin'){ + $chat .= '
'.$message->user.' :- '.$message->message.'        '.date('m.d h:i a', strtotime($message->date)).'
'; + } + } + //echo $dateShow; + echo $chat; + + break; +} +?> + diff --git a/indexSChat.php b/indexSChat.php new file mode 100644 index 0000000..7b23d91 --- /dev/null +++ b/indexSChat.php @@ -0,0 +1,102 @@ + + + + + + + Chat Room + + + + + + + + + + + +
+
+
+
+ +
+
+

+ + +
+
+ +
+ +
+ + + + + + + + + diff --git a/indexSChatAdmin.php b/indexSChatAdmin.php new file mode 100644 index 0000000..823c468 --- /dev/null +++ b/indexSChatAdmin.php @@ -0,0 +1,102 @@ + + + + + + + Chat Room + + + + + + + + + + + +
+
+
+
+ +
+
+

+ + +
+
+ +
+ +
+ + + + + + + + +