Skip to content

Commit

Permalink
Update action mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
Hồ Ngọc Triển committed Dec 25, 2015
1 parent e37418a commit 1dc3085
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/nvform/action_mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* @Author VINADES.,JSC (contact@vinades.vn)
* @Copyright (C) 2015 VINADES.,JSC. All rights reserved
* @License: Not free read more http://nukeviet.vn/vi/store/modules/nvtools/
* @Createdate Fri, 27 Nov 2015 13:23:55 GMT
* @Createdate Fri, 25 Dec 2015 03:14:14 GMT
*/

if ( ! defined( 'NV_IS_FILE_MODULES' ) ) die( 'Stop!!!' );

$sql_drop_module = array();
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $module_data . "";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_answer";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_question";

Expand Down
6 changes: 4 additions & 2 deletions modules/nvform/admin/form_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
die();
}
$form_data['template'] = unserialize( $form_data['template'] );
$form_data['form_report_type_email'] = unserialize( $form_data['form_report_type_email'] );

$page_title = $lang_module['form_edit'] . ': ' . $form_data['title'];
$lang_summit = $lang_module['form_edit'];
Expand Down Expand Up @@ -153,7 +154,7 @@
$weight = $db->query( "SELECT MAX(weight) FROM " . NV_PREFIXLANG . "_" . $module_data )->fetchColumn();
$weight = intval( $weight ) + 1;

$sql = 'INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . ' (title, alias, description, description_html, image, start_time, end_time, groups_view, user_editable, question_display, question_report, form_report_type, template, weight, add_time, status) VALUES (:title, :alias, :description, :description_html, :image, :start_time, :end_time, :groups_view, :user_editable, :question_display, :question_report, :form_report_type, :form_report_type_email, :template, ' . $weight . ', ' . NV_CURRENTTIME . ', 1)';
$sql = 'INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . ' (title, alias, description, description_html, image, start_time, end_time, groups_view, user_editable, question_display, question_report, form_report_type, form_report_type_email, template, weight, add_time, status) VALUES (:title, :alias, :description, :description_html, :image, :start_time, :end_time, :groups_view, :user_editable, :question_display, :question_report, :form_report_type, :form_report_type_email, :template, ' . $weight . ', ' . NV_CURRENTTIME . ', 1)';
}

$query = $db->prepare( $sql );
Expand Down Expand Up @@ -198,7 +199,7 @@
$form_data['question_report_check'] = $form_data['question_report'] ? 'checked="checked"' : '';
$form_data['user_editable_check'] = $form_data['user_editable'] ? 'checked="checked"' : '';

$form_report_type_email = unserialize( $form_data['form_report_type_email'] );
$form_report_type_email = $form_data['form_report_type_email'];
$form_data['form_report_type_email'] = $form_report_type_email['form_report_type_email'];
$form_data['listmail'] = $form_report_type_email['listmail'];

Expand Down Expand Up @@ -360,6 +361,7 @@
$xtpl->parse( 'main.form_report_type_email' );
}

$form_report_type_email['group_email'] = explode( ',', $form_report_type_email['group_email'] );
foreach( $groups_list as $_group_id => $_title )
{
$xtpl->assign( 'GR_EMAIL', array(
Expand Down

0 comments on commit 1dc3085

Please sign in to comment.