/home/mjc1/public_html/manage/billProcess.php


1
2
3
4
5
6
7
8
9
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?
   
include("./category/common.php");
   
   if( 
$docType == "1" && $mode !== "" ){  //±âº»Á¤º¸ µî·Ï,¼öÁ¤
   
     
if($mode == "insert"){
       
       
$bill_insert  =  " insert into bill_mijin values (
       
                          '','
$companyNum','$companyName','$chiefName','$companyAddr','$opt_1','$opt_2'

                         )"
;
                         
                          
mysql_query($bill_insert);
?>
<script>
 location.href = "billBasic.php";
</script>
<?        
       
}
      else{
       
$bill_update  =  " update bill_mijin set
                         companyNum =  '
$companyNum',companyName ='$companyName',chiefName ='$chiefName',companyAddr ='$companyAddr',opt_1= '$opt_1',opt_2='$opt_2'
                           WHERE idx = '
$idx'
                         "
;
                 
                          
mysql_query($bill_update);
?>
<script>
 location.href = "billBasic.php";
</script>
<?            
        

     }
   if( 
$docType == "2" && $mode !== "" ){  //¼¼±Ý°è»ê¼­ ¿äûȸ»ç µî·Ï,¼öÁ¤
     
          
if($mode == "insert"){
            
            for(
$i=11;$i>=1;$i--){
              
               
$str[]  .=   ${"offerPrice".$i};
              
              }
             for(
$i=10;$i>=1;$i--){
              
               
$str2[]  .=   ${"billPrice".$i};
              
              }
              for(
$i=7;$i>=1;$i--){
              
               
$str3[]  .=   ${"serialNum".$i};
              
              }  
        
$str   implode($str ,"");
        
$str2  implode($str2 ,"");
        
$str3  implode($str3 ,"");
       
       
$bill_insert  =  " insert into bill_publish values (
       
     '', '
$volume' , '$pageName' , '$str3' , '$companyNum' ,  '$companyName',  '$chiefName',   '$companyAddr',   '$opt_1' ,  '$opt_2' ,
     '
$year'  , '$month' ,  '$day',   '$blankNum' ,  '$str' ,  '$str2',   '$month_1',   '$day_1' ,  '$item_1' ,  '$standard_1', 
     '
$cnt_1',   '$unitPrice_1',   '$offerPrice_1',   '$billPrice_1',   '$month_2' ,   '$day_2' ,  '$item_2' ,  '$standard_2'  , '$cnt_2'  , '$unitPrice_2' , 
     '
$offerPrice_2'  , '$billPrice_2',   '$month_3' , '$day_3' ,  '$item_3'  , '$standard_3'   ,'$cnt_3' ,  '$unitPrice_3',   '$offerPrice_3' ,  '$billPrice_3'  ,
     '
$totalPrice',   '$cash' , '$checkPrice' ,  '$bill' ,  '$onCredit' ,'1','1'


                         )"
;
                         
                          
mysql_query($bill_insert); 
                                                        
        
$bill_publish_sel           =  " select idx from bill_publish order by idx desc limit 1";  
        
$bill_publish_result_sel    =    mysql_query($bill_publish_sel); 
        if( 
mysql_num_rows($bill_publish_result_sel) > 0){
        
$bill_publish_row_sel       =    mysql_fetch_array($bill_publish_result_sel);             
        }
?>
<script>
   location.href = "billReg.php?idx=<?=$bill_publish_row_sel[0];?>";
</script>
<?        
       
}
      else{
            
            for(
$i=11;$i>=1;$i--){
              
               
$str[]  .=   ${"offerPrice".$i};
              
              }
             for(
$i=10;$i>=1;$i--){
              
               
$str2[]  .=   ${"billPrice".$i};
              
              }
              for(
$i=7;$i>=1;$i--){
              
               
$str3[]  .=   ${"serialNum".$i};
              
              }  
        
$str1   implode($str ,"");
        
$str2  implode($str2 ,"");
        
$str3  implode($str3 ,"");
       
        
       
$bill_update  =  " update bill_publish set
       
     volume = '
$volume' ,pageName= '$pageName' ,serialNum= '$str3' , companyNum = '$companyNum' ,  companyName ='$companyName', chiefName = '$chiefName',   companyAddr ='$companyAddr',   opt_1='$opt_1' , opt_2 = '$opt_2' ,
     year = '
$year'  ,MONTH = '$month' , DAY = '$day',  blankNum = '$blankNum' , offerPrice = '$str1' ,billPrice =  '$str2',  month_1= '$month_1',  day_1 = '$day_1' , item_1 = '$item_1' , standard_1 =  '$standard_1', 
     cnt_1 = '
$cnt_1',  unitPrice_1 = '$unitPrice_1',  offerPrice_1 = '$offerPrice_1',  billPrice_1= '$billPrice_1',  month_2= '$month_2' , day_2=  '$day_2' , item_2 = '$item_2' , standard_2 = '$standard_2'  ,cnt_2= '$cnt_2'  ,unitPrice_2='$unitPrice_2' , 
     offerPrice_2 = '
$offerPrice_2'  ,billPrice_2= '$billPrice_2',  month_3 = '$month_3' , day_3 ='$day_3' , item_3 = '$item_3'  , standard_3 ='$standard_3'   ,cnt_3='$cnt_3' , unitPrice_3= '$unitPrice_3',  offerPrice_3= '$offerPrice_3' , billPrice_3= '$billPrice_3'  ,
    totalPrice=  '
$totalPrice',  cash= '$cash' , checkPrice='$checkPrice' , bill= '$bill' , onCredit = '$onCredit
                         
                           WHERE idx = '
$idx'
                         "
;
                         
                          
mysql_query($bill_update);
                    
            
?>
<script>
  location.href = "billReg.php?idx=<?=$idx;?>";
</script>
<?            

     
}
     
     }
?>

<?
   
if( $exCode == "alldel"){

     for (
$i 0$i count$billForm ); $i++) { 

      
$alldel   =  " delete from bill_publish where idx = '$billForm[$i]' ";  
                         
MYSQL_QUERY($alldel);
     }
     
?>
<script>
   location.href = "bill.php"; 
</script>
<?                 
    
}
?>




<?    

  
if( $exCode == "ChangSend"){

      
$ChangSend   =  " update bill_publish set ismailsend = '$val' WHERE idx = $idx ";  
      
            
MYSQL_QUERY($ChangSend);

?>

<script>
 parent.location.href = "bill.php?pg=<?=$pg;?>&mode=search&searchCode=<?=$searchCode;?>&SearchMsw1=<?=$SearchMsw1;?>&keyword=<?=$keyword;?>";
</script> 

<?
    
}
?>