You are on page 1of 51

Agent ​System

‫‪Table of contents‬‬
‫‪Table of contents‬‬ ‫‪2‬‬

‫‪Project files‬‬ ‫‪4‬‬


‫‪Backend‬‬ ‫‪4‬‬
‫‪Frontend‬‬ ‫‪4‬‬
‫‪Log‬‬ ‫‪4‬‬
‫‪Other‬‬ ‫‪5‬‬

‫ﺗﺴﺠﯿﻞ اﻟﺪﺧﻮل‬ ‫‪6‬‬

‫اﻟﻘﺎﺋﻤﺔ اﻟﺮﺋﯿﺴﯿﺔ‬ ‫‪8‬‬

‫ﻣﻌﻠﻮﻣﺎت اﻟﺤﺴﺎب‬ ‫‪9‬‬

‫ﺳﺠﻞ اﻟﺘﺤﻮﯾﻼت‬ ‫‪12‬‬

‫ﺳﺠﻞ اﻟﺪﻓﻌﺎت‬ ‫‪13‬‬

‫اﻟﺒﺤﺚ‬ ‫‪15‬‬

‫إﺿﺎﻓﺔ ﻣﺴﺘﺨﺪم‬ ‫‪16‬‬

‫ﺗﺤﻮﯾﻞ رﺻﯿﺪ‬ ‫‪17‬‬

‫اﻟﺴﺠﻼت‬ ‫‪18‬‬
‫ﺳﺠﻞ دﻓﻌﺎﺗﻲ‬ ‫‪18‬‬
‫ﺳﺠﻞ ﺗﺤﻮﯾﻼﺗﻲ‬ ‫‪18‬‬

‫ﻃﻠﺒﺎت ﺷﺮاء‬ ‫‪18‬‬


‫دﻓﻊ ﻓﺎﺗﻮرة‬ ‫‪19‬‬
‫ﺗﻐﯿﯿﺮ اﻟﺴﺮﻋﺔ‬ ‫‪20‬‬
‫اﺷﺘﺮاك ﺟﺪﯾﺪ‬ ‫‪21‬‬
‫ﺗﺠﻤﯿﺪ ﺣﺴﺎب‬ ‫‪23‬‬
‫ﻣﻀﺎﻋﻔﺔ اﻟﺴﺮﻋﺔ‬ ‫‪24‬‬
‫إﻟﻐﺎء ﻣﻀﺎﻋﻔﺔ اﻟﺴﺮﻋﺔ‬ ‫‪25‬‬

‫اﺳﺘﻌﺮاض‬ ‫‪26‬‬
‫اﺳﺘﻌﺮاض اﻟﻤﻘﺎﺳﻢ‬ ‫‪26‬‬
‫ﻣﺴﺘﺨﺪﻣﻲ اﻟﻨﻈﺎم‬ ‫‪30‬‬

‫اﻟﻘﺎﺋﻤﺔ اﻹدارﯾﺔ‬ ‫‪31‬‬


‫ﺗﻨﺒﯿﻪ ﻋﺎم‬ ‫‪31‬‬
‫ﻃﻠﺒﺎت ﻟﻠﻤﻮاﻓﻘﺔ‬ ‫‪33‬‬
‫ﻃﻠﺒﺎت ﻣﺮﻓﻮﺿﺔ‬ ‫‪34‬‬
‫ﺗﺼﺪﯾﺮ ﻧﻘﻄﺔ ﺑﯿﻊ‬ ‫‪35‬‬
‫ﺗﺤﺮﯾﺮ اﻟﺒﺎﻗﺎت‬ ‫‪36‬‬
‫ﺗﺤﺮﯾﺮ اﻟﺼﻼﺣﯿﺎت‬ ‫‪37‬‬
‫اﻟﺴﺠﻞ اﻟﻌﺎم‬ ‫‪38‬‬
‫اﻟﺪﻓﻌﺎت‬ ‫‪38‬‬
‫اﻟﺘﺤﻮﯾﻼت‬ ‫‪40‬‬
‫اﻷرﺷﯿﻒ‬ ‫‪42‬‬
‫ﺳﺠﻞ اﻟﺪﻓﻌﺎت‬ ‫‪42‬‬
‫ﺳﺠﻞ اﻟﺘﺤﻮﯾﻼت‬ ‫‪42‬‬
‫ﻗﺎﺋﻤﺔ اﻟﺘﻘﺎرﯾﺮ‬ ‫‪43‬‬
‫إﻧﺸﺎء ﺗﻘﺮﯾﺮ ﺟﺪﯾﺪ‬ ‫‪43‬‬
‫ﺳﺠﻞ اﻟﺘﻘﺎرﯾﺮ‬ ‫‪45‬‬
‫ﺳﺠﻞ اﻟﻤﻘﺎﺳﻢ‬ ‫‪46‬‬
‫ﺣﺎﻟﺔ اﻟﻨﻈﺎم‬ ‫‪47‬‬
‫اﻟﻤﻘﺎﺳﻢ‬ ‫‪48‬‬
‫إﺿﺎﻓﺔ‬ ‫‪49‬‬
‫اﺳﺘﯿﺮاد‬ ‫‪50‬‬

