}
             }
         }
     }
 }
 $res = $orgUserObj->updateData($dts, " iUserID={$iUserID} ");
 $iVerifiedID = $userToVerifyObj->getDetails('*', " AND iUserID={$iUserID} ", " iVerifiedID DESC ", '', " LIMIT 0,1");
 if (is_array($iVerifiedID) && count($iVerifiedID) > 0) {
     $iVerifiedID = $iVerifiedID[0]['iVerifiedID'];
     $rs = $userToVerifyObj->updateData($dt, " iVerifiedID={$iVerifiedID} ");
 }
 if ($res) {
     $usrprmtdtls = $orgUserPermObj->getDetails('*', " AND iUserID={$iUserID} ");
     $vudtl = $orgUserPermVerifyObj->getDetails('*', " AND iUserID={$iUserID} ", " iVerifiedID DESC ", '', " LIMIT 0,1");
     if ($usrprmtdtls[0]['eStatus'] == 'Need to Verify' || $usrprmtdtls[0]['eStatus'] == 'Modified' || $usrprmtdtls[0]['eStatus'] == 'Delete' || $usrprmtdtls[0]['eNeedToVerify'] == 'Yes') {
         $rs = $orgUserPermObj->updateData($dts, " iUserID={$iUserID} ");
         if ($vudtl[0]['iVerifiedID'] > 0) {
             $rs = $orgUserPermVerifyObj->updateData($dt, " iVerifiedID=" . $vudtl[0]['iVerifiedID']);
         }
     }
 }
 // $res = $orgUserPermObj->updateData($dts," iUserID=$iUserID ");
 // $pVerifiedID = $orgUserPermVerifyObj->getDetails('iVerifiedID'," AND iUserID=$iUserID ",' iVerifiedID DESC','',' LIMIT 0,1 ');
 // $pVerifiedID = $pVerifiedID[0]['iVerifiedID'];
 // $rs = $userToVerifyObj->updateData($dt," iVerifiedID=$pVerifiedID ");
 if ($res) {
     $msg = "rus";
 } else {
     $msg = "ruserr";
 }
 $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_MSG'] = $msg;
Exemple #2
0
 $dt['eStatus'] = $dts['eStatus'] = "Active";
 $usrprmtdtls = $orgUserPermObj->getDetails('*', " AND iPermissionID={$iPermissionID} ");
 if ($usrprmtdtls[0]['eStatus'] == 'Need to Verify') {
     $dt['eStatus'] = $dts['eStatus'] = "Inactive";
 } else {
     if ($usrprmtdtls[0]['eStatus'] == 'Modified') {
         $dt['eStatus'] = $dts['eStatus'] = "Active";
         $dts['iModifiedByID'] = "";
         $dts['eModifiedBy'] = "";
     }
 }
 $dt['tReasonToReject'] = $_POST['tReasonToReject'];
 $dt['iRejectedById'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'];
 $dt['eRejectedBy'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_USER_TYPE_SHORT'];
 $dt['dRejectedDate'] = calcGTzTime(date('Y-m-d H:i:s'), 'Y-m-d H:i:s');
 $res = $orgUserPermObj->updateData($dts, " iPermissionID={$iPermissionID} ");
 $iVerifiedID = $orgUserPermVerifyObj->getDetails('*', " AND iPermissionID={$iPermissionID} ", " iVerifiedID DESC ", '', " LIMIT 0,1");
 if (is_array($iVerifiedID) && count($iVerifiedID) > 0) {
     $iVerifiedID = $iVerifiedID[0]['iVerifiedID'];
     $rs = $orgUserPermVerifyObj->updateData($dt, " iVerifiedID={$iVerifiedID} ");
 }
 if ($res) {
     $updtl = $orgUserPermObj->select($iPermissionID);
     $iUserID = $updtl[0]['iUserID'];
     $usrprmtdtls = $orgUsrObj->getDetails('*', " AND iUserID={$iUserID} ");
     $vudtl = $userToVerifyObj->getDetails('*', " AND iUserID={$iUserID} ", " iVerifiedID DESC ", '', " LIMIT 0,1");
     if ($usrprmtdtls[0]['eStatus'] == 'Need to Verify' || $usrprmtdtls[0]['eStatus'] == 'Modified' || $usrprmtdtls[0]['eStatus'] == 'Delete' || $usrprmtdtls[0]['eNeedToVerify'] == 'Yes') {
         $rs = $orgUsrObj->updateData($dts, " iUserID={$iUserID} ");
         if ($vudtl[0]['iVerifiedID'] > 0) {
             $rs = $userToVerifyObj->updateData($dt, " iVerifiedID=" . $vudtl[0]['iVerifiedID']);
         }
 $usr = $orgUserPermObj->getDetails('*', " AND iUserID IN (Select iUserID from " . PRJ_DB_PREFIX . "_organization_user where iOrganizationID={$iOrganizationID})");
 //prints($usr);exit;
 if ($eOrganizationType == "Both") {
 } else {
     if ($eOrganizationType == "Buyer") {
         for ($l = 0; $l < count($usr); $l++) {
             if (trim($usr[$l]['tPermission']) != '') {
                 //$usr[$l]['tPermission'] = preg_replace('/inv:(.*);/','inv:5,6;',$usr[$l]['tPermission']);
                 $tempPermission = @explode(";", $usr[$l]['tPermission']);
                 //prints($tempPermission);
                 $usr[$l]['tPermission'] = "inv:5,6;" . $tempPermission[1];
                 //$sql = "Update ".PRJ_DB_PREFIX."_organization_user_permission set tPermission='".$usr[$l]['tPermission']."' where iUserID=".$usr[$l]['iUserID'];
                 $pData['tPermission'] = $usr[$l]['tPermission'];
                 $pWhere = " iUserID='" . $usr[$l]['iUserID'] . "'";
                 //prints($pData);
                 $row = $orgUserPermObj->updateData($pData, $pWhere);
             }
         }
         //$orgUserPermObj->updateData($pData,$pWhere);
     } else {
         if ($eOrganizationType == "Supplier") {
             for ($l = 0; $l < count($usr); $l++) {
                 if (trim($usr[$l]['tPermission']) != '') {
                     //$usr[$l]['tPermission'] = preg_replace('/po:(.*)/','po:5,6;',$usr[$l]['tPermission']);
                     $pWhere = "  iUserID='" . $usr[$l]['iUserID'] . "'";
                     $tempPermission = @explode(";", $usr[$l]['tPermission']);
                     $usr[$l]['tPermission'] = $tempPermission[0] . ";po:15,16";
                     $pData['tPermission'] = $usr[$l]['tPermission'];
                     //  prints($pData);
                     //print $where;
                     $row = $orgUserPermObj->updateData($pData, $pWhere);