вопрос
Здравствуйте хотел добавить поле fio, company, city, phone, для жалоб в дле, добавил все поля отправляю запрос в базе кроме заполненного text ничего нету!
elseif ($_POST['action'] == "news") {
if( !$is_logged );
if( !$id OR !$text) die( "error" );
$row = $db->super_query( "SELECT id, autor FROM " . PREFIX . "_post WHERE id='{$id}'" );
if(!$row['id']) die("Operation not Allowed");
$member_id['name'] = $db->safesql($member_id['name']);
$db->query( "SELECT id FROM " . PREFIX . "_complaint WHERE n_id='{$id}' AND `from`='{$member_id['name']}'" );
if ($db->num_rows()) { echo $lang['error_complaint_1']; die(); }
$text = $db->safesql( $text );
$fio = $db->safesql( $fio );
$company = $db->safesql( $company );
$city = $db->safesql( $city );
$phone = $db->safesql( $phone );
$db->query( "INSERT INTO " . PREFIX . "_complaint (`p_id`, `c_id`, `n_id`, `text`, `fio`, `company`, `city`, `phone`, `from`, `to`, `date`) values ('0', '0', '{$row['id']}', '{$text}', '{$fio}', '{$company}', '{$city}', '{$phone}', '{$member_id['name']}', '', '{$_TIME}')" );
if ( $config['allow_complaint_mail'] ) {
$mail->send( $config['admin_mail'], $lang['mail_complaint'], $lang['mail_complaint_1'] );
}
} elseif ($_POST['action'] == "orfo") {
if(!$text) die( "error" );
$seltext = convert_unicode( $_POST['seltext'], $config['charset'] );
$seltext = htmlspecialchars( $parse->process( trim( $seltext ) ), ENT_QUOTES, $config['charset'] );
$url = $db->safesql( htmlspecialchars( $parse->clear_url( trim( $_POST['url'] ) ), ENT_QUOTES, $config['charset'] ) );
if(!$seltext) die( "error" );
if( !$is_logged ) $author = $_IP; else $author = $db->safesql($member_id['name']);
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_complaint WHERE p_id='0' AND c_id='0' AND n_id='0' AND `from`='{$author}'" );
if ($row['count'] > 2 ) { echo $lang['error_complaint_1']; die(); }
$seltext = "<div class=\"quote\">".stripslashes( $seltext )."</div>";
$text = $db->safesql( $seltext.$text );
$db->query( "INSERT INTO " . PREFIX . "_complaint (`p_id`, `c_id`, `n_id`, `text`, `fio`, `company`, `city`, `phone`, `from`, `to`, `date`) values ('0', '0', '0', '{$text}', '{$fio}', '{$company}', '{$city}', '{$phone}', '{$url}', '{$_TIME}')" );
if ( $config['allow_complaint_mail'] ) {
$mail->send( $config['admin_mail'], $lang['mail_complaint'], $lang['mail_complaint_1'] );
}
}
function AddComplaint( id, action ){
var b = {};
b[dle_act_lang[3]] = function() {
$(this).dialog('close');
};
b[dle_p_send] = function() {
if ( $('#dle-promt-text').val().length < 1) {
$('#dle-promt-text').addClass('ui-state-error');
} else {
var response = $('#dle-promt-text').val()
$(this).dialog('close');
$('#dlepopup').remove();
$.post(dle_root + 'engine/ajax/complaint.php', { id: id, text: response, action: action },
function(data){
if (data == 'ok') { DLEalert(dle_p_send_ok, dle_info); } else { DLEalert(data, dle_info); }
});
}
};
$('#dlepopup').remove();
$('body').append("<div id='dlepopup' title='"+dle_complaint+"' style='display:block'><br /><table>в доработке<br>Тестовый режим<br><tr><td width='100px'>Ф.И.О.</td><td><input type='text' maxlength='45' name='fio' id='fio' class='f_input' /></td></tr><tr><td>Компания:</td><td><input type='text' maxlength='45' name='company' class='f_input' /></td></tr><tr><td>Город:</td><td><input type='text' maxlength='45' name='city' class='f_input' /></td></tr><tr><td>Тел:</td><td><input type='text' maxlength='45' name='phone' class='f_input' /></td></tr><tr><td>E-Mail:</td><td><input type='text' maxlength='45' name='dle-promt-text' id='dle-promt-text' class='f_input' /></td></tr></table></div>");
$('#dlepopup').dialog({
autoOpen: true,
width: 500,
resizable: false,
dialogClass: "modalfixed",
buttons: b
});
$('.modalfixed.ui-dialog').css({position:"fixed"});
$('#dlepopup').dialog( "option", "position", ['0','0'] );
};
function AddComplaint( id, action ){
var b = {};
b[dle_act_lang[3]] = function() {
$(this).dialog('close');
};
b[dle_p_send] = function() {
if ( $('#dle-promt-text').val().length < 1) {
$('#dle-promt-text').addClass('ui-state-error');
} else {
var response = $('#dle-promt-text').val();
var fio = $("input[name='fio']").val();
var company = $("input[name='company']").val();
var city = $("input[name='city']").val();
var phone = $("input[name='phone']").val();
$(this).dialog('close');
$('#dlepopup').remove();
$.post(dle_root + 'engine/ajax/complaint.php', { id: id, fio: fio, company: company, city: city, phone: phone, text: response, action: action },
function(data){
if (data == 'ok') { DLEalert(dle_p_send_ok, dle_info); } else { DLEalert(data, dle_info); }
});
}
};
$('#dlepopup').remove();
$('body').append("<div id='dlepopup' title='"+dle_complaint+"' style='display:block'><br /><table>в доработке<br>Тестовый режим<br><tr><td width='100px'>Ф.И.О.</td><td><input type='text' maxlength='45' name='fio' id='fio' class='f_input' /></td></tr><tr><td>Компания:</td><td><input type='text' maxlength='45' name='company' class='f_input' /></td></tr><tr><td>Город:</td><td><input type='text' maxlength='45' name='city' class='f_input' /></td></tr><tr><td>Тел:</td><td><input type='text' maxlength='45' name='phone' class='f_input' /></td></tr><tr><td>E-Mail:</td><td><input type='text' maxlength='45' name='dle-promt-text' id='dle-promt-text' class='f_input' /></td></tr></table></div>");
$('#dlepopup').dialog({
autoOpen: true,
width: 500,
resizable: false,
dialogClass: "modalfixed",
buttons: b
});
$('.modalfixed.ui-dialog').css({position:"fixed"});
$('#dlepopup').dialog( "option", "position", ['0','0'] );
};