Пример #1
1
 public function query($sql)
 {
     LogMaster::log($sql);
     $res = sasql_query($this->connection, $sql);
     if ($res === false) {
         throw new Exception("SaSQL operation failed\n" . sasql_error($this->connection));
     }
     $this->last_result = $res;
     return $res;
 }
 /**
  * Exec a query os sql comand
  * @param  string $sql_string SQÇ Command
  * @return SQLAnywhereQuery|boolean            
  */
 public function exec($sql_string)
 {
     $this->sql_string = $sql_string;
     $query = sasql_query($this->connection, $this->sql_string);
     if ($query) {
         return new SQLAnywhereQuery($query, $this->connection);
     } else {
         throw new Exception("SQL String Problem :: " . sasql_error($this->connection), 110);
     }
     return 0;
 }
Пример #3
0
 public function __construct($calc_id)
 {
     $this->calc_id = $calc_id;
     //подключения к базе
     $this->con = sasql_connect("UID=dba;PWD=gjknfdf_rhtlbns;SERVER=app_12;DBN=lease12;HOST=front");
     //информацыя о машине
     $q = 'select * from calc_pars where calc_id = ' . $this->calc_id;
     $res = sasql_query($this->con, $q);
     $this->car = sasql_fetch_array($res);
     //        $this->prn($this->car);
     $q = 'SELECT * FROM "DBA"."s_mark" where id = ' . $this->car['mark_id'];
     $res = sasql_query($this->con, $q);
     $this->mark = sasql_fetch_array($res);
     $this->model = $this->car['mark_id'];
     $q = 'select month_id, debt*-1 as debt from Graphics_Calc where calc_id = ' . $this->calc_id;
     //        $this->prn($q);
     $res = sasql_query($this->con, $q);
     //        $this->ulf_pay = sasql_fetch_array($res);
     while ($row = sasql_fetch_array($res)) {
         $this->ulf_pay[$row['month_id']] = $row['debt'];
     }
     //        $this->prn($this->ulf_pay);
 }
Пример #4
0
 private function saveGuarantor()
 {
     $q = 'UPDATE Applications SET app_req_guarantor = \'y\' WHERE  App_ID=(select app_id from app_calc WHERE calc_id = ' . $this->calc_id . ')';
     $res = sasql_query($this->con, $q);
 }
 public function __uquery(&$query)
 {
     if (!($query = sasql_query($this->__connection, $query))) {
         $this->__setErrors('SQLER');
         return false;
     }
     $this->__result = new SQLAnywhereQuery($query, $this->__connection);
     return $this->__result;
 }
Пример #6
0
 /**
  * Execute the query
  *
  * @access	private called by the base class
  * @param	string	an SQL query
  * @return	resource
  */
 function _execute($sql)
 {
     $sql = $this->_prep_query($sql);
     return @sasql_query($this->conn_id, $sql);
 }
Пример #7
0
 /**
  * Perform a query, using the current database handle.
  */
 function db_query($query)
 {
     return sasql_query($this->_dbh, $query);
 }
Пример #8
-1
 public function __construct($calc_id)
 {
     $this->calc_id = $calc_id;
     //подключения к базе
     $this->con = sasql_connect("UID=dba;PWD=gjknfdf_rhtlbns;SERVER=app_12;DBN=lease12;HOST=front");
     $q1 = 'SELECT * FROM "DBA"."физ_лица_nst" LEFT  JOIN Applications on Applications.app_client_id="физ_лица_nst".ID
             LEFT JOIN app_calc on Applications.app_id=app_calc.app_id where app_calc.calc_id=' . $this->calc_id;
     $res = sasql_query($this->con, $q1);
     $this->users = sasql_fetch_array($res);
     $this->inn = $this->users['ИНН'];
     //        $this->inn = '2905602379';
     $this->lnameua = $this->users['Фамилия'];
     //        $this->lnameua = 'Нікітін';
     $this->fnameua = $this->users['Имя'];
     //        $this->fnameua = 'Андрій';
     $this->mnameua = $this->users['Отчество'];
     //        $this->mnameua = 'Іванович';
     $this->pser = $this->users['Паспорт_Серия'];
     //        $this->pser = 'КН';
     $this->pnom = $this->users['Паспорт_Номер'];
     //        $this->pnom = '925600';
     $this->bdate = $this->users['Дата_Рождения'];
     //        $this->bdate = '1969-06-17';
     //        $this->prn($this->users);
 }