- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
<?php
if ($_POST['act']=='addstuff')
{
//print_r($_POST);
$c_config=array(
'slider1_title'=>($_POST['slider1_title']),
'slider1_text'=> ($_POST['slider1_text']),
'slider1_link'=> ($_POST['slider1_link']),
'slider1'=> ($_POST['slider1']),
'slider2_title'=>($_POST['slider2_title']),
'slider2_text'=> ($_POST['slider2_text']),
'slider2_link'=> ($_POST['slider2_link']),
'slider2'=> ($_POST['slider2']),
'slider3_title'=>($_POST['slider3_title']),
'slider3_text'=> ($_POST['slider3_text']),
'slider3_link'=> ($_POST['slider3_link']),
'slider3'=> ($_POST['slider3']),
'slider4_title'=>($_POST['slider4_title']),
'slider4_text'=> ($_POST['slider4_text']),
'slider4_link'=> ($_POST['slider4_link']),
'slider4'=> ($_POST['slider4']),
'slider5_title'=>($_POST['slider5_title']),
'slider5_text'=> ($_POST['slider5_text']),
'slider5_link'=> ($_POST['slider5_link']),
'slider5'=> ($_POST['slider5']),
'number_title'=>($_POST['number_title']),
'number_text'=> ($_POST['number_text']),
'number_link'=> ($_POST['number_link']),
'date_title'=>($_POST['date_title']),
'date_text'=> ($_POST['date_text']),
'date_link'=> ($_POST['date_link']),
'banner_link'=> ($_POST['banner_link']),
'banner'=> ($_POST['banner'])
);
$c_config=json_encode($c_config);
if (intval($_POST['category_id'])>0)
{
$db->query('UPDATE ecrm_category set category_name=\''.addslashes($_POST['category_name']).'\', category_config=\''.addslashes($c_config).'\', category_img=\''.addslashes($_POST['category_img']).'\', category_type=\''.intval($_POST['category_type']).'\' WHERE category_id='.intval($_POST['category_id']));
//echo 'UPDATE ecrm_category set category_name=\''.addslashes($_POST['category_name']).'\', category_config=\''.addslashes($c_config).'\', category_img=\''.addslashes($_POST['category_img']).'\', category_type=\''.intval($_POST['category_type']).'\' WHERE category_id='.intval($_POST['category_id']);
} else{
$db->query('INSERT INTO ecrm_category (category_name,category_config,category_img,category_parent,category_type) VALUES (\''.addslashes($_POST['name']).'\',\''.$c_config.'\',\''.addslashes($_POST['category_img']).'\','.intval($_POST['category_parent']).','.intval($_POST['category_type']).')');
}
}
damir 09.07.2015 13:58 # 0
inkanus-gray 09.07.2015 14:37 # 0
Vasiliy 09.07.2015 16:57 # 0
ЗЫ почему не заюзали replace не пойму.