Esempio n. 1
0
 /**
  * Get a value
  * @params pdoMap_Mapping_Entity Entity to handle
  * @params pdoMap_Mapping_Metadata_Field Field to manage
  * @params mixed Value to handle                
  * @returns pdoMap_Mapping_Entity
  */
 public function getter(pdoMap_Mapping_Entity $entity, pdoMap_Mapping_Metadata_Field $field, $value)
 {
     if (is_numeric($value)) {
         return pdoMap::get($field->getOption('adapter'))->SelectEntity($value);
     } else {
         return $value;
     }
 }
<?php

$category = $_GET["category"];
require_once 'lib/pdomap.php';
pdoMap::config('config.xml');
$addInfo = pdoMap::get('additional_info_master')->SelectBy("CAT_ID", $category);
if ($addInfo->count()) {
    $start = true;
    echo "([";
    foreach ($addInfo as $key => $value) {
        if ($start) {
            $start = false;
        } else {
            echo ",";
        }
        echo "{'INFO_NAME' : '" . $value->INFO_NAME . "' , ";
        echo "'MANDATORY' : '" . $value->MANDATORY . "' , ";
        echo "'ADD_INFO_MASTER_ID' : '" . $value->ADD_INFO_MASTER_ID . "' , ";
        echo "'TYPE' : '" . $value->TYPE . "' , ";
        echo "'COMMENTS' : '" . $value->COMMENTS . "'}";
    }
    echo "])";
} else {
    echo "([])";
}
pdoMap::cache()->closeSession();
Esempio n. 3
0
		</div>
	</td>
  </tr>
</table>


<?php 
} else {
    $user = pdoMap::get('user')->Create();
    $user->USERNAME = $_POST['username'];
    $user->PASSWORD = $_POST['password'];
    $user->TYPE = "I";
    $user->Insert();
    //$user->User=pdoMap::get('internal_user')->Create();
    $user = pdoMap::get('user')->SelectBy("USERNAME", $user->USERNAME);
    $iuser = pdoMap::get('internal_user')->Create();
    $iuser->USER_ID = $user->current()->USER_ID;
    $iuser->NAME = $_POST['name'];
    $iuser->EMAIL = $_POST['email'];
    $iuser->ADDR_LINE1 = $_POST['addl1'];
    $iuser->ADDR_LINE2 = $_POST['addl2'];
    $iuser->ADDR_CITY = $_POST['city'];
    $iuser->ADDR_STATE = $_POST['state'];
    $iuser->ADDR_COUNTRY = $_POST['country'];
    $iuser->PIN = $_POST['pin'];
    $iuser->PHONE = $_POST['phone'];
    $iuser->Insert();
    ?>
<center>
<div style="position:relative; ">
						<div style="position:relative; height:37px;width:500px">
Esempio n. 4
0
 margin-bottom: 0px;
}
.style1 {color: #FF0000}
</style>


</head>

<body>	
<?php 
    $username = $_SESSION['user_sc'];
    $password = "";
    $login = 2;
    require_once 'lib/pdomap.php';
    pdoMap::config('config.xml');
    $category = pdoMap::get('category_master')->SelectAll();
    $ret = "";
    $js = "([";
    foreach ($category as $key => $value) {
        if ($js != "([") {
            $js .= ",";
        }
        $ret .= "<option value='" . $value->CAT_ID . "'>" . $value->CATEGORY_NAME . "</option>";
        $js .= "{'ID' : '" . $value->CAT_ID . "','Name' : '" . $value->CATEGORY_NAME . "','Comment' : '" . $value->COMMENTS . "'}";
    }
    $js .= "])";
    ?>
<script language="javascript">
var categoryMaster= eval(<?php 
    echo $js;
    ?>
Esempio n. 5
0
 /**
  * Get to the next item
  */
 public function next()
 {
     $this->index++;
     if (!isset($this->buffer[$this->index])) {
         $this->buffer[$this->index] = pdoMap::database()->Fetch($this->ptr);
     }
     if ($this->type && $this->buffer[$this->index]) {
         $this->current = pdoMap::get($this->type)->Create($this->buffer[$this->index]);
     } else {
         $this->current = $this->buffer[$this->index];
     }
 }
Esempio n. 6
0
 /**
  * Get the service manager
  */
 public function Adapter()
 {
     return pdoMap::get($this->type);
 }
Esempio n. 7
0
 /**
  * Load object from a var_export command
  */
 public static function __set_state($data)
 {
     return pdoMap::get($data['type'])->Create($data['values']);
 }
Esempio n. 8
0
$js .= "])";
pdoMap::cache()->closeSession();
if (!isset($_POST['user']) && !empty($_SESSION['user_sc'])) {
    $username = $_SESSION['user_sc'];
    $password = "";
    $login = 2;
} else {
    if (!isset($_POST['user'])) {
        $login = -1;
    } else {
        $_SESSION['user_sc'] = "";
        $username = $_POST["user"];
        $password = $_POST["password"];
        require_once 'lib/pdomap.php';
        pdoMap::config('config.xml');
        $user = pdoMap::get('user')->SelectBy("USERNAME", $username);
        if ($user->count()) {
            $user = $user->current();
            if ($user->PASSWORD == $password) {
                $_SESSION['user_sc'] = $username;
                setcookie("user_sc", md5($username . $password), time() + 3600);
                $login = 2;
            } else {
                $login = 0;
            }
        } else {
            $login = 1;
        }
        pdoMap::cache()->closeSession();
    }
}