Untitled

mail@pastecode.io avatar
unknown
php
4 years ago
4.0 kB
11
Indexable
Never
<?php
									//$count = 0;
                                    //    if($resultApi['code'] == 200) {
                                    if ($code == 200) {
                                        //        $dataDecode = json_decode($data,true);
                                        $count = 0;
                                        foreach ($data as $i => $ra) {
                                            //            $docDate = date('j F Y',strtotime($ra['doc_date']));
                                            $partCode = $ra['part_code'];
                                            if (count(explode(' ', $partCode)) > 1) {
                                                $partCodeArray = explode(' ', $partCode);
                                                $partCode = implode('|-----|', $partCodeArray);
                                            }
                                            $partCode = str_replace(".", "|", $partCode);
                                            $partCode = str_replace(",", "|COMMASIGN|", $partCode);
											// $partCode = str_replace('"', '|QUOTESIGN|', $partCode);
											// $partCode = str_replace('(', '|KURUNGBUKASIGN|', $partCode);
											// $partCode = str_replace(')', '|KURUNGTUTUPSIGN|', $partCode);
											// $partCode = str_replace('@', '|ATSIGN|', $partCode);
                                            $qtyReq = $ra['part_qty'];
                                            $qtyPR = $ra['QtyPR'];
                                            $qtyGI = $ra['Qtygs'];
                                            $disable = '';
                                            if ($qtyReq == ($qtyPR + $qtyGI) || $qtyReq < ($qtyPR + $qtyGI)) {
                                                $disable = 'disabled';
                                            } else {
                                                $count = $count + 1;
                                            }
                                            $param = $ra['qtysoh'] . "--" . "detail[GI][" . $partCode . "]";
                                            ?>
                                    <tr>
                                        <td><?= $ra['part_code'] ?></td>
                                        <td><?= $ra['part_desc'] ?></td>
                                        <td><?= $ra['brand_name'] ?></td>
                                        <td><?= number_format($ra['part_qty'],2) ?></td>
                                        <td id="detail[GI][<?= $ra['qtysoh'] ?>]"><?= number_format($ra['qtysoh'],2) ?></td>
                                        <td id="detail[GI][<?= $ra['qty_doc_avai'] ?>]"><?= number_format($ra['qty_doc_avai'],2) ?></td>
                                        <td><?= number_format($ra['qtygit'],0) ?></td>
                                        <td><?= $ra['part_unit'] ?></td>
                                        <td><?= number_format($ra['QtyPR'],2) ?></td>
                                        <td><input type="number" name="detail[PR][<?= $partCode ?>]" class="inpt_pr" id="detail[PR][<?= $partCode ?>]" min="0" onkeypress="return hanyaAngka(event)" onchange="checkQtyPR(<?= $ra['qtysoh'] . ",'" . $partCode . "','" . $ra['Qtygs'] . "','" . $ra['part_qty'] . "','" . $ra['QtyPR'] . "'" ?>)" <?php echo $disable; ?>></td>
                                        <td><?= number_format($ra['Qtygs'],2) ?></td>
                                        <td><input type="number" name="detail[GI][<?= $partCode ?>]" class="inpt_gi" id="detail[GI][<?= $partCode ?>]" min="0" onkeypress="return hanyaAngka(event)" onchange="checkQtyGI( <?= $ra['qtysoh'] . ",'" . $partCode . "','" . $ra['Qtygs'] . "','" . $ra['part_qty'] . "','" . $ra['QtyPR'] . "'" ?>)" <?php echo $disable; ?>></td>
                                    </tr>

                                      }
                                    }