‫‪Export to Excel‬‬ ‫‪51‬‬


Project ​files
The files that we have edited in the system

Backend
➔ In agent2/application/config => We edited on:
1. config.php
2. databases.php
3. Token.php
➔ agent2/application/controllers (All controllers)
➔ agent2/application/models (All models)
➔ agent2/exported/templates:
There are appropriate templates for exporting data to Excel.

Frontend
➔ agent2/file/dist/translations:
Language files exist.
➔ agent2/file/dist/images:
All images in system .
➔ agent2/file/src/css:
All styles in system.
➔ agent2/file/src/js
All functions and routes in frontend system.
➔ agent2/file/templates/
All view pages.

Log
➔ In agent2/logs:
All logs in system.
Other
➔ agent2/agent-upload
➔ agent2/change_token
➔ agent2/agent_config.txt
➔ agent2/gulpfile.js
User guide and documentation
‫ﺗﺴﺠﯿﻞ اﻟﺪﺧﻮل‬
In the browser when requesting the address: ​https://agent2.nas.sy
We move to the login page

Where the code and password are placed and press the login
button
At the code level: ​in ​agent2/application/config/config.php
There is the link we are requesting :
$config['base_url'] = 'agent2.nas.sy';

In​ ​agent2/application/config/database.php
There is database information that we use

When requesting a page /login in ​agent2/file/src/js/app.route.js


the template is executed login-directive ​that is​ located in
agent2/file/src/js/directives.js​ this is where the following HTML
page is requested: ​agent2/file/templates/login.html​ that the user
enters his or her code with the password ,Where these values are taken by
agent2/file/src/js/services.j​s​ They are sent to where
agent2/application/controllers/MainCtrl.php
they are processed in function login_process :
The function checkUser that is located in
agent2/application/models/UserModel.php​ Which verifies that this
information exists in the database, If this user is a system users, his
information is fetched through function getUserInfo that is located in
agent2/application/models/UserModel.php​ ,If it does not exist, an
error message is sent.
The current state of the system is then defined by: function
getCurrentSystemStatus that is located in :
agent2/application/models/OpModel.php
If the information is correct, the token is created in function insert_sess
that is located in ​agent2/application/models/UserModel.php​ The
information for this session is entered in the session table in the database.
This information is then entered into the operationUser table in the
database through function insertOp that is located in
agent2/application/models/OpModel.php​ ,and add user in cookies

Then go to the dashboard in ​agent2/file/src/js/app.route.js


‫اﻟﻘﺎﺋﻤﺔ اﻟﺮﺋﯿﺴﯿﺔ‬

Here the main menu appears according to the user's


permissions
in​ ​agent2/file/src/js/app.route.js​ ​this is where the following
HTML page is requested: ​agent2/file/templates/dashboard.html​,
The main menu is displayed on a page sidebar.html, That are requested
and send a request for the listing in ​agent2/file/src/js/directives.js
The menu is obtained through function index_get that is located in
agent2/application/controllers/Menus.php​ Who gets response from
function newMenu that is located in
agent2/application/models/MenuModel.php​ In which the user's
permissions are checked by function getPrivilegeForMenu that is located
in ​agent2/application/models/UserModel.php
Some elements in the menu have sub-elements obtained through a
function getSubMenu that is located in
agent2/application/models/MenuModel.php
For search within the main menu or submenus is done through function
search that is located in ​agent2/application/models/MenuModel.php

‫ﻣﻌﻠﻮﻣﺎت اﻟﺤﺴﺎب‬
When you press the button

Here is the user information


At the code level: ​When requesting a page /user in
agent2/file/src/js/app.route.js​ the template is executed user-info ​that is
located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/userInfo.html​ That
contain the information that is displayed,This information is retrieved from the
database from the user table by a function getUserInfo that is located in
agent2/application/models/UserModel.php

Here is the user information and can edit his personal information by clicking
on:

