Example #1
0
 function ajax()
 {
     $dir = $this->input->post('dir');
     $fieldKey = 'fileajax';
     if (!isset($_FILES[$fieldKey]['tmp_name']) || !$_FILES[$fieldKey]['tmp_name']) {
         return false;
     }
     if (!$dir) {
         $dir = 'uploads';
     }
     $this->load->helper('file');
     $dir_full = $this->config->item('resouce_dir') . $dir;
     if (is_dir($dir_full)) {
         $config['upload_path'] = $dir_full;
     } else {
         $config['upload_path'] = BASEPATH . '../files/' . $dir;
     }
     $config['allowed_types'] = 'gif|jpg|png';
     $this->load->library('upload', $config);
     if (!$this->upload->do_upload($fieldKey)) {
         bug($this->upload->error_msg);
         die('can not upload');
     } else {
         $newFile = array('name' => $this->upload->file_name, 'size' => $this->upload->file_size);
         echo json_encode(array('f' => $this->config->item('resouce_url') . $dir . $this->upload->file_name));
     }
     return NULL;
 }
Example #2
0
 /**
  * Get Laporan Dari Datatable
  */
 public function get_laporan_datatable()
 {
     $lokasi = decode($this->uri->segment(3));
     $tahun = decode($this->uri->segment(4));
     $this->load->model('laporan');
     $data = $this->laporan->data_pegawai_datatable($lokasi, $tahun);
     bug($data);
 }
Example #3
0
 function update($data)
 {
     $data = $this->Common_Model->alias_check($data, 'title');
     $existed = false;
     foreach ($data['alias'] as $alias) {
         if (!$existed && $alias && $this->item_existed($data['id'], $alias)) {
             $existed = true;
         }
     }
     if ($existed) {
         bug($existed);
         die('exited');
         return $data;
     }
     if (!$data['img']) {
         unset($data['img']);
     }
     $this->Common_Model->update(0, 'articles', $data, $this->fields_lang);
     return true;
 }
Example #4
0
 private function ajax($limitF = 0, $limitTo = 5, $order = '', $where = '', $table, $select = '*', $returnTableAjax = TRUE)
 {
     $dataReturn = array('totalRecords' => 0, 'data' => null);
     $limitTo = $limitTo ? $limitTo : 10;
     if (is_array($where)) {
         foreach ($where as $key => $item) {
             $this->where[$key] = $item;
         }
     }
     if ($order != '') {
         $this->order = $order;
     }
     //		$this->order = ($order !='' )?$order:$orderDefault;
     $dataReturn['totalRecords'] = $this->pak->from($table)->where($this->where)->count_all_results();
     if ($dataReturn['totalRecords'] <= $limitF) {
         $limitF = 0;
     }
     $query = $this->pak->select($select)->from($table)->where($this->where)->order_by($this->order)->limit($limitTo, $limitF)->get();
     if (!$query) {
         bug($this->pak->last_query());
         exit('error database');
     }
     $data = $query->result_array();
     if ($data) {
         if ($returnTableAjax === TRUE) {
             foreach ($data as $key => $v) {
                 $row = array_values($v);
                 $row[] = null;
                 $dataReturn['data'][] = $row;
             }
         } else {
             $dataReturn['data'] = $data;
         }
     }
     return $dataReturn;
 }
<?php

$PHP_SELF = $_SERVER["PHP_SELF"];
bug($_POST, "POST");
?>
<h1>TODOS LOS CONTROLES</h1>
EN CASO DE ENVIO DE FICHEROS: enctype="multipart/form-data"
<form id="frmTest" name="frmTest" method="post" action="<?php 
echo $PHP_SELF;
?>
" enctype="" >
    <table id="tblTest" style="border: 1px solid #5C9425; width: 70%" >
       <tr>
            <td style="border: 1px solid #5C9425" >
                <label for="botBoton" >botBoton </label>
                <input type="button" id="botBoton" name="botBoton" value="botBoton" onclick="" />
            </td>
        </tr>
         
        <tr style="border: 1px solid #5C9425" >
            <td style="border: 1px solid #5C9425" >
                <label for="txtText" >TxtTest</label>
                <input type="text" id="txtTest" name="txtTest" value="value txttest" />
            </td>
        </tr>
        <tr style="border: 1px solid #5C9425" >
            <td style="border: 1px solid #5C9425" >
                <label for="passTest" >passTest</label>
                <input type="password" id="passTest" name="passTest" value="value passTest" />
            </td>
        </tr>        
