コード例 #1
0
ファイル: batchno.php プロジェクト: sknagesh/divyaeng2
<?php

require_once 'autoload.php';
$bn = new Batch();
if (isset($_POST['mqty'])) {
    //print_r($_POST);
    if (isset($_POST['Drawing_ID'])) {
        $drawingid = $_POST['Drawing_ID'];
    } else {
        $drawingid = $_POST['drawing'];
    }
    $bn->setPartID($drawingid);
    $totalbqty = $_POST['totalbqty'];
    ///total quantity in batch
    if (isset($_POST['Batch_Remarks'])) {
        $bn->setBatchRemarks($_POST['Batch_Remarks']);
    }
    if (isset($_POST['Batch_Desc'])) {
        $Batch_Desc = $_POST['Batch_Desc'];
    } else {
        $Batch_Desc = '';
    }
    if ($Batch_Desc == '') {
        date_default_timezone_set('Asia/Kolkata');
        $p = new Part();
        $p->setValue('partid', $drawingid);
        $p->setPartDetails();
        $pr = $p->getValue('partrevision');
        $Batch_Desc = $drawingid . "-" . date("Y") . "-" . date("m") . "-" . date("d") . "-" . $totalbqty . '-' . $pr;
        echo $p->getValue('partrevision');
    }