At the code level:​ The information is sent from the interface through the
function updateUserInfo that it is located in
agent2/file/src/js/directives.js
The possibility of this modification is verified by a function index_put that is
located in ​agent2/application/controllers/User.php
The database is then modified by a function updateUserInfo that is located in
agent2/application/models/UserModel.php
● User Status: ​The user status is then modified by a function
updateUserStatus that is located in ​agent2/file/src/js/directives.js
The possibility of this modification is verified by a function status_post
that is located in a​ gent2/application/controllers/User.php​ The result
is returned from the database by a function updateUserStatus that is
located in ​agent2/application/models/UserModel.php

- It can modify its password by clicking:

At the code level: ​The information is sent from the interface through the
function updateUserPassword that it is located in
agent2/file/src/js/directives.js​ The possibility of this modification is
verified by a function editPassword_post that is located in
agent2/application/controllers/User.php
The database is then modified by a function updatePassword that is located in
agent2/application/models/UserModel.php
‫ﺳﺠﻞ اﻟﺘﺤﻮﯾﻼت‬

​When you press the button

Here all user transactions are shown, both Outbound


transactions and Incoming transactions,we can search
results,we can be filtered by date, and we can export to excel.

At the code level: ​When requesting a page /transLog in


agent2/file/src/js/app.route.js​ the template is executed trans-log ​that is
located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/trans_agent_get.html
That contain the information that is displayed.
In a​ gent2/file/src/js/app.route.js​, we can search in all transactions
in function trans_agent_get that is located in
agent2/application/controllers/Log.php​,The user is validated and
information is fetched from the database by a function get_trans_log that is
located in ​agent2/application/models/logModel.php
‫ﺳﺠﻞ اﻟﺪﻓﻌﺎت‬

When you press the button

All payments paid by subscribers to the user,we can search


results,we can be filtered by date, and we can export to excel.
At the code level:​When requesting a page /paymentLog in
agent2/file/src/js/app.route.js​ the template is executed payment-log
located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/paymentLog.html​ That
contain the information that is displayed.
In a​ gent2/file/src/js/app.route.js​, we can search in all payments.
In function pay_billing_get located in
agent2/application/controllers/Log.php​,The user is validated and
information is fetched from the database by a function get_pay_billing located
in a​ gent2/application/models/logModel.php​.
When you press the button

At the code level:​ in ​agent2/file/src/js/app.route.js​ ​The information


displayed on the interface is brought,The user and his or her permissions are
verified by a function products_get located in
agent2/application/controllers/AdslPackages.php​ ,in function getProduct
that is located in ​agent2/application/models/UserModel.php
Firstly the role user is validated and get user product from table productUser,
and role product from roleProduct in databases.
‫اﻟﺒﺤﺚ‬
When you press the button

We can search agents or subscribers by name or code


Example :

At the code level: ​When requesting a page /search in


agent2/file/src/js/app.route.js​ the template is executed search-directive
that is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the
following HTML page is requested: ​agent2/file/templates/search.html​,
The request is sent when the code or phone number is greater than 3 characters.
In function index_get that is located in
agent2/application/controllers/Search.php​ check the User privilege and
discuss mistakes.
The search is done by code and fetching information from the database through
a function SearchByCode that is located in
agent2/application/models/UserModel.php​.
The search is done by name and fetching information from the database through
a function searchByName that is located in
agent2/application/models/UserModel.php​.

‫إﺿﺎﻓﺔ ﻣﺴﺘﺨﺪم‬
When you press the button
We can add a new user to the system when filling this data.
At the code level: ​When requesting a page /addEmployee in
agent2/file/src/js/app.route.js​ ​this is where the following HTML page is
requested: ​agent2/file/templates/addEmployee.html​.
In function index_post that is located in
agent2/application/controllers/User.php ​check the User privilege and
discuss mistakes,The user is added to the database through a function add_user
that is located in a​ gent2/application/models/UserModel.php​.

‫ﺗﺤﻮﯾﻞ رﺻﯿﺪ‬
When you press the button

Here you can transfer credit to an agent or point of sale.


At the code level: ​When requesting a page /newPayment in
agent2/file/src/js/app.route.js​ the template is executed new-payment ​that
is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/newPayment.html​,
In function index_post that is located in
agent2/application/controllers/Transaction.php​ check the User privilege
and discuss mistakes,and check balance user through a function checkBalance
that is located in a​ gent2/application/models/UserModel.php​ ,It fetches user
information and checks the current balance
balance transfer is done through a function addNewPayment that is located in
agent2/application/models/paymentsModel.php

‫اﻟﺴﺠﻼت‬

When you press the button A submenu opens:

We'll explain all of them.

‫ﺳﺠﻞ دﻓﻌﺎﺗﻲ‬

