
-----------------------------------------------------------------------
기성청구 잔액 및 누적합계는 자동계산됩니다.
prepare($sql);
$stmh->bindValue(1, $num, PDO::PARAM_STR);
$stmh->execute();
$row = $stmh->fetch(PDO::FETCH_ASSOC);
$item_num = $row["num"];
$item_id = $row["id"];
$item_name = $row["name"];
$item_nick = $row["nick"];
$item_hit = $row["hit"];
$image_name[0] = $row["file_name_0"];
$image_name[1] = $row["file_name_1"];
$image_name[2] = $row["file_name_2"];
$image_copied[0] = $row["file_copied_0"];
$image_copied[1] = $row["file_copied_1"];
$image_copied[2] = $row["file_copied_2"];
$item_date = $row["regist_day"];
$item_date = substr($item_date,0,10);
$item_subject = str_replace(" ", " ", $row["subject"]);
$item_content = $row["content"];
$is_html = $row["is_html"];
$content="";
$sum=[];
$condate=$row["condate"];
$condate1=$row["condate1"];
$condate2=$row["condate2"];
$estimate1=$row["estimate1"];
$estimate2=$row["estimate2"];
$estimate3=$row["estimate3"];
$estimate4=$row["estimate4"];
$sum[0]=$row["estimate1"];
$sum[1]=$row["estimate2"];
$sum[2]=$row["estimate3"];
$sum[3]=$row["estimate4"];
for($i=0;$i<=3;$i++)
{
if($sum[$i]!="") $sumhap=preg_replace("/[^0-9]*/s","",$sum[$i]);
}
$bill1=$row["bill1"];
$bill2=$row["bill2"];
$bill3=$row["bill3"];
$bill4=$row["bill4"];
$bill5=$row["bill5"];
$bill6=$row["bill6"];
$billdate1=$row["billdate1"];
$billdate2=$row["billdate2"];
$billdate3=$row["billdate3"];
$billdate4=$row["billdate4"];
$billdate5=$row["billdate5"];
$billdate6=$row["billdate6"];
$deposit1=$row["deposit1"];
$deposit2=$row["deposit2"];
$deposit3=$row["deposit3"];
$deposit4=$row["deposit4"];
$deposit5=$row["deposit5"];
$deposit6=$row["deposit6"];
$depositdate1=$row["depositdate1"];
$depositdate2=$row["depositdate2"];
$depositdate3=$row["depositdate3"];
$depositdate4=$row["depositdate4"];
$depositdate5=$row["depositdate5"];
$depositdate6=$row["depositdate6"];
$claimamount1=$row["claimamount1"];
$claimamount2=$row["claimamount2"];
$claimamount3=$row["claimamount3"];
$claimamount4=$row["claimamount4"];
$claimamount5=$row["claimamount5"];
$claimamount6=$row["claimamount6"];
$claimamount7=$row["claimamount7"];
$claimfix1=$row["claimfix1"];
$claimfix2=$row["claimfix2"];
$claimfix3=$row["claimfix3"];
$claimfix4=$row["claimfix4"];
$claimfix5=$row["claimfix5"];
$claimfix6=$row["claimfix6"];
$claimfix7=$row["claimfix7"];
$claimdate1=$row["claimdate1"];
$claimdate2=$row["claimdate2"];
$claimdate3=$row["claimdate3"];
$claimdate4=$row["claimdate4"];
$claimdate5=$row["claimdate5"];
$claimdate6=$row["claimdate6"];
$claimbalance1=$row["claimbalance1"];
$claimbalance2=$row["claimbalance2"];
$claimbalance3=$row["claimbalance3"];
$claimbalance4=$row["claimbalance4"];
$claimbalance5=$row["claimbalance5"];
$claimbalance6=$row["claimbalance6"];
$claimbalance7=$row["claimbalance7"];
$claimperson=$row["claimperson"];
$claimtel=$row["claimtel"];
$receivable=$row["receivable"];
$totalbill=$row["totalbill"];
$asman=$row["asman"];
$asendday=$row["asendday"];
$asproday=$row["asproday"];
$accountnote =$row["accountnote"];
$workplacename=$row["workplacename"];
$chargedperson=$row["chargedperson"];
$address=$row["address"];
$firstord=$row["firstord"];
$firstordman=$row["firstordman"];
$firstordmantel=$row["firstordmantel"];
$secondord=$row["secondord"];
$secondordman=$row["secondordman"];
$secondordmantel=$row["secondordmantel"];
$worklist=$row["worklist"];
$motormaker=$row["motormaker"];
$power=$row["power"];
$workday=$row["workday"];
$worker=$row["worker"];
$endworkday=$row["endworkday"];
$cableday=$row["cableday"];
$cablestaff=$row["cablestaff"];
$endcableday=$row["endcableday"];
$asday=$row["asday"];
$asorderman=$row["asorderman"];
$asordermantel=$row["asordermantel"];
$aslist=$row["aslist"];
$asresult=$row["asresult"];
$ashistory=$row["ashistory"];
$comment=$row["comment"];
$work_state=$row["work_state"];
$as_refer=$row["as_refer"];
$change_worklist=$row["change_worklist"];
$checkbox=$row["checkbox"];
$checkstep=$row["checkstep"];
$asfee=$row["asfee"];
$asfee_estimate=$row["asfee_estimate"];
$promiseday=$row["promiseday"];
$as_check=$row["as_check"];
$outputmemo=$row["outputmemo"];
$aswriter=$row["aswriter"];
$setdate=$row["setdate"];
$subject=$workplacename;
$sumbill=[];
$sumdeposit=[];
$sumbill[0]=preg_replace("/[^0-9]*/s","",$bill1);
$sumbill[1]=preg_replace("/[^0-9]*/s","",$bill2);
$sumbill[2]=preg_replace("/[^0-9]*/s","",$bill3);
$sumbill[3]=preg_replace("/[^0-9]*/s","",$bill4);
$sumbill[4]=preg_replace("/[^0-9]*/s","",$bill5);
$sumbill[5]=preg_replace("/[^0-9]*/s","",$bill6);
$sumdeposit[0]=preg_replace("/[^0-9]*/s","",$deposit1);
$sumdeposit[1]=preg_replace("/[^0-9]*/s","",$deposit2);
$sumdeposit[2]=preg_replace("/[^0-9]*/s","",$deposit3);
$sumdeposit[3]=preg_replace("/[^0-9]*/s","",$deposit4);
$sumdeposit[4]=preg_replace("/[^0-9]*/s","",$deposit5);
$sumdeposit[5]=preg_replace("/[^0-9]*/s","",$deposit6);
$total_bill=0;
$total_deposit=0;
for($i=0;$i<=5;$i++)
{
$total_bill +=$sumbill[$i];
$total_deposit +=$sumdeposit[$i];
}
$total_receivable=$sumhap-$total_deposit;
$total_receivable=number_format($total_receivable);
//$vat_total_bill=$total_bill+$total_bill*0.1;
$total_bill=number_format($total_bill);
//$vat_total_deposit=$total_deposit+$total_deposit*0.1;
$total_deposit=number_format($total_deposit);
if($workday!="0000-00-00") $workday = date("Y-m-d", strtotime( $workday)); // date형태로 저장된 것들만 이렇게 표시함.
else $workday="";
if($cableday!="0000-00-00") $cableday = date("Y-m-d", strtotime( $cableday));
else $cableday="";
if($asday!="0000-00-00") $asday = date("Y-m-d", strtotime( $asday));
else $asday="";
if($condate!="0000-00-00") $condate = date("Y-m-d", strtotime($condate));
else $condate="";
if($condate1!="0000-00-00") $condate1 = date("Y-m-d", strtotime($condate1));
else $condate1="";
if($condate2!="0000-00-00") $condate2 = date("Y-m-d", strtotime($condate2));
else $condate2="";
if($billdate1!="0000-00-00") $billdate1 = date("Y-m-d", strtotime($billdate1) );
else $billdate1="";
if($billdate2!="0000-00-00") $billdate2 = date("Y-m-d", strtotime($billdate2) );
else $billdate2="";
if($billdate3!="0000-00-00") $billdate3 = date("Y-m-d", strtotime($billdate3) );
else $billdate3="";
if($billdate4!="0000-00-00") $billdate4 = date("Y-m-d", strtotime($billdate4) );
else $billdate4="";
if($billdate5!="0000-00-00") $billdate5 = date("Y-m-d", strtotime($billdate5) );
else $billdate5="";
if($billdate6!="0000-00-00") $billdate6 = date("Y-m-d", strtotime($billdate6) );
else $billdate6="";
if($endworkday!="0000-00-00") $endworkday = date("Y-m-d", strtotime($endworkday) );
else $endworkday="";
if($endcableday!="0000-00-00") $endcableday = date("Y-m-d", strtotime($endcableday) );
else $endcableday="";
if($depositdate1!="0000-00-00") $depositdate1 = date("Y-m-d", strtotime($depositdate1) );
else $depositdate1="";
if($depositdate2!="0000-00-00") $depositdate2 = date("Y-m-d", strtotime($depositdate2) );
else $depositdate2="";
if($depositdate3!="0000-00-00") $depositdate3 = date("Y-m-d", strtotime($depositdate3) );
else $depositdate3="";
if($depositdate4!="0000-00-00") $depositdate4 = date("Y-m-d", strtotime($depositdate4) );
else $depositdate4="";
if($depositdate5!="0000-00-00") $depositdate5 = date("Y-m-d", strtotime($depositdate5) );
else $depositdate5="";
if($depositdate6!="0000-00-00") $depositdate6 = date("Y-m-d", strtotime($depositdate6) );
else $depositdate6="";
if($asproday!="0000-00-00") $asproday = date("Y-m-d", strtotime($asproday) );
else $asproday="";
if($asendday!="0000-00-00") $asendday = date("Y-m-d", strtotime($asendday) );
else $asendday="";
if($claimdate1!="0000-00-00")$claimdate1 = date("Y-m-d", strtotime($claimdate1) );
else $claimdate1="";
if($claimdate2!="0000-00-00") $claimdate2 = date("Y-m-d", strtotime($claimdate2) );
else $claimdate2="";
if($claimdate3!="0000-00-00") $claimdate3 = date("Y-m-d", strtotime($claimdate3) );
else $claimdate3="";
if($claimdate4!="0000-00-00") $claimdate4 = date("Y-m-d", strtotime($claimdate4) );
else $claimdate4="";
if($claimdate5!="0000-00-00") $claimdate5 = date("Y-m-d", strtotime($claimdate5) );
else $claimdate5="";
if($claimdate6!="0000-00-00") $claimdate6 = date("Y-m-d", strtotime($claimdate6) );
else $claimdate6="";
if($promiseday!="0000-00-00") $promiseday = date("Y-m-d", strtotime($promiseday));
else $promiseday="";
if($setdate!="0000-00-00") $setdate = date("Y-m-d", strtotime($setdate));
else $setdate=""; // 1번 패턴
if ($is_html!="y"){
$item_content = str_replace(" ", " ", $item_content);
$item_content = str_replace("\n", "
", $item_content);
}
$new_hit = $item_hit + 1;
try{
$pdo->beginTransaction();
$sql = "update chandj.work set hit=? where num=?"; // 조회수 증가
$stmh = $pdo->prepare($sql);
$stmh->bindValue(1, $new_hit, PDO::PARAM_STR);
$stmh->bindValue(2, $num, PDO::PARAM_STR);
$stmh->execute();
$pdo->commit();
} catch (PDOException $Exception) {
$pdo->rollBack();
print "오류: ".$Exception->getMessage();
}
?>

기성청구 잔액 및 누적합계는 자동계산됩니다.