当前位置: 首页>>代码示例>>PHP>>正文


PHP CRUD::getInstance方法代码示例

本文整理汇总了PHP中CRUD::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP CRUD::getInstance方法的具体用法?PHP CRUD::getInstance怎么用?PHP CRUD::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRUD的用法示例。


在下文中一共展示了CRUD::getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 private function __construct()
 {
     $this->crud = CRUD::getInstance();
     $this->expenses = new NameList("Expenses");
     $this->income = new NameList("Income");
     $this->dataExpenses = new Data("ExpensesData", $this->expenses->getNameTable());
     $this->dataIncome = new Data("IncomeData", $this->income->getNameTable());
     $this->filterDate = date("Y-m");
     $this->crud->create($this->expenses);
     $this->crud->create($this->income);
     $this->crud->create($this->dataExpenses);
     $this->crud->create($this->dataIncome);
     $this->setOldDate();
     $this->incomeScore = 0;
     $this->expensesScore = 0;
 }
开发者ID:RossWeb,项目名称:Wydatki,代码行数:16,代码来源:lib.php

示例2: unset

    unset($_POST['country_code']);
    $_POST['dob'] = date("Y-m-d H:i:s", strtotime($_POST['dob']));
    $client = new Client();
    try {
        $data = $client->register($_POST);
    } catch (Exception $e) {
        /*return with exception */
        header("Location:" . RESOURCE_PATH_DIY . "login?error=" . $e->getMessage());
        exit;
    }
    $_SESSION['client'] = $data;
    $access_token = Hash::get($_SESSION['client']['client_id'], Hash::salt(10) . time());
    Logger::logPlobizUser($data['client_id'], $access_token, 'N/A', uniqid(), 'WEB', 1);
    $_SESSION['client']['access_token'] = $access_token;
    /*generate verification link 
     * 26-03-15 :: time() added to make unique everytime
     * */
    $verify = Hash::get($data['email'], 'verify_email' . time());
    $crud = CRUD::getInstance();
    $crud->insert("client_reset_tokens", array('client_id' => $data['client_id'], 'type' => 'email', 'hash' => $verify));
    $mail = new Mail();
    $vlink = RESOURCE_PATH . "handlers/verify-client.php?verify=" . $verify;
    /*email verification link */
    $mail->emailVerificationMail(array(array('name' => $data['name'], 'email' => $data['email'])), $vlink);
    // 	03-07-15 : redirect to pending redirectto url
    $redirectto = isset($_SESSION['redirectto']) && $_SESSION['redirectto'] != '' ? $_SESSION['redirectto'] : RESOURCE_PATH_DIY . "dashboard";
    $_SESSION['redirectto'] = '';
    header("Location:" . $redirectto);
} else {
    header("Location:" . RESOURCE_PATH_DIY . "login?error=All fields are required.");
}
开发者ID:kirannaikdanavath,项目名称:fanci,代码行数:31,代码来源:register-handler.php

示例3: __construct

 public function __construct()
 {
     $this->_db = CRUD::getInstance();
 }
开发者ID:kirannaikdanavath,项目名称:fanci,代码行数:4,代码来源:auth.class.php

示例4: resetClientPassword

 public function resetClientPassword($fields = array())
 {
     $client = new Client($fields['email']);
     // 4Nov15 :: Sankalp : Change $data to an array so that it can hold user information
     $data['info'] = $client->data();
     if ($data) {
         //29Nov15 :: Sankalp : Enter proper email of client
         $verify = Hash::get($data['info']['email'], 'reset_password');
         $crud = CRUD::getInstance();
         //29Nov15 :: Sankalp : Enter proper id of client
         $crud->insert("client_reset_tokens", array('client_id' => $data['info']['client_id'], 'hash' => $verify));
         // 4Nov15 :: Sankalp : adding $rlink to data array
         $data['rlink'] = RESOURCE_PATH_DIY . "confirm-password?reset=" . $verify;
         if ($verify) {
             return $data;
         } else {
             return "error";
         }
     } else {
         return "error";
     }
 }