‫ﺳﺠﻞ ﺗﺤﻮﯾﻼﺗﻲ‬

‫ﻃﻠﺒﺎت ﺷﺮاء‬

When you press the button A submenu opens:

We'll explain all of them


‫دﻓﻊ ﻓﺎﺗﻮرة‬

Phone number and bill payment are placed


At the code level: ​When requesting a page /invoicePayment in
agent2/file/src/js/app.route.js​ the template is executed invoice-info ​that
is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/adslPayment.html​, and
payment is done by function pay.
In function adsl_invoice_bill_post that is located in
agent2/application/models/payments.php​,check the User privilege and
discuss mistakes, and check balance user through a function checkBalance that
is located in a​ gent2/application/models/UserModel.php​,
The bill is paid through a function invoice_bill that is located in
agent2/application/models/paymentsModel.php​, First, we know the amount
we want to pay and whether it is a debt or not, then if the point of sale is known
commission is adjusted to the amount paid with the commission and the
adjustment to the balance is through a function deductUserBalance that is
located a​ gent2/application/models/UserModel.php​, and then the payment is
made in the billing.
This information is collected and entered into a table paymentBillingOpUser.
- Function getBillingOpID that is located in
agent2/application/models/opModel.php​: get the
id_payment_billing_op
- Function getOpStatusID that is located in
agent2/application/models/opModel.php​:get the operation status.
‫ﺗﻐﯿﯿﺮ اﻟﺴﺮﻋﺔ‬

We can change the internet speed of one of your ISP


subscribers.
At the code level: ​When requesting a page /changeSpeed in
agent2/file/src/js/app.route.js​ the template is executed change-speed ​that
is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/changeADSL.html​, and
change speed is done by function changeSpeed.
In function change_speed_post that is located
agent2/application/controllers/Customers.php​, check the User privilege
and discuss mistakes,check phone from billing,check if there previous
request,and check balance user through a function checkBalance that is located
in ​agent2/application/models/UserModel.php
The speed is changed by a function pendingChangeSpeed that is located
agent2/application/models/AdslModel.php
Firstly we have old package and new package through getProductIdByName
that is located ​agent2/application/models/AdslModel.php​,First, we know the
amount we want to pay and whether it is a debt or not, then if the point of sale is
known commission is adjusted to the amount paid with the commission and the
adjustment to the balance is through a function deductUserBalance that is
located a​ gent2/application/models/UserModel.php​, and then the change
speed.
This information is collected and entered into a table paymentBillingOpUser.
- Function getBillingOpID that is located in
agent2/application/models/opModel.php​: get the
id_payment_billing_op
- Function getOpStatusID that is located in
agent2/application/models/opModel.php​:get the operation status.

‫اﺷﺘﺮاك ﺟﺪﯾﺪ‬

We can add a new subscriber to your ISP.


At the code level: ​When requesting a page /newADSLUser in
agent2/file/src/js/app.route.js​ the template is executed new-adsl ​that is
located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/newAdsl.html​,
Phone prefix is verified by a function checkPhonePrefix, check ports is verified
by a function checkPorts, the addition is done by a function add.
In function adslUser_post in
agent2/application/controllers/Customers.php​ check the User privilege
and discuss mistakes
The price of the package worn is checked by a function getPackagePrice that is
located in a​ gent2/application/models/AdslModel.php​,and check balance user
through a function checkBalance that is located in
agent2/application/models/UserModel.php​,Start inserting into a database is
done through a function newADSLUser that is located in
agent2/application/models/AdslModel.php​, first check pbx availability,and
check operation status through function getOpStatusID that is located in
agent2/application/models/OpModel.php​,and get all money info through
function getMoneyToInsert, then if the point of sale is known commission is
adjusted to the amount paid with the commission and the adjustment to the
balance is through a function deductUserBalance that is located
agent2/application/models/UserModel.php​,
This information is collected and entered into a table paymentBillingOpUser.
and create dump new adsl user in billing.
Taking into account whether the first month is free or not.
‫ﺗﺠﻤﯿﺪ ﺣﺴﺎب‬

We can freeze the account of any subscriber in the ISP.


At the code level: ​When requesting a page /freeze in
agent2/file/src/js/app.route.js​ the template is executed freez-account ​that
is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/freezAccount.html​,
The calculation is frozen by a function freezingAccount.
In function freeze_post that is located in
agent2/application/controllers/Customers.php​, check the account in
synchronization, check the User privilege and discuss mistakes,check phone
from billing, and check balance user through a function checkBalance that is
located in a​ gent2/application/models/UserModel.php​, the operation is done
in a function pendingFreeze that is located
agent2/application/models/AdslModel.php​, get all money info through
function getMoneyToInsert, then if the point of sale is known commission is
adjusted to the amount paid with the commission and the adjustment to the
balance is through a function deductUserBalance that is located
agent2/application/models/UserModel.php​,
This information is collected and entered into a table paymentBillingOpUser.
‫ﻣﻀﺎﻋﻔﺔ اﻟﺴﺮﻋﺔ‬

We can double the speed of an ISP subscriber


At the code level: ​When requesting a page /extraSpeed in
agent2/file/src/js/app.route.js​ the template is executed extra-speed ​that is
located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/extraSpeed.html​, the
operation is performed by a function extraSpeed.
In function extraSpeedConfirm_post that is located in
agent2/application/controllers/Customers.php​, check the User privilege
and discuss mistakes,check phone from billing,and get the pkg speed current
through a function getPkgSpeed that is located in
agent2/application/models/AdslModel.php​.
the speed is doubled by a function pendingExtraSpeed that is located in
agent2/application/models/AdslModel.php​, this information is collected and
entered into a table paymentBillingOpUser.
‫إﻟﻐﺎء ﻣﻀﺎﻋﻔﺔ اﻟﺴﺮﻋﺔ‬

We can cancel the Internet speed increase for an ISP


subscriber.
At the code level: ​When requesting a page /cancelExtraSpeed in
agent2/file/src/js/app.route.js​ the template is executed cancel-extra ​that
is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/cancelExtraSpeed.html​,
The speed increase is canceled by a function cancelExtraSpeed.
In function cancelExtraSpeed_post that is located in
agent2/application/controllers/Customers.php​, check the User privilege
and discuss mistakes,check phone from billing, the operation is done in a
function pendingCancelExtraSpeed that is located in
agent2/application/models/AdslModel.php​, this information is collected and
entered into a table paymentBillingOpUser.
‫اﺳﺘﻌﺮاض‬
When you press the button A submenu opens:

We'll explain all of them.

‫اﺳﺘﻌﺮاض اﻟﻤﻘﺎﺳﻢ‬

Here is displayed all the bpx in the system with the possibility
of deleting and modifying any of them and exporting to Excel
and zeroing of all pbx.
At the code level: ​When requesting a page /browsePbx in
agent2/file/src/js/app.route.js​ the template is executed pbx-list ​that is
located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/pbxList.html​, there are
functions for all operations.
In function index_get that is located in
agent2/application/controllers/Pbx.php​, check the User privilege and
discuss mistakes, get all pbx by a function getPbx that is located in
agent2/application/models/PbxModel.php​.

When you press the button

At the code level:​ in frontend in function update that is located in


agent2/file/src/js/directives.js​.
In function edit_pbx_status_post that is located in
agent2/application/controllers/Pbx.php​,the user privileges are checked and
then the modification to the status of the PBX through a function
updatePbxStatus that is located in a​ gent2/application/models/PbxModel.php​:
get this process ID through a function getPBXOperationId that is located in
agent2/application/models/OpModel.php​.
this information is collected and entered into a table pbxHistory.

When you press the button


At the code level:​ in frontend in function updateAll that is located in
agent2/file/src/js/directives.js​.
In function index_put that is located in
agent2/application/controllers/Pbx.php​,the user privileges are checked and
then the modification to the PBX through a function updatePbxInfo that is
located in ​agent2/application/models/PbxModel.php​:
get this process ID through a function getPBXOperationId that is located in
agent2/application/models/OpModel.php​.
this information is collected and entered into a table pbxHistory.

When you press the button

At the code level:​ in frontend in function delete that is located in


agent2/file/src/js/directives.js​.
In function index_delete that is located in
agent2/application/controllers/Pbx.php​, the user privileges are checked
and then deleted to the PBX through a function deletePBX that is located in
agent2/application/models/PbxModel.php​:
get this process ID through a function getPBXOperationId that is located in
agent2/application/models/OpModel.php​.
When you press the button

At the code level:​ in frontend in function resetPbx that is located in


agent2/file/src/js/directives.js​.
In function reset_ports_post that is located in
agent2/application/controllers/Pbx.php​,the user privileges are checked and
then reset to the all PBX through a function resetPbxports that is located in
agent2/application/models/PbxModel.php​:
And modification in the table pbx.
We can search in the pbx in​ a​ gent2/file/src/js/app.route.js​ W
​ hen
requesting a page /browsePbx .
‫ﻣﺴﺘﺨﺪﻣﻲ اﻟﻨﻈﺎم‬

Here all users are displayed in the system of agents,


employees, points of sale and managers.
We can search and filtering .

