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
e7b2fc6d
Commit
e7b2fc6d
authored
Dec 30, 2016
by
John Punzalan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Entity and news
parent
9bd2d955
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
2 deletions
+114
-2
esi-management-admin.css
...plugins/esi-management/admin/css/esi-management-admin.css
+4
-0
esi-management-admin.js
...t/plugins/esi-management/admin/js/esi-management-admin.js
+1
-0
class-esi-management-entity-form.php
...admin/modules/entity/class-esi-management-entity-form.php
+9
-0
functions-entity.php
.../esi-management/admin/modules/entity/functions-entity.php
+83
-0
esi-management-entity-form.php
...in/modules/entity/partials/esi-management-entity-form.php
+15
-0
esi-management-news-form.php
.../admin/modules/news/partials/esi-management-news-form.php
+2
-2
No files found.
wp-content/plugins/esi-management/admin/css/esi-management-admin.css
View file @
e7b2fc6d
...
...
@@ -2,3 +2,7 @@
* All of the CSS for your admin-specific functionality should be
* included in this file.
*/
.chosen-container-single
{
height
:
33px
;
}
\ No newline at end of file
wp-content/plugins/esi-management/admin/js/esi-management-admin.js
View file @
e7b2fc6d
...
...
@@ -34,6 +34,7 @@
$
(
'#radar_function'
).
multiSelect
();
$
(
'#industry_sub_id'
).
multiSelect
();
$
(
'.join_sub_data_select'
).
multiSelect
();
$
(
'.js-multiselect'
).
multiSelect
();
$
(
"#radar_id"
).
live
(
'change'
,
function
(
el
){
$
.
ajax
({
...
...
wp-content/plugins/esi-management/admin/modules/entity/class-esi-management-entity-form.php
View file @
e7b2fc6d
...
...
@@ -36,6 +36,8 @@ class Esi_Management_Entity_Form {
wp_die
(
__
(
'Permission Denied!'
,
'esi'
)
);
}
// var_dump($_POST);
// die;
$errors
=
array
();
$page_url
=
admin_url
(
'admin.php?page=esi-management-entity'
);
...
...
@@ -54,6 +56,7 @@ class Esi_Management_Entity_Form {
$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'
]
)
:
''
;
if
(
$is_investor
==
"on"
)
{
$is_investor
=
1
;
...
...
@@ -94,6 +97,7 @@ class Esi_Management_Entity_Form {
'acquired_amount'
=>
$acquired_amount
,
'total_raised'
=>
$total_raised
,
'latest_round_type'
=>
$latest_round_type
,
'technology_ids'
=>
$technology_ids
);
// New or edit?
...
...
@@ -110,6 +114,11 @@ class Esi_Management_Entity_Form {
$insert_id
=
esi_insert_entity
(
$fields
);
}
// var_dump($fields['id']);
// die;
esi_save_list_entity_technology
(
$insert_id
,
$technology_ids
);
if
(
$is_ajax
){
return
$fields
;
}
...
...
wp-content/plugins/esi-management/admin/modules/entity/functions-entity.php
View file @
e7b2fc6d
...
...
@@ -189,4 +189,87 @@ function esi_get_list_industry( $id = 0 ) {
$arrSelectedIndustry
=
$wpdb
->
get_results
(
"SELECT * FROM "
.
$wpdb
->
prefix
.
"esi_industry WHERE parent = "
.
$id
.
" ORDER BY name ASC"
);
return
$arrSelectedIndustry
;
}
/**
* Fetch technologies array
*
* @param int $id
*
* @return array
*/
function
esi_get_all_list_technology
(
$id
=
0
)
{
global
$wpdb
;
// Get Selected technology mapping
$arrSelectedTechnology
=
$wpdb
->
get_results
(
"SELECT * FROM "
.
$wpdb
->
prefix
.
"esi_technology ORDER BY name ASC"
);
return
$arrSelectedTechnology
;
}
/**
* Fetch technologies array
*
* @param int $id
*
* @return array
*/
function
esi_get_list_entity_technology
(
$id
=
0
)
{
global
$wpdb
;
// Get Selected technology mapping
$arrSelectedTechnology
=
$wpdb
->
get_results
(
"SELECT * FROM "
.
$wpdb
->
prefix
.
"esi_technology_entity ORDER BY name ASC"
);
return
$arrSelectedTechnology
;
}
/**
* Fetch technologies array
*
* @param int $id
*
* @return array
*/
function
esi_get_list_selected_entity_technology
(
$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
*
* @param int $entityid
* @param array $technologyids
*
* @return array
*/
function
esi_save_list_entity_technology
(
$entityid
=
0
,
$technologyids
=
array
()
)
{
global
$wpdb
;
// Delete all current join from liaison table
$wpdb
->
query
(
$wpdb
->
prepare
(
'DELETE FROM '
.
$wpdb
->
prefix
.
'esi_technology_entity WHERE entity_id = %d'
,
$entityid
));
// Insert new news_id technology_id relation
foreach
(
$technologyids
as
$technology_id
)
{
$wpdb
->
insert
(
$wpdb
->
prefix
.
"esi_technology_entity"
,
array
(
'technology_id'
=>
$technology_id
,
'entity_id'
=>
intval
(
$entityid
)
));
}
}
\ No newline at end of file
wp-content/plugins/esi-management/admin/modules/entity/partials/esi-management-entity-form.php
View file @
e7b2fc6d
...
...
@@ -18,6 +18,9 @@ $countries = esi_get_all_countries();
$entity_types
=
esi_get_all_entity_type_id
();
$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'
);
add_thickbox
();
?>
...
...
@@ -175,6 +178,18 @@ add_thickbox();
</select><br
/>
</td>
</tr>
<tr
class=
"row-technology-id"
>
<th
scope=
"row"
>
<label
for=
"technology_id"
>
<?php
_e
(
'Technology'
,
'esi'
);
?>
</label>
</th>
<td>
<select
id=
"technology_id"
class=
"chosen-select"
name=
"technology_id[]"
multiple=
"multiple"
>
<?php
foreach
(
$technologies
as
$technology
)
:
?>
<option
value=
"
<?=
$technology
->
id
?>
"
<?=
(
in_array
(
$technology
->
id
,
$technologies_selected
))
?
"selected='selected'"
:
""
?>
>
<?=
$technology
->
name
?>
</option>
<?php
endforeach
;
?>
</select><br
/>
</td>
</tr>
</tbody>
</table>
...
...
wp-content/plugins/esi-management/admin/modules/news/partials/esi-management-news-form.php
View file @
e7b2fc6d
...
...
@@ -139,14 +139,14 @@ add_thickbox();
<label
for=
"entity_id"
>
<?php
_e
(
'Entity'
,
'esi'
);
?>
</label>
</th>
<td>
<select
id=
"entity_id"
name=
"entity_id"
style=
"float:left"
>
<select
id=
"entity_id"
name=
"entity_id"
class=
"chosen-select"
style=
"float:left"
>
<option
value=
"0"
>
Select a entity
</option>
<?php
foreach
(
$companies
as
$entity
)
:
?>
<option
value=
"
<?=
$entity
->
id
?>
"
<?=
(
$item
->
entity_id
==
$entity
->
id
)
?
'selected="selected"'
:
''
?>
>
<?=
$entity
->
name
?>
</option>
<?php
endforeach
;
?>
</select>
<a
href=
"/wp-admin/admin.php?page=esi-management-entity&action=new"
target=
"_blank"
class=
"page-title-action"
style=
"
float:left;
margin-top:5px;"
>
class=
"page-title-action"
style=
"margin-top:5px;"
>
Add entity
</a>
</td>
...
...
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