开发者ID:kirannaikdanavath,项目名称:fanci,代码行数:22,代码来源:Client.class.php

示例5: json_decode

<?php

/*
 * @author Plobal-vikash
 * File to fetch call history for an app	
 */
if ($Request->method == 'GET') {
    // $result=$Request->params['filters'];
    $result = json_decode($Request->params['filters'], true);
    $CRUD = CRUD::getInstance();
    $count = 0;
    $feature_condition = "";
    if (isset($result['search']) && !empty($result['search'])) {
        $seacrh_string = $result['search'];
        $feature_condition = " and kmp.actual_no='{$seacrh_string}'";
    } elseif (isset($result['date']) && !empty($result['date'])) {
        $feature_dfilter = explode("-", $result['date']);
        $feature_condition = " and kct.date >= '" . date("Y-m-d", strtotime(str_replace('/', '-', $feature_dfilter[0]))) . "' AND kct.date <= '" . date("Y-m-d", strtotime(str_replace('/', '-', $feature_dfilter[1]))) . "' ";
        // echo $feature_condition = " and kct.date >= '".$feature_dfilter[0]." ' AND kct.date <='".$feature_dfilter[1]." ' ";
    } elseif (isset($result['feature']) && !empty($result['feature'])) {
        $feature_filter = explode(":", $result['feature']);
        $feature_condition = " and kmp.unique_id='{$feature_filter[0]}'";
        if (count($feature_filter) > 1) {
            $feature_condition .= " and kmp.actual_no='{$feature_filter[1]}'";
            if (isset($result['date']) && !empty($result['date'])) {
                $feature_dfilter = explode("-", $result['date']);
                $feature_condition = " and kct.date >= '" . date("Y-m-d", strtotime(str_replace('/', '-', $feature_dfilter[0]))) . "' AND kct.date <= '" . date("Y-m-d", strtotime(str_replace('/', '-', $feature_dfilter[1]))) . "' AND actual_no='{$feature_filter[1]}' ";
            }
        }
        if (isset($result['date']) && !empty($result['date'])) {
            $feature_dfilter = explode("-", $result['date']);
开发者ID:kirannaikdanavath,项目名称:fanci,代码行数:31,代码来源:call-track.php

示例6: array

<?php

require_once "conexao.class.php";
require_once "crud.class.php";
//cria um objeto de crud
$teste = CRUD::getInstance(Conexao::getInstance());
$nome = 'Tereza Camargo';
$email = 'tereza_camargo@gmail.com';
$nome2 = 'Teste update';
$email2 = 'tereza_camargo@gmail.com';
$info = array($nome, $email);
//paramentos: tabela, quantidade de informacoes, nomes das colunas, values abstratos, e array de informacoes
//$teste->insert('clientes', 2, 'nome, email', '?,?', $info);
//$teste->delete('clientes', 6);
/*$leitura = $teste->readAll('clientes');
  
  foreach($leitura as $reg){
      echo "<br/>*********************<br/>";
      echo "ID: " . $reg->id . "";
      echo " NOME: " . $reg->nome . "";
      echo " EMAIL: " . $reg->email . "";
  }*/
$info2 = array($nome2, $email2);
//paramentros: tabela, quantidade de informacoes, sets para update, id do que vai ser atualizado, e array de informacoes
$teste->update('clientes', 2, 'nome=?, email=?', 1, $info2);
开发者ID:guimenegussi,项目名称:PHP-PDO-OO,代码行数:25,代码来源:index.php

示例7: logUserActivity

 public static function logUserActivity($user_id, $app_id, $feature_id, $app_feature_id, $tuple_id, $activity)
 {
     if (Authenticate::$session_user_id) {
         $log = array('user_id' => $user_id, 'app_id' => $app_id, 'feature_id' => $feature_id, 'app_feature_id' => $app_feature_id, 'tuple_id' => $tuple_id, 'activity' => $activity);
         $CRUD = CRUD::getInstance();
         $CRUD->insert('user_activity_log', $log);
     }
 }
开发者ID:kirannaikdanavath,项目名称:fanci,代码行数:8,代码来源:Logger.class.php


注:本文中的CRUD::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。