At the code level: ​When requesting a page /browseEmployee in


agent2/file/src/js/app.route.js​ ​this is where the following HTML page is
requested: ​agent2/file/templates/browsePOS.html​.
You can search and filtering in ​agent2/file/src/js/app.route.js
In function by_role_get that is located in
agent2/application/controllers/Users.php​, check the User privilege and
discuss mistakes, and get all users by filtering through function users_by_role
that is located in a​ gent2/application/models/UserModel.php​,
The balance of children is calculated if the filters are on the agents.
‫اﻟﻘﺎﺋﻤﺔ اﻹدارﯾﺔ‬

When you press the button A submenu opens:

We'll explain all of them.

‫ﺗﻨﺒﯿﻪ ﻋﺎم‬

Here we can send a notification to a system user or to all


users by role.
At the code level: ​When requesting a page /globalNotify in
agent2/file/src/js/app.route.js​ the template is executed global-notification
that is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the
following HTML page is requested:
agent2/file/templates/globalNotification.html​, and get all users in system
and send notification.
In function index_post that is located in
agent2/application/controllers/Notifications.php​, the user privileges are
checked and then add to the notification through a function addNotify that is
located in ​agent2/application/models/opModel.php​, this information is
collected and entered into a table notification.
In function role_get that is located in
agent2/application/controllers/Notifications.php​, We can get all the
roles in the system through a function get_roles that is located in
agent2/application/models/UserModel.php
The person who received the notification

At the code level: ​in function index_get, The getNotification function is


executed that is located in ​agent2/application/models/UserModel.php
‫ﻃﻠﺒﺎت ﻟﻠﻤﻮاﻓﻘﺔ‬

Here are all pending requests which need approval.

At the code level: ​When requesting a page /pendingOrders in


agent2/file/src/js/app.route.js​ the template is executed pending-orders
that is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the
following HTML page is requested:
agent2/file/templates/pendingOrders.html​, Where the orders can be
searched and filtered and the order can be rejected or approved.
In function by_role_get that is located in
agent2/application/controllers/Users.php​, check the User privilege and
discuss mistakes, and get all users by filtering through function users_by_role
that is located in a​ gent2/application/models/UserModel.php​,
The balance of children is calculated if the filters are on the agents.
In a​ gent2/application/controllers/Orders.php​ :
there are acceptance and rejection function.
‫ﻃﻠﺒﺎت ﻣﺮﻓﻮﺿﺔ‬

At the code level: ​When requesting a page /rejectedOrders in


agent2/file/src/js/app.route.js​ the template is executed rejected-orders
that is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the
following HTML page is requested:
agent2/file/templates/rejected-orders.html​,
‫ﺗﺼﺪﯾﺮ ﻧﻘﻄﺔ ﺑﯿﻊ‬

Here we can export a point of sale from another agent's agent


At the code level: ​When requesting a page /exportPOS in
agent2/file/src/js/app.route.js​ the template is executed export-pos ​that is
located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/exportPOS.html​,
In function export_post that is located in
agent2/application/controllers/Pos.php​, check the User privilege and
discuss mistakes, and check for mismatch (pos, old_agent) and check for
current_balance.
The point of sale is exported through a function import_pos that is located in
agent2/application/models/UserModel.php​, where user table is modified.
‫ﺗﺤﺮﯾﺮ اﻟﺒﺎﻗﺎت‬

Here the Products of each user role are modified


At the code level: ​When requesting a page /roleProduct in
agent2/file/src/js/app.route.js​ the template is executed edit-product ​that
is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the following
HTML page is requested: ​agent2/file/templates/editProducts.html​, and
edit role product.
In function edit_role_product_post that is located in
agent2/application/controllers/Users.php​, check the User privilege and
discuss mistakes, and get roles id through a function get_role_id that is located
in a​ gent2/application/models/UserModel.php​,and update role product
through a function updateRoleProduct that is located in
agent2/application/models/UserModel.php​, where roleProduct table is
modified.
‫ﺗﺤﺮﯾﺮ اﻟﺼﻼﺣﯿﺎت‬

Here the privileges of each user role are modified


At the code level: ​When requesting a page /rolePrivilege in
agent2/file/src/js/app.route.js​ the template is executed edit-privileges
that is​ located in​ a​ gent2/file/src/js/directives.js​ this is where the
following HTML page is requested:
agent2/file/templates/editPrivileges.html​, and edit role privilege.
In function edit_role_privilege_post that is located in
agent2/application/controllers/Users.php​, check the User privilege and
discuss mistakes, and get roles id through a function get_role_id that is located
in a​ gent2/application/models/UserModel.php​,and update role privilege
through a function updateRolePrivilege that is located in
agent2/application/models/UserModel.php​, where rolePrivilege table is
modified.
‫اﻟﺴﺠﻞ اﻟﻌﺎم‬
When you press the button A submenu opens:

