


Let me share some useful information today. Implementation of curriculum in PHP. ,.php curriculum_PHP tutorial
Today I will share some useful information. Implementation of curriculum in PHP. , .php course schedule
First post the code, and then go into details after posting the code:
Front HTML:
<span> 1</span> <span><</span><span>div </span><span>id</span><span>="studentRead"</span><span> class</span><span>="reading"</span><span> style</span><span>="z-index:10"</span> <span>></span> <span> 2</span> <span><</span><span>div </span><span>class</span><span>="class-table"</span><span>></span> <span> 3</span> <span><</span><span>div </span><span>class</span><span>="class-table-tit clearfix"</span><span>></span> <span> 4</span> <span><</span><span>h3 </span><span>class</span><span>="fl"</span><span>></span>班级课程表<span></</span><span>h3</span><span>></span> <span> 5</span> <span><</span><span>a </span><span>class</span><span>="fr"</span><span> id </span><span>='studentEditKcb' </span><span>attr</span><span>="edit"</span><span> onclick </span><span>= "editKcb(this);"</span><span> style</span><span>="cursor:pointer;"</span><span>></span><span>编辑 </span><span> 6</span> <span></</span><span>a</span><span>></span> <span> 7</span> <span></</span><span>div</span><span>></span> <span> 8</span> <span><</span><span>table </span><span>border</span><span>="0"</span><span> cellspacing</span><span>="0"</span><span> cellpadding</span><span>="0"</span><span> id </span><span>= "myTable"</span><span>></span> <span> 9</span> <span><</span><span>tr</span><span>></span> <span>10</span> <span><</span><span>th </span><span>width</span><span>="5%"</span><span>></</span><span>th</span><span>></span> <span>11</span> <span><</span><span>th </span><span>width</span><span>="19%"</span><span>></span>周一<span></</span><span>th</span><span>></span> <span>12</span> <span><</span><span>th </span><span>width</span><span>="19%"</span><span>></span>周二<span></</span><span>th</span><span>></span> <span>13</span> <span><</span><span>th </span><span>width</span><span>="19%"</span><span>></span>周三<span></</span><span>th</span><span>></span> <span>14</span> <span><</span><span>th </span><span>width</span><span>="19%"</span><span>></span>周四<span></</span><span>th</span><span>></span> <span>15</span> <span><</span><span>th </span><span>width</span><span>="19%"</span><span>></span>周五<span></</span><span>th</span><span>></span> <span>16</span> <span></</span><span>tr</span><span>></span> <span>17</span> <span><</span><span>tr </span><span>id </span><span>= "focustr"</span><span>></span> <span>18</span> <span><</span><span>td </span><span>rowspan</span><span>="4"</span><span> class</span><span>="td-bg"</span><span>></span>上<span><</span><span>br</span><span>/></span>午<span></</span><span>td</span><span>></span> <span>19</span> <span><</span><span>volist </span><span>name </span><span>= "dataListStu"</span><span> id </span><span>= "val"</span><span> offset</span><span>="0"</span><span> length</span><span>='1'</span><span>></span> <span>20</span> <span><</span><span>volist </span><span>name </span><span>= "val"</span><span> id </span><span>= "value"</span><span>></span> <span>21</span> <span><</span><span>td</span><span>></span> <span>22</span> <span><</span><span>input </span><span>id </span><span>= "focusId"</span><span> readonly</span><span>="true"</span><span> maxlength</span><span>='7' </span><span>type</span><span>="text"</span><span> value</span><span>="{$value}"</span> <span>/></span> <span>23</span> <span></</span><span>td</span><span>></span> <span>24</span> <span></</span><span>volist</span><span>></span> <span>25</span> <span></</span><span>volist</span><span>></span> <span>26</span> <span></</span><span>tr</span><span>></span> <span>27</span> <span><</span><span>volist </span><span>name </span><span>= "dataListStu"</span><span> id </span><span>= "val"</span><span> offset</span><span>="1"</span><span> length</span><span>='3'</span><span>></span> <span>28</span> <span><</span><span>tr</span><span>></span> <span>29</span> <span><</span><span>volist </span><span>name </span><span>= "val"</span><span> id </span><span>= "value"</span><span>></span> <span>30</span> <span><</span><span>td</span><span>></span> <span>31</span> <span><</span><span>input </span><span>readonly</span><span>="true"</span><span> maxlength</span><span>='7' </span><span>type</span><span>="text"</span><span> value</span><span>="{$value}"</span> <span>/></span> <span>32</span> <span></</span><span>td</span><span>></span> <span>33</span> <span></</span><span>volist</span><span>></span> <span>34</span> <span></</span><span>tr</span><span>></span> <span>35</span> <span></</span><span>volist</span><span>></span> <span>36</span> <span><</span><span>tr</span><span>></span> <span>37</span> <span><</span><span>td </span><span>rowspan</span><span>="4"</span><span> class</span><span>="td-bg"</span><span>></span>下<span><</span><span>br</span><span>/></span>午<span></</span><span>td</span><span>></span> <span>38</span> <span><</span><span>volist </span><span>name </span><span>= "dataListStu"</span><span> id </span><span>= "val"</span><span> offset</span><span>="4"</span><span> length</span><span>='1'</span><span>></span> <span>39</span> <span><</span><span>volist </span><span>name </span><span>= "val"</span><span> id </span><span>= "value"</span><span>></span> <span>40</span> <span><</span><span>td</span><span>></span> <span>41</span> <span><</span><span>input </span><span>readonly</span><span>="true"</span><span> maxlength</span><span>='7' </span><span>type</span><span>="text"</span><span> value</span><span>="{$value}"</span> <span>/></span> <span>42</span> <span></</span><span>td</span><span>></span> <span>43</span> <span></</span><span>volist</span><span>></span> <span>44</span> <span></</span><span>volist</span><span>></span> <span>45</span> <span></</span><span>tr</span><span>></span> <span>46</span> <span><</span><span>volist </span><span>name </span><span>= "dataListStu"</span><span> id </span><span>= "val"</span><span> offset</span><span>="5"</span><span> length</span><span>='3'</span><span>></span> <span>47</span> <span><</span><span>tr</span><span>></span> <span>48</span> <span><</span><span>volist </span><span>name </span><span>= "val"</span><span> id </span><span>= "value"</span><span>></span> <span>49</span> <span><</span><span>td</span><span>></span> <span>50</span> <span><</span><span>input </span><span>readonly</span><span>="true"</span><span> maxlength</span><span>='7' </span><span>type</span><span>="text"</span><span> value</span><span>="{$value}"</span> <span>/></span> <span>51</span> <span></</span><span>td</span><span>></span> <span>52</span> <span></</span><span>volist</span><span>></span> <span>53</span> <span></</span><span>tr</span><span>></span> <span>54</span> <span></</span><span>volist</span><span>></span> <span>55</span> <span></</span><span>table</span><span>></span> <span>56</span> <span></</span><span>div</span><span>></span> <span>57</span> <span></</span><span>div</span><span>></span>
CSS:

