Ejemplo n.º 1
0
 function gettwofieldscategories($params)
 {
     $query = "SELECT * FROM twofieldtypes";
     $result = parent::execute($query, 'json');
     if ($result) {
         echo $result;
     } else {
         echo false;
     }
 }
Ejemplo n.º 2
0
 function getTwoCategoryList($params)
 {
     if ($params['key']) {
         $query = "SELECT * FROM two_field_category WHERE category_id = '" . $params['key'] . "'";
     } else {
         $query = "SELECT * FROM two_field_category";
     }
     $result = parent::execute($query, 'json');
     if ($result) {
         echo $result;
     } else {
         echo false;
     }
 }
Ejemplo n.º 3
0
 function loginuser($params)
 {
     if (!$params) {
         echo "required username and password";
         return;
     }
     //$query = "SELECT * FROM users";
     $query = "SELECT * FROM user WHERE user_name = '" . $params['user'] . "' AND password ='******'pass'] . "'";
     $this->result = parent::execute($query, 'json');
     if ($this->result) {
         session_start();
         $_SESSION['sid'] = session_id();
         $response = array('code' => 1, 'success' => true, 'data' => $this->result);
         echo json_encode($response);
     } else {
         echo "Please check Username and password";
     }
 }
Ejemplo n.º 4
0
 function checkuser($params)
 {
     session_start();
     if ($_SESSION['sid'] == session_id()) {
         if (!$params) {
             session_destroy();
             return false;
         }
         return true;
         $query = "SELECT * FROM user WHERE user_name = '" . $params['user'] . "' AND password ='******'pass'] . "'";
         $this->result = parent::execute($query, 'json');
         if ($this->result) {
             return true;
         } else {
             session_destroy();
             return false;
         }
     } else {
         session_destroy();
         echo "error:1000,message:authentication failed,success:false";
         return false;
     }
 }