We'll explain all of them.

‫اﻟﺪﻓﻌﺎت‬

All payments paid by users in system ,we can search


results,we can be filtered by date, and we can export to excel.
At the code level:​When requesting a page /generalPaymentLog in
agent2/file/src/js/app.route.js​ the template is executed general-pay-log
located in​ a​ gent2/file/src/js/directives.js​, this is where the following
HTML page is requested: ​agent2/file/templates/generalPayLog.html​ That
contain the information that is displayed.
In a​ gent2/file/src/js/app.route.js​ we can search in all payments
In function general_pay_log_get located in
agent2/application/controllers/Log.php​,The user is validated and
information is fetched from the database by a function get_pay_billing located
in a​ gent2/application/models/logModel.php​ .
When you press the button

We can update the payment


At the code level:​ in frontend in function update that is located in
agent2/file/src/js/directives.js​.
In function index_put that is located in
agent2/application/controllers/Payments.php​,​ ​check the User privilege and
discuss mistakes,
Updates a payment and returns the updated payment in response through a
function updatePayment that is located in
agent2/application/models/PaymentsModel.php​, where we updated in
money, user balance after, benefit rate and balance to add in
paymentBillingOpUser table.

When you press the button

We can delete the payment.

At the code level:​ in frontend in function delete that is located in


agent2/file/src/js/directives.js​.
In function index_delete that is located in
agent2/application/controllers/Payments.php​,​ ​check the User privilege and
delete a payment through a function delete_payment that is located in
agent2/application/models/PaymentsModel.php​, where we updated in
money, user balance and delete in paymentBillingOpUser table.
‫اﻟﺘﺤﻮﯾﻼت‬

All conversions made by users in the system, we can search


for results, can be filtered by date, and we can export to excel.
At the code level:​When requesting a page /generalTransLog in
agent2/file/src/js/app.route.js​ the template is executed general-trans-log
located in​ a​ gent2/file/src/js/directives.js​, this is where the following
HTML page is requested: ​agent2/file/templates/generalTransLog.html
That contain the information that is displayed.
In a​ gent2/file/src/js/app.route.js​ we can search in all Conversions
In function general_trans_log_get located in
agent2/application/controllers/Log.php​, we check in privilege information
is fetched from the database by a function get_general_trans_log located in
agent2/application/models/logModel.php​ .
When you press the button

We can edit the converted, commissions and date and add a


note to it.
At the code level:​ in frontend in function update that is located in
agent2/file/src/js/directives.js​.
In function index_put that is located in
agent2/application/controllers/Transaction.php​,​ ​check the User privilege
and discuss mistakes,
Updates a transformation and returns the updated transformation in response
through a function edit_trans that is located in
agent2/application/models/PaymentsModel.php​, where we updated in
money, user balance after, benefit rate and balance to add in
paymentOperationUser table.
When you press the button

We can delete the converted.


At the code level:​ in frontend in function delete that is located in
agent2/file/src/js/directives.js​.
In function index_delete that is located in
agent2/application/controllers/Transaction.php​,​ ​check the User privilege
and delete a transformation through a function delete_trans that is located in
agent2/application/models/PaymentsModel.php​, where we updated in
money, user balance in paymentOperationUser table.

‫اﻷرﺷﯿﻒ‬
When you press the button A submenu opens:

‫​ ﺳﺠﻞ اﻟﺪﻓﻌﺎت‬

‫ﺳﺠﻞ اﻟﺘﺤﻮﯾﻼت‬

Here are all payments and conversions that are archived


‫ﻗﺎﺋﻤﺔ اﻟﺘﻘﺎرﯾﺮ‬
When you press the button A submenu opens:

We'll explain all of them.

‫إﻧﺸﺎء ﺗﻘﺮﯾﺮ ﺟﺪﯾﺪ‬

We can create a new report to see conversions or sales for a


specific user or all users.
At the code level:​When requesting a page /addReport in
agent2/file/src/js/app.route.js​, ​this is where the following HTML page is
requested: ​agent2/file/templates/addReport.html
When you fill out the data and request the report we move to the page
agent2/file/templates/report.html
Example:

In function index_post that is located in