Example #6
0
File: DB.php Project: quanict/giaF
/**
 * Initialize the database
 *
 * @category Database
 * @author ExpressionEngine Dev Team
 * @link http://codeigniter.com/user_guide/database/
 * @param
 *        	string
 * @param
 *        	bool	Determines if active record should be used or not
 */
function &DB($params = '', $active_record_override = NULL)
{
    if (!$params) {
        $params = 'default';
    }
    // Load the DB config file if a DSN string wasn't passed
    if (is_string($params) and strpos($params, '://') === FALSE) {
        include BASEPATH . 'config/database.php';
        // Is the config file in the environment folder?
        if (!defined('ENVIRONMENT') or !file_exists($file_path = APPPATH . 'config/' . ENVIRONMENT . '/database.php')) {
            if (file_exists($file_path = APPPATH . 'config/database.php')) {
                // show_error('The configuration file database.php does not exist.');
                include $file_path;
            }
        }
        if (!isset($db) or count($db) == 0) {
            show_error('No database connection settings were found in the database config file.');
        }
        if ($params != '') {
            $active_group = $params;
        }
        if (!isset($active_group) or !isset($db[$active_group])) {
            bug($active_group);
            die('no $active_group');
            show_error('You have specified an invalid database connection group.');
        }
        $params = $db[$active_group];
    } elseif (is_string($params)) {
        /*
         * parse the URL from the DSN string
         * Database settings can be passed as discreet
         * parameters or as a data source name in the first
         * parameter. DSNs must have this prototype:
         * $dsn = 'driver://*****:*****@hostname/database';
         */
        if (($dns = @parse_url($params)) === FALSE) {
            show_error('Invalid DB Connection String');
        }
        $params = array('dbdriver' => $dns['scheme'], 'hostname' => isset($dns['host']) ? rawurldecode($dns['host']) : '', 'username' => isset($dns['user']) ? rawurldecode($dns['user']) : '', 'password' => isset($dns['pass']) ? rawurldecode($dns['pass']) : '', 'database' => isset($dns['path']) ? rawurldecode(substr($dns['path'], 1)) : '');
        // were additional config items set?
        if (isset($dns['query'])) {
            parse_str($dns['query'], $extra);
            foreach ($extra as $key => $val) {
                // booleans please
                if (strtoupper($val) == "TRUE") {
                    $val = TRUE;
                } elseif (strtoupper($val) == "FALSE") {
                    $val = FALSE;
                }
                $params[$key] = $val;
            }
        }
    }
    // No DB specified yet? Beat them senseless...
    if (!isset($params['dbdriver']) or $params['dbdriver'] == '') {
        show_error('You have not selected a database type to connect to.');
    }
    // Load the DB classes. Note: Since the active record class is optional
    // we need to dynamically create a class that extends proper parent class
    // based on whether we're using the active record class or not.
    // Kudos to Paul for discovering this clever use of eval()
    if ($active_record_override !== NULL) {
        $active_record = $active_record_override;
    }
    require_once BASEPATH . 'database/DB_driver.php';
    if (!isset($active_record) or $active_record == TRUE) {
        require_once BASEPATH . 'database/DB_active_rec.php';
        if (!class_exists('CI_DB')) {
            eval('class CI_DB extends CI_DB_active_record { }');
        }
    } else {
        if (!class_exists('CI_DB')) {
            eval('class CI_DB extends CI_DB_driver { }');
        }
    }
    require_once BASEPATH . 'database/drivers/' . $params['dbdriver'] . '/' . $params['dbdriver'] . '_driver.php';
    // Instantiate the DB adapter
    $driver = 'CI_DB_' . $params['dbdriver'] . '_driver';
    $DB = new $driver($params);
    if ($DB->autoinit == TRUE) {
        $DB->initialize();
    }
    if (isset($params['stricton']) && $params['stricton'] == TRUE) {
        $DB->query('SET SESSION sql_mode="STRICT_ALL_TABLES"');
    }
    return $DB;
}
Example #7
0
 function instruction()
 {
     bug("This should not happen.");
 }
