Location: PHPKode > projects > MembersGear > membersgear/includes/master_class.php
<?php
  require_once "peardb_class.php";
  
  class master_class extends peardb_class
  {
        function View($pMasterName)
        {
            
            global $mdb2;    
            $result;  
     
            $query      = "select id, value from ".TABLE_PREFIX."master_values where masterid = (select id from ".TABLE_PREFIX."master where name='".$pMasterName."')";
            $resultset  = $mdb2->query($query);
            
            if(PEAR::isError($resultset)) 
            {
                die("Failed to issue query, error message : " . $resultset->getMessage());
            }
            
            while($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC))
            {
                $result[] = $row;
            }
                                                                                                                     
            return  $result;   
            
            //print_r($pParameters);
            
            
            
        }
        
        
        function getMasterValuesId($pmasterValue,$pmasterId)
         {
             $quey="select id from ".TABLE_PREFIX."master_values where value='$pmasterValue' and masterid=$pmasterId";
             $lsRes=master_class::BaseView($quey);
             $adminPermissionId=$lsRes[0]['id'];
             return $adminPermissionId;
             
         }
         
          function getValueFromID($pid)
         {
             $quey="select value from ".TABLE_PREFIX."master_values where id=$pid";
             $lsRes=master_class::BaseView($quey);
             $mastvalue=$lsRes[0]['value'];
             return $mastvalue;
             
         }
         
           function getMasterId($pmastName)
         {
             
              $quey="select id from ".TABLE_PREFIX."master where `name`='$pmastName'";
              $lsRes=master_class::BaseView($quey);
              $adminPermissionId=$lsRes[0]['id'];
              return $adminPermissionId;
             
         }
         
           function getPaygerMastervalueId($pmastName,$pmastervaluename)
         {
             
              $query="select paygear_id from ".TABLE_PREFIX."paygear_mastervalues where paygear_master='".$pmastName."' and paygear_value='".$pmastervaluename."'";
              $lsRes=master_class::BaseView($query);
              $paygearmastervalueid=$lsRes[0]['paygear_id'];
              return $paygearmastervalueid;
             
         }
        
        
        
        
        
        
  }
?>
Return current item: MembersGear