agent2/application/controllers/Report.php​,​ ​check the User privilege and
create the report by a function generateReport that is located in
agent2/application/models/reportModel.php​, Where the discussion is in the
presence of code or not and fetch the report by type( functions located in
agent2/application/models/logModel.php​) and enter the information in the
report table.
In function index_get that is located in
agent2/application/controllers/Report.php​, check the User privilege and
get the report by number.
‫ﺳﺠﻞ اﻟﺘﻘﺎرﯾﺮ‬

All reports requested.


At the code level:​When requesting a page /reportLog in
agent2/file/src/js/app.route.js​, ​this is where the following HTML page is
requested: ​agent2/file/templates/reportsLog.html
In function log_get that is located in
agent2/application/controllers/Report.php​, ​check the User privilege and
get all reports by function allReport that is located in
agent2/application/models/logModel.php​.
‫ﺳﺠﻞ اﻟﻤﻘﺎﺳﻢ‬

Report on a specific exchange or governorate exchange by a


specific date.

At the code level:​When requesting a page /pbxLogs in


agent2/file/src/js/app.route.js​ the template is executed pbx-report located
in​ a​ gent2/file/src/js/directives.js​, this is where the following HTML
page is requested: ​agent2/file/templates/pbxReport.html​ ,That contain the
information that is displayed.
In function report_get that is located in
agent2/application/controllers/Pbx.php​:
user permissions are checked and fetching information from the database is
corrupted according to the data entered by a function getPBXReport that is
located in a​ gent2/application/models/pbxModel.php​.

‫ﺣﺎﻟﺔ اﻟﻨﻈﺎم‬
When you press the button

We can change the status of the system and send some


payments and transfers to the archive and sync the packages
with the Billing system.
At the code level:​When requesting a page /sysStatus in
agent2/file/src/js/app.route.js​ the template is executed sys-status that is
located in​ a​ gent2/file/src/js/directives.js​, this is where the following
HTML page is requested: ​agent2/file/templates/systemStatus.html​ ,
Where there are archiving, sync, and state change functions.
In function index_get that is located in
agent2/application/controllers/SystemStatus.php​, check the user privilege
and we get the current state of the system through a set of functions.
In function index_post that is located in
agent2/application/controllers/SystemStatus.php​, check the user privilege
and we can update system status through function updateSystemStatus that is
located in ​agent2/application/models/opModel.php​, where systemStatus
table is modified.

When you press the button

At the code level:​In function archiveLog_post that is located in


agent2/application/controllers/Log.php​, check the user privilege and we
discuss the type that was introduced, where through a set of functions, you get
the number that will be archived and archived

When you press the button

At the code level:​In function syncPkg_post that is located in


agent2/application/controllers/AdslPackages.php​, check the user privilege
and sync package through function syncPkgs that is located in
agent2/application/models/AdslModel.php​, where product table is modified.

‫اﻟﻤﻘﺎﺳﻢ‬
When you press the button A submenu opens:

We'll explain all of them.


‫إﺿﺎﻓﺔ‬

We can add new pbx in the isp.


At the code level:​When requesting a page /addPbx in
agent2/file/src/js/app.route.js​ the template is executed add-pbx that is
located in​ a​ gent2/file/src/js/directives.js​, this is where the following
HTML page is requested: ​agent2/file/templates/addPBX.html​ .
In function index_post that is located in
agent2/application/controllers/Pbx.php​, check the user privilege, get city
id through function getCityId that is located in
agent2/application/models/PbxModel.php​, and we can add new pbx through
a function addPBX that is located in
agent2/application/models/PbxModel.php​, where pbx table is modified and
get the Pbx operation id through function getPBXOperationId that is located in
agent2/application/models/OpModel.php​, and insert data in pbxHistory table .
‫اﺳﺘﯿﺮاد‬

We can import the pbx .


At the code level:​When requesting a page /pbxImport in
agent2/file/src/js/app.route.js​ the template is executed import-pbx that is
located in​ a​ gent2/file/src/js/directives.js​, this is where the following
HTML page is requested: ​agent2/file/templates/importPbx.html​,
In event send we call toISOString to prevent arabic content in header value
because it's not accepted.
In function upload_post that is located in
agent2/application/controllers/Pbx.php​, check the user privilege, import
pbxs from an excel file through function import that is located in
agent2/application/models/PbxModel.php​.

‫ﺗﺴﺠﯿﻞ اﻟﺨﺮوج‬
In ​agent2/file/src/js/services.js​ exist function logout, remove user in
cookies and send request to MainCtrl.php in
agent2/application/controllers/MainCtrl.php
Export to Excel
In function _export that is located in
agent2/application/controllers/MainCtrl.php​, we can export some data in
system (report , incoming transaction,all pbx , …)
Templates located in ​agent2/exported/templates

You might also like