<?php

Tfw::IMPORT(FOL_PHP_CLASSES, "CGmap");
$oGmap = new CGMap("EspaƱa", "Madrid", "Carretera de Villaverde a vallecas 46", "28021", "Villaverde bajo");
bug($oGmap->get_xml_status(), "status");
bug($oGmap->get_latitud(), "Latitud");
bug($oGmap->get_longitud(), "Longitud");
bug($oGmap->get_xml_object_responsed(), "object xml");
Example #9
0
//Configuramos el zoom
$oGoogleMap->set_zoom(7);
//Dibujamos las lineas entre los marcadores (pines)
//$oGoogleMap->draw_lines();
//TamaƱo del mapa
$oGoogleMap->set_size_container(500, 500);
$oGoogleMap->set_size_unit('pt');
$oGoogleMap->draw_routes();
$oGoogleMap->set_route_color("black");
$oGoogleMap->set_marker_color("green");
$oGoogleMap->set_route_width(2);
//No se mostrarƔn numeros en los pines de googlemaps
//$oGoogleMap->set_markers_numbers_off();
//Calcula la distancia entre las chinchetas
$fDistancia = $oGoogleMap->sum_distance();
bug($fDistancia, "DISTANCIA");
//muestra 11.1
//$oGoogleMap->draw_map();
?>

<html>
    <head>
    <title>Goglemaps API 3 Clase PHP</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta charset="UTF-8">
    <script type="text/javascript" src="html_js/js_google/js_google_maps_3.js"></script>
    </head>
<body>
<!--<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=<?php 
echo TFW_GOOGLEAPIKEY;
?>
Example #10
0
<dd>Added version info to handlers which show in phpinfo() output.</dd>
<dd>GDB: Fixed bug with continuing after breakpoint where only 'cont'
worked.</dd>
<dd>GDB: Fixed bug in deleting absolute breakpoints on Windows.</dd>
<dd>Fixed <?php 
bug(27);
?>
: Repeated connect attempts when no debugger is
listening.</dd>
<dd>Fixed <?php 
bug(19);
?>
: The value of xdebug.output_dir in a .htaccess
never takes effect.</dd>
<dd>Fixed <?php 
bug(18);
?>
: Mistyped sizeof()'s for array indexes in profiler
output.</dd>
<dd>Fixed handling stack traces for when display_errors was set to Off.</dd>
<dd>Fixed segfault where a function name didn't exist in case of a
"call_user_function".</dd>
<dd>Fixed reading a filename in case of an callback to a PHP function from an
internal function (like "array_map()").</dd>

<dt>[2003-09-18]</dt>
<dd>Fixed bug with wrong file names for functions called from call_user_*().</dd>

<dt>[2003-08-30]</dt>
<dd>Added the option "dump_superglobals" to the remote debugger. If you set
this option to 0 the "show-local" and similar commands will not return any data
Example #11
0
 public function instruction()
 {
     bug('This should not happen.');
 }
function bugcond($var, $isCheckCondition)
{
    //var_dump($isCheckCondition);
    if ($isCheckCondition) {
        bug($var);
    } else {
        pr("isCheckCondition = FALSE");
    }
}
Example #13
0
<?php

function bug($flag)
{
    $tag = '';
    if ($flag) {
        $tag .= 'x';
    }
    $tag = '33';
    if ($flag) {
    } else {
        var_dump($tag);
    }
}
bug(false);
Example #14
0
 private function read_clobsss($field)
 {
     bug($field->load());
 }
