diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b96a08f --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +MIT License + +Copyright (c) 2025 Ravikiran Pradip Yavalkar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 2459dbe..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Kivy_APP - -Kivy_APP 配套NFC使用,矿用APP研发 \ No newline at end of file diff --git a/assets/Book_rack.jpg b/assets/Book_rack.jpg new file mode 100644 index 0000000..7a536a4 Binary files /dev/null and b/assets/Book_rack.jpg differ diff --git a/assets/_logo.png b/assets/_logo.png new file mode 100644 index 0000000..64e3b3b Binary files /dev/null and b/assets/_logo.png differ diff --git a/assets/bg_img.jpg b/assets/bg_img.jpg new file mode 100644 index 0000000..2a6987e Binary files /dev/null and b/assets/bg_img.jpg differ diff --git a/assets/branch.png b/assets/branch.png new file mode 100644 index 0000000..6803e4e Binary files /dev/null and b/assets/branch.png differ diff --git a/assets/google.png b/assets/google.png new file mode 100644 index 0000000..8e77584 Binary files /dev/null and b/assets/google.png differ diff --git a/assets/img.bmp b/assets/img.bmp new file mode 100644 index 0000000..48368c2 Binary files /dev/null and b/assets/img.bmp differ diff --git a/assets/img.png b/assets/img.png new file mode 100644 index 0000000..0c44ff8 Binary files /dev/null and b/assets/img.png differ diff --git a/assets/journal_section.jpg b/assets/journal_section.jpg new file mode 100644 index 0000000..ce034b9 Binary files /dev/null and b/assets/journal_section.jpg differ diff --git a/assets/keyboard.jpg b/assets/keyboard.jpg new file mode 100644 index 0000000..30271df Binary files /dev/null and b/assets/keyboard.jpg differ diff --git a/assets/lib_img1.jpg b/assets/lib_img1.jpg new file mode 100644 index 0000000..7310988 Binary files /dev/null and b/assets/lib_img1.jpg differ diff --git a/assets/lib_img2.jpg b/assets/lib_img2.jpg new file mode 100644 index 0000000..eb47385 Binary files /dev/null and b/assets/lib_img2.jpg differ diff --git a/assets/lib_img3.jpg b/assets/lib_img3.jpg new file mode 100644 index 0000000..a4df171 Binary files /dev/null and b/assets/lib_img3.jpg differ diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..63733cd Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/pc1.jpg b/assets/pc1.jpg new file mode 100644 index 0000000..db33e1a Binary files /dev/null and b/assets/pc1.jpg differ diff --git a/assets/reading_space.jpg b/assets/reading_space.jpg new file mode 100644 index 0000000..f76f70c Binary files /dev/null and b/assets/reading_space.jpg differ diff --git a/assets/sample_book_display.jpg b/assets/sample_book_display.jpg new file mode 100644 index 0000000..287b0ad Binary files /dev/null and b/assets/sample_book_display.jpg differ diff --git a/assets/semister.png b/assets/semister.png new file mode 100644 index 0000000..0f7f71b Binary files /dev/null and b/assets/semister.png differ diff --git a/data/Books.csv b/data/Books.csv new file mode 100644 index 0000000..c9334d3 --- /dev/null +++ b/data/Books.csv @@ -0,0 +1,121 @@ +Name,Author,Publication Year,Publisher,ISBN,Availability +Cryptography and Network Security. [Principles and Practice] (8th Ed.),Stallings William,2023,Pearson Education,9789357059718,1 +The 48 Laws of Power,Greene Robert,1998,Profile Books Ltd,9781861972781,1 +Shriman Yogi,Desai Ranjeet,2023,Mehta Publication,9788177666403,1 +Partner,Kale V P,2023,Mehta Publication,9788177664294,1 +Think and Grow Rich. [Unleash the secret to success],Hill Napoleon,2014,India Book Distributors,9788192910918,1 +SUBTLE ART F NOT GIVING A FUCK. [A counterintuitive Approch to Living a Good Life ],MANSON MARK,2016,Harper Collins Publications,9780062641540,1 +Secret of the Nagas. [Book 2 of the shiva Trilogy],Amish,2022,Harper Collins Publications,9789356290600,1 +The Poppy War,Kuang R F,2018,Harper Voyager,9780008239848,1 +The hard things about hard things,Horowitz Ben,2018,Harper Collins Publication,9780062273208,0 +Word Power Made Easy. [The Complete Handbook for building a superior Vocabulary],LEWIS NORMAN,1978,Penguin Random House,9780143424680,1 +Certificate Physical and Human Geography,Leong Goh Cheng,2024,Oxford University Press,9789354975660,1 +SSC Reasoning,Aggarwal R S,2023,S Chand Publications,9789355017284,1 +How to Prepare for Quantitative Aptitude for CAT. (10th Ed.),Sharma A K,2023,Mcgraw Hill,9789355320852,1 +Through the Broken Glass. [An Autobiography],Seshan T N,2023,Rupa Publications India Pvt. Ltd,9789357021968,1 +1984,Orwell George,2022,Golden Minds Publication,9789357201674,1 +Chemical Engineering. (3rd Ed.),Made Easy Publications GATE 2024,2023,Made Easy Publication,9789395548878,0 +Daivatanchi Satyakatha,Null,2023,Vishwakarma Publications,9789393757432,1 +How to win Friends and Influence People,Del Karnegi,2023,Vishwakarma Publications,9789393757456,1 +The Empress of Indraprastha Part 2 Building on Emprie,Raje Sonali,2023,Vishwakarma Publications,9789395481267,1 +Principles of Mass Transfer and Separation Processes,Dutta Binay K,2023,PHI Learning Pvt Ltd,9788120329904,29 +Fundamentals of Python. [First Programs] (2nd Ed.),Lambert Kenneth A,2023,Cengage Learning India Pvt Ltd,9789353502898,19 +Artificial Intelligence. (2nd Ed.),Kaushik Saroj,2023,Cengage Learning India Pvt Ltd,9789355730425,24 +Operating Systems. [Concept building and Problem solving Approach],Singh Manish Kumar. Kumar Sachin & Pal Saibal K,2022,Cengage Learning India Pvt Ltd,9789355733542,19 +Web Design. [Introductory] (6 th Ed.),Campbell J T,2021,Cengage Learning India Pvt Ltd,9789386650320,19 +Cryptography Network Security and Cyber Laws,Menezes Bernard L & Kumar Ravinder,2023,Cengage Learning India Pvt Ltd,9789386858948,9 +Product Design and Development. (7th Ed.),Ulrich Karl T; Eppinger Steven D & Yang M C,2023,Null,9789390113231,4 +Software Engineering. [Concepts and Practices] (2nd Ed.),Suman Ugrasen,2022,Cengage Learning India Pvt Ltd,9789390555475,4 +Software Engineering. [Concepts and Practices] (2nd Ed.),Suman Ugrasen,2022,Cengage Learning India Pvt Ltd,9789390555475,14 +Machine Learning with R. (4th Ed.),Lantz Brett,2023,Packet Publication,9781801071321,4 +Natural Langurage Processing and Information Retrieval,Siddiqui Tanveer & Tiwary U S,2023,Oxford University Press,9780195692327,9 +Computer Science. [A Structured Programming Approach Using C ] (3rd Ed.),Forouzan Behrouz A,2022,Cengage Learning India Pvt Ltd,9788131503638,19 +Fundamentals of Data Structures in C. (2nd Ed.),Horowitz Ellis; Sahni S & Anderson Freed Susan,2023,University Press,9788173716058,19 +Data Structures and Algorithm Made Easy,Karumanchi Narasimha,2022,Career Monk Publication,9788193245279,4 +Principles of Information Systems. (14th Ed.),Stair Ralph M & Reynolds George W,2023,Cengage Learning India Pvt Ltd,9789355733771,19 +Principles of Information Security. (7th Ed.),Whitman Michael E & Mattord Hebert J,2023,Cengage Learning India Pvt Ltd,9789355738905,19 +Cyber Security and Cyber Laws,Basta Alfred; Basta Nadine; Brown Mary & Kumar Ravinder,2018,Cengage Learning India Pvt Ltd,9789387511675,19 +Cryptography Network Security and Cyber Laws,Menezes Bernard & Kumar Ravinder,2023,Cengage Learning India Pvt Ltd,9789386858948,19 +Atomic Habits,Clear James,2018,Pengiun Random House,9780735211292,2 +Mechanical Engineering,Made Easy Publications GATE 2024,2023,Made Easy Publications,9788119100019,2 +ATOMIC HABITS (Marathi),CLEAR JAMES,2023,Manjul Publishing House P ltd,9789390085408,2 +Introduction to Indian Knowledge System,Mahadevan B & Nagendra Pavana R N,2023,PHI Learning,9789391818203,24 +Traditional Knowledge System in India,Jha Amit,2023,Atlantic Publishers & Distributors,9788126912230,24 +Linear Algebra. (4th),Poole David,2023,Cengage learning,9788131530245,29 +Probability and Statistics for Engineering and Sciences. (9th Ed.),Devore J L,2023,Cengage,9789353506247,29 +Discrete Mathematics wieh Applications. [Metric Version] (5th Ed.),Epp S S,2023,Cengage,9789355731029,29 +Enterpreneurship. (2nd Ed.),Batra Safal,2023,Cengage,9789355735676,19 +Enterprise Cloud Computing,Shroff Gautam,2022,Cambridge University Press,9781107648890,19 +"Engineering Design, An Introduction. (2nd)",Karsnitz John R; Obrien Stephen & Hutchinson John,2021,Cengage Learning India Pvt Ltd,9788131530740,59 +Soft Skills for Everyone. (2nd),Butterfield jeff,2023,Cengage Learning India Pvt Ltd,9789353501051,9 +Quantitative Aptitude and Reasoing,Saraf Shyam & Swarup Abhilasha,2020,Cengage Learning India Pvt Ltd,9789353501525,59 +Self Development and Professional Excellence,John Peter A,2020,Cengage Learning India Pvt Ltd,9789353501624,9 +"Entrepreneurship. [Theory, Process, Practice]",kuratko Donald F,2023,Cengage Learning India Pvt Ltd,9789355734006,9 +Enviranmental Science. (16th),Miller G Tayler,2023,Cengage Learning India Pvt Ltd,9789355738899,9 +Machine Learning with Python for Everyone,Fenner Mark E,2023,Pearson Education,9789353944902,14 +"System Design Interview. [An Insider's Guide, Vol.1]",Xu Alex,2023,Shroff Publishers and Distributors,9789355427199,9 +Concepts of Programming Languages,Sebesta Robert W,2023,Pearson Education,9789356067417,19 +CLOULD COMPUTING. [CONCEPTS TECHNOLOGY AND ARCHITECHTURE],ERL THOMAS; MAHOOD ZAIGHAM & PUTTINI RICARDO,2024,Pearson Education,9789332535923,14 +Fuzzy Sets and Fuzzy Logic:theory and Applications,KLIR GEORGE J & YUAN BO,2023,Prentice Hall of India,9789332549425,9 +CLOUD COMPUTING DESIGN PATTERNS,ERL THOMAS; COPE ROBERT & NASERPOUR AMIN,2016,Pearson Education,9789332557307,9 +MACHINE LEARNING,DUTT SAIKAT; CHANDRAMOULI S & DAS AMIT KUMAR,2024,Pearson Education,9789353066697,9 +DEEP LEARNING,DAS AMITKUMAR; GOSWAMI S & MITRA PABITRA,2022,Pearson Education,9789354493874,9 +DEEP LEARNING. [CORE CONCEPTS METHODA AND APPLICATIONS],GOPAL M,2022,Pearson Education,9789356061972,18 +Learning Deep Learning,Ekman Magnus,2023,Pearson Education,9789356063976,9 +BUILDING BLOCKCHAIN APPS,YUAN MICHAEL JUNTAO,2020,Pearson Education,9789390168385,9 +Cryptography and Network Security. [Principles and Practices] (8th Ed.),Stallings William,2024,Pearson Education,9789357059718,24 +Engineering Design Process. (2 nd Ed.),Haik Yousef & Shahin Tamer,2023,Cengage Learning India Pvt Ltd,9788131529041,59 +[Mechanical Engineering],"Made Easy Publications, GATE 2024 ",2023,Made Easy Publication,9788119100019,24 +Let Us C,Kanetkar Yashavant P,2023,BPB Publications,9789355512765,9 +Mrutyunjay,Sawant Shivaji,2023,Mehata Publishing House,9789357201674,59 +[Computer Science and IT] (17th Ed.),Made Easy Publications GATE 2024,2023,Made Easy Publication,9789395548984,2 +Aagantuk,Vaidya Vivek,2023,Vishwakaram Publications,9789395481625,2 +Amazing Child Saylee,Agavane Manisha,2024,Vishwakarma Publications,9789393757548,2 +Beneath Divided Skies,Sharma natasha,2024,Vishwakarma Publications,9789395481533,2 +Bhagwatgeeta Ani Kuran Madhil Karmyog Parichay,Vakil Asim,2024,Vishwakarma Publications,9789395481151,2 +Chhatrapati Shri Shivarai,Tapkir Sandip Bhanudas,2023,Vishwakarma Publications,9789393757586,2 +Chhatrapati Shree Shivarai (Hindi Anuwad),Tapkir Sandeep,2023,Vishwkarma Publications,9789393757418,2 +Communication Skills Simplified Through Stories And Exercises,Joshi Nitin,2023,Vishwakarma Publications,9789395481243,2 +Cupid at Corporate ,Singh Meenakshi,2024,Vishwakarma Publications,9789395481618,2 +Daivatanchi Satyakatha,Rana Ashok,2023,Vishwakarma Publications,9789393757432,2 +The Iconic Iconociast,Lal Subodh; Fahmida Riaz,2023,Vishwakarma Publications,9789395481106,2 +How to Stop Worring and Start living. [Anuwad DR. Jundare Vaishali ],Karnegi Del,2024,Vishwakarma Publications,9789395481465,2 +How to win Friends and Influence People,Del Karnegi,2023,Vishwakarma Publications,9789393757456,2 +Husband by Proxy,Mehta Purva A,2024,Vishwakarma Publications,9789395481403,2 +Ichchapatra Kalachi Garaj Vyavasthapatra Mrityupatra Yabaddal Sarva kahi,Puranik Akanksha,2023,Vishwakarma Publications,9789395481175,2 +IF THEN ELSE,Ranganathan Sandhya,2023,Vishwakarma Publications,9789395481083,2 +Jaliyanwala Baug 13 April 1919 Bharatiya Swatantryacha Trigar Point,Sonavane Manohar,2023,Vishwakarma Publications,9789395481144,2 +Jewels From The Treasure Trove,Kundu Anamika,2023,Vishwakarma Publications,9789395481953,2 +Kabeer Vichar,Banakar Vijay,2024,Vishwakarma Publications,9789393757658,2 +Karheche Pani (Sankshipt),Atre Aacharya,2023,Vishwakarma University,9789393757678,2 +Keep Moving,Lifeschool,2023,Vishwakarma Publications,9789389624311,2 +Keep Moving 2,Lifesschool,2023,Vishwakarma Publications,9788194317777,2 +Kiwiyo Safar New zealandchi (Marathi),Lonkar Vijay,2023,Null,9789395481110,2 +Letters To My Mother,Pareek Vikkas Arun,2023,Vishwakarma Publications,9789393757036,2 +Lokkaletil Gan (Marathi),Dekhane Ramchandra,2023,Vishwakarma Publications,9789395481809,2 +Lover By Command and other Spy stories. [Counter operations by India's Best],Saraf V K,2023,Vishwakarma Publications,9789395481397,2 +Lt Colonel Purohit. [Vishvasghatacha Bali],Mishra Smita,2023,Vishwakarma Publications,9789395481298,2 +Madam Commissioner. [The Extraordinary Life of an Indian Police Chief],Borwankar Meera,2023,Vishwakarma Publications,9789361137679,2 +Maharashtrachi Phule Sanskruti arthat Bahujan Sanskruti,Shende S R,2023,Vishwakarma Publications,9789395481168,2 +Malawani Mulakhatil Itihasache Paharekari,Tapkir Sandeep Bhanudas,2023,Vishwakarma Publications,9789390869312,2 +Marga Yashacha Marga Sukhacha,Ghodekar Sudhakar & Salunkhe Sanjay,2023,Vishwakarma Publications,9789393757517,2 +Not Before You,Gwalani Lata,2024,Vishwakarma Publications,9789395481502,2 +PanchayatRaj,joshi Smita,2024,Vishwakarma Publications,9789395481489,2 +Phoenix in Flames,Singh Rachna,2023,Vishwakarma Publications,9789395481601,2 +Pranayama. [AN ART OF BREATHING KNOWLEDGE AND SCIENCE],Karajgaonkar Giridhar,2024,Vishwakarma Publications,9789395481977,2 +Anuwad Prerak Utprerak,Chandramouli Venkatesan & Kale Neha,2023,Vishwakarma Publications,9789390869633,2 +Raising. [Inspiring Stories of Growth & Resilience],Pathak Preeti,2023,Vishwakarma Publications,9789395481472,2 +Rangadya Durgvaibhavacha Khajina,Tapkir Sandeep Bhanudas,2023,Vishwakarma Publications,9789390869541,2 +Satyache Prayog athava Aatmakatha,Gandhi Mahatma,2024,Vishwakarma Publications,9789393757647,2 +SHINING DARKNESS,Sharangpani Shrinivas,2024,Vishwakarma Publications,9789395481199,2 +Shrikrushana Bhagwatgeeta Vayvasthapan Ani Vyaktimattwa vikas,Thakur Dadaji,2023,Vishwakarma Publications,9789395481458,2 +Shunyatoon Suryakade,Datar Aarati,2023,Vishwakarma Publications,9789395481182,2 +Story of Ordinary,Bhalla Deepika,2023,Vishwakarma Publications,9789393757999,2 +Swami Vivekananda ani Mahatma Gandhi,Patil Vishwas,2024,Vishwakarma Publications,9789395481571,2 +10 Sutras to Surf the Corporate Tide Called Office Politics,Ghosh Indranil,2023,Vishwakarma Publications,9789395481656,2 +Adventures of Little Kanya The Moscow Mosaic,Sane Ashwini R,2024,Vishwakarma Publications,9789395481427,2 +Art of Beetfulness. [Aajachya Digital Yugat Shant Rahane],Nandan Nilekani; Bhojawani Tanuj & Anuwad -- Nandapurkar; Fadake Suchita,2024,Vishwakarma Publications,9789395481427,2 +Art of Public Speaking,Karnegi Del & Anuwad- Panase Shruti,2024,Vishwakarma Publications,9789395481212,2 +The Empress of Indraprastha Part 2 Building on Emprie,Raje Sonali,2023,Vishwakarma Publications,9789395481267,2 +The Eye of the Fish,Nair Samyuktha,2024,Vishwakarma Publications,9789395481939,2 +The Making of Star,Khandekar Kohali & Khandekar Vaneeta,2023,Vishwakarma Publications,9789393757302,2 diff --git a/data/Users.csv b/data/Users.csv new file mode 100644 index 0000000..7e08a29 --- /dev/null +++ b/data/Users.csv @@ -0,0 +1,4 @@ +Student_Name,Student_PRN,Student_Email,Student_Whatsapp_no,Student_pass,Branch,Semester +Ravikiran Yavalkar,12444444,abcd.efgh24@gmail.com,9607111115,India,AIML-F,III +jfen,55775577,test@example.com,NULL,China,AIML-F,III + diff --git a/data/all_book_transactions.csv b/data/all_book_transactions.csv new file mode 100644 index 0000000..a700f3b --- /dev/null +++ b/data/all_book_transactions.csv @@ -0,0 +1,3 @@ +User,User_No,Book_Name,ISBN,Date,Due_Date,Return_Date +12444444,9607111115,Shriman Yogi,9788177666403,2025-02-06 18:41:57.020884,2025-02-16 18:41:57.020884,06/02/2025 +12444444,9607111115,The hard things about hard things,9780062273208,2025-02-05 14:58:13.566729,2025-02-15 14:58:13.566729,Not Returned diff --git a/data/book_positions.csv b/data/book_positions.csv new file mode 100644 index 0000000..5dfa129 --- /dev/null +++ b/data/book_positions.csv @@ -0,0 +1,7 @@ +Name,Pos +Cryptography and Network Security. [Principles and Practice] (8th Ed.),2L23 +The 48 Laws of Power,1L13 +Shriman Yogi,1L53 +Partner,1L43 +Think and Grow Rich. [Unleash the secret to success],1L23 +SUBTLE ART F NOT GIVING A FUCK. [A counterintuitive Approch to Living a Good Life ],1L33 \ No newline at end of file diff --git a/data/borrowed_books.csv b/data/borrowed_books.csv new file mode 100644 index 0000000..f773486 --- /dev/null +++ b/data/borrowed_books.csv @@ -0,0 +1,2 @@ +User,User_No,Book_Name,ISBN,Date,Due_Date,Renew_status +12444444,9607111115,The hard things about hard things,9780062273208,2025-02-05 14:58:13.566729,2025-02-15 14:58:13.566729,Not Renewed diff --git a/fonts/Chinese/msyh.ttf b/fonts/Chinese/msyh.ttf new file mode 100644 index 0000000..2b0c91f Binary files /dev/null and b/fonts/Chinese/msyh.ttf differ diff --git a/fonts/Croissant_One/CroissantOne-Regular.ttf b/fonts/Croissant_One/CroissantOne-Regular.ttf new file mode 100644 index 0000000..6b0d123 Binary files /dev/null and b/fonts/Croissant_One/CroissantOne-Regular.ttf differ diff --git a/fonts/Pacifico/Pacifico-Regular.ttf b/fonts/Pacifico/Pacifico-Regular.ttf new file mode 100644 index 0000000..e7def95 Binary files /dev/null and b/fonts/Pacifico/Pacifico-Regular.ttf differ diff --git a/fonts/Poppins/Poppins-Medium.ttf b/fonts/Poppins/Poppins-Medium.ttf new file mode 100644 index 0000000..6bcdcc2 Binary files /dev/null and b/fonts/Poppins/Poppins-Medium.ttf differ diff --git a/fonts/Poppins/Poppins-SemiBold.ttf b/fonts/Poppins/Poppins-SemiBold.ttf new file mode 100644 index 0000000..74c726e Binary files /dev/null and b/fonts/Poppins/Poppins-SemiBold.ttf differ diff --git a/fonts/Rubik_Vinyl/RubikVinyl-Regular.ttf b/fonts/Rubik_Vinyl/RubikVinyl-Regular.ttf new file mode 100644 index 0000000..1d9e0bf Binary files /dev/null and b/fonts/Rubik_Vinyl/RubikVinyl-Regular.ttf differ diff --git a/kv/app.kv b/kv/app.kv new file mode 100644 index 0000000..34a8ed7 --- /dev/null +++ b/kv/app.kv @@ -0,0 +1,2466 @@ +ScreenManager: # 屏幕管理器,用于管理应用中所有的屏幕及其切换 + MainScreen: # 主屏幕 + name: 'main' # 屏幕名称,用于导航切换 + HomeScreen: # 首页屏幕 + name: 'home' # 首页,显示应用主要内容和功能入口 + LoginScreen: # 登录屏幕 + name: 'login' # 用户登录界面,输入账号密码等 + SignUpScreen: # 注册屏幕 + name: 'signup' # 用户注册界面,创建新账号 + OtpScreen: # 验证码屏幕 + name: 'otp' # 用于验证码验证的界面(如手机验证、邮箱验证) + ResetPassScreen: # 重置密码屏幕 + name: 'reset_pass' # 重置密码界面,设置新密码 + ForgetPassScreen: # 忘记密码屏幕 + name: 'forgot_pass' # 忘记密码入口,用于启动密码找回流程 + ProfileScreen: # 个人资料屏幕 + name: "profile" # 显示用户个人信息的界面 + HistoryScreen: # 历史记录屏幕 + name: 'history' # 显示用户操作历史(如下单记录、浏览记录等) + RecommendScreen: # 推荐屏幕 + name: 'recommend' # 显示推荐内容(如推荐书籍等) + SearchBookScreen: # 搜索书籍屏幕 + name: 'searchBook' # 用于搜索书籍的界面 + ProfileEditScreen: # 编辑个人资料屏幕 + name: 'profile_edit' # 用于修改用户个人信息的界面 + NotificationScreen: # 通知屏幕 + name: 'notification' # 显示系统通知和消息的界面 + BorrowBookScreen: # 借书屏幕 + name: 'borrow_book' # 处理借书操作的界面 + ReturnBookScreen: # 还书屏幕 + name: 'return_book' # 处理还书操作的界面 + RenewBookScreen: # 续借书籍屏幕 + name: 'renew_book' # 处理书籍续借操作的界面 + + +: + MDFloatLayout: + Image: + source: 'assets/logo.png' + size_hint: None, 0.9 + width: dp(150) + pos_hint: {'center_x': 0.1, 'center_y': 0.95} + + Image: + source: 'assets/img.png' + size_hint: None, 0.8 + width: dp(400) + pos_hint: {'center_x': 0.5, 'center_y': 0.8} + + MDLabel: + text: "欢 迎 使 用!" + font_name: "BPoppins" + font_size: "23sp" + pos_hint: {'center_y': 0.53} + halign: "center" + color: rgba(0, 0, 59, 255) + MDLabel: + text: "矿用上位机测试软件---Jfen" + font_name: "MPoppins" + font_size: "13sp" + size_hint_x: 0.85 + pos_hint: {'center_x': 0.5,'center_y': 0.45} + halign: "center" + color: rgba(127, 127, 127, 255) + Button: + text: "登 入" + size_hint: None, None + font_name: "BPoppins" + width: dp(350) + height: dp(59) + pos_hint: {'center_x': 0.5, 'center_y': 0.28} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + root.manager.current = "login" + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [5] + Button: + text: "注 册" + size_hint: None, None + font_name: "BPoppins" + width: dp(350) + height: dp(59) + pos_hint: {'center_x': 0.5, 'center_y': 0.19} + background_color: 0,0,0,0 + color: rgba(52, 0, 231, 255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + root.manager.current = "signup" + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + Line: + width: 1.2 + rounded_rectangle: self.x, self.y, self.width, self.height, 5,5,5,5,100 + + + + + +: + MDFloatLayout: + md_bg_color: 1, 1, 1, 1 + + BoxLayout: + orientation: 'vertical' + size_hint_y: None + height: "54dp" + pos_hint: {"top": 1} + MDTopAppBar: + title: "LMS" + halign: 'center' + elevation: 10 + left_action_items: [["menu", lambda x: nav_drawer.set_state('toggle')]] + + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + # Carousel at the top + Carousel: + id: carousel + size_hint_y: None + height: "205dp" + width: self.parent.width + pos_hint: {'top': .918} # Adjust position to fit below the AppBar + loop: False + anim_type: 'in_out_quad' + anim_move_duration: 0.2 + BoxLayout: + orientation: 'vertical' + + + Image: + source: 'assets/lib_img1.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "Bajrangdas Lohiya Central Library" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + bold: True + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + + BoxLayout: + orientation: 'vertical' + + Image: + source: 'assets/Book_rack.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "Vast Book Collection (80,000+)" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + BoxLayout: + orientation: 'vertical' + + Image: + source: 'assets/reading_space.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "Quiet Room" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + + BoxLayout: + orientation: 'vertical' + + Image: + source: 'assets/journal_section.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "National & International Journals & Research Paper" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + + + + BoxLayout: + orientation: 'vertical' + + Image: + source: 'assets/lib_img2.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "Reference Section" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + + BoxLayout: + orientation: 'vertical' + + Image: + source: 'assets/lib_img3.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "Career and Test Preparation Section:" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + BoxLayout: + orientation: 'vertical' + + Image: + source: 'assets/pc1.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "Online E-Resources" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + BoxLayout: + orientation: 'vertical' + + Image: + source: 'assets/keyboard.jpg' + allow_stretch: True + keep_ratio: False + + MDLabel: + text: "iThenticate Software for Plagiarism checking" + font_name: "BPoppins" + font_size: "24sp" + size_hint0: None, None + width: self.parent.width + padding: "12dp",0,0,"5dp" + color: rgba(255, 255, 255, 255) + + # Navigation Buttons Positioned Over the Carousel + MDIconButton: + icon: "arrow-left-thin-circle-outline" + pos_hint: {'x': 0.025, 'center_y': 0.7705} # Adjusted position + size_hint: None, None + size: "48dp", "48dp" + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: (1,1,1,1) + on_release: carousel.load_previous() + disabled: carousel.index == 0 + + MDIconButton: + icon: "arrow-right-thin-circle-outline" + pos_hint: {'right': 0.9725, 'center_y': 0.7705} + size_hint: None, None + size: "48dp", "48dp" + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: (1,1,1,1) + on_release: carousel.load_next() + disabled: carousel.index == len(carousel.slides) - 1 + + ScrollView: + size_hint: 1, None + height: self.parent.height - dp(324) + pos_hint: {'top':0.615} + MDList: + id : image_label_grid + padding: "20dp", "40dp", "12dp", "17dp" + spacing: "50dp" + MDLabel: + text: "Bajrangdas Lohiya Central Library" + font_name: "BPoppins" + font_size: "24sp" + halign: 'center' + bold: True + color: rgba(0, 0, 59, 255) + MDCard: + size_hint: None, None + width: self.parent.width-50 # Set the size of the box + height: "225dp" + pos_hint: {"center_x": 0.5, "center_y": 0.3} # Center the box + elevation: 5 # Add shadow (elevation) + padding: "20dp","5dp","5dp","10dp" + spacing: "10dp" + orientation: 'vertical' + MDLabel: + text: "The main objective of Bajrangdas Lohiya Central Library, established in the year 1984, is to support the educational & research programmes of the Institute by providing physical and intellectual access to information consistent with the present and anticipated educational and research functions of the Institute." + font_name: "MPoppins" + font_size: "13sp" + size_hint_x: 1 + pos_hint: {'center_x': 0.5,'center_y': 0.3} + color: rgba(127, 127, 127, 255) + + MDRaisedButton: + text: "know more..." + size_hint: None, None + size: "100dp", "25dp" + pos_hint: {"center_x": 0.5} + on_release: root.manager.current= "home" + MDLabel: + text: "Where is the Book Kept?" + font_name: "BPoppins" + font_size: "24sp" + pos_hint: {'center_x': 0.45} + halign: 'center' + bold: True + color: rgba(0, 0, 0, 255) + MDCard: + size_hint: None, None + width: self.parent.width-50 # Set the size of the box + height: "225dp" + pos_hint: {"center_x": 0.5, "center_y": 0.3} # Center the box + elevation: 5 # Add shadow (elevation) + padding: "20dp","10dp","5dp","10dp" + spacing: "10dp" + orientation: 'vertical' + MDTextField: + id: book_pos_name + text: "" + hint_text: "Enter Book Name.." + font_name: "MPoppins" + font_size: "15sp" + helper_text_mode: "on_focus" + icon_right: "alphabetical" + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.475, "center_y": 0.8} + size_hint_x: None + width: 335 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDRaisedButton: + text: "Find" + size_hint: None, None + size: "150dp", "25dp" + pos_hint: {"center_x": 0.5} + on_release: app.where_is_book() + + MDLabel: + id : book_pos + text: "Example.,Book Position is 1L42 , 1 represent row no., L represent left side of row, 4 represent rack/shelves no. ,2 represent shelves step no." + halign: 'center' + bold: True + font_name: "BPoppins" + font_size: "13sp" + size_hint_x: 1 + color: rgba(127, 127, 127, 255) + + Widget: + + MDNavigationDrawer: + id: nav_drawer + size_hint: None, 1 + width:Window.size[1]-425 + radius: [0,0] + MDNavigationDrawerMenu: + MDNavigationDrawerHeader: + id : user + title: "Welcome! TeenAger" + text: "Make your Bright future with us..!" + text_color: "#6c7272" + text_font_size: '13sp' + title_color: "#00f0ff" + title_font_size: '25sp' + spacing: '4dp' + padding: "12dp", 0, 0, "5dp" + + MDNavigationDrawerDivider: + + MDNavigationDrawerLabel: + text: "Profile" + TwoLineIconListItem: + id : user + text: "" + secondary_text:"View profile" + divider:None + spacing: '4dp' + bold: True + padding: "1dp",0,0,"1dp" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + root.manager.current = "profile" + IconLeftWidget: + MDFloatingActionButton: + icon: "account" + size_hint: 1.5, 1.5 + + MDNavigationDrawerDivider: + + MDNavigationDrawerLabel: + text: "Menu" + + DrawerClickableItem: + icon: "home-outline" + text: "Home" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + root.manager.current = "home" + + DrawerClickableItem: + icon: "bell-outline" + right_text: '+99' + text_right_color: "#4a4930" + text: "Notification" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + root.manager.current = "home" + + DrawerClickableItem: + icon: 'book-search-outline' + text: "Search Book" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + app.data_load() + root.manager.current = "searchBook" + + DrawerClickableItem: + icon: 'thumb-up-outline' + text: "Recommendations" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + root.manager.current = "recommend" + + DrawerClickableItem: + icon: 'cart-outline' + text: "Borrow Book" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + app.clear_text() + root.manager.current = "borrow_book" + + DrawerClickableItem: + icon: 'keyboard-return' + text: "Return Book" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + app.return_book("Return") + root.manager.current = "return_book" + + DrawerClickableItem: + icon: 'autorenew' + text: "Re-New Book" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + app.return_book("Renew") + root.manager.current = "renew_book" + + DrawerClickableItem: + icon: 'history' + text: "History" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + app.book_history() + root.manager.current = "history" + + DrawerClickableItem: + icon: 'account-edit-outline' + text: "Edit Profile" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + root.manager.current = "profile_edit" + + MDNavigationDrawerDivider: + + MDNavigationDrawerLabel: + text: "Help" + + DrawerClickableItem: + icon: 'information-outline' + text: "About Us" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + root.manager.current = "home" + + DrawerClickableItem: + icon: 'message-alert-outline' + text: "Feedback" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + nav_drawer.set_state('close') + root.manager.current = "home" + + MDNavigationDrawerDivider: + + DrawerClickableItem: + icon: 'logout' + text: "Logout" + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "down" + nav_drawer.set_state('close') + root.manager.current = "main" + app.clear_text() + + +: + Image: + source: "assets/bg_img.jpg" # Path to your gradient + size: self.size + allow_stretch: True + keep_ratio: False + MDFloatLayout: + mg_bd_color: 1,1,1,1 + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "main" + app.on_press_back_arrow() + + MDLabel: + text: "W e l c o m e !" + font_name: "BPoppins" + font_size: "26sp" + size_hint_x: None + width: dp(350) + pos_hint: {'center_x': 0.5,'center_y': 0.85} + color: rgba(0, 0, 59, 255) + + MDLabel: + text: "登录并继续 ... " + font_name: "MPoppins" + size_hint_x: None + width: dp(350) + font_size: "18sp" + pos_hint: {'center_x': 0.5,'center_y': 0.79} + color: rgba(135, 133, 193, 255) + + MDTextField: + id: username + hint_text: "Enter PRN" + font_name: "MPoppins" + helper_text: "PRN 仅为八位数字" + helper_text_mode: "on_focus" + icon_right: "dialpad" + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.63} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + + MDRelativeLayout: + size: self.width, self.height + + MDTextField: + id : password + font_name: "MPoppins" + font_size: "14sp" + hint_text: "Enter Password" + helper_text: "must contain at least one 'a' , 'A' , '@' & '0'" + helper_text_mode: "on_focus" + pos_hint: {"center_x": 0.5, "center_y": 0.53} + size_hint_x: None + width: dp(335) + password:True + on_focus: app.focus_text_field(icon, self.focus, "password") + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + + MDIconButton: + id: icon + icon: 'eye-off' + theme_icon_color: "Custom" + icon_color: rgba(162, 169, 188, 255) + size_hint: None, None + size: dp(24), dp(24) + pos: password.x + password.width - self.width+dp(4), password.center_y - self.height / 2+dp(5) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + app.toggle_password_visibility(password, self) + password.focus=True + + Button: + text: "登录" + font_name: "BPoppins" + size_hint: None, None + width: dp(300) + height: dp(59) + pos_hint: {'center_x': 0.5, 'center_y': 0.37} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "up" + app.on_start() + app.verify(False) + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [5] + + MDTextButton: + text: "忘记密码" + pos_hint: {'center_x': 0.5, 'center_y': 0.31} + color: rgba(68,78,132,255) + font_name: "BPoppins" + font_size: '13sp' + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= "down" + root.manager.current="forgot_pass" + MDLabel: + text: "or" + color: rgba(52, 0, 231, 255) + pos_hint: {'center_y': 0.25} + font_name: "BPoppins" + font_size: '13sp' + halign: 'center' + + MDFloatLayout: + md_bg_color: rgba(178, 178, 178, 255) + size_hint: 0.35, 0.002 + pos_hint: {'center_x': 0.27, 'center_y': .248} + MDFloatLayout: + md_bg_color: rgba(178, 178, 178, 255) + size_hint: 0.35, 0.002 + pos_hint: {'center_x': 0.73, 'center_y': .248} + + MDTextButton: + id: prn_mode + text: "验证邮箱" + font_name: 'BPoppins' + font_size: '13sp' + color: rgba(135, 133, 193, 255) + pos_hint: {'center_x': 0.5, 'center_y': 0.19} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + app.login_mode(username, self) + + MDGridLayout: + cols: 1 + size_hint: 0.2, 0.07 + pos_hint: {'center_x': 0.5, 'center_y': 0.15} + Image: + source: 'assets/google.png' + + + MDTextButton: + text: "Don't have an account? Sign up" + font_name: 'BPoppins' + halign: 'center' + font_size: '11sp' + color: rgba(52, 0, 231, 255) + pos_hint: {'center_x': 0.5, 'center_y': 0.05} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "left" + root.manager.current="signup" + +: + name: "signup" + MDFloatLayout: + mg_bd_color: 1,1,1,1 + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "main" + MDLabel: + text: "H i!" + font_name: "RPac" + font_size: "26sp" + size_hint_x: None + width: dp(350) + pos_hint: {'center_x': 0.5,'center_y': 0.9} + color: rgba(0, 0, 59, 255) + + MDLabel: + text: "Create a new account" + font_name: "BPoppins" + font_size: "20sp" + size_hint_x: None + width: dp(350) + pos_hint: {'center_x': 0.5,'center_y': 0.85} + color: app.theme_cls.primary_color + + + ScrollView: + size_hint: 1, None + height: self.parent.height - dp(250) + pos_hint: {'top':0.81} + MDList: + padding: "12dp", "10dp", "12dp", "3dp" + spacing: "10dp" + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDLabel: + text: "Name" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + + MDRelativeLayout: + size_hint_y: None + height: "60dp" + MDTextField: + id: signup_name + hint_text: "Enter Name*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "Provide your fullname" + helper_text_mode: "on_focus" + icon_right: "alphabetical" + icon_color: app.theme_cls.primary_color + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDLabel: + text: "PRN" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + + MDRelativeLayout: + size_hint_y: None + height: "60dp" + MDTextField: + id: signup_prn + hint_text: "Provide your PRN*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "PRN of 8 digits starting with 1 2 ......only*" + helper_text_mode: "on_focus" + icon_right: "dialpad" + input_filter: 'int' + required_length: 8 + icon_color: app.theme_cls.primary_color + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDLabel: + text: "Email" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + + MDRelativeLayout: + size_hint_y: None + height: "60dp" + MDTextField: + id: signup_email + hint_text: "邮箱地址*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "只是测试邮箱*" + helper_text_mode: "on_focus" + icon_right: "email-arrow-left-outline" + min_text_length: 11 + icon_color: app.theme_cls.primary_color + size_hint_x: None + width: 335 + pos_hint: {"center_x": 0.5, "center_y": 0.5} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDLabel: + text: "电话" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + + + MDRelativeLayout: + size_hint_y: None + height: "60dp" + MDTextField: + id: signup_no + hint_text: "Enter WhatsApp Number*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "Provide your Whatsapp no. only*" + helper_text_mode: "on_focus" + icon_right: "whatsapp" + icon_color: app.theme_cls.primary_color + input_filter: 'int' + max_text_length: 10 + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDLabel: + text: "Password" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + spacing: "10dp" + + MDRelativeLayout: + size_hint_y: None + height: "60dp" + MDRelativeLayout: + size: self.width, self.height + MDTextField: + id : signup_pass + font_name: "MPoppins" + font_size: "15sp" + hint_text: "Create Password*" + helper_text: "must contain 8 char* with at least one 'a' , 'A' , '@' & '0'" + helper_text_mode: "on_focus" + password:True + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + on_focus: app.focus_text_field(icon, self.focus, "sign_pass") + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDIconButton: + id: icon + icon: 'eye-off' + theme_icon_color: "Custom" + icon_color: rgba(217, 217, 217, 255) + size_hint: None, None + size: dp(24), dp(24) + pos: signup_pass.x + signup_pass.width - self.width+dp(4), signup_pass.center_y - self.height / 2+dp(5) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + app.toggle_password_visibility(signup_pass, self) + signup_pass.focus=True + + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDLabel: + text: "Branch" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + + + MDRelativeLayout: + size_hint_y: None + height: "60dp" + MDTextField: + id: signup_branch + hint_text: "Branch*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "Provide your Branch" + helper_text_mode: "on_focus" + icon_right: "source-branch" + min_text_length: 11 + icon_color: app.theme_cls.primary_color + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDRelativeLayout: + size_hint_y: None + height: "5dp" + MDLabel: + text: "Semester" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + + + MDRelativeLayout: + size_hint_y: None + height: "60dp" + MDTextField: + id: signup_sem + hint_text: "Semester*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "Provide your Branch" + helper_text_mode: "on_focus" + icon_right: "roman-numeral-2" + min_text_length: 11 + icon_color: app.theme_cls.primary_color + size_hint_x: None + width: dp(335) + pos_hint: {"center_x": 0.5, "center_y": 0.5} + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDRelativeLayout: + size_hint_y: None + height: "65dp" + Button: + text: "Get OTP" + font_name: "BPoppins" + size_hint: None, None + width: dp(300) + height: dp(59) + pos_hint: {'center_x': 0.5, 'center_y': 1} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "up" + app.otp_button_fun(False) + app.on_start() + app.check_signup(signup_name.text, signup_prn.text, signup_email.text, signup_no.text, signup_pass.text, signup_branch.text, signup_sem.text) + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [10] + +: + + MDFloatLayout: + anchor_x: 'center' + anchor_y: 'center' + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'up' + root.manager.current= "login" + app.on_press_back_arrow() + + MDLabel: + text: "Forget Your Password?" + font_name: "BPoppins" + font_size: "26sp" + pos_hint: {'center_x': 0.55,'center_y': 0.85} + color: rgba(0, 0, 59, 255) + + + MDLabel: + text: "That's Okay. It happens!" + font_name: "MPoppins" + font_size: "18sp" + pos_hint: {'center_x': 0.55,'center_y': 0.8} + color: rgba(135, 133, 193, 255) + + MDLabel: + text: "Provide your Whatsapp No. for reset Password " + font_name: "MPoppins" + font_size: "13sp" + size_hint:0.91 , 0.8 + pos_hint: {'center_x': 0.55,'center_y': 0.7} + color: rgba(135, 133, 193, 255) + + + MDTextField: + id: forgotPass_no + hint_text: "Enter WhatsApp Number" + font_name: "MPoppins" + helper_text: "or click on for login through username" + helper_text_mode: "on_focus" + icon_right: "dialpad" + input_filter: 'int' + min_text_length: 10 + max_text_length:10 + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.6} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + + Button: + text: "Get OTP" + font_name: "BPoppins" + size_hint: None, 0.065 + width: dp(350) + pos_hint: {'center_x': 0.5, 'center_y': 0.45} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + app.on_start() + root.manager.transition.direction = "up" + app.otp_button_fun("True") + app.verify_no() + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [5] + +: + MDFloatLayout: + mg_bd_color: 1,1,1,1 + MDIconButton: + id : back_button + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + app.otp_back_arrow_fun() + root.manager.transition.direction= 'down' + + + MDLabel: + text: "V e r i f i n g Y o u...!" + font_name: "BPoppins" + font_size: "26sp" + pos_hint: {'center_x': 0.55,'center_y': 0.75} + + color: rgba(0, 0, 59, 255) + + + + + AnchorLayout: + anchor_x: 'center' + anchor_y: 'center' + + BoxLayout: + orientation: "vertical" + size_hint: None, None + size: self.minimum_size + MDLabel: + text: "One time password (OTP) has been shared on your Whatsapp number. Please check and enter here.." + font_name: "MPoppins" + font_size: "13sp" + size_hint_x: .85 + pos_hint: {'center_x': 0.5,'center_y': 1} + color: rgba(135, 133, 193, 255) + + MDBoxLayout: + orientation: 'horizontal' + spacing: dp(35) + padding: dp(50) + size_hint: None, None + size: self.minimum_size + + MDTextField: + id: d1 + hint_text: "" + font_name: "MPoppins" + font_size: "25sp" + pos_hint: {"center_x": 0.2, "center_y": 0.6} + size_hint_x: None + width: dp(37.5) + multiline: False + max_text_length: 1 + input_filter: 'int' + halign : 'center' + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + padding: 10 + spacing: 10 + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-12, self.y+20, self.width+25, self.height-25, 10,10,10,10,100 + MDTextField: + id: d2 + hint_text: "" + font_name: "MPoppins" + font_size: "25sp" + pos_hint: {"center_x": 0.4, "center_y": 0.6} + size_hint_x: None + width: dp(37.5) + multiline: False + max_text_length: 1 + input_filter: 'int' + halign : 'center' + on_touch_down: app.change_cursor(True) + padding: 10 + spacing: 10 + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-12, self.y+20, self.width+25, self.height-25, 10,10,10,10,100 + MDTextField: + id: d3 + hint_text: "" + font_name: "MPoppins" + font_size: "25sp" + pos_hint: {"center_x": 0.6, "center_y": 0.6} + size_hint_x: None + width: dp(37.5) + multiline: False + max_text_length: 1 + input_filter: 'int' + halign : 'center' + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + padding: 10 + spacing: 10 + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-12, self.y+20, self.width+25, self.height-25, 10,10,10,10,100 + + MDTextField: + id: d4 + hint_text: "" + font_name: "MPoppins" + font_size: "26sp" + pos_hint: {"center_x": 0.8, "center_y": 0.6} + size_hint_x: None + width: dp(37.5) + multiline: False + max_text_length: 1 + input_filter: 'int' + halign : 'center' + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + padding: 10 + spacing: 10 + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-12, self.y+20, self.width+25, self.height-25, 10,10,10,10,100 + + Button: + id: otp_button + text: "SignUp" + font_name: "BPoppins" + size_hint: 0.66, 0.065 + pos_hint: {'center_x': 0.5, 'center_y': 0.07} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "up" + app.on_start() + app.verify_otp(d1.text, d2.text,d3.text,d4.text, self.text) + + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [5] + + +: + MDFloatLayout: + md_bg_color: 1,1,1,1 + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'down' + root.manager.current= "main" + app.on_press_back_arrow() + + MDLabel: + text: "Reset Password!" + font_name: "BPoppins" + font_size: "26sp" + pos_hint: {'center_x': 0.6,'center_y': 0.85} + color: rgba(0, 0, 59, 255) + + MDRelativeLayout: + size: self.width, self.height + MDTextField: + id : new_pass + font_name: "MPoppins" + font_size: "15sp" + hint_text: "New Password" + helper_text: "must contain 8 char* with at least one 'a' , 'A' , '@' & '0'" + helper_text_mode: "on_focus" + pos_hint: {"center_x": 0.5, "center_y": 0.63} + size_hint_x: None + min_text_length: 8 + width: dp(335) + password:True + on_focus: app.focus_text_field(icon, self.focus, "sign_pass") + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDIconButton: + id: icon + icon: 'eye-off' + theme_icon_color: "Custom" + icon_color: rgba(210, 210, 210, 255) + size_hint: None, None + size: dp(24), dp(24) + pos: new_pass.x + new_pass.width - self.width + dp(4), new_pass.center_y - self.height / 2 + dp(5) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + app.toggle_password_visibility(new_pass, self) + new_pass.focus=True + MDRelativeLayout: + size: self.width, self.height + MDTextField: + id : new_pass1 + font_name: "MPoppins" + font_size: "15sp" + hint_text: "Re-enter Password" + helper_text: "must contain 8 char* with at least one 'a' , 'A' , '@' & '0'" + helper_text_mode: "on_focus" + pos_hint: {"center_x": 0.5, "center_y": 0.53} + size_hint_x: None + min_text_length: 8 + width: dp(335) + password:True + on_focus: app.focus_text_field(icon1, self.focus) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + + MDIconButton: + id: icon1 + icon: 'eye-off' + theme_icon_color: "Custom" + icon_color: rgba(210, 210, 210, 255) + size_hint: None, None + size: dp(24), dp(24) + pos: new_pass1.x + new_pass1.width - self.width+dp(4), new_pass1.center_y - self.height / 2+dp(5) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + app.toggle_password_visibility(new_pass1, self) + new_pass1.focus=True + + Button: + text: "Change Password" + font_name: "BPoppins" + size_hint:None, None + width: dp(300) + height: dp(59) + pos_hint: {'center_x': 0.5, 'center_y': 0.37} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "up" + app.reset_password() + app.on_start() + + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [5] + + +: + MDFloatLayout: + md_bg_color: 1,1,1,1 + spacing: '5dp' + BoxLayout: + orientation: 'vertical' + MDTopAppBar: + title: "My Profile" + font_style: 'H5' + specific_text_color: [0, 0, 0, 1] + halign: 'center' + elevation: 0 + md_bg_color: [1,1,1,1] + spacing: "2dp" + MDLabel: + id: profile_name + text: "" + halign: 'center' + + Widget: + + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = 'right' + root.manager.current = "home" + app.on_press_back_arrow() + AnchorLayout: + anchor_y: 'top' + BoxLayout: + orientation: 'vertical' + padding: "12dp", "12dp", "12dp", "12dp" + spacing: "0dp" + Widget: # Add a spacer to push the MDLabel down a bit + size_hint_y: None + height: "70dp" + BoxLayout: + orientation: 'horizontal' + size_hint_y: None + height: '30dp' + MDLabel: + text: "Your Details" + font_name: "BPoppins" + font_size: "14sp" + color: [0,0,0,1] + size_hint_y: None + height: self.texture_size[1]+50 + padding: "15dp" + pos_hint: {'center_y': 0.85} + MDFloatingActionButton: + icon: 'account-edit' + padding: "12dp" + pos_hint: {'center_y': 0.85, 'center_x': 0.9} + size_hint: 0.2,1 + on_release: + root.manager.current = 'profile_edit' + + + ScrollView: + MDList: + spacing: "0dp" + OneLineIconListItem: + text: profile_name.text + IconLeftWidget: + icon: "account-outline" + + OneLineIconListItem: + id : profile_email + text: "" + IconLeftWidget: + icon: "email-outline" + OneLineIconListItem: + id : profile_prn + text: "" + IconLeftWidget: + icon: "dialpad" + OneLineIconListItem: + id : profile_number + text: "" + IconLeftWidget: + icon: "phone-outline" + MDLabel: + text: "Other Details" + font_name: "BPoppins" + font_size: "14sp" + size_hint_y: None + height: self.texture_size[1] + padding: "12dp" + pos_hint: {'center_y': 0.9} + + ScrollView: + MDList: + spacing: "0dp" + OneLineAvatarListItem: + id : profile_branch + text: "" + ImageLeftWidget: + source:'assets/branch.png' + size_hint: 2, .68 + pos: self.pos + + OneLineAvatarListItem: + id : profile_semester + text: "" + ImageLeftWidget: + source:'assets/semister.png' + size_hint: 2, .68 + pos: self.pos + + + + +: + MDFloatLayout: + orientation: 'vertical' + md_bd_color: 1,1,1,1 + anchor_x: 'center' + anchor_y: 'center' + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + size_hint_x: None + width: dp(500) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "home" + app.on_press_back_arrow() + + MDLabel: + text: "Reading Chronicle" + font_name: "BPoppins" + font_size: "24sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.9} + color: rgba(0, 0, 59, 255) + + + MDLabel: + text: "Reflecting on Read and Returned" + font_name: "MPoppins" + font_size: "18sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.85} + color: rgba(135, 133, 193, 255) + + ScrollView: + size_hint: 1, None + height: self.parent.height - dp(150) + pos_hint: {'top':0.81} + MDList: + id : history_grid + padding: "1dp", "50dp", "12dp", "30dp" + spacing: "50dp" + + +: + MDFloatLayout: + md_bg_color: 1,1,1,1 + + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + app.clear_text() + root.manager.current= "home" + app.on_press_back_arrow() + + MDLabel: + text: "Discover Your Next Adventure!" + font_name: "BPoppins" + font_size: "24sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.87} + color: rgba(0, 0, 59, 255) + + MDTextField: + id: book_input + hint_text: 'Enter a Title...' + font_name: "MPoppins" + font_size: "15sp" + helper_text_mode: "on_focus" + icon_right: "search" + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.77} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + + MDRaisedButton: + text: "Get Recommendations" + pos_hint: {"center_x": 0.5, "center_y": 0.67} + on_release: app.get_recommendations() + + MDLabel: + id: rec_label + text: "" + halign: "center" + pos_hint: {"center_x": 0.5, "center_y": 0.4} + + MDBoxLayout: + id : rec_grid + orientation:'vertical' + pos_hint: {'center_x': 0.5, 'center_y': 0.367} + size_hint:(1,0.53) + +: + MDFloatLayout: + md_bg_color: 1,1,1,1 + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + app.clear_text() + root.manager.current= "home" + app.on_press_back_arrow() + MDLabel: + text: "Discover Your Next Adventure!" + font_name: "BPoppins" + font_size: "24sp" + size_hint_x: None + width: 400 + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.87} + color: rgba(0, 0, 59, 255) + + MDTextField: + id: search_field + hint_text: 'Search...' + font_name: "MPoppins" + font_size: "15sp" + helper_text_mode: "on_focus" + icon_right: "search" + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.77} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + + MDBoxLayout: + id : search_grid + orientation:'vertical' + pos_hint: {'center_x': 0.5, 'center_y': 0.415} + size_hint:(1,0.62) + +: + MDFloatLayout: + md_bg_color: 1,1,1,1 + spacing: '5dp' + BoxLayout: + orientation: 'vertical' + MDTopAppBar: + title: "Edit your Details" + font_style: 'H5' + specific_text_color: [0, 0, 0, 1] + halign: 'center' + elevation: 0 + md_bg_color: [1,1,1,1] + spacing: "2dp" + Widget: + + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "profile" + app.on_press_back_arrow() + app.secure_profile() + + MDLabel: + text: "Name" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + pos_hint: {'center_x': 0.5, 'center_y': 0.90} + size_hint_x: None + width: dp(335) + MDLabel: + text: "PRN" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + pos_hint: {'center_x': 0.5, 'center_y': 0.78} + size_hint_x: None + width: dp(335) + MDLabel: + text: "Email" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + pos_hint: {'center_x': 0.5, 'center_y': 0.66} + size_hint_x: None + width: dp(335) + MDLabel: + text: "Phone Number" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + pos_hint: {'center_x': 0.5, 'center_y': 0.54} + size_hint_x: None + width: dp(335) + MDLabel: + text: "Branch" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + pos_hint: {'center_x': 0.5, 'center_y': 0.42} + size_hint_x: None + width: dp(335) + MDLabel: + text: "Semester" + color: rgba(0, 0, 0, 255) + font_name: "BPoppins" + font_size: '15sp' + pos_hint: {'center_x': 0.5, 'center_y': 0.30} + size_hint_x: None + width: dp(335) + + + MDTextField: + id: edit_name + text: "" + hint_text: "Enter Name*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "Provide your fullname" + helper_text_mode: "on_focus" + icon_right: "alphabetical" + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.8425} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + + MDTextField: + id: edit_prn + text: "" + hint_text: "Provide your PRN*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "unable to change prn directly" + helper_text_mode: "on_focus" + readonly: True + icon_right: "dialpad" + input_filter: 'int' + max_text_length: 8 + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.7225} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + MDTextField: + id: edit_email + text: "" + hint_text: "Provide Email-id*" + font_name: "MPoppins" + font_size: "15sp" + readonly: True + helper_text: "unable to change email directly" + helper_text_mode: "on_focus" + icon_right: "email-arrow-left" + min_text_length: 11 + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.6025} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDTextField: + id:edit_no + text: "" + hint_text: "Enter WhatsApp Number*" + font_name: "MPoppins" + font_size: "15sp" + readonly: True + helper_text: "unable to change number directly" + helper_text_mode: "on_focus" + icon_right: "whatsapp" + icon_color: app.theme_cls.primary_color + input_filter: 'int' + max_text_length: 10 + pos_hint: {"center_x": 0.5, "center_y": 0.4825} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDTextField: + id: edit_branch + text: "" + hint_text: "Branch*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "Provide your Branch" + helper_text_mode: "on_focus" + icon_right: "source-branch" + min_text_length: 11 + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.3625} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: 0.5 + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + MDTextField: + id: edit_sem + text: "" + hint_text: "Semester*" + font_name: "MPoppins" + font_size: "15sp" + helper_text: "Provide your semester like I,II,III only*" + helper_text_mode: "on_focus" + icon_right: "roman-numeral-2" + min_text_length: 11 + icon_color: app.theme_cls.primary_color + pos_hint: {"center_x": 0.5, "center_y": 0.2425} + size_hint_x: None + width: dp(335) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + + Button: + text: "Save Profile & Continue" + font_name: "BPoppins" + size_hint: 0.66, 0.065 + pos_hint: {'center_x': 0.5, 'center_y': 0.17} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction = "up" + app.edit_profile() + app.secure_profile() + + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [25] + + MDTextButton: + id : edit_private_credential_butn + text: "Do you want edit prn/email/No." + pos_hint: {'center_x': 0.5, 'center_y': 0.12} + color: rgba(68,78,132,255) + font_name: "BPoppins" + font_size: '13sp' + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= "down" + app.send_otp(edit_no.text) + app.otp_button_fun("1") + root.manager.current="otp" + +: + MDFloatLayout: + md_bg_color: 1,1,1,1 + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + user_font_size: "30sp" + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "home" + app.on_press_back_arrow() + MDTextButton: + id : profile_edit + text: "All Notifications" + font_name: "RPac" + font_size: "18sp" + pos_hint: {'center_x': 0.62,'center_y': 0.95} + color: rgba(1,1,1, 255) + background_color: rgba(0,0,0,255) + +: + MDFloatLayout: + orientation: 'vertical' + md_bd_color: 1,1,1,1 + anchor_x: 'center' + anchor_y: 'center' + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + size_hint_x: None + width: dp(500) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "home" + app.on_press_back_arrow() + + MDLabel: + text: "Want to read Book?" + font_name: "BPoppins" + font_size: "26sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.85} + color: rgba(0, 0, 59, 255) + + + MDLabel: + text: "That's Good. Then borrow it!" + font_name: "MPoppins" + font_size: "18sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.8} + color: rgba(135, 133, 193, 255) + + MDLabel: + text: "Provide ISBN number of Book and get book for 10 days! " + font_name: "MPoppins" + font_size: "13sp" + size_hint_y: 0.8 + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.65} + color: rgba(135, 133, 193, 255) + + + MDTextField: + id: isbn + text : "" + hint_text: "ISBN number" + font_name: "MPoppins" + font_size: "15sp" + helper_text_mode: "on_focus" + icon_right: "book" + icon_color: app.theme_cls.primary_color + max_text_length: 13 + pos_hint: {"center_x": 0.5, "center_y": 0.55} + size_hint_x: None + width: dp(350) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + canvas.before: + Color: + rgb: rgba(127, 127, 127, 255) + Line: + width: dp(0.5) + rounded_rectangle: self.x-5, self.y+20, self.width+10, self.height-25, 10,10,10,10,100 + Button: + text: "Get Book" + font_name: "BPoppins" + size_hint_y: 0.065 + size_hint_x: None + width: dp(350) + pos_hint: {'center_x': 0.5, 'center_y': 0.4} + background_color: 0,0,0,0 + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: app.get_book(isbn.text) + canvas.before: + Color: + rgb: rgba(52, 0, 231, 255) + RoundedRectangle: + size: self.size + pos: self.pos + radius: [10] + + + +: + MDFloatLayout: + orientation: 'vertical' + md_bd_color: 1,1,1,1 + anchor_x: 'center' + anchor_y: 'center' + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "home" + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + size_hint_x: None + width: dp(500) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "home" + + MDLabel: + text: "Done reading the Book?" + font_name: "BPoppins" + font_size: "24sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.9} + color: rgba(0, 0, 59, 255) + + + MDLabel: + text: "Return, recharge, and read on!" + font_name: "MPoppins" + font_size: "18sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.85} + color: rgba(135, 133, 193, 255) + + ScrollView: + size_hint: 1, None + height: self.parent.height - dp(150) + pos_hint: {'top':0.81} + MDList: + id : image_label_grid + padding: "1dp", "50dp", "12dp", "30dp" + spacing: "50dp" + + +: + MDFloatLayout: + orientation: 'vertical' + md_bd_color: 1,1,1,1 + anchor_x: 'center' + anchor_y: 'center' + MDBottomAppBar: + height: "62dp" + elevation: 10 + MDActionBottomAppBarButton: + icon: "home" + pos_hint:{'center_x':0.15, 'center_y': 0.5} + on_press: root.manager.current = 'home' + MDActionBottomAppBarButton: + icon: "cart-outline" + pos_hint:{'center_x':0.38, 'center_y': 0.5} + on_press: root.manager.current = 'borrow_book' + MDActionBottomAppBarButton: + icon: "thumb-up-outline" + pos_hint:{'center_x':0.61, 'center_y': 0.5} + on_press: root.manager.current = 'recommend' + MDActionBottomAppBarButton: + icon: "history" + pos_hint:{'center_x':0.85, 'center_y': 0.5} + on_press: + root.manager.current = 'history' + app.book_history() + + + + MDIconButton: + icon: "arrow-left" + pos_hint: {'center_y': 0.95} + theme_text_color: "Custom" + text_color: rgba(26,24,58,255) + size_hint_x: None + width: dp(500) + on_touch_down: app.change_cursor(True) + on_touch_up: app.change_cursor(False) + on_release: + root.manager.transition.direction= 'right' + root.manager.current= "home" + + MDLabel: + text: "Keep the Story Alive!" + font_name: "BPoppins" + font_size: "24sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.9} + color: rgba(0, 0, 59, 255) + + + MDLabel: + text: "Keep reading, keep growing.!" + font_name: "MPoppins" + font_size: "18sp" + size_hint_x: None + width: dp(400) + padding:"12dp" + pos_hint: {'center_x': 0.5,'center_y': 0.85} + color: rgba(135, 133, 193, 255) + + ScrollView: + size_hint: 1, None + height: self.parent.height - dp(150) + pos_hint: {'top':0.81} + MDList: + id : renew_grid + padding: "1dp", "50dp", "12dp", "30dp" + spacing: "50dp" diff --git a/main.py b/main.py new file mode 100644 index 0000000..a97c1df --- /dev/null +++ b/main.py @@ -0,0 +1,1038 @@ + +from kivy.properties import ObjectProperty +from datetime import datetime, timedelta +from kivy.core.text import LabelBase +from kivy.metrics import dp +from kivy.uix.anchorlayout import AnchorLayout +from kivy.uix.boxlayout import BoxLayout +from kivy.uix.button import Button +from kivy.uix.gridlayout import GridLayout +from kivy.uix.image import Image +from kivymd.app import MDApp +from kivy.core.window import Window +from kivy.uix.screenmanager import ScreenManager +from kivy.lang import Builder +from kivy.uix.screenmanager import ScreenManager, Screen +from kivymd.uix.datatables import MDDataTable +import random + +import csv + +from kivymd.uix.boxlayout import MDBoxLayout +from kivymd.uix.button import MDFlatButton +from kivymd.uix.dialog import MDDialog +from kivymd.uix.label import MDLabel +from kivy.uix.label import Label + +LabelBase.register(name="MPoppins", fn_regular="fonts/Chinese/msyh.ttf") +LabelBase.register(name="BPoppins", fn_regular="fonts/Chinese/msyh.ttf") +LabelBase.register(name="RRubik", fn_regular="fonts/Chinese/msyh.ttf") +LabelBase.register(name="RCro", fn_regular="fonts/Chinese/msyh.ttf") +LabelBase.register(name="RPac", fn_regular="fonts/Chinese/msyh.ttf") + +def get_books(): + pass + + +class MainScreen(Screen): + pass + +class LoginScreen(Screen): + login = ObjectProperty(None) + +class SignUpScreen(Screen): + signup: ObjectProperty = ObjectProperty(None) + +class ForgetPassScreen(Screen): + forget_Password = ObjectProperty(None) + +class OtpScreen(Screen): + otp = ObjectProperty(None) + +class ResetPassScreen(Screen): + reset_pass = ObjectProperty(None) + +class HomeScreen(Screen): + home = ObjectProperty(None) + +class ProfileScreen(Screen): + profile = ObjectProperty(None) + +class ProfileEditScreen(Screen): + profile_edit = ObjectProperty(None) + +class SearchBookScreen(Screen): + search_book = ObjectProperty(None) + +class NotificationScreen(Screen): + notifications = ObjectProperty(None) + +class RecommendScreen(Screen): + recommendation = ObjectProperty(None) + +class BorrowBookScreen(Screen): + borrow_book = ObjectProperty(None) + +class ReturnBookScreen(Screen): + return_book = ObjectProperty(None) + +class RenewBookScreen(Screen): + renew_book = ObjectProperty(None) + +class HistoryScreen(Screen): + history = ObjectProperty(None) + +class app(MDApp): + def __init__(self): + super().__init__() + self.signup_sem = None + self.signup_branch = None + self.user_name = None + self.book_pos_name = None + self.book_pos = None + self.rec_label = None + self.rec_grid = None + self.recommend_screen = None + self.book_input = None + self.data_tables = None + self.search_grid = None + self.search_field = None + self.renew_grid = None + self.renewable_books = [] + self.renew = self.renewable_books + self.history_grid = None + self.books_history = [] + self.history = self.books_history + self.image_label_grid = None + self.books = [] + self.items = self.books + self.book_name = None + self.isbn = None + self.a = None + self.back_button = None + self.user = None + self.dialog = None + self.profile_edit_screen = None + self.edit_email = None + self.edit_prn = None + self.edit_name = None + self.edit_number = None + self.edit_branch = None + self.profile_semester = None + self.profile_branch = None + self.profile_number = None + self.profile_prn = None + self.profile_email = None + self.profile_name = None + self.user_no = None + self.user_email = None + self.user_prn = None + self.d2 = None + self.d3 = None + self.d4 = None + self.user_pass = None + self.d1 = None + self.edit_semester = None + self.otp_button = None + self.new_pass = None + self.new_pass1 = None + self.mobile_no = None + self.password = None + self.username = None + + + def build(self): + Builder.load_file('kv/app.kv') + screen_manager = ScreenManager() + screen_manager.add_widget(MainScreen(name="main")) + screen_manager.add_widget(HomeScreen(name="home")) + screen_manager.add_widget(LoginScreen(name="login")) + screen_manager.add_widget(SignUpScreen(name="signup")) + screen_manager.add_widget(ForgetPassScreen(name="forgot_pass")) + screen_manager.add_widget(OtpScreen(name="otp")) + screen_manager.add_widget(ResetPassScreen(name="reset_pass")) + screen_manager.add_widget(ProfileScreen(name="profile")) + screen_manager.add_widget(ProfileEditScreen(name="profile_edit")) + screen_manager.add_widget(NotificationScreen(name="notification")) + screen_manager.add_widget(SearchBookScreen(name="searchBook")) + screen_manager.add_widget(RecommendScreen(name="recommend")) + screen_manager.add_widget(BorrowBookScreen(name="borrow_book")) + screen_manager.add_widget(ReturnBookScreen(name="return_book")) + screen_manager.add_widget(RenewBookScreen(name="renew_book")) + screen_manager.add_widget(HistoryScreen(name="history")) + + return screen_manager + +#############################################ALL INPUT TEXT############################################################ + def on_start(self): + login_screen = self.root.get_screen("login") + self.username = login_screen.ids.username + self.password = login_screen.ids.password + + home_screen = self.root.get_screen("home") + self.user = home_screen.ids.user + self.book_pos_name = home_screen.ids.book_pos_name + self.book_pos = home_screen.ids.book_pos + + forgot_pass_screen = self.root.get_screen("forgot_pass") + self.mobile_no = forgot_pass_screen.ids.forgotPass_no + + reset_pass_screen = self.root.get_screen("reset_pass") + self.new_pass = reset_pass_screen.ids.new_pass + self.new_pass1 = reset_pass_screen.ids.new_pass1 + + otp_screen = self.root.get_screen("otp") + self.otp_button = otp_screen.ids.otp_button + self.back_button = otp_screen.ids.back_button + self.d1 = otp_screen.ids.d1 + self.d2 = otp_screen.ids.d2 + self.d3 = otp_screen.ids.d3 + self.d4 = otp_screen.ids.d4 + + signup_screen = self.root.get_screen("signup") + self.user_name = signup_screen.ids.signup_name + self.user_prn = signup_screen.ids.signup_prn + self.user_email = signup_screen.ids.signup_email + self.user_no = signup_screen.ids.signup_no + self.user_pass = signup_screen.ids.signup_pass + self.signup_branch = signup_screen.ids.signup_branch + self.signup_sem = signup_screen.ids.signup_sem + + profile_screen = self.root.get_screen("profile") + self.profile_name = profile_screen.ids.profile_name + self.profile_email = profile_screen.ids.profile_email + self.profile_prn = profile_screen.ids.profile_prn + self.profile_number = profile_screen.ids.profile_number + self.profile_branch = profile_screen.ids.profile_branch + self.profile_semester = profile_screen.ids.profile_semester + + self.profile_edit_screen = self.root.get_screen("profile_edit") + self.edit_name = self.profile_edit_screen.ids.edit_name + self.edit_email = self.profile_edit_screen.ids.edit_email + self.edit_prn = self.profile_edit_screen.ids.edit_prn + self.edit_number = self.profile_edit_screen.ids.edit_no + self.edit_branch = self.profile_edit_screen.ids.edit_branch + self.edit_semester = self.profile_edit_screen.ids.edit_sem + + borrow_screen = self.root.get_screen("borrow_book") + self.isbn = borrow_screen.ids.isbn + + return_book_screen = self.root.get_screen("return_book") + self.image_label_grid = return_book_screen.ids.image_label_grid + + renew_book_screen = self.root.get_screen("renew_book") + self.renew_grid = renew_book_screen.ids.renew_grid + + history_screen = self.root.get_screen("history") + self.history_grid = history_screen.ids.history_grid + + search_book_screen = self.root.get_screen("searchBook") + self.search_field = search_book_screen.ids.search_field + self.search_grid = search_book_screen.ids.search_grid + + self.recommend_screen = self.root.get_screen("recommend") + self.book_input = self.recommend_screen.ids.book_input + self.rec_grid = self.recommend_screen.ids.rec_grid + self.rec_label = self.recommend_screen.ids.rec_label + + #############################################@Frequently used functions################################################## + + @staticmethod + def change_cursor(is_enter): + if is_enter: + Window.set_system_cursor('hand') + else: + Window.set_system_cursor('arrow') + @staticmethod + def toggle_password_visibility(password_field, icon_button): + if password_field.password: + password_field.password = False + icon_button.icon = "eye" + else: + password_field.password = True + icon_button.icon = "eye-off" + + def clear_text(self): + self.search_field.text = "" + self.book_input.text = "" + self.username.text = "" + self.password.text = "" + self.mobile_no.text = "" + self.d1.text = "" + self.d2.text = "" + self.d3.text = "" + self.d4.text = "" + self.book_pos_name.text = "" + self.book_pos.text = "Example.,Book Position is 1L42 , 1 represent row no., L represent left side of row, 4 represent rack/shelves no. ,2 represent shelves step no." + self.mobile_no.text = "" + self.isbn.text = '' + + def on_press_back_arrow(self): + self.username.text = "" + self.password.text = "" + self.mobile_no.text = "" + self.d1.text = "" + self.d2.text = "" + self.d3.text = "" + self.d4.text = "" + + def focus_text_field(self, icon_button, focus, page): + if focus: + icon_button.icon_color = self.theme_cls.primary_color + elif page == "password": + icon_button.icon_color = 162 / 255, 169 / 255, 188 / 255, 1 + elif page == "sign_pass": + icon_button.icon_color = 217 / 255, 217 / 255, 217 / 255, 1 + else: + pass + + def otp_button_fun(self, obj): + if obj == "True": + self.otp_button.text = "Reset Password" + elif obj == "1": + self.otp_button.text = "Edit Credentials" + elif obj == "2": + self.otp_button.text = "Verify OTP" + else: + self.otp_button.text = "Sign Up" + + def otp_back_arrow_fun(self): + if self.otp_button.text == "Sign Up": + self.root.current = 'signup' + elif self.otp_button.text == "Reset Password": + self.root.current = 'reset_pass' + elif self.otp_button.text == "Verify OTP": + self.root.current = 'borrow_book' + +############################################@DIALOG BOX most used functions############################################## + # MDDialog box function 'dialog' + + def dialog1(self, text, title="Tips"): + close_button = MDFlatButton( + text="关闭", + font_name="MPoppins", + on_release=self.close_dialog + ) + + content_label = Label( + text=text, + font_name="MPoppins", + color=(0, 0, 0, 1), + size_hint_y=None, + height=dp(30), + halign="center", + valign="middle" + ) + content_label.bind(size=content_label.setter('text_size')) + + self.dialog = MDDialog( + title=title, + type="custom", + content_cls=content_label, + size_hint=(0.84, None), + buttons=[close_button] + ) + self.dialog.open() + + # MDDialog box dismiss function 'close_dialog' + def close_dialog(self, *args): + self.dialog.dismiss() + +###################################LoginPageWork-Start################################################# + + # login Verification function "verify" + def verify(self, obj): + status = False + if self.username.text == "" or self.password.text == "": + check = "请输入账户和密码" + return self.dialog1(check) + else: + name = "" + with open('data/Users.csv', "r", encoding="utf-8") as file: + csv_reader = csv.reader(file, delimiter=",") + for line in csv_reader: + try: + if not obj: + a = (line[1] == self.username.text or line[2] == self.username.text) + else: + a = (line[1] == self.edit_prn.text or line[2] == self.edit_email.text) + if a and line[4] == self.password.text: + status = True + name = line[0] + prn = line[1] + email = line[2] + number = line[3] + branch = line[5] + semester = line[6] + break + except IndexError: + pass + except Exception as e: + print(e) + + if status: + if not obj: + check = "Login Successful" + "\nHello! " + name + else: + check = "Profile Updated Successfully!" + self.secure_profile() + self.root.current = "home" + self.user.text = f"""[b]Hey! {name}[/b]""" + self.profile_name.text = self.edit_name.text = name + self.profile_email.text = self.edit_email.text = email + self.profile_prn.text = self.edit_prn.text = prn + self.profile_number.text = self.edit_number.text = number + self.profile_semester.text = self.edit_semester.text = semester + self.profile_branch.text = self.edit_branch.text = branch + + else: + check = "Login Failed!. " + "Enter correct username and password." + self.dialog1(check) + + click_count = 0 + def login_mode(self, username_text, button_text): + self.click_count += 1 + if self.click_count % 2 == 0: + username_text.hint_text = "Enter PRN" + button_text.text = "VIT Email Login" + username_text.icon_right = "dialpad" + username_text.helper_text = "PRN of 8 digits starting with 1 2 ......only*" + username_text.max_text_length = 8 + else: + username_text.hint_text = "Enter Email" + username_text.icon_right = "email-arrow-left" + button_text.text = "VIT PRN Login" + username_text.helper_text = "enter email ID of vit.edu only*" + username_text.max_text_length = 50 + +###############################################SIGNUP Page Functions##################################################### + + # signup Verification function "check_signup" + def check_signup(self, name, prn, email, num, password, branch, sem): + if name == "" or prn == "" or email == "" or num == "" or password == "" or branch == "" or sem == "": + check = "Enter all required fields" + return self.dialog1(check) + else: + status = "None" + with open('data/Users.csv', "r") as file: + csv_reader = csv.reader(file, delimiter=',') + for line in csv_reader: + try: + if line[3] == num: + status = "num" + break + if line[1] == prn: + status = "prn" + break + if line[2] == email: + status = "email" + break + + else: + status = False + except IndexError: + pass + if status == "num": + check = "Number already registered Please enter a new number" + return self.dialog1(check) + elif status == "prn": + check = "PRN already registered Please enter a PRN" + return self.dialog1(check) + elif status == "email": + check = "Email already registered Please enter a new email" + return self.dialog1(check) + else: + self.root.current = "otp" + self.send_otp(num) + check = "One Time Password has been shared on your registered Whatsapp No. Successful!." + self.dialog1(check) + +##################################################FORGOT PassWord Page################################################## + + # FORGOT PASSWORD page mobile number verification function 'verify_no' + def verify_no(self): + status = False + if self.mobile_no.text == "": + check = "Please enter your Mobile Number." + return self.dialog1(check) + else: + with open('data/Users.csv', "r", encoding="utf-8") as file: + csv_reader = csv.reader(file, delimiter=",") + for line in csv_reader: + try: + if line[3] == self.mobile_no.text: + status = True + break + else: + status = False + except IndexError: + pass + except Exception as e: + print(e) + + if status: + check = "One Time Password has been shared on your registered Whatsapp No. Successful!." + self.root.current = "otp" + self.send_otp(self.mobile_no.text) + return self.dialog1(check) + else: + check = "Enter Registered Mobile Number." + self.dialog1(check) + + def reset_password(self): + if self.new_pass.text == "" or self.new_pass1.text == "": + check = "Please enter your new password" + return self.dialog1(check) + + elif not self.new_pass.text == self.new_pass1.text: + check = "Password Does Not Match. \nPlease Re-check your password." + return self.dialog1(check) + + else: + with open('data/Users.csv', "r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + + for row in rows: + if row['Student_Whatsapp_no'] == self.mobile_no.text: + row['Student_pass'] = self.new_pass.text + break + + try: + with open('data/Users.csv', "w", newline='', encoding="utf-8") as file: + headers = ["Student_Name", "Student_PRN", "Student_Email", "Student_Whatsapp_no", "Student_pass", + "Branch", "Semester"] + csv_writer = csv.DictWriter(file, fieldnames=headers) + csv_writer.writeheader() + csv_writer.writerows(rows) + check = "Password Updated Successfully!" + self.root.current = "login" + except Exception as e: + print(e) + check = "Something went wrong please try again." + self.dialog1(check) + +###############################################PROFILE & EDIT Profile Page############################################## + + def edit_profile(self): + if self.edit_name.text == "" or self.edit_prn.text == "" or self.edit_email.text == "" or self.edit_number.text == "": + check = "Enter all required fields" + return self.dialog1(check) + else: + with open('data/Users.csv', "r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + + for row in rows: + if row['Student_Whatsapp_no'] == self.profile_number.text: + row['Student_Name'] = self.edit_name.text + row['Student_PRN'] = self.edit_prn.text + row['Student_Email'] = self.edit_email.text + row['Student_Whatsapp_no'] = self.edit_number.text + row['Student_pass'] = self.password.text + row['Branch'] = self.edit_branch.text + row['Semester'] = self.edit_semester.text + break + + with open('data/Users.csv', newline="", mode="w", encoding="utf-8") as file: + header = ["Student_Name", "Student_PRN", "Student_Email", "Student_Whatsapp_no", "Student_pass", + "Branch", "Semester"] + csv_writer = csv.DictWriter(file, fieldnames=header) + csv_writer.writeheader() + csv_writer.writerows(rows) + self.verify(True) + self.root.current = "home" + + def secure_profile(self): + self.profile_edit_screen.ids.edit_email.readonly = True + self.profile_edit_screen.ids.edit_prn.readonly = True + self.profile_edit_screen.ids.edit_no.readonly = True + self.profile_edit_screen.ids.edit_private_credential_butn.disabled = False + + +#############################################OTP SEND & VERIFY PAGE##################################################### + + def send_otp(self, number): + self.a = random.randint(1000, 9999) + if len(str(number)) == 10: + number1 = "+91" + str(number) + message = f"""Your verification code is {self.a}. It expires in 10 minutes. Don’t share this code with anyone.""" + pywhatkit.sendwhatmsg_instantly(number1, message, wait_time=15, tab_close=True, close_time=3) + elif len(str(number)) != 10: + check = "Please enter a 10 digit number." + return self.dialog1(check) + else: + pass + + def verify_otp(self, d1, d2, d3, d4, otp_button): + entered_otp = str(d1) + str(d2) + str(d3) + str(d4) + if entered_otp == str(self.a): + if otp_button == "Reset Password": + self.root.current = "reset_pass" + check = "Reset your password " + return self.dialog1(check) + + elif otp_button == "Edit Credentials": + self.root.current = "profile_edit" + check = "Edit your credentials " + self.profile_edit_screen.ids.edit_email.readonly = False + self.profile_edit_screen.ids.edit_prn.readonly = False + self.profile_edit_screen.ids.edit_no.readonly = False + self.profile_edit_screen.ids.edit_private_credential_butn.disabled = True + return self.dialog1(check) + + elif otp_button == "Verify OTP": + self.root.current = "home" + self.add_book() + + else: + data = [self.user_name.text, self.user_prn.text, self.user_email.text, self.user_no.text, + self.user_pass.text, self.signup_branch.text, self.signup_sem.text] + + with open('data/Users.csv', encoding="utf-8") as file: + csv_writer = csv.writer(file, delimiter=",") + csv_writer.writerow(data) + + self.root.current = "home" + check = "SignUP Successful" + "\nHello ! " + self.user_name.text + self.user.text = "H e y !" + self.user_name.text + self.verify(True) + return self.dialog1(check) + + elif entered_otp != str(self.a): + check = "Please enter a correct verification code." + self.d1.text = "" + self.d2.text = "" + self.d3.text = "" + self.d4.text = "" + return self.dialog1(check) + + else: + check = "Sorry! Try again later." + self.root.current = "login" + self.d1.text = "" + self.d2.text = "" + self.d3.text = "" + self.d4.text = "" + return self.dialog1(check) + + #######################################################Borrow BOok###################################################### + + def get_book(self, isbn): + self.isbn.text = isbn + if not self.isbn.text: + check = "Please enter a valid ISBN." + return self.dialog1(check) + elif not len(self.isbn.text) == 13: + check = "Please enter a valid ISBN." + return self.dialog1(check) + else: + with open('data/Books.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + for row in rows: + if row["ISBN"] == self.isbn.text: + if row['Availability'] == "0": + check = "Your book is unavailable. " + return self.dialog1(check) + else: + self.otp_button_fun('2') + self.root.current = "otp" + self.send_otp(self.profile_number.text, ) + + def add_book(self): + with open('data/Books.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + + for row in rows: + if row['ISBN'] == self.isbn.text: + try: + self.book_name = row['Name'] + a = row['Availability'] + row['Availability'] = str(int(a) - 1) + except KeyError: + pass + + with open('data/Books.csv', newline="", mode="w", encoding="utf-8") as file: + headers = ["Name", "Author", "Publication Year", "Publisher", "ISBN", + "Availability"] + csv_writer = csv.DictWriter(file, fieldnames=headers) + csv_writer.writeheader() + csv_writer.writerows(rows) + + self.date = datetime.now() + self.Due_date = self.date + timedelta(days=10) + + details = [self.profile_prn.text, self.profile_number.text, self.book_name, self.isbn.text, self.date, + self.Due_date, ] + transaction_details = details + ["Not Returned"] + borrow_details = details + ["Not Renewed"] + + files = ['data/borrowed_books.csv', 'data/all_book_transactions.csv'] + for file1 in files: + with open(file1, "a", encoding="utf-8", newline='') as file: + csv_writer = csv.writer(file, delimiter=",") + if file1 == 'data/borrowed_books.csv': + csv_writer.writerow(borrow_details) + elif file1 == 'data/all_book_transactions.csv': + csv_writer.writerow(transaction_details) + + check = "OTP Verified! \nBook Borrowed Successfully!" + return self.dialog1(check) + + def fetch_borrowed_book(self): + with open('data/borrowed_books.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + self.books.clear() + for row in rows: + if row['User'] == self.profile_prn.text: + book = {'source': 'assets/sample_book_display.jpg', 'btn_text': 'Return Book', 'Book_name': row['Book_Name'], + 'time': row['Due_Date'], 'Renew_status': row['Renew_status']} + self.books += [book] + print(self.books) + self.items = self.books + + def fetch_renewable_books(self): + with open('data/borrowed_books.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + self.renewable_books.clear() + for row in rows: + a = datetime.strptime(row['Due_Date'], "%Y-%m-%d %H:%M:%S.%f") + a = a.strftime("%d-%m-%Y") + if row['User'] == self.profile_prn.text and row[ + 'Renew_status'] == "Not Renewed" and a == datetime.now().strftime("%d-%m-%Y"): + renew_book = {'source': 'assets/sample_book_display.jpg', 'btn_text': 'Renew Book', 'Book_name': row['Book_Name'], + 'time': row['Due_Date'], 'Renew_status': row['Renew_status']} + self.renewable_books += [renew_book] + print(self.renewable_books) + self.renew = self.renewable_books + + def return_book(self, obj): + if obj == 'Return': + self.fetch_borrowed_book() + self.image_label_grid.clear_widgets() + book_list = self.items + elif obj == 'Renew': + self.fetch_renewable_books() + self.renew_grid.clear_widgets() + book_list = self.renew + + for item in book_list: + box = MDBoxLayout(orientation='vertical', size_hint_y=None, height="125dp") + anchor = AnchorLayout(anchor_x="center", anchor_y="center") + grid = GridLayout(cols=2, spacing=dp(20), size_hint_x=None, size_hint_y=None, size=[dp(320), dp(200)], + padding=dp(0)) + + img = Image(source=item['source'], + size_hint_x=None, + size_hint_y=None, + width=dp(100), + height=dp(125), + allow_stretch=True) + label = MDLabel( + text=item['Book_name'], + font_name="BPoppins", + size_hint_x=None, + size_hint_y=None, + bold=True, + size=[dp(215), dp(70)], + padding=dp(0), + on_touch_down=lambda instance, touch: self.change_cursor(True), + on_touch_up=lambda instance, touch: self.change_cursor(False), + ) + date11 = item['time'] + date22 = "Due Date is " + for i in range(10): + date22 += date11[i] + + label1 = MDLabel( + text=date22, + font_name="BPoppins", + size_hint_x=None, + size_hint_y=None, + size=[dp(215), dp(40)], + padding=dp(0), + on_touch_down=lambda instance, touch: self.change_cursor(True), + on_touch_up=lambda instance, touch: self.change_cursor(False), + ) + + if item['btn_text'] == "Return Book": + btn = Button( + text=item['btn_text'], + font_name="BPoppins", + size_hint=(None, None), + size=(dp(200), dp(30)), + background_color=(0, 0, 1, 1), + on_touch_down=lambda instance, touch: self.change_cursor(True), + on_touch_up=lambda instance, touch: self.change_cursor(False), + on_release=lambda instance, src=item['source'], txt=item['btn_text'], name=item['Book_name'], + time=item['time']: self.remove_book(src, txt, name, time), + ) + elif item['btn_text'] == "Renew Book": + btn = Button( + text=item['btn_text'], + font_name="BPoppins", + size_hint=(None, None), + size=(dp(200), dp(30)), + background_color=(0, 0, 1, 1), + on_touch_down=lambda instance, touch: self.change_cursor(True), + on_touch_up=lambda instance, touch: self.change_cursor(False), + on_release=lambda instance, src=item['source'], txt=item['btn_text'], name=item['Book_name'], + time=item['time']: self.renew_book(src, txt, name, time), + ) + + vertical_box = BoxLayout(orientation='vertical', size_hint_y=None, height=label.height + btn.height) + vertical_box.add_widget(label) + vertical_box.add_widget(label1) + vertical_box.add_widget(btn) + + grid.add_widget(img) + grid.add_widget(vertical_box) + anchor.add_widget(grid) + box.add_widget(anchor) + if btn.text == "Return Book": + self.image_label_grid.add_widget(box) + elif btn.text == "Renew Book": + self.renew_grid.add_widget(box) + + def remove_book(self, source, text, name, time): + with open('data/borrowed_books.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.reader(file, delimiter=",") + header = next(csv_reader) + rows = list(csv_reader) + + new_rows = [row for row in rows if row[0] != self.profile_prn.text or row[2] != name or row[5] != time] + + with open('data/borrowed_books.csv', mode="w", newline="", encoding="utf-8") as file: + csv_writer = csv.writer(file, delimiter=",") + csv_writer.writerow(header) + csv_writer.writerows(new_rows) + + with open('data/all_book_transactions.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + + return_date = datetime.now() + return_date = return_date.strftime("%d/%m/%Y") + + for row in rows: + if row['User'] == self.profile_prn.text and row['Book_Name'] == name and row['Due_Date'] == time: + row["Return_Date"] = return_date + + with open('data/all_book_transactions.csv', mode="w", newline="", encoding="utf-8") as file: + headers = ['User', 'User_No', 'Book_Name', 'ISBN', 'Date', 'Due_Date', 'Return_Date', ] + csv_writer = csv.DictWriter(file, fieldnames=headers) + csv_writer.writeheader() + csv_writer.writerows(rows) + + with open('data/Books.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + + for row in rows: + if row['Name'] == name: + try: + a = row['Availability'] + row['Availability'] = str(int(a) + 1) + except KeyError: + pass + + with open('data/Books.csv', newline="", mode="w", encoding="utf-8") as file: + headers = ["Name", "Author", "Publication Year", "Publisher", "ISBN", + "Availability"] + csv_writer = csv.DictWriter(file, fieldnames=headers) + csv_writer.writeheader() + csv_writer.writerows(rows) + + self.items = [item for item in self.items if + not (item['source'] == source and item['btn_text'] == text and item['Book_name'] == name)] + + check = "Book Returned Successfully!" + self.dialog1(check) + self.return_book("Return") + + def fetch_book_history(self): + with open('data/all_book_transactions.csv', mode="r", encoding="utf-8") as file: + csv_reader = csv.DictReader(file, delimiter=",") + rows = [row for row in csv_reader] + self.books_history.clear() + for row in rows: + if row['User'] == self.profile_prn.text and row['Return_Date'] != 'Not Returned': + book = {'source': 'assets/sample_book_display.jpg', 'text': 'Rate Book', 'Book_name': row['Book_Name'], + 'time': row['Date'], 'Return_Date': row['Return_Date']} + self.books_history += [book] + self.history = self.books_history + + def book_history(self): + self.fetch_book_history() + self.history_grid.clear_widgets() + + for item in self.history: + box = MDBoxLayout(orientation='vertical', size_hint_y=None, height="125.001dp") + anchor = AnchorLayout(anchor_x="center", anchor_y="center") + grid = GridLayout(cols=2, spacing=dp(20), size_hint_x=None, size_hint_y=None, size=[dp(320), dp(200)], + padding=dp(0)) + + img = Image(source=item['source'], size_hint_x=None, size_hint_y=None, width=dp(100), height=dp(125), + allow_stretch=True) + label = MDLabel( + text=item['Book_name'], + font_name="BPoppins", + size_hint_x=None, + size_hint_y=None, + bold=True, + size=[dp(215), dp(60)], + padding=dp(0), + on_touch_down=lambda instance, touch: self.change_cursor(True), + on_touch_up=lambda instance, touch: self.change_cursor(False), + ) + + B_date = datetime.strptime(item['time'], '%Y-%m-%d %H:%M:%S.%f') + B_date = B_date.strftime("%d-%m-%Y") + + formated_B = "" + for i in range(10): + formated_B += B_date[i] + + R_date = datetime.strptime(item['Return_Date'], '%d/%m/%Y') + R_date = R_date.strftime("%d-%m-%Y") + formated_R = "" + for i in range(10): + formated_R += R_date[i] + + date22 = f"""Borrow Date: {formated_B}\nReturn Date: {formated_R}""" + + label1 = MDLabel( + text=date22, + font_name="BPoppins", + size_hint_x=None, + size_hint_y=None, + size=[dp(215), dp(50)], + padding=dp(0), + on_touch_down=lambda instance, touch: self.change_cursor(True), + on_touch_up=lambda instance, touch: self.change_cursor(False), + ) + + btn = Button( + text=item['text'], + font_name="BPoppins", + size_hint=(None, None), + size=(dp(200), dp(30)), + background_color=(0, 0, 1, 1), + on_touch_down=lambda instance, touch: self.change_cursor(True), + on_touch_up=lambda instance, touch: self.change_cursor(False), + ) + vertical_box = BoxLayout(orientation='vertical', size_hint_y=None, height=label.height + btn.height) + vertical_box.add_widget(label) + vertical_box.add_widget(label1) + vertical_box.add_widget(btn) + + grid.add_widget(img) + grid.add_widget(vertical_box) + anchor.add_widget(grid) + box.add_widget(anchor) + self.history_grid.add_widget(box) + + def data_load(self): + self.search_field.bind(text=self.search_books) + self.search_grid.clear_widgets() + self.data_tables = MDDataTable( + pos_hint={'center_x': 0.5, 'center_y': 0.4}, + size_hint=(0.95, 0.5), + use_pagination=True, + padding=dp(0), + rows_num=7, + pagination_menu_pos='auto', + background_color_selected_cell=(0.8, 0.9, 1, 1), + column_data=[ + ("Book Name", dp(80)), + ("Author", dp(50)), + ("Publication Year", dp(30)), + ("Publisher", dp(40)), + ("ISBN", dp(30)), + ("Availability", dp(30)), + ], + row_data=get_books() + ) + self.search_grid.add_widget(self.data_tables) + + def search_books(self, instance, value): + all_data = get_books() + filtered_data = [row for row in all_data if ( + value.lower() in row[0].lower() or value.lower() in row[1].lower() or value.lower() in row[4])] + self.data_tables.row_data = filtered_data + + def get_recommendations(self): + book_title = self.book_input.text + recommendations = self.rec_book(book_title) + if isinstance(recommendations, str): + self.rec_label.text = recommendations + self.rec_grid.clear_widgets() + else: + self.display_rec_table(recommendations) + + @staticmethod + def rec_book(book_title): + book_title_lower = book_title.lower() + if book_title_lower not in df["Name_lower"].values: + return f"{book_title} not in database" + index = df[df['Name_lower'] == book_title_lower].index[0] + + distance, indices = knn.kneighbors(s_matrix[index].reshape(1, -1)) + rec_title = df.iloc[indices.flatten()]["Name"].tolist() + aval = df.iloc[indices.flatten()]["Availability"].tolist() + isbn = df.iloc[indices.flatten()]["ISBN"].tolist() + + recommendation = list(zip(rec_title, isbn, aval)) + + return recommendation + + def display_rec_table(self, recommendations): + self.rec_grid.clear_widgets() + data_tables = MDDataTable( + pos_hint={'center_x': 0.5, 'center_y': 0.2}, + size_hint=(0.95, 0.2), + use_pagination=True, + padding=dp(0), + rows_num=6, + pagination_menu_pos='auto', + background_color_selected_cell=(0.8, 0.9, 1, 1), + column_data=[ + ("Book Name", dp(80)), + ("ISBN", dp(30)), + ("Availability", dp(30)), + ], + row_data=[(title, isbn, availability) for title, isbn, availability in recommendations] + ) + self.rec_grid.add_widget(data_tables) + + def where_is_book(self): + with open('data/book_positions.csv', 'r') as csvfile: + data = csv.reader(csvfile, delimiter=',') + rows = list(data) + a = self.book_pos_name.text.lower() + for row in rows: + if row[0].lower() == a: + pos = str(row[1]) + self.book_pos.text = f"{a.upper()} Book is kept at {row[1]} location. Please Go and Borrow it!!\n({row[1]} means {pos[0]} th row, Left/Right side(L/R), {pos[2]} th shelf, {pos[3]} th shelf step )" + break + else: + self.book_pos.text = "Please check the Spell!" + + +# LabelBase.register(name="MPoppins", fn_regular="fonts/Poppins/Poppins-Medium.ttf") +# LabelBase.register(name="BPoppins", fn_regular="fonts/Poppins/Poppins-SemiBold.ttf") +# LabelBase.register(name="RRubik", fn_regular="fonts/Rubik_Vinyl/RubikVinyl-Regular.ttf") +# LabelBase.register(name="RCro", fn_regular="fonts/Croissant_One/CroissantOne-Regular.ttf") +# LabelBase.register(name="RPac", fn_regular="fonts/Pacifico/Pacifico-Regular.ttf") + + + +if __name__ == '__main__': + app().run() + + + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..92a3622 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +numpy==1.24.4 +pandas==2.0.3 +scikit-learn==1.3.0 +kivy==2.3.1 +kivymd==1.2.0 +pywhatkit==5.0 +reportlab==4.0.0