Beispiel #1
0
}
if (!isset($orgUserPermObj)) {
    include_once SITE_CLASS_APPLICATION . "user/class.OrganizationUserPermission.php";
    $orgUserPermObj = new OrganizationUserPermission();
}
if ($msg == 'pb2m') {
    $msg = $smarty->get_template_vars('MSG_PRODUCT_BUYER2_MISMATCH');
}
$invoiceid = 0;
$view = 'add';
if (trim($irfq2id) != '' && $irfq2id > 0 && $msg != 'i') {
    $view = 'edit';
    $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_status_master sm on rfq2.iStatusID=sm.iStatusID\r\n                  LEFT JOIN " . PRJ_DB_PREFIX . "_inovice_order_heading ioh on rfq2.iInvoiceID=ioh.iInvoiceID \r\n                      LEFT JOIN " . PRJ_DB_PREFIX . "_purchase_order_heading poh on rfq2.iPurchaseOrderID=poh.iPurchaseOrderID";
    $where .= " AND rfq2.iRFQ2ID={$irfq2id} ";
    $fields = " rfq2.*, ioh.*, rfq2.iPurchaseOrderID, poh.vPOCode, poh.vBuyerCompanyName,poh.vSupplierName as poh_vSupplierName, poh.fPOTotal, sm.vStatus_en as vStatus, rfq2.eSaved, rfq2.eDelete ";
    $dtls = $rfq2Obj->getJoinTableInfo($jtbl, $fields, $where, '', '', '', '');
    //pr($dtls); exit;
    // $orgprf = $orgprefObj->select($dtls[0]['iOrganizationID']);
    if (isset($dtls[0]['eAuctionStatus']) && strtolower($dtls[0]['eAuctionStatus']) == 'cancelled' || isset($dtls[0]['iOrganizationID']) && $dtls[0]['iOrganizationID'] != $curORGID) {
        header("Location: " . SITE_URL_DUM . "rfq2view/{$irfq2id}");
        exit;
    }
    if (!is_array($dtls) || count($dtls) < 1) {
        header("Location: " . SITE_URL_DUM . "rfq2list/rnme");
        exit;
    }
    if (!isset($statusmasterObj)) {
        include_once SITE_CLASS_APPLICATION . "class.StatusMaster.php";
        $statusmasterObj = new StatusMaster();
    }
    $crsts = $statusmasterObj->getDetails('*', " AND vForAuction LIKE 'RFQ2,%' AND vStatus_en='Create' ");
Beispiel #2
0
// rfq2 status
$rs = $rfq2Obj->setAllRfq2Ststus();
//
$limit = " LIMIT " . ($page - 1) * $REC_LIMIT_FRONT . ", " . $REC_LIMIT_FRONT . " ";
// echo $where;
$jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_inovice_order_heading ioh on rfq2.iInvoiceID=ioh.iInvoiceID\r\n            LEFT JOIN " . PRJ_DB_PREFIX . "_purchase_order_heading poh on rfq2.iPurchaseOrderID=poh.iPurchaseOrderID\r\n            LEFT JOIN " . PRJ_DB_PREFIX . "_status_master sm on rfq2.iStatusID=sm.iStatusID\r\n            LEFT JOIN " . PRJ_DB_PREFIX . "_rfq2_product_buyer2 rpb2 on rpb2.iRFQ2Id=rfq2.iRFQ2Id ";
// echo $where; exit;
// $where .= " AND rfq2.iStatusID!=$csts ";
// $where .= " AND rfq2.dStartDate<NOW() ";
$where .= " AND rfq2.eDelete!='Verified' ";
// echo $where = " AND rpb2.iBuyer2Id=71 AND rfq2.eDelete!='Verified' ";
$fields = " DISTINCT rfq2.*, IF(rfq2.eFrom='Invoice',ioh.vInvoiceCode,poh.vPOCode) as vInvoiceCode, IF(rfq2.eFrom='Invoice',ioh.fAcceptedAmount,poh.fPOTotal) as fAcceptedAmount, IF(rfq2.eFrom='Invoice',ioh.vBuyerName,poh.vBuyerCompanyName) as vBuyerName, IF(rfq2.eFrom='Invoice',ioh.vSupplierName,poh.vSupplierName) as vSupplierName, sm.vStatus_" . LANG . " as status,\r\n\t\t\t\t\tIF(rfq2.eAuctionStatus='Completed' || rfq2.eAuctionStatus='Cancelled', rfq2.eAuctionStatus, IF(rfq2.dStartDate<NOW() AND rfq2.dEndDate>NOW(),'Live', IF(rfq2.dStartDate>NOW() AND rfq2.dEndDate>NOW(),'Not Started', rfq2.eAuctionStatus)) ) as eStatus,\r\n\t\t\t\t\tIF(rpb2.ePType='BProduct',(Select vProductName from " . PRJ_DB_PREFIX . "_bproduct_organization where iProductId=rpb2.ePType), (Select vProductName from " . PRJ_DB_PREFIX . "_sproduct_organization where iProductId=rpb2.ePType) ) as vProductName,\r\n                                        @rd:=IF(rfq2.dStartDate>UTC_TIMESTAMP(), TIMESTAMPDIFF(DAY,UTC_TIMESTAMP(),rfq2.dStartDate), 0) as rdays, IF(rfq2.dStartDate>UTC_TIMESTAMP(), TIME_FORMAT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND,UTC_TIMESTAMP(),rfq2.dStartDate) - (@rd * 24*60*60) ), '%H:%i'), 0) as rtime,\r\n\t\t\t\t\t(Select COUNT(iBidId) FROM " . PRJ_DB_PREFIX . "_rfq2_bids WHERE iRFQ2Id=rfq2.iRFQ2Id AND eStatus='current') AS totbid  ";
// ,
// IF(rfq2.dStartDate<NOW() AND rfq2.dEndDate>NOW(), 'Live', IF(rfq2.dStartDate>NOW() AND rfq2.dEndDate>NOW(), 'Not Started', IF(rfq2.eAuctionStatus!='Completed' AND rfq2.eAuctionStatus!='Cancelled', 'Completed', rfq2.eAuctionStatus) ) ) as eStatus,
// "IF(rfq2.dStartDate>NOW(), TIMESTAMPDIFF(DAY,NOW(),rfq2.dStartDate), 0) as rdays, IF(rfq2.dStartDate>NOW(), TIME_FORMAT(SEC_TO_TIME(TIMESTAMPDIFF(SECOND,NOW(),rfq2.dStartDate) - (TIMESTAMPDIFF(DAY,NOW(),rfq2.dStartDate) * 24*60*60) ), '%H:%i'), 0) as rtime ";
$dtls = $rfq2Obj->getJoinTableInfo($jtbl, $fields, $where, $orderBy, 'rfq2.iRFQ2Id' . $having, $limit, 'yes');
// pr($dtls); exit;
$count = $dtls['tot'];
unset($dtls['tot']);
if (!isset($pgajxobj)) {
    require_once SITE_CLASS_GEN . "class.paging-ajax.php";
    $pgajxobj = new Paging($count, $page, "listrfq2", $REC_LIMIT_FRONT);
}
$paging = $pgajxobj->getListPG($page);
$pgmsg = $pgajxobj->setMessage("Records");
//echo $paging; exit;
$smarty->assign('dtls', $dtls);
$smarty->assign('isusts', $isusts);
$smarty->assign('count', $count);
$smarty->assign('paging', $paging);
$smarty->assign('pgmsg', $pgmsg);