Road Draft
Road Draft
Road Draft
[2]
Chapter 4
Administrative Procedures
The reported road problems are accessible to administrators for examination.
They have the power to delegate maintenance chores to pertinent staff or divisions.
Each reported issue may be tracked by administrators, who can then guarantee prompt
resolution.
Monitoring of maintenance:
The development of ongoing maintenance projects can be observed by administrators.
They get access to a thorough summary of all concerns that have been reported and
their current states.
Administrators can then efficiently prioritize activities and assign resources as a
result.
|
[3]
Users' functionality:
Through the web-based interface, users can simply report road issues.
For tracking purposes, each reported issue is assigned a specific ticket number.
Administrators' functionality:
All reported road issues are shown on a dashboard that is accessible to administrators.
Based on the seriousness and impact of the reported difficulties, they might review
and order them.
Maintenance chores are delegated by administrators to the proper staff or divisions.
They can keep track of the development and status of every reported problem.
Administrators can create thorough reports using the system for analysis and decision-
making.
Users can readily report road concerns using the Road Maintenance Management
System, and administrators can quickly handle, manage, and address these issues,
assuring effective road maintenance and improving overall transportation safety and
efficiency.
[4]
System architecture
ERD
[5]
Used technologies.
PHP.
Web development capabilities: PHP is a great option for creating web-based systems like the
Road Maintenance Management System because it was created expressly for web
development. It smoothly integrates with HTML, allowing programmers to insert PHP code
right into web pages, enabling the creation of dynamic content.
PHP is simple to learn and use, especially when compared to other programming languages.
Since its syntax is comparable to those of C and Perl, developers with experience in these
languages can easily use it. PHP is user-friendly in part because of the abundance of online
resources, documentation, and community assistance
Large User Base and Widespread Library Support: The PHP user base is enormous and very
active. This community-driven feature makes guarantee that there is constant improvement,
problem fixing, and security upgrades. A large number of libraries, frameworks, and
extensions (such as Laravel and Symfony) are also available for PHP, giving developers
access to a wide range of tools and resources to speed up development and improve
functionality.
Database Integration: PHP has strong connectivity support for databases. It works effortlessly
with a variety of database management systems, including MySQL, one of the most widely
used options for online applications. The Road Maintenance Management System can easily
store and retrieve data thanks to this connectivity, ensuring efficient operations and data
management.
[12]
Performance & Scalability: PHP has a reputation for being scalable, making it appropriate for
both small-scale and enterprise-level applications. PHP applications are able to handle huge
traffic volumes while preserving performance with the use of suitable coding standards and
optimization methods. Performance is further enhanced by PHP's support for caching systems
and accelerators like APC and OPcache.
PHP has a strong presence in the web development business and has attracted a large
following from the community. PHP is used by a lot of well-known websites and platforms,
including Facebook, WordPress, and Wikipedia. Due to its widespread use, PHP is a
dependable and well-supported technology that benefits from a large development
community, robust community support, and an abundance of readily available resources.
Overall, PHP is popular and widely used because to its aptitude for web development,
simplicity, cross-platform interoperability, database integration, scalability, and affordability.
These elements make PHP a reliable and adaptable option for creating programs like the
Road Maintenance Management System, along with a sizable and active community,
substantial libraries, and ongoing development.
Mysql
Structure: Using tables made up of rows and columns, MySQL arranges data. Every record is
represented by a row, and every attribute or field is represented by a column. Primary and
foreign keys can be used to construct the connections between tables.
Data Types: MySQL supports a wide range of data types, including boolean, date and time,
text, and numeric. Each data type has unique characteristics and limitations that specify how
the data is handled and stored.
SQL is the structured query language that MySQL employs to communicate with the
database. For the purposes of storing, retrieving, updating, and removing data, SQL offers a
wide range of commands. Users can create intricate queries, joins, and aggregations to get the
needed data out of the database.
[13]
Indexing: In order to enhance query performance, MySQL supports indexing. Data structures
called indexes allow for quick access to information depending on particular columns. By
lowering the amount of disk I/O required, they can greatly speed up data retrieval activities.
Transactions are groups of database activities that are handled as a single entity and are
supported by MySQL. Data integrity is ensured through transactions, which either commit all
changes or roll them back in the event of a mistake. In applications where data consistency is
crucial, this capability is very crucial.
Security: To secure data, MySQL offers strong security features. Administrators can manage
who has access to the database and its objects thanks to its support for user authentication and
permission. In order to protect sensitive data, it also provides encryption options.
High availability and fault tolerance are made possible by MySQL's provision for replication,
which enables the creation of numerous copies of the database. Replication enhances
scalability and offers backup alternatives by enabling data synchronization across different
database instances.
Stored Procedures and Triggers: MySQL supports the development of stored procedures and
triggers. Database objects known as triggers go into action automatically in response to
certain events, such as the insertion or updating of data. The precompiled collections of SQL
statements known as stored procedures are ready to use whenever needed.
Compatibility and Ecosystem: MySQL has a large user base and strong community backing.
Different operating systems and programming languages are compatible with it. Furthermore,
MySQL works well with a variety of other technologies, including web servers, programming
frameworks, and analytical software.
[14]
Javascript.
JavaScript is largely a client-side scripting language, which implies that it executes on the
user's web browser rather than a server. As a result, programmers may make interactive web
sites that instantly react to user input.
Numerous Uses: JavaScript is not just for web development. It has a wide range of uses. It is
also utilized in different settings, including desktop application development with
frameworks like Electron, server-side with Node.js, and mobile app development with
frameworks like React Native and Ionic.
Syntax and Features: The syntax of JavaScript is comparable to that of other programming
languages like C++ and Java, making it relatively simple for developers to learn. It supports
both functional programming approaches and object-oriented programming (OOP) ideas like
classes and inheritance.
DOM Manipulation: JavaScript offers effective capabilities for modifying an HTML page's
Document Object Model (DOM). JavaScript allows you to handle events like clicks, mouse
movements, and keyboard inputs as well as dynamically generate, alter, and delete HTML
elements.
JavaScript offers outstanding support for asynchronous programming, which enables tasks to
be carried out concurrently without obstructing the main thread. This is necessary to manage
network requests, retrieve data from APIs, and carry out other time-consuming tasks without
the user interface freezing.
Libraries and Frameworks: A large ecosystem of libraries and frameworks exists for
JavaScript, which expands its functionality and speeds up development. Popular libraries for
DOM manipulation, data visualization, and handling dates and times are jQuery, D3.js, and
moment.js. Complex online applications can be built using structured methods provided by
frameworks like React, Angular, and Vue.js.
[15]
All of the popular online browsers, including Chrome, Firefox, Safari, and Edge, support
JavaScript. However, the implementations and support for more recent language features may
vary slightly between browsers. To create versions of modern JavaScript code that are
backward-compatible, developers frequently utilize transpilers like Babel.
JavaScript contains security implications that developers should be aware of, just like any
other programming language. For instance, if user input is not correctly checked and
sanitized, Cross-Site Scripting (XSS) attacks may take place. Best practices must be
followed, and security precautions including input validation, secure coding techniques, and
secure communication protocols must be used.
Continuous Evolution: New language features and advancements are always being added to
JavaScript. Regular updates are made to the ECMAScript standard, which specifies
JavaScript. The 2015 release of ECMAScript 6 (ES6) brought about important improvements
including arrow functions, classes, modules, and promises. It's crucial for developers to keep
up with current developments and industry best practices.
Community and Learning Resources: There is a sizable and vibrant community of JavaScript
developers all over the world. Developers can ask questions, share information, and work on
projects in a variety of online groups, forums, and tutorials. For seasoned developers as well
as newbies, popular learning sites like MDN Web Docs, W3Schools, and freeCodeCamp
offer in-depth training and tips.
[16]
Development.
Code explanations.
Database connection.
This line defines a variable named $logo and assigns it a string value. The string is an HTML
<img> tag that specifies the source, width, and height of an image file. The image source
points to a file located in the "../images/icon" directory named "logo.png".
This line defines a variable named $sitename and assigns it a string value. The string is an
HTML <font> tag that specifies the color and size of the text. The color is set to white
(#FFFFFF), and the size is increased by 5. The text content is "EIEM".
$server="localhost";
This line defines a variable named $server and assigns it the value "localhost". This indicates
that the MySQL database server is running on the same machine as the PHP script.
$database="eiem_project";
This line defines a variable named $database and assigns it the value "eiem_project". This
variable represents the name of the database that the PHP script will connect to.
[17]
$username = "root";
This line defines a variable named $username and assigns it the value "root". This variable
represents the username used to connect to the MySQL database.
$password = "";
This line defines a variable named $password and assigns it an empty string. This variable
represents the password used to connect to the MySQL database. In this case, there is no
password specified.
This line creates a new instance of the mysqli class, which is a built-in PHP class used for
connecting to a MySQL database. It takes four parameters: the server name, username,
password, and database name. The resulting instance is assigned to the variable $con.
if ($con->connect_errno) { ... }
This line checks if there was an error connecting to the MySQL database. If there was an
error, the code within the curly braces will be executed.
This line outputs an error message if the connection to the MySQL database fails. The error
message includes the text "Failed to connect to MySQL: " concatenated with the specific
error message obtained from the $con->connect_error property.
exit();
This line terminates the execution of the PHP script if there was an error connecting to the
MySQL database. The script will stop running after this line.
[18]
Login
include "../resources/connection.php";
This line includes the file "connection.php" located in the "../resources" directory. It is likely
that this file contains the code to establish a database connection using the mysqli class, as
mentioned in the previous example.
if(isset($_POST['hid'])){ ... }
This line checks if the form submission contains a POST parameter named 'hid'. It is often
used to determine if a form has been submitted. The code within the curly braces will be
executed if the condition is true.
This line executes a SQL SELECT query on the database using the query() method of the
$con object (assumed to be a valid database connection). The query selects the rows from the
'users_master' table where the 'users_email', 'users_password', and 'u_status' column values
match the submitted email, password, and '0' respectively.
$num = $res->num_rows;
This line retrieves the number of rows returned by the previous SELECT query and assigns it
to the variable $num.
[19]
This line checks if there is exactly one row that matches the provided email, password, and
'u_status'. If the condition is true, the code within the curly braces will be executed.
This line executes another SQL SELECT query to fetch the 'users_id' and 'users_type' from
the 'users_master' table where the 'users_email' matches the submitted email.
$id_data = $id_req->fetch_array();
This line fetches the result of the previous query and stores it in the associative array
$id_data.
This line executes yet another SQL SELECT query to fetch the 'users_id', 'first_name', and
'profile_pic' from the 'register_user_master' table where the 'users_id' matches the 'users_id'
obtained from the previous query.
$data = $req->fetch_array();
This line fetches the result of the previous query and stores it in the associative array $data.
if($id_data['users_type']!="Administrator"){ ... }
This line checks if the 'users_type' obtained from the first query is not equal to
"Administrator". If true, the code within the curly braces will be executed.
session_start();
This line starts a PHP session, which allows you to store and retrieve data across multiple
pages for a specific user.
$_SESSION['khjshdagsj'] = md5(time());
This line assigns a unique session identifier to the 'khjshdagsj' key in the $_SESSION
superglobal array. The identifier is generated by hashing the current timestamp using the
md5() function.
$_SESSION['id'] = $data['users_id'];
This line stores the 'users_id' from the 'register_user_master' table in the session variable 'id'.
[20]
$_SESSION['name'] = $data['first_name'];
This line stores the 'first_name' from the 'register_user_master' table in the session variable
'name'.