Example #1
0
    public static function editStore()
    {
        $sql = 'SELECT * FROM {{dealers_stores}} WHERE id=' . $_POST['id'];
        $tmp = DB::getRow($sql);
        $oldstatus = $tmp['status'];
        DB::escapePost();
        $sql = '
			UPDATE {{dealers_stores}}
			SET 
				title=\'' . $_POST['title'] . '\',
				status=\'' . $_POST['status'] . '\',
				region=\'' . $_POST['region'] . '\',
				city=\'' . $_POST['city'] . '\',
				street=\'' . $_POST['street'] . '\',
				house=\'' . $_POST['house'] . '\',
				work_time=\'' . $_POST['work_time'] . '\',
				phone=\'' . $_POST['phone'] . '\',
				email=\'' . $_POST['email'] . '\',
				contact=\'' . $_POST['contact'] . '\',
				contact_phone=\'' . $_POST['contact_phone'] . '\',
				comment=\'' . $_POST['comment'] . '\'
			WHERE id=' . $_POST['id'] . '
		';
        DB::exec($sql);
        //файлы
        DealersFiles::uploadStorePhotos($_POST['id']);
        //оповещение
        if ($oldstatus != $_POST['status']) {
            DealersEmail::address_status($_POST['id']);
        }
    }