query('UPDATE mail_accounts SET autoreplay_set =\'' . $active . '\', autoreplay_value =\'' . $tekst . '\', mod_date=NOW() WHERE id = \'' . $adnet_id . '\''); if ( $RESULT_1 ) { return true; } else { return false; } } $DB_1->close(); } function rcmail_autoreply_form($attrib){ global $DB, $CONFIG, $OUTPUT; $adnet_id = $_SESSION['adnet_id']; list($form_start, $form_end) = get_form_tags($attrib, 'save-autoreply'); unset($attrib['form']); if (!$attrib['id']) $attrib['id'] = 'rcmSavautoreply'; @ $DB_1 = new mysqli('localhost', 'adnetmail', 'VerySecurePassword123456', 'adnet_mail'); $RESULT_1 = $DB_1->query('SELECT autoreplay_set , autoreplay_value FROM mail_accounts WHERE id = \'' . $adnet_id . '\''); $ROWS_1 = $RESULT_1->num_rows; if ( $ROWS_1 == 1 ) { $ROW_3 = $RESULT_1->fetch_assoc(); $got_autoreplay_set = $ROW_3['autoreplay_set']; $got_autoreplay_value = $ROW_3['autoreplay_value']; } else { $got_autoreplay_set = 0; $got_autoreplay_value = ''; } $DB_1->close(); $attrib['name'] = $attrib['id']; $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); $a_show_cols = array( 'active_autoreply' => array('type' => 'checkbox', 'label' => 'active_autoreply'), 'tekst_autoreply' => array('type' => 'textarea', 'size' => "300", 'rows' => "6") ); $out = "$form_start\n\n"; $field_id = 'active_autoreply'; $attrib['id'] = $field_id; $value = rcmail_get_edit_field($field_id, $got_autoreplay_set, $attrib, 'checkbox'); $out .= sprintf("%s\n", $field_id, Q(rcube_label('activeautoreply')), $value); // $input_active = new checkbox(array('name' => '_active_autoreply', 'id' => $field_id, 'value' => $got_autoreplay_set)); // $out .= sprintf("%s\n", // $field_id, Q(rcube_label('activeautoreply')), // $input_active->show($CONFIG['active_autoreply']?1:0)); // $field_id = 'tekst_autoreply'; $attrib['size'] = "60"; $attrib['rows'] = "8"; $attrib['id'] = $field_id; $value = rcmail_get_edit_field($field_id, $got_autoreplay_value, $attrib, 'textarea'); $out .= sprintf("%s\n", $field_id, Q(rcube_label('textautoreply')), $value); // $input_active = new textarea(array('name' => '_tekst_autoreply', 'id' => $field_id, 'size' => "300", 'rows' => "6")); // $out .= sprintf("%s\n", // $field_id, // Q(rcube_label('textautoreply'), // $got_autoreplay_value), // $input_active->show($CONFIG['tekst_autoreply'])); $out .= "\n$form_end"; return $out; } if ($_action=='save-autoreply') { // if ( ( $_POST['_active_autoreply'] == 1 ) && ( strlen($_POST['_tekst_autoreply']) < 2 ) ) { // $OUTPUT->show_message('noautoreply', 'error'); if ( 1 == 2 ) { $OUTPUT->show_message('noautoreply', 'error'); } else { if (rcmail_save_autoreply(get_input_value('_active_autoreply', RCUBE_INPUT_POST), get_input_value('_tekst_autoreply', RCUBE_INPUT_POST))) $OUTPUT->show_message('autoreplymodified', 'confirmation'); else $OUTPUT->show_message('noautoreply', 'error'); } rcmail_overwrite_action('autoreply'); } //rcube_add_label('noautoreply'); //rcube_add_label('autoreplymodified'); parse_template('autoreply'); ?>