当前位置: 首页>>代码示例>>PHP>>正文


PHP Batch::setBatchID方法代码示例

本文整理汇总了PHP中Batch::setBatchID方法的典型用法代码示例。如果您正苦于以下问题:PHP Batch::setBatchID方法的具体用法?PHP Batch::setBatchID怎么用?PHP Batch::setBatchID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Batch的用法示例。


在下文中一共展示了Batch::setBatchID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBatchSummary

    function getBatchSummary()
    {
        $db = Database::getInstance();
        $cxn = $db->getConnection();
        $bn = new Batch();
        $bn->setBatchID($this->batchid);
        $bqty = $bn->getBatchQty();
        $query = "SELECT cust.Customer_Name,Machine_Name,\nSUM(CASE WHEN Activity_ID=1 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Production,\nSUM(CASE WHEN Activity_ID=2 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Setup,\nSUM(CASE WHEN Activity_ID=16 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Proving,\nSUM(CASE WHEN Activity_ID=3 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Rework,\nSUM(CASE WHEN Activity_ID=9 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS CMM,\nSUM(TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time)) AS Total From ActivityLog as actl\nINNER JOIN Production as prod ON prod.Activity_Log_ID=actl.Activity_Log_ID\nINNER JOIN Operation as ope On ope.Operation_ID=prod.Operation_ID\nINNER JOIN Component as comp on comp.Drawing_ID=ope.Drawing_ID\nINNER JOIN Customer as cust ON cust.Customer_ID=comp.Customer_ID \nINNER JOIN Machine as mach ON mach.Machine_ID=actl.Machine_ID\nWHERE ope.Drawing_ID={$this->drawingid} AND Batch_ID='{$this->batchid}' AND mach.Machine_ID!=9 GROUP BY mach.Machine_ID;";
        if (!($res = $cxn->query($query))) {
            exit("error (getBatchSummary1: {$query} ) : {$cxn->error}");
        }
        echo '<table class="pcd">';
        echo '<tr><th>Machines used</th><th>Production</th><th>Set Up</th><th>Prog. Proving</th><th>Rework</th><th>CMM Programing</th><th>Total</th></tr>';
        $mtime = 0;
        $mtimewcmm = 0;
        while ($row = mysqli_fetch_assoc($res)) {
            if ($row['Production'] != '') {
                $p = $this->min2hm($row['Production']);
                $mtime += $row['Production'];
            } else {
                $p = '';
            }
            if ($row['Setup'] != '') {
                $s = $this->min2hm($row['Setup']);
                $mtime += $row['Setup'];
            } else {
                $s = '';
            }
            if ($row['Proving'] != '') {
                $pp = $this->min2hm($row['Proving']);
                $mtime += $row['Proving'];
            } else {
                $pp = '';
            }
            if ($row['Rework'] != '') {
                $rw = $this->min2hm($row['Rework']);
            } else {
                $rw = '';
            }
            if ($row['CMM'] != '') {
                $cmm = $this->min2hm($row['CMM']);
            } else {
                $cmm = '';
            }
            if ($row['Total'] != '') {
                $t = $this->min2hm($row['Total']);
            } else {
                $t = '';
            }
            echo '<tr><td>' . $row['Machine_Name'] . '</td><td>' . $p . '</td><td>' . $s . '</td><td>' . $pp . '</td><td>' . $rw . '</td><td>' . $cmm . '</td><td>' . $t . '</td></tr>';
        }
        $tti = $this->min2hm($mtime);
        $avgtime = $mtime / $bqty;
        $avt = $this->min2hm($avgtime);
        $q8 = "SELECT TIME_TO_SEC(ADDTIME(Clamping_Time,Machining_Time)) as tmt FROM Operation as ope\nINNER JOIN Component as comp on comp.Drawing_ID=ope.Drawing_ID\nWHERE ope.Drawing_ID={$this->drawingid} AND ope.In_Op_List=1;";
        if (!($res8 = $cxn->query($q8))) {
            exit("error (getBatchSummary2: {$q8} ) : {$cxn->error}");
        }
        $stime = 0;
        while ($ror8 = mysqli_fetch_assoc($res8)) {
            $stime += $ror8['tmt'];
        }
        $stime = $this->min2hm($stime / 60);
        $q2 = "SELECT cust.Customer_Name,Machine_Name,\nSUM(CASE WHEN Activity_ID=11 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS FAI,\nSUM(CASE WHEN Activity_ID=4 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Fixture,\nSUM(TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time)) AS Total From ActivityLog as actl\nINNER JOIN NonProduction as nprod ON nprod.Activity_Log_ID=actl.Activity_Log_ID\nINNER JOIN BNo_MI_Challans as bmc on bmc.Batch_ID=nprod.Batch_ID\nINNER JOIN MI_Drg_Qty as mdq on mdq.MI_Drg_Qty_Id=bmc.MI_Drg_Qty_ID\nINNER JOIN Component as comp on comp.Drawing_ID=mdq.Drawing_ID\nINNER JOIN Customer as cust ON cust.Customer_ID=comp.Customer_ID\nINNER JOIN Machine as mach ON mach.Machine_ID=actl.Machine_ID\nWHERE mdq.Drawing_ID={$this->drawingid} AND nprod.Batch_ID={$this->batchid} GROUP BY mach.Machine_ID;";
        if (!($r2 = $cxn->query($q2))) {
            exit("error (getBatchSummary3: {$q2} ) : {$cxn->error}");
        }
        if ($r2->num_rows > 0) {
            echo '<table class="pcd"><tr><th>Machine</th><th>Fixture Work</th><th>FAI</th><th>Total</th></tr>';
            while ($row = mysqli_fetch_assoc($r2)) {
                if ($row['FAI'] != '') {
                    $fai = $this->min2hm($row['FAI']);
                } else {
                    $fai = '';
                }
                if ($row['Fixture'] != '') {
                    $fxt = $this->min2hm($row['Fixture']);
                } else {
                    $fxt = '';
                }
                if ($row['Total'] != '') {
                    $t = $this->min2hm($row['Total']);
                } else {
                    $t = '';
                }
                echo '<tr><td>' . $row['Machine_Name'] . '</td><td>' . $fxt . '</td><td>' . $fai . '</td><td>' . $t . '</td></tr>';
            }
        }
        $q3 = "SELECT ope.Operation_Desc,TIME_TO_SEC(ADDTIME(Clamping_Time,Machining_Time)) as tmt,\nSUM(CASE WHEN Activity_ID=1 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Production,\nSUM(CASE WHEN Activity_ID=2 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Setup,\nSUM(CASE WHEN Activity_ID=16 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Proving,\nSUM(CASE WHEN Activity_ID=3 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS Rework,\nSUM(CASE WHEN Activity_ID=9 THEN TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time) END) AS CMM,\nSUM(TIMESTAMPDIFF(minute,Start_Date_Time,End_Date_Time)) AS Total From ActivityLog as actl\nINNER JOIN Production as prod ON prod.Activity_Log_ID=actl.Activity_Log_ID\nINNER JOIN Operation as ope On ope.Operation_ID=prod.Operation_ID\nINNER JOIN Component as comp on comp.Drawing_ID=ope.Drawing_ID\nINNER JOIN Customer as cust ON cust.Customer_ID=comp.Customer_ID \nWHERE ope.Drawing_ID={$this->drawingid} AND Batch_ID={$this->batchid} GROUP BY ope.Operation_ID;";
        if (!($r3 = $cxn->query($q3))) {
            exit("error (getBatchSummary4: {$q3} ) : {$cxn->error}");
        }
        if ($r3->num_rows > 0) {
            echo '<table class="pcd"><tr><th>Operation</th><th>Standard Time/Part</th><th>Avg Time/Part</th><th>Setup/Batch</th><th>Proving/Batch</th>
							<th>Production/Batch</th><th>Rework</th><th>Total</th></tr>';
            while ($row = mysqli_fetch_assoc($r3)) {
                if ($row['Production'] != '') {
                    $p = $this->min2hm($row['Production']);
                    $apt = $this->min2hm($row['Production'] / $bqty);
                } else {
//.........这里部分代码省略.........
开发者ID:sknagesh,项目名称:divyaeng2,代码行数:101,代码来源:class.Activitylog.php

示例2: count

 $cqty = $_POST['cqty'];
 //commited quantites
 $cremark = $_POST['cremark'];
 //commitment remarks
 $miid = $_POST['MI_Drg_Qty_ID'];
 //inward challan ids
 $mqty = $_POST['mqty'];
 //challan vice quanties in batch
 $hcode = $_POST['hcode'];
 //heat codes
 $bn->saveBatch();
 $batchid = $bn->getBatchID();
 $i = 0;
 $j = count($cdates);
 while ($i < $j) {
     $bn->setBatchID($batchid);
     $bn->setCommitedDate($cdates[$i]);
     $bn->setCommitedQty($cqty[$i]);
     $bn->setCommitedRemarks($cremark[$i]);
     $bn->saveCommitment();
     $i++;
 }
 $i = 0;
 $j = count($miid);
 while ($i < $j) {
     $bn->setBatchID($batchid);
     $bn->setMIDQID($miid[$i]);
     $bn->setQuantity($mqty[$i]);
     $bn->setHeatCode($hcode[$i]);
     $bn->saveQtyDetails();
     $i++;
开发者ID:sknagesh,项目名称:divyaeng2,代码行数:31,代码来源:batchno.php


注:本文中的Batch::setBatchID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。