
select ID,
NAME LIST_TITLE,
DESCRIPTION LIST_TEXT,
TO_CHAR(DUE_DATE,'DD/MM/YYYY') LIST_BADGE,
'fa fa-spinner' ICON_CLASS,
APEX_PAGE.GET_URL ( p_page => 6,
p_items => 'P6_ID',
p_values => ID ) LINK
from S_TASKS
WHERE STATUS = 'NEW'
create or replace TRIGGER "S_TASKS_BIU"
before insert on S_TASKS
for each row
BEGIN
:new.ID := S_TASKS_SEQ.NEXTVAL ;
:NEW.CREATED_BY := NVL(v('APP_USER') ,USER);
:NEW.CREATION_DATE := SYSDATE;
:NEW.STATUS := 'NEW';
end S_TASKS_BIU;
<li class="t-MediaList-item #LIST_CLASS#">
<button id="action-button-1" type="button" title="#ACTION_TITLE#" aria-label="#ACTION_TITLE#"
class="#ACTION_NAME# t-Button t-Button--noLabel t-Button--icon t-Button--hot t-Button--large t-Button--link" task-id="#ID#">
<span id="action-button-icon-1" aria-hidden="true" class="t-Icon #ACTION_ICON_CLASS#"></span>
</button>
<a href="#LINK#" class="t-MediaList-itemWrap #LINK_CLASS#" #LINK_ATTR#>
<div class="t-MediaList-body">
<h3 class="t-MediaList-title">#LIST_TITLE#</h3>
<p class="t-MediaList-desc">#LIST_TEXT#</p>
</div>
<div class="t-MediaList-badgeWrap">
<span class="t-MediaList-badge #ICON_BADGE#">#LIST_BADGE#</span></span>
</div>
</a>
<button id="action-button-2" type="button" title="#ACTION_TITLE2#" aria-label="#ACTION_TITLE2#"
class="#ACTION_NAME2# t-Button t-Button--Label t-Button--icon t-Button--hot t-Button--large t-Button--link" task-id="#ID#">
<span id="action-button-icon-2" aria-hidden="true" class="t-Icon #ACTION_ICON_CLASS2#"></span>
</button>
</li>
this.triggeringElement.getAttribute ('task-id');
--
update S_tasks
set status = 'COMPLETED'
where id = :P5_TASK_ID;
this.triggeringElement.getAttribute ('task-id');
--
update S_tasks
set IS_IMPORTANT = 'N'
where id = :P5_TASK_ID;
select
apex_string.get_initials(email) user_icon,
post_created comment_date,
first_name || ' ' || last_name user_name,
post comment_text,
' ' comment_modifiers,
'u-color-' || ora_hash(email, 45) icon_modifier,
'' ATTRIBUTE_1,
'' ATTRIBUTE_2,
'' ATTRIBUTE_3,
'' ATTRIBUTE_4,
'' ACTIONS
from
POST_V
<li class="t-Comments-item #COMMENT_MODIFIERS#">
<div class="t-Comments-icon">
<div class="t-Comments-userIcon #ICON_MODIFIER#" aria-hidden="true">#USER_ICON#</div>
</div>
<div class="t-Comments-body">
<div class="t-Comments-info">
#USER_NAME# <span class="t-Comments-date">#COMMENT_DATE#</span> <span class="t-Comments-actions">#ACTIONS#</span>
</div>
<div class="t-Comments-info">
<span class="t-Comments-actions">#ACTION_1#</span> <span class="t-Comments-actions">#ACTION_2#</span> <span class="t-Comments-actions">#ACTION_3#</span> <span class="t-Comments-actions">#ACTION_4#</span>
</div>
<div class="t-Comments-comment">
#COMMENT_TEXT##ATTRIBUTE_1##ATTRIBUTE_2##ATTRIBUTE_3##ATTRIBUTE_4#
</div>
</div>
</li>
---
select
apex_string.get_initials(email) user_icon,
post_created comment_date,
first_name || ' ' || last_name user_name,
post comment_text,
' ' comment_modifiers,
'u-color-' || ora_hash(email, 45) icon_modifier,
'' ATTRIBUTE_1,
'' ATTRIBUTE_2,
'' ATTRIBUTE_3,
'' ATTRIBUTE_4,
'' ACTIONS,
'<button type="button" post-id ="' || post_id || '" title="Commenta" aria-label="Commenta" class="x-commment t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-comment-o"> ' || nvl(comments_num, 0) || '</span></button>' action_1,
'<button type="button" post-id ="' || post_id || '" title="Retweet" aria-label="Retweet" class="x-retweet t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-retweet"> ' || nvl(repost_num, 0) || '</span></button>' action_2,
'<button type="button" post-id ="' || post_id || '" title="Mi Piace" aria-label="Mi Piace" class="x-like t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-heart-o"> ' || nvl(likes_num, 0) || '</span></button>' action_3,
'<button type="button" post-id ="' || post_id || '" title="Condividi" aria-label="Condividi" class="x-share t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-share2"> ' || nvl(shares_num, 0) || '</span></button>' action_4
from
POST_V
Application Computations
select count(1) From NOTIFICATIONS where is_new = 'Y'
Badge Value
&APP_NEW_NOTIFICATION.
Badge Class
u-color-4
use this code as source for the list
select name as d, id as r from APEX_200200.wwv_flow_authentications where flow_id = :APP_ID and security_group_id = :WORKSPACE_ID order by 1
and make process to update Application Authentication
UPDATE APEX_200200.wwv_flows
SET AUTHENTICATION_ID =:P2_AUTHENTICATION_ID
where ID = :APP_ID;
first make select list item P4_AUTHORIZTION_SCHEMA
that will contain all DB schema available for your workspace
use this code as source
select APEX_200200.wwv_flow_escape.html(schema) d, schema rfrom APEX_200200.wwv_flow_company_schemaswhere security_group_id = :flow_security_group_idorder by 1
and make process to update Application Authentication
UPDATE APEX_200200.wwv_flows SET SECURITY_SCHEME =:P4_AUTHORIZTION_SCHEMA
first make select list item P7_SECURITY_ID
that will contain all Authorization available for your APP
use this code as source
select NAME,ID from APEX_200200.wwv_flow_security_schemes where FLOW_ID =:P7_FLOW_ID
and make process to update Page Authorization
BEGIN
UPDATE APEX_200200.wwv_flow_steps -- PageS
SET required_role = :P7_SECURITY_ID -- Authorization schema
WHERE FLOW_ID = :P7_FLOW_ID -- APP ID
and ID = :P7_STEP_ID -- PAGE ID
;
end;
make process to change Page to Public or Not
BEGIN
UPDATE APEX_200200.wwv_flow_steps -- PageS
SET PAGE_IS_PUBLIC_Y_N = :P7_PAGE_IS_PUBLIC_Y_N -- Authorization schema
WHERE FLOW_ID = :P7_FLOW_ID -- APP ID
and ID = :P7_STEP_ID -- PAGE ID;
end;
first make select list item P7_BUILD_OPTION
that will contain all Build Option available for your APP
use this code as source
select patch_name||' ('||wwv_flow_lang.system_message(patch_status)||')' d, id r from APEX_200200.wwv_flow_patches where FLOW_ID = :APP_ID
and make process to update Page Build Option
BEGIN
UPDATE APEX_200200.wwv_flow_steps -
SET REQUIRED_PATCH = :P7_BUILD_OPTION
WHERE FLOW_ID = :P7_FLOW_ID
and ID = :P7_STEP_ID ;
end;
--
1: Make P6_REGION_ID
that will contain all Region available for your page
use this code as source
select
PLUG_NAME,
ID
from APEX_200200.wwv_flow_page_plugs
where FLOW_ID =:P6_FLOW_ID
and PAGE_ID =:P6_STEP_ID
and select list item P6_SECURITY_ID
that will contain all Authorization available for your APP
use this code as source
select NAME,ID from APEX_200200.wwv_flow_security_schemes where FLOW_ID =:P7_FLOW_ID
and make process to update Region Authorization
BEGIN
UPDATE APEX_200200.wwv_flow_page_plugs
SET PLUG_REQUIRED_ROLE = :P6_SECURITY_ID
WHERE FLOW_ID = :P6_FLOW_ID
and PAGE_ID = :P6_STEP_ID
and ID = :P6_REGION_ID
end;
--
1: Make P6_REGION_ID
that will contain all Region available for your page
use this code as source
select
PLUG_NAME,
ID
from APEX_200200.wwv_flow_page_plugs
where FLOW_ID =:P6_FLOW_ID
and PAGE_ID =:P6_STEP_ID
and select list item P6_BUILD_OPTION
that will contain all build Option available for your APP
use this code as source
select PATCH_NAME,ID from APEX_200200.wwv_flow_patches where FLOW_ID =:P6_FLOW_ID
and make process to update Region Build Option
BEGIN
UPDATE APEX_200200.wwv_flow_page_plugs -- Region
SET REQUIRED_PATCH = :P6_BUILD_OPTION
WHERE FLOW_ID = :P6_FLOW_ID -- APP ID
and PAGE_ID = :P6_STEP_ID -- PAGE ID
and ID = :P6_REGION_ID -- REGION ID;
end;
1: Make P6_REGION_ID
that will contain all Region available for your page
use this code as source
select
PLUG_NAME,
ID
from APEX_200200.wwv_flow_page_plugs
where FLOW_ID =:P6_FLOW_ID
and PAGE_ID =:P6_STEP_ID
and make process to update Region Server side condition
BEGIN
UPDATE APEX_200200.wwv_flow_page_plugs -- Region
SET PLUG_DISPLAY_CONDITION_TYPE = 'NOT_EXISTS' ,
PLUG_DISPLAY_WHEN_CONDITION = 'SELECT 1 from dual where 1=2'
WHERE FLOW_ID = :P6_FLOW_ID -- APP ID
and PAGE_ID = :P6_STEP_ID -- PAGE ID
and ID = :P6_REGION_ID -- REGION ID;
end;
1: Make P6_REGION_ID
that will contain all Region available for your page
use this code as source
select
PLUG_NAME,
ID
from APEX_200200.wwv_flow_page_plugs
where FLOW_ID =:P6_FLOW_ID
and PAGE_ID =:P6_STEP_ID
and make process to update Region read only
BEGIN
UPDATE APEX_200200.wwv_flow_page_plugs -- Region
SET PLUG_READ_ONLY_WHEN_TYPE = 'EXISTS' ,
PLUG_READ_ONLY_WHEN = 'SELECT 1 from dual where 1 =2 '
WHERE FLOW_ID = :P6_FLOW_ID -- APP ID
and PAGE_ID = :P6_STEP_ID -- PAGE ID
and ID = :P6_REGION_ID -- REGION ID
; end;
How to Change Item
Autharization, Build Option ,Read only and Server side condtion
on runtime in Oracle APEX
Make Item for Items
select NAME,ID from APEX_200200.wwv_flow_step_items
where FLOW_ID = :P9_FLOW_ID
and FLOW_STEP_ID =:P9_STEP_ID
and ITEM_PLUG_ID =:P9_REGION_ID
Process for Autharization
BEGIN
UPDATE APEX_200200.wwv_flow_step_items -- ITEMS
SET SECURITY_SCHEME = :P9_SECURITY_ID -- Authorization schema
WHERE FLOW_ID = :P9_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P9_STEP_ID -- PAGE ID
and ITEM_PLUG_ID =:P9_REGION_ID -- region region
and ID = :P9_ITEM_ID; -- item id
end;
Process for Build Option
BEGIN
UPDATE APEX_200200.wwv_flow_step_items -- Region
SET REQUIRED_PATCH = :P9_BUILD_OPTION
WHERE FLOW_ID = :P9_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P9_STEP_ID -- PAGE ID
and ITEM_PLUG_ID =:P9_REGION_ID -- region region
and ID = :P9_ITEM_ID; -- item id
end;
Process for Read only
BEGIN
UPDATE APEX_200200.wwv_flow_step_items -- ITEMS
SET READ_ONLY_WHEN_TYPE = 'EXISTS',
READ_ONLY_WHEN ='select 1 from dual'
WHERE FLOW_ID = :P9_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P9_STEP_ID -- PAGE ID
and ITEM_PLUG_ID =:P9_REGION_ID -- region region
and ID = :P9_ITEM_ID; -- item id
end;
Process for Server side condtion
BEGIN
UPDATE APEX_200200.wwv_flow_step_items -- ITEMS
SET DISPLAY_WHEN_TYPE = 'EXISTS',
DISPLAY_WHEN ='select 1 from dual where 1=2'
WHERE FLOW_ID = :P9_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P9_STEP_ID -- PAGE ID
and ITEM_PLUG_ID =:P9_REGION_ID -- region region
and ID = :P9_ITEM_ID; -- item id
end;
Change Autharization, boint and assigned button
for Process on runtime in APEX
Make Item for process
select PROCESS_NAME,ID from APEX_200200.wwv_flow_step_processing
where FLOW_ID = :P10_FLOW_ID
and FLOW_STEP_ID =:P10_STEP_ID
Process for Autharization
BEGIN
UPDATE APEX_200200.wwv_flow_step_processing -- Process table
SET SECURITY_SCHEME = :P10_SECURITY_ID -- Authorization schema
WHERE FLOW_ID = :P10_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P10_STEP_ID -- PAGE ID
and ID = :P10_PROCESS_ID; -- process id
end;
Process for process point
BEGIN
UPDATE APEX_200200.wwv_flow_step_processing -- Process table
SET PROCESS_POINT = 'BEFORE_HEADER' -- PROCESS POINT
WHERE FLOW_ID = :P10_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P10_STEP_ID -- PAGE ID
and ID = :P10_PROCESS_ID; -- process id
end;
Process for assigned button
BEGIN
UPDATE APEX_200200.wwv_flow_step_processing -- Process table
SET PROCESS_WHEN_BUTTON_ID = :P10_BUTTON_ID --when button
WHERE FLOW_ID = :P10_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P10_STEP_ID -- PAGE ID
and ID = :P10_PROCESS_ID; -- process id
Make Item for process
select PROCESS_NAME,ID from APEX_200200.wwv_flow_step_processing
where FLOW_ID = :P10_FLOW_ID
and FLOW_STEP_ID =:P10_STEP_ID
Process for Autharization
BEGIN
UPDATE APEX_200200.wwv_flow_step_processing -- Process table
SET SECURITY_SCHEME = :P10_SECURITY_ID -- Authorization schema
WHERE FLOW_ID = :P10_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P10_STEP_ID -- PAGE ID
and ID = :P10_PROCESS_ID; -- process id
end;
Process for process point
BEGIN
UPDATE APEX_200200.wwv_flow_step_processing -- Process table
SET PROCESS_POINT = 'BEFORE_HEADER' -- PROCESS POINT
WHERE FLOW_ID = :P10_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P10_STEP_ID -- PAGE ID
and ID = :P10_PROCESS_ID; -- process id
end;
Process for assigned button
BEGIN
UPDATE APEX_200200.wwv_flow_step_processing -- Process table
SET PROCESS_WHEN_BUTTON_ID = :P10_BUTTON_ID --when button
WHERE FLOW_ID = :P10_FLOW_ID -- APP ID
and FLOW_STEP_ID = :P10_STEP_ID -- PAGE ID
and ID = :P10_PROCESS_ID; -- process id
end;
X_PATIENT
id /pk
first_name vc50
last_name vc50
X_DOCTOR
id /pk
first_name vc50
last_name vc50
X_APPOINTMENT
id /pk
PATIENT /fk X_PATIENT
DOCTOR /fk X_DOCTOR
booking_status vc150
start_time date
end_time date
notes vc500
select
X_APPOINTMENT.ID P_ID,
X_APPOINTMENT.BOOKING_STATUS as BOOKING_STATUS,
X_APPOINTMENT.START_TIME as START_TIME,
X_APPOINTMENT.END_TIME as END_TIME,
X_DOCTOR.FIRST_NAME as P_NAME,
X_DOCTOR.ID as D_ID,
X_PATIENT.FIRST_NAME as D_NAME ,
case when BOOKING_STATUS = 'New' then 'apex-cal-orange'
when BOOKING_STATUS = 'Confirmed' then 'apex-cal-green'
when BOOKING_STATUS = 'Canceled' then 'apex-cal-gray'
else null
end css_style
from X_PATIENT X_PATIENT,
X_APPOINTMENT X_APPOINTMENT,
X_DOCTOR X_DOCTOR
where X_DOCTOR.ID=X_APPOINTMENT.DOCTOR
and X_PATIENT.ID=X_APPOINTMENT.PATIENT
You need to use the special calendar substitution variables
&APEX$NEW_START_DATE.
and
&APEX$NEW_END_DATE.
to pass the selected dates from the calendar to the target page.
begin
update X_APPOINTMENT
set start_time = to_date(:APEX$NEW_START_DATE, 'YYYYMMDDHH24MISS'),
end_time = to_date(:APEX$NEW_END_DATE, 'YYYYMMDDHH24MISS')
where id = :APEX$PK_VALUE;
end;
select
X_APPOINTMENT.ID P_ID,
X_APPOINTMENT.BOOKING_STATUS as BOOKING_STATUS,
X_APPOINTMENT.START_TIME as START_TIME,
X_APPOINTMENT.END_TIME as END_TIME,
X_DOCTOR.FIRST_NAME as P_NAME,
X_DOCTOR.ID as D_ID,
X_PATIENT.FIRST_NAME as D_NAME ,
case when BOOKING_STATUS = 'New' then 'apex-cal-orange'
when BOOKING_STATUS = 'Confirmed' then 'apex-cal-green'
when BOOKING_STATUS = 'Canceled' then 'apex-cal-gray'
else null
end css_style
from X_PATIENT X_PATIENT,
X_APPOINTMENT X_APPOINTMENT,
X_DOCTOR X_DOCTOR
where X_DOCTOR.ID=X_APPOINTMENT.DOCTOR
and X_PATIENT.ID=X_APPOINTMENT.PATIENT
and (:P8_DOCTOR is null or X_DOCTOR.ID = :P8_DOCTOR)
function ( pOptions) {
pOptions.titleFormat = "[Conference Schedule]"; // custom title
pOptions.minTime = "07:00:00"; // hide slots before minTime
pOptions.maxTime = "18:00:00"; // hide slots after maxTime
pOptions.columnFormat = {month: '', week: 'dddd', day: 'dddd'}; // week view column headings
pOptions.slotDuration = "00:15:00"; // custom slot duration
pOptions.weekNumbers = true; // show week numbers
pOptions.weekNumberTitle = "CW";
return pOptions;
}
function (pOptions) {
var startTime = apex.item("P8_START_TIME").getValue();
pOptions.minTime = startTime;
return pOptions;
}
Calender Static Id
calendar
Client Side Condition
$v("P8_GO_TO_DATE").match(/\d\d\d\d\-\d\d\-\d\d/) != null
Action
Execute JavaScript Code
apex.region("calendar").widget().data("fullCalendar").gotoDate($v("P8_GO_TO_DATE"))
CREATE TABLE "S_CATEGORY"
( "CATEGORY_ID" NUMBER NOT NULL ENABLE,
"CATEGORY_NAME" VARCHAR2(300),
"CATEGORY_DESC" VARCHAR2(500),
"CATEGORY_REAMRKS" VARCHAR2(600),
CONSTRAINT "S_CATEGORY_PK" PRIMARY KEY ("CATEGORY_ID") ENABLE,
CONSTRAINT "S_CATEGORY_UK" UNIQUE ("CATEGORY_NAME") ENABLE )
/
CREATE OR REPLACE TRIGGER "BI_S_CATEGORY"
before insert on "S_CATEGORY"
for each row
begin if :NEW."CATEGORY_ID" is null then
select "S_CATEGORY_SEQ".nextval into :NEW."CATEGORY_ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_S_CATEGORY" ENABLE /
CREATE TABLE "S_UNIT"
( "UNIT_ID" NUMBER NOT NULL ENABLE,
"UNIT_NAME" VARCHAR2(200),
"UNIT_DESC" VARCHAR2(300),
CONSTRAINT "S_UNIT_PK" PRIMARY KEY ("UNIT_ID") ENABLE,
CONSTRAINT "S_UNIT_UK" UNIQUE ("UNIT_NAME") ENABLE
)
/
CREATE OR REPLACE TRIGGER "BI_S_UNIT"
before insert on "S_UNIT"
for each row
begin
if :NEW."UNIT_ID" is null
then
select "S_UNIT_SEQ".nextval into :NEW."UNIT_ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_S_UNIT" ENABLE
/
CREATE TABLE "S_PRODUCTS" (
"PRODUCT_ID" NUMBER NOT NULL ENABLE,
"PRODUCT_CODE" VARCHAR2(50),
"PRODUCT_NAME" VARCHAR2(200),
"PRODUCT_UNIT" NUMBER,
"PRODUCT_CATEGORY" NUMBER,
"SELL_PRICE" NUMBER,
"BUY_PRICE" NUMBER,
"QUANTITY" NUMBER,
"R_ORDER_QUANTITY" NUMBER,
"PRODUCT_REMARKS" VARCHAR2(500),
CONSTRAINT "S_PRODUCTS_PK" PRIMARY KEY ("PRODUCT_ID") ENABLE,
CONSTRAINT "S_PRODUCTS_UK1" UNIQUE ("PRODUCT_CODE") ENABLE )
/
ALTER TABLE "S_PRODUCTS" ADD CONSTRAINT "S_PRODUCTS_FK1" FOREIGN KEY ("PRODUCT_UNIT") REFERENCES "S_UNIT" ("UNIT_ID") ON DELETE SET NULL ENABLE
/
ALTER TABLE "S_PRODUCTS" ADD CONSTRAINT "S_PRODUCTS_FK2" FOREIGN KEY ("PRODUCT_CATEGORY") REFERENCES "S_CATEGORY" ("CATEGORY_ID") ON DELETE SET NULL ENABLE
/
CREATE OR REPLACE TRIGGER "BI_S_PRODUCTS"
before insert on "S_PRODUCTS"
for each row begin if :NEW."PRODUCT_ID" is null then
select "S_PRODUCTS_SEQ".nextval into :NEW."PRODUCT_ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_S_PRODUCTS" ENABLE
/
CREATE TABLE "S_VENDOR" (
"VENDOR_ID" NUMBER NOT NULL ENABLE,
"VENDOR_NAME" VARCHAR2(200),
"VENDOR_PHONE1" VARCHAR2(25),
"VENDOR_PHONE2" VARCHAR2(25),
"VENDOR_MAIL" VARCHAR2(150),
"VENDOR_ADDRESS" VARCHAR2(200),
"VENDOR_BALANCE" NUMBER,
VENDOR_REMARKS" VARCHAR2(500),
CONSTRAINT "S_VENDOR_PK" PRIMARY KEY ("VENDOR_ID") ENABLE )
/
CREATE OR REPLACE TRIGGER "BI_S_VENDOR"
before insert on "S_VENDOR"
for each row
begin
if :NEW."VENDOR_ID" is null then
select "S_VENDOR_SEQ".nextval into :NEW."VENDOR_ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_S_VENDOR" ENABLE
/
CREATE TABLE "S_CLIENT"
( "CLIENT_ID" NUMBER NOT NULL ENABLE,
"CLIENT_NAME" VARCHAR2(200),
"CLIENT_PHONE1" VARCHAR2(25),
"CLIENT_PHONE2" VARCHAR2(25),
"CLIENT_MAIL" VARCHAR2(150),
"CLIENT_ADDRESS" VARCHAR2(200),
"CLIENT_BALANCE" NUMBER,
"CLIENT_REMARKS" VARCHAR2(500),
CONSTRAINT "S_CLIENT_PK" PRIMARY KEY ("CLIENT_ID") ENABLE
)
/
CREATE OR REPLACE TRIGGER "BI_S_CLIENT"
before insert on "S_CLIENT"
for each row
begin
if :NEW."CLIENT_ID" is null then
select "S_CLIENT_SEQ".nextval into :NEW."CLIENT_ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_S_CLIENT" ENABLE
/
Create Mobile Shop Application with Default Option
Create Editable Interactive grid Page For Units
Create Blank Page For Category
and Create Interactive Grid Region for Category
Create Page for Product Report
and
Page for Product Form
Understand Link in Report Page
and Process In Form Page
CREATE TABLE "S_SELL_ORDER" (
"SELL_ORDER_ID" NUMBER NOT NULL ENABLE,
"SELL_ORDER_CLIENT_ID" NUMBER,
"SELL_ORDER_DATE" DATE,
"SELL_ORDER_TOTAL" NUMBER,
CONSTRAINT "S_SELL_ORDER_PK" PRIMARY KEY ("SELL_ORDER_ID") ENABLE
)
/
ALTER TABLE "S_SELL_ORDER" ADD CONSTRAINT "S_SELL_ORDER_FK"
FOREIGN KEY ("SELL_ORDER_CLIENT_ID")
REFERENCES "S_CLIENT" ("CLIENT_ID") ON DELETE SET NULL ENABLE
/
CREATE OR REPLACE TRIGGER "BI_S_SELL_ORDER"
before insert on "S_SELL_ORDER"
for each row
begin
if :NEW."SELL_ORDER_ID" is null then
select "S_SELL_ORDER_SEQ".nextval into :NEW."SELL_ORDER_ID" from sys.dual;
end if;
end;
/ ALTER TRIGGER "BI_S_SELL_ORDER" ENABLE /
-------
CREATE TABLE "S_SELL_ORDER_ITEMS" (
"SELL_ORDER_ITEM_ID" NUMBER NOT NULL ENABLE,
"SELL_ORDER_ID" NUMBER,
"PRODUCT_ID" NUMBER,
"PRODUCT_PRICE" NUMBER,
"PRODUCT_QUANTITY" NUMBER,
"PRODUCT_TOTAL" NUMBER,
CONSTRAINT "S_SELL_ORDER_ITEMS_PK" PRIMARY KEY ("SELL_ORDER_ITEM_ID") ENABLE
)
/
ALTER TABLE "S_SELL_ORDER_ITEMS" ADD CONSTRAINT "S_SELL_ORDER_ITEMS_FK1" FOREIGN KEY ("SELL_ORDER_ID") REFERENCES "S_SELL_ORDER" ("SELL_ORDER_ID") ON DELETE SET NULL ENABLE
/
ALTER TABLE "S_SELL_ORDER_ITEMS" ADD CONSTRAINT "S_SELL_ORDER_ITEMS_FK2" FOREIGN KEY ("PRODUCT_ID") REFERENCES "S_PRODUCTS" ("PRODUCT_ID") ON DELETE SET NULL ENABLE
/
CREATE OR REPLACE TRIGGER
"BI_S_SELL_ORDER_ITEMS"
before insert on "S_SELL_ORDER_ITEMS"
for each row
begin
if :NEW."SELL_ORDER_ITEM_ID" is null then
select "S_SELL_ORDER_ITEMS_SEQ".nextval into :NEW."SELL_ORDER_ITEM_ID" from sys.dual;
end if;
end;
/
ALTER TRIGGER "BI_S_SELL_ORDER_ITEMS" ENABLE
/
Create Drill Down Master Detail for Sell Order & Sell Order Items
Customize Sell Order Page
using select List for Client and Product
Add Dynamic Action to Get Product Sell Price
Use Form Navigation Process
Create Dynamic Action to Get Price * quantity
Update Sell Order Total by Getting total from detail Table
----
begin
Update S_SELL_ORDER
set SELL_ORDER_TOTAL = (Select Sum (PRODUCT_TOTAL) from S_SELL_ORDER_ITEMS
where SELL_ORDER_ID = :P11_SELL_ORDER_ID)
where SELL_ORDER_ID = :P11_SELL_ORDER_ID;
end;
Create Validation on Quantity to be sure
i will not sell item 5 pieces when i have only 3
----
DECLARE
V_COUNT NUMBER;
begin
Select QUANTITY into V_COUNT from S_PRODUCTS where PRODUCT_ID = :PRODUCT_ID;
if :PRODUCT_QUANTITY <= ( V_COUNT )
then
return true;
else
return false;
end if;
end;
Manage and customize Report Page using List of Value
Update Branching to stay in from page after transaction
Use Pl/SQL Code for Interactive Grid Process
---
begin
case :APEX$ROW_STATUS
when 'C' then
insert into S_SELL_ORDER_ITEMS ( SELL_ORDER_ID , PRODUCT_ID, PRODUCT_PRICE, PRODUCT_QUANTITY, PRODUCT_TOTAL )
values ( :SELL_ORDER_ID ,:PRODUCT_ID, :PRODUCT_PRICE, :PRODUCT_QUANTITY, :PRODUCT_TOTAL )
returning SELL_ORDER_ITEM_ID into :SELL_ORDER_ITEM_ID;
when 'U' then
update S_SELL_ORDER_ITEMS
set PRODUCT_ID = :PRODUCT_ID,
PRODUCT_PRICE = :PRODUCT_PRICE,
PRODUCT_QUANTITY = :PRODUCT_QUANTITY,
PRODUCT_TOTAL = :PRODUCT_TOTAL
where SELL_ORDER_ITEM_ID = :SELL_ORDER_ITEM_ID;
when 'D' then
delete S_SELL_ORDER_ITEMS
where SELL_ORDER_ITEM_ID = :SELL_ORDER_ITEM_ID;
end case;
end;
How to Create and Save Mater and Detail in One step
begin
case :APEX$ROW_STATUS
when 'C' then
insert into S_SELL_ORDER_ITEMS ( SELL_ORDER_ID , PRODUCT_ID, PRODUCT_PRICE, PRODUCT_QUANTITY, PRODUCT_TOTAL )
values ( :P11_SELL_ORDER_ID ,:PRODUCT_ID, :PRODUCT_PRICE, :PRODUCT_QUANTITY, :PRODUCT_TOTAL )
returning SELL_ORDER_ITEM_ID into :SELL_ORDER_ITEM_ID;
when 'U' then
update S_SELL_ORDER_ITEMS
set PRODUCT_ID = :PRODUCT_ID,
PRODUCT_PRICE = :PRODUCT_PRICE,
PRODUCT_QUANTITY = :PRODUCT_QUANTITY,
PRODUCT_TOTAL = :PRODUCT_TOTAL
where SELL_ORDER_ITEM_ID = :SELL_ORDER_ITEM_ID;
when 'D' then
delete S_SELL_ORDER_ITEMS
where SELL_ORDER_ITEM_ID = :SELL_ORDER_ITEM_ID;
end case;
end;
How to Handle Product Quantity After insert or Update or delete in sell Order Item Table
create or replace TRIGGER "A_S_SELL_ORDER_ITEMS"
BEFORE
insert or update or delete on "S_SELL_ORDER_ITEMS"
for each row
declare
pragma autonomous_transaction;
begin
IF INSERTING THEN
UPDATE S_PRODUCTS
set S_PRODUCTS.QUANTITY= S_PRODUCTS.QUANTITY -:new.PRODUCT_QUANTITY
where S_PRODUCTS.PRODUCT_ID= :new.PRODUCT_ID;
END IF; -- End of Inserting Code
IF UPDATING THEN
UPDATE S_PRODUCTS
set S_PRODUCTS.QUANTITY =(S_PRODUCTS.QUANTITY +:old.PRODUCT_QUANTITY)-(:new.PRODUCT_QUANTITY)
where S_PRODUCTS.PRODUCT_ID= :new.PRODUCT_ID;
END IF;
-- End of Inserting Code
IF DELETING THEN
UPDATE S_PRODUCTS
set S_PRODUCTS.QUANTITY =(S_PRODUCTS.QUANTITY +:old.PRODUCT_QUANTITY)
where S_PRODUCTS.PRODUCT_ID= :old.PRODUCT_ID;
end if;
-- End of DELETING Code
commit;
end;
Update Order Total Dynamically
---
// create a private scope where $ is set to apex.jQuery
(function($) {
// This is the function that calculates over all the rows of the model and then
// updates something else.
// Change this to do whatever calculation is needed.
// Call this whenever the model data changes.
function update(model) {
var salKey = model.getFieldKey("PRODUCT_TOTAL"),
total = 0;
console.log(">> starting sum SAL column")
model.forEach(function(record, index, id) {
var sal = parseFloat(record[salKey]), // record[salKey] should be a little faster than using model.getValue in a loop
meta = model.getRecordMetadata(id);
if (!isNaN(sal) && !meta.deleted && !meta.agg) {
total += sal;
}
});
console.log(">> setting sum SAL column to " + total)
$s("P11_SELL_ORDER_TOTAL", total);
}
//
// This is the general pattern for subscribing to model notifications
//
// need to do this here rather than in Execute when Page Loads so that the handler
// is setup BEFORE the IG is initialized otherwise miss the first model created event
$(function() {
// the model gets released and created at various times such as when the report changes
// listen for model created events so that we can subscribe to model notifications
$("#order_items").on("interactivegridviewmodelcreate", function(event, ui) {
var sid,
model = ui.model;
// note this is only done for the grid veiw. It could be done for
// other views if desired. The imporant thing to realize is that each
// view has its own model
if ( ui.viewId === "grid" ) {
sid = model.subscribe( {
onChange: function(type, change) {
console.log(">> model changed ", type, change);
if ( type === "set" ) {
// don't bother to recalculate if other columns change
if (change.field === "PRODUCT_TOTAL" ) {
update( model );
}
} else if (type !== "move" && type !== "metaChange") {
// any other change except for move and metaChange affect the calculation
update( model );
}
},
progressView: $("#P11_SELL_ORDER_TOTAL") // this will cause a spinner on this field
} );
// if not lazy loaded there is no notification for initial data so update
update( model );
// just in case fetch all the data. Model notifications will
// cause calls to update so nothing to do in the callback function.
// can remove if data will always be less than 50 records
model.fetchAll(function() {});
}
});
});
})(apex.jQuery);
Update Client Balance using Trigger
---
create or replace TRIGGER "A_S_SELL_ORDER"
BEFORE
insert or update or delete on "S_SELL_ORDER"
for each row
declare
pragma autonomous_transaction;
begin
IF INSERTING THEN
UPDATE S_CLIENT
set S_CLIENT.CLIENT_BALANCE = S_CLIENT.CLIENT_BALANCE + :new.SELL_ORDER_TOTAL
where S_CLIENT.CLIENT_ID= :new.SELL_ORDER_CLIENT_ID;
END IF; -- End of Inserting Code
IF UPDATING THEN
UPDATE S_CLIENT
set S_CLIENT.CLIENT_BALANCE= (S_CLIENT.CLIENT_BALANCE + :new.SELL_ORDER_TOTAL) - :old.SELL_ORDER_TOTAL
where S_CLIENT.CLIENT_ID= :new.SELL_ORDER_CLIENT_ID;
END IF;
-- End of Inserting Code
IF DELETING THEN
UPDATE S_CLIENT
set S_CLIENT.CLIENT_BALANCE=(S_CLIENT.CLIENT_BALANCE - :old.SELL_ORDER_TOTAL)
where S_CLIENT.CLIENT_ID = :old.SELL_ORDER_CLIENT_ID;
end if;
-- End of DELETING Code
commit;
end;
Prevent Duplicate product in same order using unique Constraint
--
alter table "S_SELL_ORDER_ITEMS" add constraint
"S_SELL_ORDER_ITEMS_CON" unique ("SELL_ORDER_ID","PRODUCT_ID")
/
Using Pl/SQL Dynamic Region for Printing Part 2
CREATE TABLE "S_BUY_ORDER" ( "BUY_ORDER_ID" NUMBER NOT NULL ENABLE, "VENDOR_ID" NUMBER, "BUY_ORDER_DATE" DATE, "BUY_ORDER_TOTAL" NUMBER, CONSTRAINT "S_BUY_ORDER_PK" PRIMARY KEY ("BUY_ORDER_ID") ENABLE ) / ALTER TABLE "S_BUY_ORDER" ADD CONSTRAINT "S_BUY_ORDER_FK" FOREIGN KEY ("VENDOR_ID") REFERENCES "S_VENDOR" ("VENDOR_ID") ON DELETE SET NULL ENABLE /
CREATE OR REPLACE TRIGGER "BI_S_BUY_ORDER" before insert on "S_BUY_ORDER" for each row begin if :NEW."BUY_ORDER_ID" is null then select "S_BUY_ORDER_SEQ".nextval into :NEW."BUY_ORDER_ID" from sys.dual; end if; end; / ALTER TRIGGER "BI_S_BUY_ORDER" ENABLE /
---
CREATE TABLE "S_BUY_ORDER_ITEMS" ( "BUY_ORDER_ITEM_ID" NUMBER NOT NULL ENABLE, "BUY_ORDER_ID" NUMBER, "PRODUCT_CODE" VARCHAR2(50), "PRODUCT_PRICE" NUMBER, "PRODUCT_QUANTITY" NUMBER, "PRODUCT_TOTAL" NUMBER, "PRODUCT_NAME" VARCHAR2(200), CONSTRAINT "S_BUY_ORDER_ITEMS_PK" PRIMARY KEY ("BUY_ORDER_ITEM_ID") ENABLE, CONSTRAINT "S_BUY_ORDER_ITEMS_CON" UNIQUE ("BUY_ORDER_ID", "PRODUCT_CODE") ENABLE ) / ALTER TABLE "S_BUY_ORDER_ITEMS" ADD CONSTRAINT "S_BUY_ORDER_ITEMS_FK1" FOREIGN KEY ("BUY_ORDER_ID") REFERENCES "S_BUY_ORDER" ("BUY_ORDER_ID") ON DELETE SET NULL ENABLE / ALTER TABLE "S_BUY_ORDER_ITEMS" ADD CONSTRAINT "S_BUY_ORDER_ITEMS_FK2" FOREIGN KEY ("PRODUCT_CODE") REFERENCES "S_PRODUCTS" ("PRODUCT_CODE") ON DELETE SET NULL ENABLE /
CREATE OR REPLACE TRIGGER "BI_S_BUY_ORDER_ITEMS" before insert on "S_BUY_ORDER_ITEMS" for each row begin if :NEW."BUY_ORDER_ITEM_ID" is null then select "S_BUY_ORDER_ITEMS_SEQ".nextval into :NEW."BUY_ORDER_ITEM_ID" from sys.dual; end if; end; /
SELECT LEVEL AS item_no,
APEX_ITEM.TEXT(p_idx => 1, p_attributes => NULL) AS Name,
APEX_ITEM.text( p_idx=> 2 , p_value=> null , p_attributes=> 'class="number"') as Age,
APEX_ITEM.SELECT_LIST(3,'MALE','MALE;MALE,FEMALE;FEMALE') Gender,
APEX_ITEM.TEXT(p_idx => 4, p_attributes => NULL) AS School
FROM dual
CONNECT BY LEVEL <= TO_NUMBER (:P4_HOW_MANY)
;
if :P4_HOW_MANY is NOT NULL and :P4_HOW_MANY > 0 then
FOR i IN 1 .. apex_application.g_f01.COUNT LOOP
insert into C_CHILDREN (CHILD_ID, CHILD_NAME, GENDER, SCHOOL, AGE)
values ( "C_CHILDREN_SEQ".nextval, apex_application.g_f01(i), apex_application.g_f03(i), apex_application.g_f04(i), apex_application.g_f02(i));
END LOOP;
end if;
IF :P4_HOW_MANY is NOT NULL and :P4_HOW_MANY > 0 then
IF NOT APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'C_CHILDREN_COLLECTION') THEN
APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
p_collection_name => 'C_CHILDREN_COLLECTION');
END IF;
APEX_COLLECTION.ADD_MEMBERS(
p_collection_name => 'C_CHILDREN_COLLECTION',
p_c001 => apex_application.g_f01,
p_c002 => apex_application.g_f03,
p_c003 => apex_application.g_f04,
p_c004 => apex_application.g_f02
);
End IF;
select
seq_id editlink,
seq_id ID,
c001 Name,
c002 Gender,
c003 School,
c004 AGE
from apex_collections
where collection_name = 'C_CHILDREN_COLLECTION';
-- Procees to fetch data
select c001, -- Name,
c002, -- Gender,
c003, -- School,
c004 --AGE
into :P5_CHILD_NAME, :P5_GENDER, :P5_SCHOOL, :P5_AGE from apex_collections
where collection_name = 'C_CHILDREN_COLLECTION' AND seq_id = to_number(:P5_CHILD_ID);
-- Procees to Add Member
APEX_COLLECTION.ADD_MEMBER (p_collection_name => 'C_CHILDREN_COLLECTION',
p_c001 => :P5_CHILD_NAME,
p_c002 => :P5_GENDER,
p_c003 => :P5_SCHOOL,
p_c004 => :P5_AGE
);
-- poress to update Member
APEX_COLLECTION.UPDATE_MEMBER (
p_collection_name => 'C_CHILDREN_COLLECTION',
p_seq => :P5_CHILD_ID,
p_c001 => :P5_CHILD_NAME,
p_c002 => :P5_GENDER,
P_c003 => :P5_SCHOOL,
P_c004 => :P5_AGE);
-- poress to Delete Member
APEX_COLLECTION.DELETE_MEMBER (
p_collection_name => 'C_CHILDREN_COLLECTION',
p_seq => :P5_CHILD_ID);
select id,
title,
description,
creation_date,
archived,
type,
title alert_title,
description alert_desc,
'<button type="button" title="Archivia Alert" aria-label="Archivia Alert" class="t-Button t-Button--noLabel t-Button--icon t-Button--hot t-Button--link archiviaAlert" alert-id="'||id||'"><span aria-hidden="true" class="t-Icon fa fa-remove"></span></button>' alert_action,
type alert_type
from CR_alerts
select 5 new_requests,
6 assigned_to_me,
30 assigned_to_my_groups,
8 on_track,
2 at_risk,
3 overdue
from dual
--
select id,
name,
description,
image,
likes_counter,
apex_util.prepare_url('#') card_link,
'<h2>'||name||'</h2>' card_subtitle,
description card_text,
'fa-heart' card_icon, /* this could be anything */
null card_color,
'<img src="' || image || '" width="350px"></img>' card_title,
'<button type="button" class="t-Button t-Button--icon t-Button--hot t-Button--link t-Button--iconLeft"><span aria-hidden="true" class="t-Icon t-Icon--left fa fa-heart"></span>'||likes_counter||'</button>' card_subtext
from CR_pizza
select POSTS.POST as COMMENT_TEXT,
'Ali Saleh' USER_NAME,
POSTS.COMMENTS_NUM as COMMENTS_NUM,
POSTS.REPOST_NUM as REPOST_NUM,
POSTS.LIKES_NUM as LIKES_NUM,
POSTS.SHARES_NUM as SHARES_NUM ,
POST_CREATED COMMENT_DATE,
''ATTRIBUTE_1,
'' ATTRIBUTE_2,
'' ATTRIBUTE_3,
'' ATTRIBUTE_4 ,
'' ACTIONS,
'<button type="button" post-id ="' || ID || '" title="Commenta" aria-label="Commenta" class="x-commment t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-comment-o"> ' || nvl(comments_num, 0) || '</span></button>' action_1,
'<button type="button" post-id ="' || ID || '" title="Retweet" aria-label="Retweet" class="x-retweet t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-retweet"> ' || nvl(repost_num, 0) || '</span></button>' action_2,
'<button type="button" post-id ="' || ID || '" title="Mi Piace" aria-label="Mi Piace" class="x-like t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-heart-o"> ' || nvl(likes_num, 0) || '</span></button>' action_3,
'<button type="button" post-id ="' || ID || '" title="Condividi" aria-label="Condividi" class="x-share t-Button t-Button--noLabel t-Button--icon t-Button--link"><span aria-hidden="true" class="t-Icon fa fa-share2"> ' || nvl(shares_num, 0) || '</span></button>' action_4
from POSTS POSTS
---
comment template
<li class="t-Comments-item #COMMENT_MODIFIERS#">
<div class="t-Comments-icon">
<div class="t-Comments-userIcon #ICON_MODIFIER#" aria-hidden="true">#USER_ICON#</div>
</div>
<div class="t-Comments-body">
<div class="t-Comments-info">
#USER_NAME# <span class="t-Comments-date">#COMMENT_DATE#</span> <span class="t-Comments-actions">#ACTIONS#</span>
</div>
<div class="t-Comments-info">
<span class="t-Comments-actions">#ACTION_1#</span>
<span class="t-Comments-actions">#ACTION_2#</span>
<span class="t-Comments-actions">#ACTION_3#</span>
<span class="t-Comments-actions">#ACTION_4#</span>
</div>
<div class="t-Comments-comment">
#COMMENT_TEXT##ATTRIBUTE_1##ATTRIBUTE_2##ATTRIBUTE_3##ATTRIBUTE_4#
</div>
</div>
</li>
select EMPNO,
'fa fa-user' ICON_COLOR_CLASS ,
ENAME LIST_TITLE,
JOB,
MGR,
HIREDATE LIST_TEXT,
SAL,
COMM,
DEPTNO
from CR_EMP
select EMPNO SELECTION,
ENAME TITLE ,
JOB ,
MGR,
'<span class= "fa fa-user"> </span>' ICON_HTML,
HIREDATE DESCRIPTION,
SAL MISC,
COMM,
DEPTNO,
'' ACTIONS
from CR_EMP
select id,
event_user user_name,
apex_string.get_initials(event_user) as user_avatar,
case event_type
when 'NEW_REQUEST' then 'fa fa-file-new'
when 'IN_CHARGE' then 'fa fa-file-search'
when 'RAISE_PHONE' then 'fa fa-phone'
when 'WAITING_CUSTOMER_RESPONSE' then 'fa fa-pause'
when 'CUSTOMER_RESPONSE_RECEIVED' then 'fa fa-file-arrow-down'
when 'REQUEST_CLOSED' then 'fa fa-check'
else null
end as event_icon,
case event_type
when 'NEW_REQUEST' then 'is-removed'
when 'REQUEST_CLOSED' then 'is-new'
else 'is-updated'
end as event_status,
event_user_type,
event_date event_date,
event_type,
event_title,
event_description event_desc,
apex_util.prepare_url('#') event_link
from CR_request
order by id desc
select EMPNO,
ENAME SEARCH_TITLE,
HIREDATE SEARCH_DESC,
'His Job ' LABEL_01 ,
JOB VALUE_01,
'His Salary ' LABEL_02 ,
SAL VALUE_02,
COMM,
DEPTNO
from CR_EMP
<figure class="snip1336">
<img src="#IMAGE_URL#" alt="sample87" />
<figcaption>
<img src="#IMAGE_URL#" alt="profile-sample4" class="profile" />
<h2>#TITLE#<span></span></h2>
<p>#SUB_TITLE# </p>
<a href="#" class="follow">Follow</a>
<a href="#" class="info">More Info</a>
</figcaption>
</figure>
select
DISTINCT CATEGORY as LIST_TITLE ,
CATEGORY CATEGORY ,
'' LIST_TEXT,
(SELECT COUNT(D.CATEGORY) From DEMO_PRODUCT_INFO D where X.CATEGORY =D.CATEGORY) as LIST_BADGE ,
'javascript:void(null);' as LINK ,
'fa fa-user' ICON_CLASS
from DEMO_PRODUCT_INFO X
<li class="t-MediaList-item #LIST_CLASS#">
<a href="#LINK#" class="t-MediaList-itemWrap #LINK_CLASS# CATEGORY_C" #LINK_ATTR# data-id="#CATEGORY#">
<div class="t-MediaList-iconWrap">
<span class="t-MediaList-icon u-color #ICON_COLOR_CLASS#"><span class="t-Icon #ICON_CLASS#"></span></span>
</div>
<div class="t-MediaList-body">
<h3 class="t-MediaList-title">#LIST_TITLE#</h3>
<p class="t-MediaList-desc">#LIST_TEXT#</p>
</div>
<div class="t-MediaList-badgeWrap">
<span class="t-MediaList-badge">#LIST_BADGE#</span>
</div>
</a>
</li>
select PRODUCT_ID ,
PRODUCT_NAME CARD_TEXT,
PRODUCT_DESCRIPTION CARD_SUBTEXT,
PRODUCT_AVAIL,
LIST_PRICE,
'javascript:void(null);' as CARD_LINK,
dbms_lob.getlength(PRODUCT_IMAGE ) as CARD_TITLE
from DEMO_PRODUCT_INFO
where (UPPER(CATEGORY) LIKE UPPER(:P22_CATEGORY) or :P22_CATEGORY IS NULL)
<li class="t-Cards-item #CARD_MODIFIERS#">
<div class="t-Card">
<a href="#CARD_LINK#" class="t-Card-wrap PRODCUT_C" data-id="#PRODUCT_ID#" >
<div class="t-Card-icon u-color #CARD_COLOR#"><span class="t-Icon fa #CARD_ICON#"><span class="t-Card-initials" role="presentation">#CARD_INITIALS#</span></span></div>
<div class="t-Card-titleWrap"><h3 class="t-Card-title">#CARD_TITLE#</h3><h4 class="t-Card-subtitle">#CARD_SUBTITLE#</h4></div>
<div class="t-Card-body">
<div class="t-Card-desc">#CARD_TEXT#</div>
<div class="t-Card-info">#CARD_SUBTEXT#</div>
</div>
<span class="t-Card-colorFill u-color #CARD_COLOR#"></span>
</a>
</div>
</li>
DECLARE
V_SEQ_ID number ;
V_QUY number ;
V_PRICE number ;
V_PRODUCT_NAME varchar2(200);
BEGIN
BEGIN
select
PRODUCT_NAME ,LIST_PRICE into V_PRODUCT_NAME ,V_PRICE
from DEMO_PRODUCT_INFO
where PRODUCT_ID = :P22_PRODUCT_ID ;
select seq_id,c004 into V_SEQ_ID ,V_QUY from apex_collections
where
collection_name = 'POINT_SALE'
and c001 = :P22_PRODUCT_ID ;
exception when NO_DATA_FOUND then V_SEQ_ID := 0; END;
if V_SEQ_ID != 0 THEN
V_QUY := V_QUY+1 ;
APEX_COLLECTION.update_member_attribute (
p_collection_name=> 'POINT_SALE',
p_seq=> V_SEQ_ID,
p_attr_number => 4,
p_attr_value=> V_QUY
);
else
apex_collection.add_member(
p_collection_name => 'POINT_SALE',
p_c001 => :P22_PRODUCT_ID ,
p_c002 => V_PRODUCT_NAME,
p_c003 => V_PRICE,
p_c004 => 1);
end if;
end;
DECLARE
V_SEQ_ID number ;
V_QUY number ;
V_PRICE number ;
V_PRODUCT_NAME varchar2(200);
BEGIN
BEGIN
select
PRODUCT_NAME ,LIST_PRICE into V_PRODUCT_NAME ,V_PRICE
from DEMO_PRODUCT_INFO
where PRODUCT_ID = :P22_PRODUCT_ID ;
select seq_id,c004 into V_SEQ_ID ,V_QUY from apex_collections
where
collection_name = 'POINT_SALE'
and c001 = :P22_PRODUCT_ID ;
exception when NO_DATA_FOUND then V_SEQ_ID := 0; END;
if V_SEQ_ID != 0 THEN
V_QUY := V_QUY+1 ;
APEX_COLLECTION.update_member_attribute (
p_collection_name=> 'POINT_SALE',
p_seq=> V_SEQ_ID,
p_attr_number => 4,
p_attr_value=> V_QUY
);
else
apex_collection.add_member(
p_collection_name => 'POINT_SALE',
p_c001 => :P22_PRODUCT_ID ,
p_c002 => V_PRODUCT_NAME,
p_c003 => V_PRICE,
p_c004 => 1);
end if;
end;
<div class="t-Alert t-Alert--horizontal t-Alert--colorBG t-Alert--defaultIcons t-Alert--info" role="alert">
<div class="t-Alert-wrap">
<div class="t-Alert-content">
<div class="t-Alert-header">
<h2 class="t-Alert-title">#ALERT_TITLE#</h2>
</div>
<div class="t-Alert-body">
#ALERT_DESC#
</div>
</div>
<div class="t-Alert-buttons">
#ALERT_ACTION1#
#ALERT_ACTION2#
#ALERT_ACTION3#
</div>
</div>
</div>
.increase-item
$(this.triggeringElement).parent().data('id')
DECLARE
V_SEQ_ID number ;
V_QUY number ;
BEGIN
BEGIN
select
seq_id,c004
into
V_SEQ_ID ,V_QUY
from apex_collections
where collection_name = 'POINT_SALE' and c001 = :P22_PRODUCT_C ;
exception
when NO_DATA_FOUND
then
V_SEQ_ID := 0;
END;
if V_SEQ_ID != 0
THEN
APEX_COLLECTION.update_member_attribute (
p_collection_name=> 'POINT_SALE',
p_seq=> V_SEQ_ID,
p_attr_number => 4,
p_attr_value=> V_QUY+1
);
end if;
end;
DECLARE
V_SEQ_ID number ;
V_QUY number ;
BEGIN
BEGIN
select
seq_id,c004
into
V_SEQ_ID ,V_QUY
from apex_collections
where collection_name = 'POINT_SALE' and c001 = :P22_PRODUCT_C ;
exception
when NO_DATA_FOUND
then
V_SEQ_ID := 0;
END;
if V_SEQ_ID != 0 and V_QUY != 1
THEN
APEX_COLLECTION.update_member_attribute (
p_collection_name=> 'POINT_SALE',
p_seq=> V_SEQ_ID,
p_attr_number => 4,
p_attr_value=> V_QUY-1
);
end if;
end;
.delete-item
$(this.triggeringElement).parent().data('id')
DECLARE
V_SEQ_ID number ;
V_QUY number ;
BEGIN
BEGIN
select
seq_id,c004
into
V_SEQ_ID ,V_QUY
from apex_collections
where collection_name = 'POINT_SALE' and c001 = :P22_PRODUCT_C ;
exception
when NO_DATA_FOUND
then
V_SEQ_ID := 0;
END;
if V_SEQ_ID != 0
THEN
APEX_COLLECTION.DELETE_MEMBER(
p_collection_name => 'POINT_SALE',
p_seq => V_SEQ_ID );
end if;
end;
select
SUM(c003 * c004)
from apex_collections
WHERE collection_name = 'POINT_SALE'
DECLARE
V_ORDER_ID NUMBER;
V_TOTAL NUMBER;
begin
SELECT SUM (c003* c004) INTO V_TOTAL FROM apex_collections WHERE collection_name = 'POINT_SALE' ;
INSERT INTO DEMO_ORDERS (CUSTOMER_ID,ORDER_TOTAL,ORDER_TIMESTAMP,USER_NAME)
VALUES (:P22_CUSTOMER,V_TOTAL,CURRENT_TIMESTAMP,:APP_USER )
RETURNING ORDER_ID INTO V_ORDER_ID;
insert into DEMO_ORDER_ITEMS
(
ORDER_ID,
PRODUCT_ID,
UNIT_PRICE,
QUANTITY )
select
V_ORDER_ID,
c001 ,
c003 ,
c004
from apex_collections WHERE collection_name = 'POINT_SALE' ;
end;
Oracle Application Express (APEX)
is a low-code development platform that enables you to build scalable, secure enterprise apps, with world-class features, that can be deployed anywhere.
Using APEX, developers can quickly develop and deploy compelling apps that solve real problems and provide immediate value.
You won't need to be an expert in a vast array of technologies to deliver sophisticated solutions.
Focus on solving the problem and let APEX take care of the rest.
Oracle APEX is the world's most popular low-code platform for enterprise apps. See how customers are using APEX, get started today, and become a part of the community.
if you have Oracle Database, you already have Oracle APEX? APEX is a fully supported no-cost feature of Oracle Database – the most complete, integrated, and secure data platform for any scale deployment. This solid foundation enables apps built using APEX to natively access and interact with all of the capabilities of Oracle Database.
Oracle APEX presents a myriad of possibilities when it comes to the types of solutions you can build to solve real business problems and provide immediate value to your organization.
In Our New Course we will
upload alot of APEX Projects to Learn advanced Idea for all APEX Feture
Like APEX Collection , Client Side , Image management , Mobile App, Social Authentication and More