Example #15
0
$imei = "84:85:06:46:f3:c3";
// MAC Address for iOS IMEI for other platform (Android/etc)
$countrycode = "34";
$phonenumber = "ļ»æ626963672";
$wa = new WhatsProt($sender, $imei, $nickname, true);
$url = "https://r.whatsapp.net/v1/exist.php?cc=" . $countrycode . "&in=" . $phonenumber . "&udid=" . $wa->encryptPassword();
bug($url, "url");
$content = file_get_contents($url);
if (stristr($content, 'status="ok"') === false) {
    echo "Wrong Password\n";
    //exit(0);
}
$wa->Connect();
$wa->Login();
//bug($$wa);
bug($_SERVER, "SERVER");
/*
die;
bug($_SERVER,"SERVER");
$countrycode = substr($sender, 0, 2);
$phonenumber=substr($sender, 2);

if ($argc < 2) 
{
    echo "USAGE: ".$_SERVER["argv"][0]." [-l] [-s <phone> <message>] [-i <phone>]\n<br>";
    echo "\tphone: full number including country code, without '+' or '00'\n<br>";
    echo "\t-s: send message\n<br>";
    echo "\t-l: listen for new messages\n<br>";
    echo "\t-i: interactive conversation with <phone>\n<br>";
    exit(1);
}
Example #16
0
 public function get_rev_committer($file, $rev)
 {
     $entry = $this->get_log_entry($this->get_log($file), $rev);
     bug($file, $rev, $entry);
     if (!empty($entry) && preg_match('/author:\\s+(\\w+);/', $entry, $m)) {
         return $m[1];
     }
     return null;
 }
Example #17
0
 static function suitable_delimiter($expression)
 {
     foreach (array('/', '%', '#', '=', '!') as $c) {
         if (strpos($expression, $c) === false) {
             return $c;
         }
     }
     bug("Can't think of a suitable delimiter for expression: {$expression}");
 }
Example #18
0
    $graphs = "nographs";
}
// $routing is populated by cache-data.inc.php
$navbar['brand'] = "Routing";
$navbar['class'] = "navbar-narrow";
foreach ($routing as $type => $value) {
    if ($value['count'] > 0) {
        if (!$vars['protocol']) {
            $vars['protocol'] = $type;
        }
        if ($vars['protocol'] == $type) {
            $navbar['options'][$type]['class'] = "active";
        }
        $navbar['options'][$type]['url'] = generate_url(array('page' => 'routing', 'protocol' => $type));
        $navbar['options'][$type]['text'] = nicecase($type) . ' (' . $value['count'] . ')';
    }
}
print_navbar($navbar);
unset($navbar);
switch ($vars['protocol']) {
    case 'bgp':
    case 'vrf':
    case 'cef':
    case 'ospf':
        include $config['html_dir'] . '/pages/routing/' . $vars['protocol'] . '.inc.php';
        break;
    default:
        bug();
        break;
}
// EOF
//$sStringRecibido = curl($sGmapUrlFinal);
//$oXml = simplexml_load_string($sStringRecibido);
//allow_url_include = On
$oXml = simplexml_load_file($sGmapUrlFinal) or die("url not loading");
$sXmlStatus = $oXml->status;
//bug($oXml);
if (strcmp($sXmlStatus, "OK") == 0) {
    ##Successful geocode
    $geocode_pending = false;
    $fLatitud = $oXml->result->geometry->location->lat;
    //v3
    $fLongitud = $oXml->result->geometry->location->lng;
    //v3
    $ok = 0;
    bug($fLatitud);
    bug($fLongitud);
    if ($fLatitud < 45.18786629495072 && $fLatitud > 24.654534254781115 && $fLongitud > -19.80908203125 && $fLongitud < 4.3828125) {
        $ok = 1;
        //Acota direcciones en EspaƱa y Canarias, revisarlo
    }
    $delay = 250;
} else {
    // failure to geocode
    $geocode_pending = false;
    echo "Address " . $sDireccion . " failed to geocoded. ";
    echo "Received status " . $sXmlStatus . "\n";
}
usleep($delay);
/*
 * ERRORES: 
 *   
Example #20
0
<?php

class X
{
}
function bug()
{
    if (!$GLOBALS['x']) {
        return;
    }
    return new X();
}
var_dump(bug());
Example #21
0
 public function dbh()
 {
     ###  Cache
     if (empty($this->__dbh)) {
         ###  Connect to the tags DB
         $INIT_DB_NOW = false;
         if (strpos($this->db_dsn, 'sqlite') !== false && !empty($this->db_file_path)) {
             if (!file_exists($this->config('db_file_path'))) {
                 $INIT_DB_NOW = true;
             }
             ###  Get an exclusive File_NFSLock on the DB file...
             $this->db_file_lock = new File_NFSLock($this->config('db_file_path'), LOCK_EX, 10, 30 * 60);
             # stale lock timeout after 30 minutes
         }
         if (!empty($this->db_dsn)) {
             $this->__dbh = new PDO($this->config('db_dsn'), $this->config('db_username'), $this->config('db_password'));
             $GLOBALS['orm_dbh'] = $this->__dbh;
             $this->__dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
             ///  HACK : For now, just change the below number to whatever you want to upgrade from
             ///    and run this once,
             $cur_revision = 0.21;
             #				$cur_revision = 0.20;
             ///  Version 0.1.0
             if ($INIT_DB_NOW || $cur_revision < 0.1) {
                 $this->__dbh->exec("CREATE TABLE file_tag (\n                      \t\t\t\t\t   file      character varying(1000) NOT NULL,\n                      \t\t\t\t\t   tag       character varying(25) NOT NULL,\n                      \t\t\t\t\t   revision  int NOT NULL,\n                      \t\t\t\t\t   mass_edit int NOT NULL DEFAULT 0,\n                      \t\t\t\t\t   CONSTRAINT file_tag_pk PRIMARY KEY ( file, tag )\n                      \t\t\t\t\t )\n                      \t\t\t\t\t");
             }
             ///  UPGRADE from Version 0.1.0 to 0.1.1
             if ($cur_revision == 0.1) {
                 $this->__dbh->exec("ALTER TABLE file_tag ADD COLUMN\n\t\t\t\t\t                                mass_edit int NOT NULL DEFAULT 0");
             }
             ///  Version 0.1.5
             if ($INIT_DB_NOW || $cur_revision < 0.15) {
                 $this->__dbh->exec("CREATE TABLE revision_cache (\n\t\t\t\t\t\t\t\t\t\t  file         character varying(900) NOT NULL PRIMARY KEY,\n\t\t\t\t\t\t\t\t\t\t  expire_token character varying(50)  NOT NULL,\n\t\t\t\t\t\t\t\t\t\t  revisions    text \t\t \t\t  NOT NULL,\n\t\t\t\t\t\t\t\t\t\t  committers   text \t\t \t\t  NOT NULL\n\t\t\t\t\t\t\t\t\t\t)");
                 $this->__dbh->exec("CREATE INDEX expire_token_idx ON revision_cache(expire_token)");
             }
             ///  Version 0.2.1
             if ($INIT_DB_NOW || $cur_revision < 0.21) {
                 $this->__dbh->exec("CREATE TABLE roll_point (\n\t\t\t\t\t\t\t\t\t\t  rlpt_id      INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\t\t\t\t\t\t  creation_date INTEGER               NOT NULL DEFAULT (strftime('%s','now')),\n\t\t\t\t\t\t\t\t\t\t  point_type   character(5)           NOT NULL,\n                                          created_by NOT NULL\n\t\t\t\t\t\t\t\t\t\t)");
                 $this->__dbh->exec("CREATE INDEX point_type_idx ON roll_point(point_type)");
                 $this->__dbh->exec("CREATE TABLE rlpt_file (\n\t\t\t\t\t\t\t\t\t\t  rlpf_id      INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\t\t\t\t\t\t  rlpt_id      INTEGER                NOT NULL,\n\t\t\t\t\t\t\t\t\t\t  file         character varying(900) NOT NULL,\n\t\t\t\t\t\t\t\t\t\t  revision     character varying(32)      NULL,\n                                          CONSTRAINT rp_file_uk UNIQUE(rlpt_id,file)\n\t\t\t\t\t\t\t\t\t\t)");
                 $this->__dbh->exec("CREATE INDEX file_idx ON rlpt_file(file)");
                 $this->__dbh->exec("CREATE TABLE rlpt_project (\n\t\t\t\t\t\t\t\t\t\t  rlpp_id      INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\t\t\t\t\t\t  rlpt_id      INTEGER                NOT NULL,\n\t\t\t\t\t\t\t\t\t\t  project      character varying(200) NOT NULL,\n                                          CONSTRAINT rp_file_uk UNIQUE(rlpt_id,project)\n\t\t\t\t\t\t\t\t\t\t)");
                 $this->__dbh->exec("CREATE INDEX project_idx ON rlpt_project(project)");
                 $this->__dbh->exec("CREATE TABLE rlpt_roll (\n\t\t\t\t\t\t\t\t\t\t  rlpr_id       INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\t\t\t\t\t\t  rlpt_id       INTEGER               NOT NULL,\n\t\t\t\t\t\t\t\t\t\t  creation_date INTEGER               NOT NULL DEFAULT (strftime('%s','now')),\n                                          created_by                          NOT NULL,\n                                          cmd           text                      NULL,\n                                          cmd_output    text                      NULL,\n\t\t\t\t\t\t\t\t\t\t  rollback_rlpt_id INTEGER                NULL\n\t\t\t\t\t\t\t\t\t\t)");
                 $this->__dbh->exec("CREATE INDEX roll_point_idx ON rlpt_roll(rlpt_id)");
             }
             ///  Debugging for the Database
             $this_debug = 0;
             if ($this_debug) {
                 ///  Show DB Tables:
                 $sth = $this->__dbh->query("SELECT * FROM sqlite_master WHERE type='table'");
                 bug($sth->fetchAll(PDO::FETCH_ASSOC));
                 $sth = $this->__dbh->query("SELECT * FROM rlpt_roll");
                 bug($sth->fetchAll(PDO::FETCH_ASSOC));
             }
         }
     }
     return $this->__dbh;
 }
Example #22
0
        if (has_dir($sPathDir, $arNotToCountOn, $sDS)) {
            //bug($sPathDir,"has folders");
            $arSubDir = get_folders($sPathDir, $arNotToCountOn, $sDS);
            //bug($arSubDir,"subdir");
            foreach ($arSubDir as $sFolderName) {
                $sPath = $sPathDir . $sDS . $sFolderName;
                //$arTree[] = dir_tree($sPath);
                foreach (dir_tree($sPath, $arNotToCountOn, $sDS) as $sPaths) {
                    $arTree[] = $sPaths;
                }
            }
        }
    }
    return $arTree;
}
function load_recursive_include_path($sPathDir, $arNotToCountOn = array(), $sDS = "/")
{
    //bug($arNotToCountOn);die;
    $arDirPaths = dir_tree($sPathDir, $arNotToCountOn, $sDS);
    $sDirPaths = implode(PATH_SEPARATOR, $arDirPaths);
    if (!empty($sDirPaths)) {
        $sDirPaths = get_include_path() . PATH_SEPARATOR . $sDirPaths;
        set_include_path($sDirPaths);
    }
}
//bug($_SERVER["DOCUMENT_ROOT"]);
//bug(dir_tree($sProjectDir));
load_recursive_include_path($sProjectDir, array(".svn"));
bug(get_include_path());
bug(explode(PATH_SEPARATOR, get_include_path()));
include "ajax.php";
    $arTrazado = $oBD->query($sSQL);
    /*
        $arMarcadores[]=array(
        "title"=>"uno ","content"=>"<b>Content 1</b><input type=\"text\" value=\"marcador uno\">",
        "latitude"=>"40.5475437","longitude"=>"-3.6420912"
        );*/
    //bug($arTrazado);
    $arMarkersAndStops = get_markers_and_stops($arTrazado, $i);
    //bug($arMarkersAndStops); die;
    $arRuta[$idRevision]["dots"] = $arMarkersAndStops["markers"];
    $arRuta[$idRevision]["stops"] = $arMarkersAndStops["stops"];
    $arRuta[$idRevision]["pincolor"] = $arColores[$i];
    $arRuta[$idRevision]["tracecolor"] = $arColores[$i];
    //bug($arRuta);
}
bug($arRuta);
$oGoogleMap = new HelperGoogleMaps3($arRuta);
//$oGoogleMap->draw_lines();
//$oGoogleMap->show_js_array_routes();
?>
<html>
    <head>
    <title>Goglemaps API 3 Clase PHP</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta charset="UTF-8">
    
    <script type="text/javascript" src="html_js/js_jquery/js_jquery_v1.7.1.js"></script>
    <script type="text/javascript" src="html_js/js_google/js_google_maps_3.js"></script>
    </head>
