if ($res) { $var_msg = $smarty->get_template_vars('MSG_STATUS_SENT_SUCC'); } else { $var_msg = $smarty->get_template_vars('MSG_STATUS_SENT_ERR'); } } } else { $where = "AND iOrganizationID IN ({$val})"; $arr = $orgObj->getDetails('*', $where); foreach ($arr as $k => $v) { if ($v['eStatus'] == 'Active' || $v['eStatus'] == 'Inactive') { $data['eStatus'] = 'Delete'; $data['iModifiedByID'] = $sess_id; $data['eModifiedBy'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_USER_TYPE_SHORT']; $data['dModifiedDate'] = date('Y-m-d H:i:s'); $orgObj->setAllVar($data); $where = "iOrganizationID IN (" . $v['iOrganizationID'] . ")"; $res = $orgObj->updateData($data, $where); $data = $v; $data['eStatus'] = 'Delete'; $data['iModifiedByID'] = $sess_id; $data['eModifiedBy'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_USER_TYPE_SHORT']; $data['dModifiedDate'] = date('Y-m-d H:i:s'); $orgvrfObj->setAllVar($data); $res = $orgvrfObj->insert(); $where = 'AND iOrganizationID = ' . $v['iOrganizationID'] . ''; $orderby = ' iVerifiedID Desc'; $vrfid = $orgvrfObj->getDetails('iVerifiedID', $where, $orderby); // --------------------- ORGANIZATION DATA FETCHED ------------------------------------------// $cname = $v['vCompanyName']; $regno = $v['vCompanyRegNo'];
$Data['dCreateFromIP'] = $_SERVER['REMOTE_ADDR']; // $vOrganizationCode = $generalobj->UniqueID("ORG",PRJ_DB_PREFIX."_organization_master","vOrganizationCode",$charlimit="10"); $vOrganizationCode = $orgObj->getUniqueCode($Data['eOrganizationType']); // echo $vOrganizationCode; exit; $code = $Data['vOrganizationCode'] = $vOrganizationCode; // $vCompanyRegNo = $generalobj->UniqueID("",PRJ_DB_PREFIX."_organization_master","vCompanyRegNo",$charlimit="10"); $regno = $Data['vCompanyRegNo']; // = $vCompanyRegNo; $compcode = $Data['vCompCode']; // if(count($arr)>0) { $Data['eStatus'] = "Need to Verify"; /*} else { $Data['eStatus'] = "Active"; }*/ // prints($Data);exit; $orgObj->setAllVar($Data); $iOrganizationID = $res = $orgObj->insert(); //INSERT THIS RECORD IN ORGANIZATION_MASTER_TOVERIFY TABLE $insID = $gdbobj->getMaxId(PRJ_DB_PREFIX . "_organization_master", 'iOrganizationID'); $Data1 = $Data; $iOrganizationID = $Data1['iOrganizationID'] = $insID[0]['id']; $orgvrfObj->setAllVar($Data1); $res = $orgvrfObj->insert(); /* if($res){ $orgdtls = $orgObj->select($iOrganizationID); if($orgdtls[0]['eOrganizationType'] == 'Supplier'){ $opdt['vOrderStatusLevel'] = ''; $rs = $orgprefObj->updateData($opdt,"iOrganizationID=$iOrganizationID"); } else if($orgdtls[0]['eOrganizationType'] == 'Buyer'){ $opdt['vInvoiceStatusLevel'] = ''; $rs = $orgprefObj->updateData($opdt,"iOrganizationID=$iOrganizationID");