Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltms.eemo.co.kr
/
public_html
/
super
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/ltms.eemo.co.kr/public_html/super/hatchery_jucha_plan_add_do.php
<? session_cache_limiter('no-cache, must-revalidate'); session_start(); header("Pragma: no-cache"); header("Cache-Control: no-cache,must-revalidate"); header("Content-Type: text/html; charset=utf-8"); include_once("dbconn.php"); include_once("lib.php"); foreach($_GET as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } foreach($_POST as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } $arr_rst=array(); $arr_vv=array(); $arr_vv[0]=${"frm_mon"}; $arr_vv[1]=${"frm_tue"}; $arr_vv[2]=${"frm_wed"}; $arr_vv[3]=${"frm_thu"}; $arr_vv[4]=${"frm_fri"}; $arr_vv[5]=${"frm_sat"}; $arr_vv[6]=${"frm_sun"}; $sum=array_sum($arr_vv); $arr_day=array(); $gendate = new DateTime(); for($n=1;$n<=7;$n++) { $gendate->setISODate($jyear,$jucha,$n); //year , week num , day $arr_day[$n-1]=$gendate->format('Y-m-d'); } //echo $gendate->format('d-m-Y'); //"prints" 26-12-2013 $is_rs=RS("select * from hatchery_jucha_plan where company_no='{$_COOKIE[ucompany_no]}' and hatchery_no='$hatchery_no' and jyear='$jyear' and jucha='$jucha' and jong_type='$jong_type' and breedtype='$breedtype' and gegun_name='$frm_gegun' "); if($is_rs[no]) { $arr_rst['rst']='double'; echo json_encode($arr_rst); exit; } $query="insert into hatchery_jucha_plan set company_no='{$_COOKIE[ucompany_no]}', hatchery_no='$hatchery_no', jyear='$jyear', jucha='$jucha', susu_mon='{$arr_vv[0]}', susu_tue='{$arr_vv[1]}', susu_wed='{$arr_vv[2]}', susu_thu='{$arr_vv[3]}', susu_fri='{$arr_vv[4]}', susu_sat='{$arr_vv[5]}', susu_sun='{$arr_vv[6]}', sum_susu='$sum', susu_mon_jdate='{$arr_day[0]}', susu_tue_jdate='{$arr_day[1]}', susu_wed_jdate='{$arr_day[2]}', susu_thu_jdate='{$arr_day[3]}', susu_fri_jdate='{$arr_day[4]}', susu_sat_jdate='{$arr_day[5]}', susu_sun_jdate='{$arr_day[6]}', jong_type='$jong_type', breedtype='$breedtype', gegun_name='$frm_gegun', regdate=now() "; mysql_query($query) or die(mysql_error()); for($n=1;$n<=7;$n++) { $n2=$n-1; $query="insert into hatchery_jucha_plan_date set company_no='{$_COOKIE[ucompany_no]}', hatchery_no='$hatchery_no', jdate='{$arr_day[$n2]}', jyear='$jyear', jucha='$jucha', jweekday='$n', susu='{$arr_vv[$n2]}', jong_type='$jong_type', breedtype='$breedtype', gegun_name='$frm_gegun', regdate=now() "; mysql_query($query) or die(mysql_error()); } $arr_rst['rst']='1'; echo json_encode($arr_rst); ?>