<body>
<!--<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=<?php 
Example #24
0
 public function diff_dir_from_tag($tag, $dir = '')
 {
     $report = array('files_no_tag' => 0, 'files_behind_tag' => 0, 'files_ahead_of_tag' => 0, 'files_on_tag' => 0, 'files_unknown' => 0);
     $status = $this->get_dir_status($dir);
     foreach (preg_split('/\\n/', $status) as $line) {
         if (preg_match('/^\\s*[A-Z\\?]?\\s*\\d+\\s+(\\d+)\\s+\\S+\\s+(\\S.*)$/', $line, $m)) {
             $cur_rev = $m[1];
             $file = rtrim($m[2], "\n\r");
             ###  Skip dirs in SVN (for now)...
             if (is_dir($this->stage->env()->repo_base . '/' . $file)) {
                 continue;
             }
             ###  See what the tag is...
             $sth = dbh_query_bind("SELECT revision FROM file_tag WHERE file = ? AND tag = ?", $file, $tag);
             $tag_rev = $sth->fetch(PDO::FETCH_NUM);
             $sth->closeCursor();
             ###  Mark the group
             if (empty($tag_rev)) {
                 $report['files_no_tag']++;
                 continue;
             } else {
                 $tag_rev = $tag_rev[0];
             }
             if ($cur_rev < $tag_rev) {
                 $report['files_behind_tag']++;
             } else {
                 if ($cur_rev > $tag_rev) {
                     $report['files_ahead_of_tag']++;
                 } else {
                     if ($cur_rev = $tag_rev) {
                         $report['files_on_tag']++;
                     }
                 }
             }
         } else {
             if (preg_match('/^\\s*[\\?]?\\s+(\\S.*)$/', $line, $m)) {
                 $report['files_unknown']++;
             } else {
                 if (!empty($line)) {
                     bug("SVN status line didn't match to extract rev for tag diff! (/^\\s*[A-Z\\?]?\\s*\\d+\\s+(\\d+)\\s+\\S+\\s+(\\S.*)\$/ nor /^\\s*[\\?]?\\s+(\\S.*)\$/)", $status, $line);
                 }
             }
         }
     }
     return $report;
 }
Example #25
0
 /**
  * dbh_do_bind() - Execute a (possibly write access) SQL query with bound parameters
  *
  * @param string $sql      The SQL query to run
  * @param mixed $params   this can either be called passing an array of bind params, or just by passing the bind params as args after the SQL arg
  * @return PDOStatement
  */
 function dbh_do_bind($sql)
 {
     $use_dbh = $this->dbh();
     if (ORM_SQL_PROFILE) {
         START_TIMER('dbh_do_bind');
     }
     $bind_params = array_slice(func_get_args(), 1);
     ###  Allow params passed in an array or as args
     if (is_a($bind_params[count($bind_params) - 1], 'PDO') || is_a($bind_params[count($bind_params) - 1], 'PhoneyPDO')) {
         $use_dbh = array_pop($bind_params);
     }
     if (count($bind_params) == 1 && is_array(array_shift(array_values($bind_params)))) {
         $bind_params = array_shift(array_values($bind_params));
     }
     $this->reverse_t_bools($bind_params);
     if (ORM_SQL_DEBUG || ORM_SQL_WRITE_DEBUG) {
         bug($sql, $bind_params);
     }
     $GLOBALS['ORM_SQL_LOG'][] = array(microtime(true), $sql, $bind_params);
     try {
         $sth = $use_dbh->prepare($sql);
         $rv = $sth->execute($bind_params);
     } catch (PDOException $e) {
         trace_dump();
         $err_msg = 'There was an error running a SQL statement, [' . $sql . '] with (' . join(',', $bind_params) . '): ' . $e->getMessage() . ' in ' . trace_blame_line();
         if (strlen($err_msg) > 1024) {
             bug($err_msg, $sql, $bind_params, $e->getMessage());
             $sql = substr($sql, 0, 1020 + strlen($sql) - strlen($err_msg)) . '...';
         }
         trigger_error('There was an error running a SQL statement, [' . $sql . '] with (' . join(',', $bind_params) . '): ' . $e->getMessage() . ' in ' . trace_blame_line(), E_USER_ERROR);
         return false;
     }
     if (ORM_SQL_PROFILE) {
         END_TIMER('dbh_do_bind');
     }
     return $rv;
 }
Example #26
0
<?php

$sTrozoRequest = "acceso_prohibido";
$sTrozoRouter = "acceso";
$sTrozoRequest = "0805";
$sTrozoRouter = "[0-9]{3,4}";
//http://www.elcodigo.net/cgi-bin/DBread.cgi?tabla=scripts&campo=0&clave=89
//preg_match("/[\d]{4}/", $_valor)
$sPatronRouter = WS . $sTrozoRouter . WS;
bug($sTrozoRequest, "string a comprobar");
bug($sPatronRouter, "patron a cumplir");
//$bCoinciden = preg_match_all($sPatronRouter, $sTrozoRequest, $arCoincidencias);
$bCoinciden = preg_match($sPatronRouter, $sTrozoRequest, $arCoincidencias);
//$bCoinciden = preg_split($sPatronRouter, $sTrozoRequest);
bug($bCoinciden, "coincide?");
bug($arCoincidencias, "array coincidencias");
<?php

$sLoquesehace = "\$name = \"nombre_de_una_variable\"<br>";
$sLoquesehace .= "\$\$name = \"contenido para var: nombre_de_una_variable\"";
$name = "nombre_de_una_variable";
//$$name = "contenido para var: nombre_de_una_variable";
$loque = ${$name};
bug($sLoquesehace, " asignacion:");
bug($nombre_de_una_variable, "nombre_de_una_variable");
bug($name, "\$name");
bug(${$name}, "\$\$name");
bug($loque, "\$loque");
bug("{$name}{${$name}}", "\$name{\$\$name}");
Example #28
0
<?php

//$oBD = CBaseDatos::get_instancia(null,null,null,null,"mysql");
/**
* @var CBaseDatos 
*/
$oBD = CBaseDatos::get_instancia();
$isConnected = $oBD->conectar();
//bug($isConnected);
//bug($oBD);
$sSQL = "SELECT * FROM blog_usuario";
$arTabla = $oBD->query($sSQL);
bug($arTabla);
$sSQL = "INSERT INTO blog_usuario (id_creador)\n         VALUES (2)";
$oBD->execute($sSQL);
$sSQL = "DELETE FROM blog_usuario WHERE id_creador=2";
$oBD->execute($sSQL);
bug($oBD->get_mensaje());
Example #29
0
function bugif()
{
    bug(get_included_files(), "included_files");
}
Example #30
0
<?php

$oLogs = new ComponentFile();
$sLogsPath = TFW_PATH_APPROOTDS . "logs";
/*
bug($sLogsPath);
bug(is_dir($sLogsPath));
$oLogs->set_path_folder_source($sLogsPath);
$oLogs->set_filename_source("milog.txt");
$oLogs->create();
bug($oLogs);
bug($oLogs->get_message(),"message");
$oLogs->add_content("Esto es una linea a guardar en el archivo");
$oLogs->add_content("Esto es otra linea se crea en una nueva?");
bug($oLogs->get_message());

$oLogs->set_filename_target("cambiado.txt");
$oLogs->rename();
//$oLogs->set_path_folder_target($sLogsPath.DS."start");
//$oLogs->copy();
* 
*/
$oLogs = new ComponentLogs($sLogsPath);
$oLogs->sql_read("user000899_20120501.txt", "01:00:04", "SELECT * FROM core_users");
bug($oLogs->get_message());