-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /var/www/html/html/php/board/
File Upload :
Current File : /var/www/html/html/php/board/act.insert.php

<?php

######################################################
// approve check
######################################################

	if ( $config[$code][4]['level'] > $total['loginlevel'] || $config[$code][4]['maxlevel'] < $total['loginlevel'] )
		script_re ( $total['cmnall'] , ' ±ÇÇÑÀÌ ¾ø½À´Ï´Ù. ' ) ;

	if ( empty($_POST['title']) || empty($_POST['name']))
		script_bk( ' Çʼö»çÇ×À» ÀÔ·ÂÇØÁÖ¼¼¿ä ' ) ;

	if ( str_check_contents($_POST['title']) || str_check_contents($_POST['contents'])) script_bk( ' Á¦ÇÑµÈ ´Ü¾î¸¦ »ç¿ëÇϼ̽À´Ï´Ù. ' ) ;


	if ( emptY($_POST['oncode']) || empty($_POST['incode']))
		script_bk( ' º¸¾È Äڵ带 ÀÔ·ÂÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù. ' ) ;

	if ( strlen($_POST['oncode']) == 7 ) {
		$view_code = md5($_POST['oncode']);
		$view_code = substr($view_code , 2, 5 );
		$view_code = strtoupper( $view_code) ;
		if ( $_POST['incode'] != $view_code ) script_bk( ' Äڵ尡 ¸ÂÁö ¾Ê½À´Ï´Ù. ' ) ;
	} else script_bk( ' À¯È¿ÇÑ Äڵ尡 ¾Æ´Õ´Ï´Ù. ' ) ;

######################################################
// base construct
######################################################

	$action = array (
		'keycode'				=> $total['code'] ,
		'write_date'			=> $total['now'] ,
		'ip'					=> $total['ip'] ,
		'real_id'				=> $total['loginid'] ,
		'real_no'				=> $total['loginno'] ,
		'real_level'			=> $total['loginlevel'] ,
		'self_numid'			=> $total['loginno'] ,

	// 	'grp_id'				=> 0 ,
		'seq_id'				=> 1 ,
		'msg_level'				=> 0 ,

		'text_type'				=> $_POST['text_type'] ,
		'title'					=> str_convert($_POST['title']) ,
		'name'					=> str_convert($_POST['name']) ,
		'email'					=> ( !empty($_POST['email1']))?$_POST['email1'] . '@' . $_POST['email2']:'' ,
		'pass'					=> $_POST['pass'] ,
		'contents'				=> str_convert($_POST['contents']) ,

		//
		'category_code'			=> '' ,
	) ;

######################################################
// use record (notice or common)
######################################################

	if ( $config[$code][4]['record'] == 'on' && $config[$code][4]['record_level'] <= $total['loginlevel'] )
		$action['record_type'] = ( $_POST['record_type'] == 'Y' )?'Y':'N' ;

######################################################
// use secret
######################################################

	if ( $config[$code][4]['secret'] == 'on' )
		$action['secret_type'] = ( $_POST['secret_type'] == 'Y' )?'Y':'N' ;

######################################################
// use select
######################################################

	if ( $config[$code][4]['select'] == 'on' )
		$action['select_main']= $_POST['select_main'] ;

######################################################
// use category
######################################################

	if ( $config[$code][4]['category'] == 'on' )
	{
		$action['category_code']	= $_POST['category_code'] ;
		$action['category_numid'] = $_POST['category_numid'] ;
	}

######################################################
// use head
######################################################

	if ( $config[$code][4]['head'] == 'on' )
	{
		$action['head_code'] = $_POST['head_code'] ;
		$action['head_contents'] = $_POST['head_numid'] ;
	}

######################################################
// use movie
######################################################

	if ( $config[$code][4]['movie'] == 'on' )
	{
		$action['mov_image'] = file_upload( $_FILES['mov_image']['tmp_name'] , $_FILES['mov_image']['name'] , 'files/' . $info_file['mov_dir'] ) ;
		$action['mov_video'] = file_upload( $_FILES['mov_video']['tmp_name'] , $_FILES['mov_video']['name'] , 'files/' . $info_file['mov_dir'] ) ;
	}

######################################################
// action
######################################################

	$max_group = $exe->qry_fetch ( " from tbl_{$total[table]} where keycode='{$total[code]}' " , " MAX(grp_id) as maxnum " , "maxnum" ) ;
	if ( empty($max_group)) $max_group = 1 ;
	else $max_group++ ;

	$action['grp_id'] = $max_group ;

	$numid = $exe->qry_insert ( $action , " tbl_{$total[table]} " ) ;

######################################################
// use file
######################################################

	if ( $total['options']['file'] == 'on' ) {
		$exe->qry_update( " parent_numid = '{$numid}' , temp_code = null " , "tbl_{$info_file[table]}" , " keycode='{$total[code]}' and temp_code='{$_POST[temp_code]}' " ) ;
		$file_count = mysql_affected_rows() ;
		$f_rs = $exe->qry_fetch ( " from tbl_{$info_file[table]} where parent_numid = '{$numid}' and keycode='{$total[code]}' and up_type = 'THUMB' order by fileno asc limit 1 " , " real_file_name ") ;
		$thum_filename = "" ;
		if ( !empty($f_rs['real_file_name'])) $thum_filename = "'{$info_thumb[head]}" . $f_rs['real_file_name'] . "'" ;
		else $thum_filename = "null" ;
		$exe->qry_update( " attachfile_count = {$file_count} , prev_image = {$thum_filename}" , ' tbl_' . $config[$code][1] , ' keycode=\'' . $code . '\' and numid=\'' . $numid . '\' ' ) ;
	}

######################################################
// end
######################################################

	// 2017-04-05 LOG-IGH CTS ½ºÅ©¸³Æ® ÀÓÀÇ º¯¼ö
	$_SESSION['http_online']="online_counsel";

	script_re($total['cmnall'] . '&mode=view&numid=' . $numid , 'µî·ÏµÇ¾ú½À´Ï´Ù.' ) ;

?>

Copyright © 2017 || Recoded By Mr.Bumblebee