<?php $iAssociationId = GetVar('id'); /*if($sess_usertype == 'orgadmin' && $asoc != $iAssociationId) { header("Location: ".SITE_URL_DUM."oadashboard"); exit; }*/ if (!isset($b2spsObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association.php"; $b2spsObj = new Buyer2_Supplier_SProduct_Association(); } if (!isset($b2spsvObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association_ToVerify.php"; $b2spsvObj = new Buyer2_Supplier_SProduct_Association_ToVerify(); } $b2bprdtls = $b2spsObj->select($iAssociationId); $b2bprdthistory = $b2spsvObj->getHistory($iAssociationId); // prints($b2bprdthistory); exit; $smarty->assign('b2bprdtls', $b2bprdtls); $smarty->assign('b2bprdthistory', $b2bprdthistory);
<?php $mode = PostVar('mode'); $val = PostVar('val'); if (trim($val) == '' || $val < 1 || trim($mode) == '') { exit; } if (!isset($b2spsObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association.php"; $b2spsObj = new Buyer2_Supplier_SProduct_Association(); } if (!isset($b2spsvObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association_ToVerify.php"; $b2spsvObj = new Buyer2_Supplier_SProduct_Association_ToVerify(); } if (!isset($emailObj)) { include_once SITE_CLASS_APPLICATION . 'class.EmailTemplate.php'; $emailObj = new EmailTemplate(); } $flds = "b2sps.*, (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sps.iBuyer2Id) as vBuyer2,\r\n\t\t\t\t\t(Select vProductName from " . PRJ_DB_PREFIX . "_sproduct_organization where iProductId=b2sps.iProductId) as vProduct,\r\n (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sps.iSupplierId) as vSupplier"; $assocs = $b2spsObj->getDetails($flds, " AND b2sps.eStatus IN ('Active','Inactive') AND b2sps.eNeedToVerify!='Yes' AND b2sps.iAssociationId IN ({$val}) "); // pr($assocs); exit; $assocsids = multi21Array($assocs, 'iAssociationId'); $vl = ''; if (is_array($assocsids) && count($assocsids) > 0) { $vl = @implode(',', $assocsids); } $rs = false; $type = ''; $esubtyp = ''; if ($mode == 'status' && trim($vl) != '') {
<?php if (!isset($b2spsObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association.php"; $b2spsObj = new Buyer2_Supplier_SProduct_Association(); } if (!isset($b2spsvObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association_ToVerify.php"; $b2spsvObj = new Buyer2_Supplier_SProduct_Association_ToVerify(); } $iAssociationId = GetVar('id'); // $msg = GetVar('msg'); $mod = ''; $flds = " b2spsv.*, org.vCompanyName as vBuyer2, org.vCompCode, spo.vProductName as vProduct, spo.vProductCode, so.vCompanyName as vSupplier, so.vCompCode as vSCode "; $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_sproduct_organization spo on spo.iProductId=b2spsv.iProductId\r\n LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2spsv.iBuyer2Id\r\n LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master so on so.iOrganizationID=b2spsv.iSupplierId "; $vb2bprdtls = $b2spsvObj->getJoinTableInfo($jtbl, $flds, " AND b2spsv.iAssociationId={$iAssociationId} ", ' b2spsv.iVerifiedID DESC ', '', ' LIMIT 0,1'); // pr($vb2bprdtls); exit; $vrq = $b2spsvObj->isVerifyReq($vb2bprdtls); $vsts = ''; if ($vrq == 'vreq') { $vsts = $b2spsvObj->chkRecVrf($vb2bprdtls); if ($vsts == 'nr' || $vsts == 'om') { header('Location: ' . SITE_URL_DUM . 'b2sprodtsasoclist'); exit; } } else { if ($vrq == 'nr') { $flds = " b2sps.*, org.vCompanyName as vBuyer2, org.vCompCode, spo.vProductName as vProduct, spo.vProductCode, so.vCompanyName as vSupplier, so.vCompCode as vSCode "; $jtbl = " LEFT JOIN " . PRJ_DB_PREFIX . "_sproduct_organization spo on spo.iProductId=b2sps.iProductId\r\n LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master org on org.iOrganizationID=b2sps.iBuyer2Id\r\n LEFT JOIN " . PRJ_DB_PREFIX . "_organization_master so on so.iOrganizationID=b2sps.iSupplierId "; $vb2bprdtls = $b2spsObj->getJoinTableInfo($jtbl, $flds, " AND iAssociationId={$iAssociationId} "); $vrq = $b2spsvObj->isVerifyReq($vb2bprdtls);
$code = isset($_POST['code']) ? $_POST['code'] : ''; $product = isset($_POST['product']) ? $_POST['product'] : ''; $supplier = isset($_POST['supplier']) ? $_POST['supplier'] : ''; $stype = isset($_POST['styp']) ? $_POST['styp'] : ''; $page = $_POST['page']; if (trim($page) == '' || trim($page) < 1) { $page = 1; } // prints($_POST); exit; if (!isset($orgObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Organization.php"; $orgObj = new Organization(); } if (!isset($assObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association.php"; $assObj = new Buyer2_Supplier_SProduct_Association(); } $where = ""; $_POST['srchval'] = isset($_POST['srchval']) ? $_POST['srchval'] : ''; if ($_POST['srchval'] == 'act') { $where .= " AND b2sps.eStatus='Active' "; } else { if ($_POST['srchval'] == 'inact') { $where .= " AND b2sps.eStatus='Inactive' "; } } if ($mode == 'all') { if ($val != '') { $where .= " AND ((Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sps.iBuyer2Id) LIKE '%{$val}%' OR\r\n \t\t\t\t\t\t(Select vProductName from " . PRJ_DB_PREFIX . "_bproduct_organization where iProductId=b2sps.iProductId) LIKE '%{$val}%' OR\r\n (Select vCompanyName from " . PRJ_DB_PREFIX . "_organization_master where iOrganizationID=b2sps.iSupplierId) LIKE '%{$val}%' OR\r\n vACode LIKE '%{$val}%' )"; } // echo $where; exit;
} } $orgas = trim($orgas) != '' ? $orgas : $uorg_type; $dtls = array(); if ($curORGID > 0 && $orgas != '') { if ($orgas == 'Buyer') { if (!isset($b2bpbObj)) { include_once SITE_CLASS_APPLICATION . 'organization/class.Buyer2_Buyer_BProduct_Association.php'; $b2bpbObj = new Buyer2_Buyer_BProduct_Association(); } $dtls = $b2bpbObj->getDetails("*", " AND iBuyerId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids} "); } else { if ($orgas == 'Supplier') { if (!isset($b2spsObj)) { include_once SITE_CLASS_APPLICATION . 'organization/class.Buyer2_Supplier_SProduct_Association.php'; $b2spsObj = new Buyer2_Supplier_SProduct_Association(); } $dtls = $b2spsObj->getDetails("*", " AND iSupplierId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids} "); } else { if ($orgas == 'Both') { $sql = "(Select DISTINCT * from " . PRJ_DB_PREFIX . "_buyer2_buyer_bproduct_association where iBuyerId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids})\r\n\t\t\t\t\tUNION\r\n\t\t\t\t\t(Select DISTINCT * from " . PRJ_DB_PREFIX . "_buyer2_supplier_sproduct_association where iSupplierId={$curORGID} AND iBuyer2Id={$iBuyer2Id} AND iProductId={$ipids})\r\n\t\t\t\t\tORDER BY vACode ASC"; // echo $sql; exit; $dtls = $dbobj->MySQLSelect($sql); } } } // pr($dtls); exit; } // if (is_array($dtls) && count($dtls) > 0) { ?>
<?php if (!isset($b2spsObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association.php"; $b2spsObj = new Buyer2_Supplier_SProduct_Association(); } if (!isset($b2spsvObj)) { include_once SITE_CLASS_APPLICATION . "organization/class.Buyer2_Supplier_SProduct_Association_ToVerify.php"; $b2spsvObj = new Buyer2_Supplier_SProduct_Association_ToVerify(); } if (!isset($emailObj)) { include_once SITE_CLASS_APPLICATION . 'class.EmailTemplate.php'; $emailObj = new EmailTemplate(); } $mod = PostVar('mod'); $admr = PostVar('admr'); $iAssociationId = PostVar('iAssociationId'); $Data = PostVar('Data'); $body_arr = ''; $type = ''; $post_data = $_POST; if ($mod == 'verify') { $dtv = $vasocdt = $b2spsvObj->getDetails('*', " AND iAssociationId={$iAssociationId} ", ' iVerifiedID DESC ', '', ' LIMIT 0,1'); $dtv = $dtv[0]; if (is_array($vasocdt) && count($vasocdt) > 0 && isset($vasocdt[0]['iAssociationId']) && isset($vasocdt[0]['iVerifiedID'])) { $dtv['eVerifiedBy'] = $sess_usertype_short; $dtv['iVerifiedByID'] = $sess_id; $dtv['dVerifiedDate'] = calcGTzTime(date('Y-m-d H:i:s'), 'Y-m-d H:i:s'); // if(! (($dtv['eStatus']=='Active' || $dtv['eStatus']=='Inactive' || $dtv['eStatus']=='Delete') )) { if (!(($dtv['eStatus'] == 'Active' || $dtv['eStatus'] == 'Inactive' || $dtv['eStatus'] == 'Delete') && $dtv['eNeedToVerify'] == 'Yes')) { $dtv['eStatus'] = 'Active';