JS part:

加载失败,请重试!
"); 70 } 71 }); 72 73 // 74 // } 75 } View CodeBackend part:


Let’s start with the details: Let’s take a rendering first. Before editing:
Editing (click the upper right corner to edit):
Added some positioning and background color changes. Let users have a better experience,
Step one: When receiving this request, first I was thinking about how to get the data in the table. The first thing I thought of was to use nested for loops, and then Add judgment and add data to the defined array, but later I thought that would lead to
The data is correct, but there is a problem with the stored data. Let me give you an example: data[]={
data[1]={
data[1][1] = 0;
... ...
}
Data[2]={data[2][0]= 1;
... ...
}
… ...
}
It means that when I loop by row, because the first and fifth rows have an extra
Later I decided not to do this. I added a unique class and got the sentence var kecbInput = $(".activeStu");. This sentence means to get the collection of all objects with class="activeStu".
As for the rest of the loop writing method, if you don’t understand it, you can ask directly in the article, I won’t go into details.
The second step : After writing and obtaining the value, all that is left is to pass the value to the background. The idea is that each student has a unique course of his own surface. It's still the old method of using ajax to pass values. When saving data, save the data in json format for storage.
The third step : Pass the value to the front page and display it. In fact, many students here say that this is simple. Isn’t it just a for loop using js to control the display? Well, then it proves that you have not grasped the usefulness of the php volist tag!
Using volist, you can easily display the value you want to assign just like the code I posted.
A lot of things are actually in the posted code. My expression ability is not very good, or I don’t understand these things to a certain extent.
Originally I wanted to share some ideas with everyone, but after writing and discovering, there is actually nothing to say. That’s it. But I still think it’s better to post it. Maybe some people need it? Even though it was simple, it didn’t take long. But I believe that if you keep sharing, you may have a deeper understanding.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.
