Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esi-management
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
John
esi-management
Commits
4469d04b
Commit
4469d04b
authored
Jan 03, 2017
by
John Punzalan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Entity
parent
260e2e28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
7 deletions
+44
-7
class-esi-management-entity-form.php
...admin/modules/entity/class-esi-management-entity-form.php
+5
-4
functions-entity.php
.../esi-management/admin/modules/entity/functions-entity.php
+26
-0
esi-management-entity-form.php
...in/modules/entity/partials/esi-management-entity-form.php
+13
-3
No files found.
wp-content/plugins/esi-management/admin/modules/entity/class-esi-management-entity-form.php
View file @
4469d04b
...
...
@@ -49,11 +49,12 @@ class Esi_Management_Entity_Form {
$entity_type_id
=
isset
(
$_POST
[
'entity_type_id'
]
)
?
sanitize_text_field
(
$_POST
[
'entity_type_id'
]
)
:
''
;
$employees
=
isset
(
$_POST
[
'employees'
]
)
?
(
int
)
sanitize_text_field
(
$_POST
[
'employees'
]
)
:
''
;
$founded_date
=
isset
(
$_POST
[
'founded-date'
]
)
?
sanitize_text_field
(
$_POST
[
'founded-date'
]
)
:
''
;
$acquired_by
=
isset
(
$_POST
[
'acquired'
]
)
?
intval
(
$_POST
[
'acquired'
]
)
:
''
;
$acquired_date
=
isset
(
$_POST
[
'acquired-date'
]
)
?
sanitize_text_field
(
$_POST
[
'acquired-date'
]
)
:
''
;
$acquired_amount
=
isset
(
$_POST
[
'acquired-amount'
]
)
?
(
int
)
sanitize_text_field
(
$_POST
[
'acquired-amount'
]
)
:
''
;
$total_raised
=
isset
(
$_POST
[
'total-raised'
]
)
?
(
int
)
sanitize_text_field
(
$_POST
[
'total-raised'
]
)
:
''
;
$latest_round_type
=
isset
(
$_POST
[
'latest-round-type'
]
)
?
(
int
)
sanitize_text_field
(
$_POST
[
'latest-round-type'
]
)
:
''
;
$technology_ids
=
isset
(
$_POST
[
'technology_id'
]
)
?
(
int
)
sanitize_text_field
(
$_POST
[
'technology_id'
]
)
:
''
;
$technology_ids
=
isset
(
$_POST
[
'technology_id'
]
)
?
(
$_POST
[
'technology_id'
]
)
:
''
;
if
(
$is_investor
==
"on"
)
{
$is_investor
=
1
;
...
...
@@ -90,11 +91,11 @@ class Esi_Management_Entity_Form {
'entity_type_id'
=>
$entity_type_id
,
'employees'
=>
$employees
,
'founded_in'
=>
$founded_date
,
'acquired_by'
=>
$acquired_by
,
'acquired_at'
=>
$acquired_date
,
'acquired_amount'
=>
$acquired_amount
,
'total_raised'
=>
$total_raised
,
'latest_round_type'
=>
$latest_round_type
,
'technology_ids'
=>
$technology_ids
'latest_round_type'
=>
$latest_round_type
);
// New or edit?
...
...
@@ -111,7 +112,7 @@ class Esi_Management_Entity_Form {
$insert_id
=
esi_insert_entity
(
$fields
);
}
esi_save_list_entity_technology
(
$
insert_id
,
$technology_ids
);
esi_save_list_entity_technology
(
$
fields
[
'id'
]
,
$technology_ids
);
if
(
$is_ajax
){
return
$fields
;
...
...
wp-content/plugins/esi-management/admin/modules/entity/functions-entity.php
View file @
4469d04b
...
...
@@ -191,6 +191,32 @@ function esi_get_list_industry( $id = 0 ) {
return
$arrSelectedIndustry
;
}
/**
* Fetch technologies array
*
* @param int $id
*
* @return array
*/
function
esi_get_list_selected_entity_industry
(
$id
=
0
,
$output
=
'object'
)
{
global
$wpdb
;
// Get Selected technology mapping
$arrSelectedTechnology
=
$wpdb
->
get_results
(
"SELECT * FROM "
.
$wpdb
->
prefix
.
"esi_technology_entity WHERE entity_id = "
.
$id
,
OBJECT_K
);
if
(
$output
==
'array'
)
{
$array
=
array
();
foreach
(
$arrSelectedTechnology
as
$selected
)
{
$array
[]
=
$selected
->
technology_id
;
}
$arrSelectedTechnology
=
$array
;
}
return
$arrSelectedTechnology
;
}
/**
* Fetch technologies array
*
...
...
wp-content/plugins/esi-management/admin/modules/entity/partials/esi-management-entity-form.php
View file @
4469d04b
...
...
@@ -20,7 +20,8 @@ $industries = array();
$industries
=
array_merge
(
esi_get_list_industry
(),
$industries
);
$technologies
=
esi_get_all_list_technology
();
$technologies_selected
=
esi_get_list_selected_entity_technology
(
$id
,
'array'
);
$investment_type
=
esi_get_all_investment_type
(
array
(
'number'
=>
10000
));
$entities
=
esi_get_all_entity
(
array
(
'number'
=>
10000
));
add_thickbox
();
?>
...
...
@@ -119,8 +120,12 @@ add_thickbox();
<label
for=
"acquired-by"
>
<?php
_e
(
'Acquired by'
,
'esi'
);
?>
</label>
</th>
<td>
<select
id=
"acquired"
name=
"acquired"
>
<select
id=
"acquired"
name=
"acquired"
class=
"chosen-select"
>
<option
value=
"0"
>
Select an entity
</option>
<?php
foreach
(
$entities
as
$entity
)
:
?>
<option
value=
"
<?=
$entity
->
id
?>
"
<?=
(
$item
->
acquired_by
==
$entity
->
id
)
?
'selected="selected"'
:
''
?>
>
<?=
$entity
->
name
?>
</option>
<?php
endforeach
;
?>
</select>
</td>
</tr>
...
...
@@ -153,7 +158,12 @@ add_thickbox();
<label
for=
"latest-round-type"
>
<?php
_e
(
'Latest Round Type'
,
'esi'
);
?>
</label>
</th>
<td>
<input
type=
"text"
name=
"latest-round-type"
id=
"latest-round-type"
class=
"regular-text"
placeholder=
"
<?php
echo
esc_attr
(
'Latest Round Type'
,
'esi'
);
?>
"
value=
"
<?php
echo
(
$item
)
?
esc_attr
(
$item
->
latest_round_type
)
:
''
;
?>
"
/>
<select
id=
"latest-round-type"
name=
"latest-round-type"
class=
"chosen-select"
style=
"float:left"
>
<option
value=
"0"
>
Select an investment type
</option>
<?php
foreach
(
$investment_type
as
$type
)
:
?>
<option
value=
"
<?=
$type
->
id
?>
"
<?=
(
$item
->
latest_round_type
==
$type
->
id
)
?
'selected="selected"'
:
''
?>
>
<?=
$type
->
name
?>
</option>
<?php
endforeach
;
?>
</select>
</td>
</tr>
<hr
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment