예제 #1
0
 public function getList($show = "open")
 {
     $sql_ekstra = "";
     switch ($show) {
         case 'åbne':
             // fall through
         // fall through
         case 'open':
             $sql_ekstra = "published = 1 AND DATE_ADD(dato_start, INTERVAL 14 DAY) > NOW()";
             break;
         case 'aktuelle':
             $sql_ekstra = "dato_slut > NOW()";
             break;
         case 'intranet':
             $sql_ekstra = "dato_slut > DATE_SUB(NOW(), INTERVAL 400 DAY)";
             break;
         case 'old':
             $sql_ekstra = "dato_slut > DATE_SUB(NOW(), INTERVAL 3650 DAY)";
             break;
         default:
             $sql_ekstra = " 1 = 1";
             break;
     }
     $db = new DB_Sql();
     $db->query("SELECT id FROM langtkursus WHERE " . $sql_ekstra . " AND active = 1 ORDER BY dato_start ASC, dato_slut DESC, belong_to ASC, navn ASC");
     $kurser = array();
     while ($db->nextRecord()) {
         $kurser[] = new VIH_Model_LangtKursus($db->f('id'));
     }
     return $kurser;
 }
예제 #2
0
 private function init()
 {
     $db = new DB_Sql();
     $db->query("SELECT id FROM langtkursus_tilmelding WHERE session_id = '" . $this->session_id . "'");
     if ($db->nextRecord()) {
         parent::__construct($db->f('id'));
     }
 }
예제 #3
0
function updateCGAGpo($idGrupo, $forzarMov = 0)
{
    $db = new DB_Sql();
    $db->connect("MscCobranza", "localhost", "root", "");
    $db2 = new DB_Sql();
    $db2->connect("MscCobranza", "localhost", "root", "");
    $db3 = new DB_Sql();
    $db3->connect("MscCobranza", "localhost", "root", "");
    //echo "Gpo:$idGrupo || forzaMov:$forzarMov <br>";
    // ---------------------------------
    // PROCESO PARA ACTUALIZAR LAS C.G.A
    // ---------------------------------
    $ano = date("Y");
    $anoAnt = $ano - 1;
    $grupo = getValueTable("grupo", "D_GRUPO", "id_grupo", $idGrupo);
    $cgaAct = getValueTable("cga", "D_GRUPO", "id_grupo", $idGrupo);
    $cgaOld = getValueTable("cga_old", "D_GRUPO", "id_grupo", $idGrupo);
    // * DETECTAR REGISTROS DEL CLIENTE
    $sql2 = "select a.id_calculo as IDCALCULO, a.carta_g as CGACAL, a.id_bl_conte as IDBLCONTE ";
    $sql2 .= "from D_CALCULO a, D_CLIENTE b ";
    $sql2 .= "where ";
    $sql2 .= "a.id_cliente=b.id_cliente and b.id_grupo='{$idGrupo}' and ";
    if ($forzarMov == '0') {
        $sql2 .= "a.carta_g='' and ";
    }
    $sql2 .= "(libre_f1 BETWEEN '{$anoAnt}-01-01' and '{$ano}-12-31%' )";
    $db2->query($sql2);
    while ($db2->next_record()) {
        $idCalculo = $db2->f(IDCALCULO);
        //echo "idCalculo=$idCalculo <br>";
        $idBlConte = $db2->f(IDBLCONTE);
        $cgaCal = $db2->f(CGACAL);
        $idBl = getValueTable("id_bl", "BL_CONTE", "id_bl_conte", $idBlConte);
        $bl = getValueTable("Bl", "EXPO", "Id_expo", $idBl);
        $idBarco = getValueTable("Id_barco", "EXPO", "Id_expo", $idBl);
        $eta = getValueTable("Eta1", "BARCO", "Id_barco", $idBarco);
        if (preg_match("/^(\\d{4})/i", $eta, $parts)) {
            $etaAno = $parts[1];
        }
        // * CGA - ACTUAL
        if (!empty($cgaAct) && (empty($cgaCal) || $forzarMov == 1)) {
            if (preg_match("/CGA {$etaAno}/i", $cgaAct)) {
                $sql3 = "update D_CALCULO set carta_g='{$cgaAct}' where id_calculo='{$idCalculo}'";
                $db3->query($sql3);
                //echo "$bl [CGA - Actualizada]...<br>";
            }
        }
        // * CGA - ANTERIOR
        if (!empty($cgaOld) && (empty($cgaCal) || $forzarMov == 1)) {
            if (preg_match("/CGA {$etaAno}/i", $cgaOld)) {
                $sql3 = "update D_CALCULO set carta_g='{$cgaOld}' where id_calculo='{$idCalculo}'";
                $db3->query($sql3);
                //echo "$bl [CGA - Actualizada]...<br>";
            }
        }
    }
}
예제 #4
0
function DbConnect()
{
    $DBHandle = new DB_Sql();
    $DBHandle->Database = DBNAME;
    $DBHandle->Host = HOST;
    $DBHandle->User = USER;
    $DBHandle->Password = PASS;
    $DBHandle->connect();
    return $DBHandle;
}
예제 #5
0
 protected function load()
 {
     $db = new DB_Sql();
     $sql = "SELECT art, indhold FROM kortkursus_tilmelding_oplysninger\r\n            WHERE tilmelding_id = '" . $this->tilmelding->get('id') . "'";
     $db->query($sql);
     while ($db->nextRecord()) {
         $this->value[$db->f('art')] = $db->f('indhold');
     }
     return true;
 }
예제 #6
0
 function postForm()
 {
     $db = new DB_Sql();
     foreach ($this->body() as $key => $value) {
         foreach ($value as $id => $hold) {
             if (!$hold) {
                 continue;
             }
             $db->query("UPDATE langtkursus_tilmelding_x_fag SET hold = " . $hold . " WHERE id = " . $id);
         }
     }
     return new k_SeeOther($this->url());
 }
function checkurl()
{
    foreach ($_GET as $check1) {
        $check2 = check($check1);
        if ($check1 != $check2 || strlen($check1) != strlen($check2)) {
            @($str = "INSERT INTO `attacklog` ( `uid` , `dt` , `ip` , `key` , `memo`  , `httphost` ) \r\n\t\t\t\tVALUES ( '" . $_SESSION['uid'] . "', '" . date("Y-m-d H:i:s") . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . $_SERVER['SCRIPT_FILENAME'] . "', '', '" . $_SERVER['HTTP_HOST'] . "')");
            @($db = new DB_Sql());
            @$db->query($str);
            echo "¹¥»÷Ìáʾ";
            exit;
        }
    }
}
예제 #8
0
 function DBx($host='localhost', $user, $password) {
     $this->Host = $host;
     $this->User = $user;
     $this->Password = $password;
     $this->Database = 'mysql';
     parent::DB_Sql();
 }
예제 #9
0
 public function get($art)
 {
     if (!empty($this->info[$art])) {
         return $this->info[$art];
     }
     $art = trim(strip_tags(mysql_escape_string($art)));
     $sql = "SELECT art, indhold FROM kortkursus_deltager_oplysninger_ny\r\n            WHERE deltager_id = '" . $this->deltager->get('id') . "'";
     $db = new DB_Sql();
     $db->query($sql);
     while ($db->nextRecord()) {
         $this->info[$db->f('art')] = $db->f('indhold');
     }
     if (!empty($this->info[$art])) {
         return $this->info[$art];
     }
 }
예제 #10
0
 function DB_Blufeedme($host, $database, $user, $pass)
 {
     parent::DB_Blufeedme();
     $this->Host = $host;
     $this->Database = $database;
     $this->User = $user;
     $this->Password = $pass;
 }
function _is_jubilar($auth)
{
    $jubilar = false;
    $db = new DB_Sql();
    $db->query("SELECT aargange FROM elevforeningen_jubilar ORDER BY id DESC");
    if ($db->nextRecord()) {
        $jubilar_aargange = array_values(unserialize($db->f('aargange')));
    }
    $contact = $auth->get();
    $keywords = $auth->contact_client->getConnectedKeywords($contact['id']);
    $jubilar = false;
    if (is_array($keywords)) {
        foreach ($keywords as $key => $value) {
            if (in_array($value, $jubilar_aargange)) {
                $jubilar = true;
            }
        }
    }
    return $jubilar;
}
예제 #12
0
 function get_db_value($sql = '', $default = '')
 {
     $this->connect_to_db();
     $this->enable_data = FALSE;
     $sql = trim($sql);
     if (mb_strlen($sql) > 0) {
         $this->set_sql($sql);
     }
     $this->db->query($this->sql);
     $this->after_query();
     if ($this->db->next_record()) {
         $this->enable_data = TRUE;
         return $this->db->f(0);
     } else {
         return $default;
     }
 }
예제 #13
0
파일: db.php 프로젝트: renduples/alibtob
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
@set_time_limit(1000);
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require LIB_PATH . "db_mysql.inc.php";
uses("log");
$log = new Logs();
$db = new DB_Sql();
$conn = $db->connect($dbname, $dbhost, $dbuser, $dbpasswd);
$tpl_file = "db";
if (!($backupdir = $pdb->GetOne("SELECT valued FROM {$tb_prefix}settings WHERE variable='backup_dir'"))) {
    $backupdir = pb_radom(6);
    $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) values ('backup_dir', '{$backupdir}')");
}
require LIB_PATH . "func.db.php";
require LIB_PATH . "func.sql.php";
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    if (!file_exists(DATA_PATH . "backup_" . $backupdir)) {
        pb_create_folder(DATA_PATH . "backup_" . $backupdir);
    }
    if ($do == "query" && !empty($_POST['sql_content'])) {
        if ($admin_runquery) {
            $result = sql_run($_POST['sql_content']);
예제 #14
0
파일: Facilitet.php 프로젝트: vih/vih.dk
 function deletePicture($file_id)
 {
     $db = new DB_Sql();
     $db->query('UPDATE facilitet SET pic_id = 0, date_updated = NOW() WHERE id = ' . $this->id);
     return 1;
 }
예제 #15
0
파일: user_del.php 프로젝트: urki/timing
<?
include "../inc/config.php";

//?user_id=1&event_id=1&tekma_id=2

//$event_id = $_REQUEST["event_id"];
//$tekma_id = $_REQUEST["tekma_id"];
$user_id = $_REQUEST["user_id"];
echo "userID=".$user_id;
//create db object//
$db = new DB_Sql();

if ($user_id) {
	
	$sql = "delete  from users where id_user='******'";
	$db->query($sql);

	//echo $sql;
	//redirekt to monitor page//
	header("location:".$_SERVER['HTTP_REFERER']);
	exit();
}

echo "Ups??";



예제 #16
0
파일: LangtKursus.php 프로젝트: vih/vih.dk
 public function getPictures()
 {
     $db = new DB_Sql();
     $db->query("SELECT * FROM langtkursus_x_file WHERE langtkursus_id = " . $this->id);
     $id = array();
     while ($db->nextRecord()) {
         $id[]['file_id'] = $db->f('file_id');
     }
     return $id;
 }
예제 #17
0
파일: common.php 프로젝트: RyanCao/myweb
define("NUM", 5);
//定义每次显示的新闻条数
$smarty = new Smarty();
//建立smarty实例对象$smarty
$smarty->templates_dir = "./templates";
//设置模板目录
$smarty->compile_dir = "./templates_c";
//设置编译目录
$smarty->cache_dir = "./cache";
//设置缓存目录
$smarty->caching = false;
//这里是调试时设为false,发布时请使用true
$smarty->left_delimiter = "<{";
//设置左边界符
$smarty->right_delimiter = "}>";
//设置右边界符
//=========@@@@help 2.实例化一个类,并设置类的Host, Database, User, Password属性, 最后connect数据库=========================
$db = new DB_Sql();
//实例化一个DB类
$db->Host = "localhost";
// 数据库主机名
$db->Database = "techflash";
//数据库名称
$db->User = "******";
//用户名
$db->Password = "******";
//密码
$db->connect();
//进行数据库连接
//设置Mysql编码
mysql_query("set names " . $dbcharset);
예제 #18
0
<?php

include_once "../include/db_mysql.inc";
$hoy = date("Y-m-d");
// ---------------
// CONFIGURACION
// -------------
// --- SION ---
$sionDB = "MscCobranza";
$sionSrv = "10.110.0.5";
$db = new DB_Sql();
$db2 = new DB_Sql();
$db3 = new DB_Sql();
$db->connect($sionDB, $sionSrv, "root", "");
$db2->connect($sionDB, $sionSrv, "root", "");
$db3->connect($sionDB, $sionSrv, "root", "");
$sql = "select * from Z_BUQUE_DUP ";
$db->query($sql);
while ($db->next_record()) {
    $idBarco = $db->f('Id_barco');
    $nombre = $db->f('Nombre');
    $viaje = $db->f('Viaje');
    $eta = $db->f('Eta1');
    $IE = $db->f('Impo_expo');
    $puerto = $db->f('Puerto');
    $tlBls = $db->f('total');
    // echo "$idBarco | $nombre | $viaje | $eta | $IE | $puerto | $tlBls <br>";
    // Detectar si hay mas de uno .
    $flgDup = 0;
    $sql2 = "select Id_barco \n    from Z_BUQUE_DUP \n\tWHERE nombre='{$nombre}' and viaje='{$viaje}' and Eta1='{$eta}' and Impo_expo='{$IE}' and Puerto='{$puerto}'\n    ";
    $db2->query($sql2);
예제 #19
0
파일: Fag.php 프로젝트: vih/vih.dk
 public function getKurser()
 {
     $db = new DB_Sql();
     $db->query("SELECT * FROM langtkursus_x_fag INNER JOIN langtkursus ON langtkursus_x_fag.langtkursus_id = langtkursus.id WHERE fag_id = " . $this->id . ' AND dato_start > NOW() AND langtkursus.active = 1 AND langtkursus.published = 1 GROUP BY langtkursus_id ORDER BY dato_start');
     $kurser = array();
     while ($db->nextRecord()) {
         $kurser[] = new VIH_Model_LangtKursus($db->f('langtkursus_id'));
     }
     return $kurser;
 }
예제 #20
0
파일: print_user.php 프로젝트: urki/timing
<?
include "../inc/config.php";

//create db object//
$db = new DB_Sql();

//open template//
$tem = template_open("print_user.tpl");
//add header footer//
///$tem = template_add_head_foot($tem,head,foot);
$tmp = template_get_repeat_text("##START##","##STOP##","##USER_LIST##",$tem);
$row = $tmp[1];
$tem = $tmp[0];

//get out the events//
$sql = "SELECT * 
FROM users, events
WHERE users.event_id=events.event_id and id_user=$id_user
ORDER BY events.event_id, users.number ASC";
$db->query($sql);
while ($db->next_record()) {
	$table.=$row;
	$table = str_replace("##USER_ID##",$db->f("id_user"),$table);
	$table = str_replace("##NAME##",$db->f("full_name"),$table);
	$table = str_replace("##EVENT##",$db->f("name"),$table);
	$table = str_replace("##NUMBER##",$db->f("number"),$table);
}
//replace template variables//
$tem = str_replace("##USER_LIST##",$table,$tem);
$tem = str_replace("##MESSAGE##",$message,$tem);
///clean up//
예제 #21
0
<?php

include '../../include_videotutoriales/configpc.php';
session_start();
$html = new Smarty();
if (!isset($_POST["formulario"])) {
    $html->display("login.html");
} else {
    $usuario = $_POST["usuario"];
    $pass = $_POST["pass"];
    $pass = md5($pass);
    $db = new DB_Sql();
    //query de usuario si es que si creamos la session usuario y vamos a perifl.php , si da error a error.php
    $query = "select usuario from usuarios where usuario='{$usuario}' and pass='******'";
    $db->query($query);
    if ($db->num_rows() > 0) {
        $_SESSION["usuario"] = $usuario;
        header("location: perfil.php");
    } else {
        $html->display("error.html");
    }
}
예제 #22
0
파일: KortKursus.php 프로젝트: vih/vih.dk
 /**
  * Statistics
  *
  * @todo Optimize
  */
 function statistik($filter = '')
 {
     // count number of spots on each course
     $countPladser = 0;
     $countOptagne = 0;
     $db1 = new DB_Sql();
     $sql = "SELECT id, pladser FROM kortkursus\r\n            WHERE published=1\r\n                AND tilmeldingsmulighed = 'Ja'\r\n                AND DATE_FORMAT(dato_start, '%Y') >= 2005";
     if (!empty($filter)) {
         $sql .= "\tAND gruppe_id = " . (int) $filter;
     }
     $sql .= " ORDER BY dato_start ASC";
     $db1->query($sql);
     while ($db1->nextRecord()) {
         $countPladser += $db1->f('pladser');
         $kursus = new VIH_Model_KortKursus($db1->f('id'));
         $countOptagne += $kursus->getOptagnePladser();
     }
     if ($countPladser == 0) {
         $countPladser = 1;
     }
     $percent = round($countOptagne / $countPladser * 100, 0);
     return array('pladser' => $countPladser, 'percent' => $percent, 'optagne' => $countOptagne);
 }
예제 #23
0
 function save()
 {
     $db = new DB_Sql();
     $db->query("INSERT INTO betaling_online SET date_created = NOW(), type='" . $this->type . "', transaktionsnummer = '', status='" . $this->eval['qpstat'] . "'");
     return 1;
 }
예제 #24
0
        $arr_request[$key] = trim($value);
    }
}
include_once "db_mysqli.inc";
/// Fecha actual.
$hoy = date("Y-m-d H:i:s");
$hoyF = date("Y-m-d");
$db = new DB_Sql();
$db->connect("nesoftwa_ANAKOSTA", "localhost", "nesoftwa_root", ";L9Nehbfaxts");
$db2 = new DB_Sql();
$db2->connect("nesoftwa_ANAKOSTA", "localhost", "nesoftwa_root", ";L9Nehbfaxts");
$db3 = new DB_Sql();
$db3->connect("nesoftwa_ANAKOSTA", "localhost", "nesoftwa_root", ";L9Nehbfaxts");
$dbX = new DB_Sql();
$dbX->connect("nesoftwa_ANAKOSTA", "localhost", "nesoftwa_root", ";L9Nehbfaxts");
$dbf = new DB_Sql();
$dbf->connect("nesoftwa_ANAKOSTA", "localhost", "nesoftwa_root", ";L9Nehbfaxts");
// ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
function normaliza($cadena)
{
    // NOTA IMPORTANTE : TENER MUCHO CUIDADO YA QUE PUEDE CAMBIAR CARACTERES EN LOS BLS
    // POR EJEMPLO UN RH1234567 LO CAMBIA POR BH1234567. PELIGROSO. ATT. Nestor 20150106
    /*
    $originales = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ´R´r';
    $modificadas = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr';
    $cadena = utf8_decode($cadena);
    $cadena = strtr($cadena, utf8_decode($originales), $modificadas);
    $cadena = strtolower($cadena);
    return utf8_encode($cadena);
    */
    // METODO 2
예제 #25
0
<?php

//--------------------------------------------
// Fecha: 20051017
//--------------------------------------------
include_once "../include/confGral.php";
$dbK = new DB_Sql();
$dbK->connect("MscCobranza", "localhost", "root", "");
// fffffffffffffffffffffffffffffffffffffffffff
function generateXMLCN($idNC = '', $idND = '', $tipoNCND)
{
    // ----- CREDIT NOTE / DEBIT NOTE ------------
    global $dbK, $hoy;
    if ($tipoNCND == "NC") {
        // Validar si no ha sido enviado el XML
        $xmlSendFlg = getValueTable("xml_send_flg", "FT_NC", "id_ft_nc", $idNC);
    } elseif ($tipoNCND == "ND") {
        $xmlSendFlg = getValueTable("xml_send_flg", "FT_ND", "id_ft_nd", $idND);
    }
    if ($xmlSendFlg == 1) {
        return false;
    } else {
        $xml = new DOMDocument('1.0', 'utf-8');
        $xml->formatOutput = true;
        /*
         * Crear elemento: DocDom -> createElement('nombreElemento')
         * Crear Datos: DocDom -> createTextNode($datos)
         * Asociar: $Hijo = $Padre -> appendChild($hijo)
         */
        // Creo elemento
        $ns1 = $xml->createElement('ns1:CustomerInvoices');
예제 #26
0
include_once "../include/template.inc";
include_once "../include/db_mysql.inc";
include_once "../include/class.phpmailer.php";
$t = new Template('c:\\xampp\\htdocs\\msclink\\templates', "keep");
$hoy = date("Y-m-d");
// ---------------
// CONFIGURACION
// -------------
$hoy = date("Y-m-d");
// --- SION CONEXIONES ---
$sionDB = "MscCobranza";
$sionSrv = "10.110.0.5";
$db = new DB_Sql();
$db2 = new DB_Sql();
$dbf = new DB_Sql();
$dbX = new DB_Sql();
$db->connect($sionDB, $sionSrv, "linkuser", "pincheschinos.com");
$db2->connect($sionDB, $sionSrv, "linkuser", "pincheschinos.com");
$dbf->connect($sionDB, $sionSrv, "linkuser", "pincheschinos.com");
$dbX->connect($sionDB, $sionSrv, "linkuser", "pincheschinos.com");
// --- MSCLINK SQL SERVER ---
$linkUsr = "******";
$linkPass = "******";
// Test  10.100.131.70
// Production  10.100.131.78
$linkSrv = "10.100.131.78";
$linkDB = "Interlink_Main90";
$info = array('Database' => $linkDB, 'UID' => $linkUsr, 'PWD' => $linkPass);
// -------------------------------------------------------------------------------
// ODBC
// El sistema se trata de conectar mediante ODBC nativo a la base de datos MscLink
예제 #27
0
         break;
     case 'mysql41':
         $db_schema = SQL_SCHEMA . '/core-mysql41_install.sql';
         break;
 }
 if (empty($monit)) {
     if (isset($_POST['dbcreate'])) {
         $link = mysql_pconnect($dbhost, $dbuser, $dbpass) or die('Nie mo¿na siê po³±czyæ: ' . mysql_error());
         $result = mysql_query("CREATE DATABASE {$dbname}") or die("Nie mo¿na utworzyæ bazy danych!");
         $link = mysql_close($link);
     }
     define('DB_HOST', $dbhost);
     define('DB_USER', $dbuser);
     define('DB_PASS', $dbpass);
     define('DB_NAME', $dbname);
     $db = new DB_Sql();
     // poprawiono dla wersji php < 4.3.0
     if (!function_exists('file_get_contents')) {
         $sql_query = implode('', file($db_schema));
         $sql_query = explode(';', $sql_query);
     } else {
         $sql_query = explode(';', file_get_contents($db_schema));
     }
     $sql_query = str_replace('core_', $dbprefix, $sql_query);
     $sql_query = $lang == 'en' ? str_replace('DEFAULT_CATEGORY', 'default', $sql_query) : str_replace('DEFAULT_CATEGORY', 'ogólna', $sql_query);
     $sql_size = sizeof($sql_query) - 1;
     for ($i = 0; $i < $sql_size; $i++) {
         $db->query($sql_query[$i]);
     }
     $file = '<?php' . "\n";
     $file .= "\n// Core CMS auto-generated config file\n\n";
예제 #28
0
파일: Adresse.php 프로젝트: vih/vih.dk
 /**
  *
  * Der m� i denne funktion ikke bruges array_map() til at genneml�be
  * v�rdierne, da den �del�gger arrayet til andet brug.
  * Sune: Nu har jeg alligevel benyttet array_map, for jeg kan ikke se hvor man ikke kan det.
  */
 function save($input)
 {
     settype($input['arbejdstelefon'], 'string');
     settype($input['mobil'], 'string');
     settype($input['adresse'], 'string');
     settype($input['postnr'], 'string');
     settype($input['postby'], 'string');
     if (!$this->validate($input)) {
         return 0;
     }
     $var = $input;
     $navn = vih_split_name($var['navn']);
     $var['fornavn'] = $navn['fornavn'];
     $var['efternavn'] = $navn['efternavn'];
     if ($this->id == 0) {
         $sql_type = "INSERT INTO ";
         $sql_end = ", date_created = NOW()";
     } else {
         $sql_type = "UPDATE ";
         $sql_end = ", date_changed = NOW() WHERE id = " . $this->id;
     }
     $sql = $sql_type . "adresse SET\r\n            fornavn = '" . $var['fornavn'] . "',\r\n            efternavn = '" . $var['efternavn'] . "',\r\n            adresse = '" . $var['adresse'] . "',\r\n            postnr = '" . $var['postnr'] . "',\r\n            postby = '" . $var['postby'] . "',\r\n            email = '" . $var['email'] . "',\r\n            arbejdstelefon = '" . $var['arbejdstelefon'] . "',\r\n            telefon = '" . $var['telefonnummer'] . "',\r\n            mobil = '" . $var['mobil'] . "'" . $sql_end;
     $db = new DB_Sql();
     $db->query($sql);
     if ($this->id == 0) {
         return $db->insertedId();
     }
     $this->load();
     return $this->id;
 }
예제 #29
0
<?php

include_once "../include/db_mysql.inc";
// -------------
$sionDB = "MscCobranza";
$sionSrv = "10.110.0.5";
$db = new DB_Sql();
$db2 = new DB_Sql();
$db3 = new DB_Sql();
$db->connect($sionDB, $sionSrv, "root", "");
$db2->connect($sionDB, $sionSrv, "root", "");
$db3->connect($sionDB, $sionSrv, "root", "");
// ---------------------------------------------------------------------------------
// --- MSCLINK SQL SERVER ---
$linkUsr = "******";
$linkPass = "******";
// Test  10.100.131.70
// Production  10.100.131.78
$linkSrv = "10.100.131.78";
$linkDB = "Interlink_Main90";
$info = array('Database' => $linkDB, 'UID' => $linkUsr, 'PWD' => $linkPass);
// -------------------------------------------------------------------------------
// ODBC
// El sistema se trata de conectar mediante ODBC nativo a la base de datos MscLink
// -------------------------------------------------------------------------------
$dsn = "Driver={SQL Server};Server={$linkSrv};Database={$linkDB};Integrated Security=SSPI;Persist Security Info=False;";
// Se realiza la conex�n con los datos especificados anteriormente
$conn = odbc_connect($dsn, $linkUsr, $linkPass);
// ---------------------------------------------------------------------------------------
if ($_POST['modo'] == "ok") {
    $salesExe = "";
예제 #30
0
function getValueTable($campo, $tabla, $idTabla, $idEnviado)
{
    // Extrae solo info de SION
    global $sionSrv, $sionDB;
    /*
     * @return Info de un campo especifico
     * @param string $campo
     * @param string $tabla
     * @param string $idTabla
     * @param string $idEnviado
     * @desc Esta funcion sirve para traer informacion de x campo de cualquier tabla.
     */
    $dbf = new DB_Sql();
    $dbf->connect($sionDB, $sionSrv, "root", "");
    $sql = "select {$campo} from {$tabla} where {$idTabla}='{$idEnviado}'";
    $dbf->query($sql);
    while ($dbf->next_record()) {
        $valor = $dbf->f($campo);
        return $valor;
        // No mover el return, podria ser peligroso!.
    }
}