示例#1
0
文件: LB_DB.php 项目: elemenofi/lb
 public static function vwNews($Inputs)
 {
     $PDO = ccPDO::___GET("lbxxdb50", false);
     $Query = "CALL vwNews(:inUser__Id);";
     try {
         $SP = $PDO->prepare($Query);
         $SP->bindValue(':inUser__Id', $Inputs['Id'], PDO::PARAM_INT);
         $SP->execute();
         $ResultsSets = array();
         while ($SP->columnCount() > 0) {
             $Response = $SP->fetchAll(PDO::FETCH_ASSOC);
             $ResultsSets[] = $Response;
             $SP->nextRowset();
         }
     } catch (Exception $e) {
         ccGeneral::EXCEPTION___Process($e, debug_backtrace());
     }
     return $ResultsSets;
 }
示例#2
0
 function __Set__Credentials($Email, $Password)
 {
     $MySQL = ccPDO::___GET("lbxxdb50");
     try {
         $st = $MySQL->prepare("SELECT Id, Email FROM mgmt__user WHERE Email = :Email AND Password = :Password");
         $st->bindValue(':Email', $Email, PDO::PARAM_STR);
         $st->bindValue(':Password', md5($Password), PDO::PARAM_STR);
         $st->execute();
         $result = $st->fetchAll(PDO::FETCH_ASSOC);
     } catch (Exception $e) {
         throw $e;
     }
     if (count($result)) {
         $this->Id = $result[0][Id];
         $this->Email = $result[0][Email];
     } else {
         $this->Id = -1;
         $this->Email = "";
     }
 }
示例#3
0
文件: General.php 项目: elemenofi/lb
 public static function MYSQL___Mirror($Function__Name, $Inputs)
 {
     $Remote = new stdClass();
     $Local = new stdClass();
     try {
         $Remote->PDO = ccPDO::___GET("lbxxdb50", false, "www.loopbill.com");
         $Remote->PDO->setAttribute(PDO::ATTR_AUTOCOMMIT, 0);
         $Remote->PDO->beginTransaction();
         $Remote->Results = call_user_func($Function__Name, $Remote->PDO, $Inputs);
         $Local->PDO = ccPDO::___GET("lbxxdb50", false, "localhost");
         $Local->PDO->setAttribute(PDO::ATTR_AUTOCOMMIT, 0);
         $Local->PDO->beginTransaction();
         $Local->Results = call_user_func($Function__Name, $Local->PDO, $Inputs);
         $Remote->PDO->commit();
         $Local->PDO->commit();
     } catch (Exception $e) {
         $Remote->PDO->rollBack();
         $Local->PDO->rollBack();
         echo "ERROR: An error occured while executing, please review.";
         ccGeneral::EXCEPTION___Process($e, debug_backtrace());
     }
     //        return $Remote->Results;
     return $Local->Results;
 }
示例#4
0
<?php

require_once "../../../Web/PHP/Models/General.php";
require "../Views/Admin.php";
require_once "../../../Web/PHP/Models/PDO.php";
require_once "../../../Web/PHP/Models/DB.php";
require_once "../Models/LB_DB.php";
//require_once '../Z_Dev/Dev.php';
$Inputs = filter_input_array(INPUT_GET);
$PDO = ccPDO::___GET("lbxxdb50", false, $Inputs['DB_Host']);
$bSuccess = ccLB_Proc::CREATE_NEW__Ticket($Inputs);
$JSON = json_encode(array($bSuccess));
echo $JSON;
示例#5
0
<?php

require_once "../../../Web/PHP/Models/General.php";
require "../Views/Admin.php";
require_once "../../../Web/PHP/Models/PDO.php";
$Class__Name = filter_input(INPUT_GET, 'Class__Name');
$Object__Name = filter_input(INPUT_GET, 'Object__Name');
$MySQL = ccPDO::___GET("lbxxdb50");
try {
    $st = $MySQL->prepare("SELECT Id, Name FROM db__" . strtolower($Class__Name) . " WHERE Name LIKE '%" . $Object__Name . "%' AND Id <> 1 ORDER BY Name;");
    $st->execute();
    $result = $st->fetchAll(PDO::FETCH_ASSOC);
} catch (Exception $e) {
    throw $e->getMessage();
}
echo json_encode($result);
示例#6
0
<?php

require_once "../../../PHP/Models/General.php";
require "../Views/Admin__vw.php";
require_once "../../../PHP/Models/PDO.php";
require_once "./TXT.php";
$TXT = filter_input(INPUT_GET, 'TXT__Value');
$Action__Name = filter_input(INPUT_GET, 'Action__Name');
$TXT__Value = ccTXT__Value::CLEAN_FOR__DB($TXT);
//$MySQL = ccPDO::___GET("lbproc", false);
$MySQL = ccPDO::___GET("lbxxdb50", false);
try {
    $FakeParam = $MySQL->prepare("SET @outTXT_Action__Id = -1");
    $FakeParam->execute();
    $SP = $MySQL->prepare("CALL CREATE___TXT_Action__Id(:inTXT__Value, :inAction__Name, @outTXT_Action__Id, :inPrint);");
    $SP->bindValue(':inTXT__Value', $TXT__Value, PDO::PARAM_STR);
    $SP->bindValue(':inAction__Name', $Action__Name, PDO::PARAM_STR);
    $SP->bindValue(':inPrint', 1, PDO::PARAM_BOOL);
    $SP->execute();
    $result = $SP->fetchAll(PDO::FETCH_ASSOC);
} catch (Exception $e) {
    throw $e->getMessage();
}
echo json_encode($result);