Exemplo n.º 1
0
 public function testComputeKeyUnnormalized()
 {
     $directory = str_replace('\\', '/', __DIR__) . '/filesystem/../filesystem';
     $adapter = new Local($directory);
     $this->assertEquals('foobar', $adapter->computeKey($directory . '/foobar'));
     $this->assertEquals('foo/bar', $adapter->computeKey($directory . '/foo/bar'));
 }
Exemplo n.º 2
0
 public function actionVerLocalesCliente()
 {
     $model = new Local('search');
     $model->unsetAttributes();
     $dataProvider = $model->cargarLocalesCliente();
     $this->render('verLocalesCliente', array('dataProvider' => $dataProvider, 'model' => $model));
 }
Exemplo n.º 3
0
 public static function __construct2($nombre, $direccion)
 {
     $local = new Local();
     $local->setNombre_Local($nombre);
     $local->setDireccion_Local($direccion);
     return $local;
 }
Exemplo n.º 4
0
 public function testLocalClockShowLocalTime()
 {
     $now = new \DateTime();
     $today = $now->setTime(0, 0, 0);
     $clock = new Local();
     $this->assertEquals($today, $clock->today());
 }
Exemplo n.º 5
0
 public function eliminarLocal()
 {
     $sm = $_POST['EliminarSM'];
     $local = new Local();
     $local->delete_Local($sm);
     $this->load->view('administrarLocal.html');
     $local->to_table($local->listar_Tabla());
 }
Exemplo n.º 6
0
 public function actionAdmin()
 {
     $model = new Local('search');
     $model->unsetAttributes();
     if (isset($_GET['Local'])) {
         $model->setAttributes($_GET['Local']);
     }
     $this->render('admin', array('model' => $model));
 }
Exemplo n.º 7
0
 /**
  * Get a available updater instance, or returns NULL is none available.
  *
  * @return \Crossjoin\Browscap\Updater\AbstractUpdater
  */
 public static function getInstance()
 {
     if (function_exists('curl_init')) {
         return new Curl();
     } elseif ((bool) (int) ini_get('allow_url_fopen') !== false) {
         return new FileGetContents();
     } elseif (($browscapFile = (string) ini_get('browscap')) !== "") {
         $updater = new Local();
         $updater->setOption('LocalFile', $browscapFile);
         return $updater;
     }
     return new None();
 }
Exemplo n.º 8
0
 public static function single()
 {
     if (empty(self::$_obj)) {
         self::$_obj = new Local();
     }
     return self::$_obj;
 }
Exemplo n.º 9
0
 /**
  * 获取数据类库对象
  *
  * @return Mysql
  */
 private static function getLink()
 {
     if (self::$link instanceof Mysql == false) {
         self::$link = new Mysql('127.0.0.1', 3306, 'zhaoyan', 123123, 'test', 'utf8mb4');
     }
     return self::$link;
 }
 public function cadastrar($token, $idTo, $mensagem, $latitude, $longitude)
 {
     $msg = new Mensagem();
     $local = new Local();
     $local->setLatitude($latitude);
     $local->setLongitude($longitude);
     $msg->setIdTo($idTo);
     $msg->setToken($token);
     $msg->setMensagem($mensagem);
     $id = $this->daoLoc->cadastrar($local);
     if ($id == false) {
         return false;
     }
     $msg->setIdLoc($id);
     $valor = 0;
     return $this->daoMsg->cadastrar($msg, $valor);
 }
Exemplo n.º 11
0
 public function buscarUsuarioToken(Local $local)
 {
     try {
         $sql = "SELECT x(localizacao.coordenadas) AS latitude, y(localizacao.coordenadas) AS longitude FROM localizacao where id = ?";
         $a = $this->conexao->prepare($sql);
         $a->bindParam(1, $local->getId());
         if (!$a->execute()) {
             return false;
         }
         $arrayalunos = array();
         while ($aluno = $a->fetchObject()) {
             array_push($arrayalunos, $aluno);
         }
         return $arrayalunos;
     } catch (Exception $e) {
         return false;
     }
 }
Exemplo n.º 12
0
 public function cargarLocalesCliente()
 {
     $id_user = $this->cargarUser();
     $criteria = new CDbCriteria(array('condition' => 'user_id =:user_id', 'order' => 'id DESC', 'limit' => 500, 'params' => array(':user_id' => $id_user)));
     $model = Local::model()->findAll($criteria);
     $dataProvider = new CActiveDataProvider('Local', array('criteria' => $criteria));
     #$dataProvider->setPagination(false);
     return $dataProvider;
 }
Exemplo n.º 13
0
 /**
  * Construct a Home storage instance
  * @param array $arguments array with "user" containing the
  * storage owner and "legacy" containing "true" if the storage is
  * a legacy storage with "local::" URL instead of the new "home::" one.
  */
 public function __construct($arguments)
 {
     $this->user = $arguments['user'];
     $datadir = $this->user->getHome();
     if (isset($arguments['legacy']) && $arguments['legacy']) {
         // legacy home id (<= 5.0.12)
         $this->id = 'local::' . $datadir . '/';
     } else {
         $this->id = 'home::' . $this->user->getUID();
     }
     parent::__construct(array('datadir' => $datadir));
 }
Exemplo n.º 14
0
 /**
  * @covers mychaelstyle\storage\providers\Local::remove
  * @covers mychaelstyle\storage\providers\Local::removeDir
  * @covers mychaelstyle\storage\providers\Local::getRealPath
  * @expectedException mychaelstyle\Exception
  */
 public function testRemoveExceptionPermissionRecursive()
 {
     clearstatcache();
     $putUri = '/t2dir/child/put.txt';
     $expectedPath = DIR_WORK . $putUri;
     $this->connect();
     $this->object->put($this->org_example, $putUri);
     $this->assertTrue(file_exists($expectedPath));
     $tcd = dirname($expectedPath);
     $td = dirname($tcd);
     $tcd2 = $td . '/test';
     mkdir($tcd2, 00);
     chmod($tcd2, 00);
     $this->object->remove('/t2dir', true);
     $this->assertFalse(is_dir($td));
 }
Exemplo n.º 15
0
 /**
  * Set up the file
  */
 private static function setup()
 {
     if (self::$fd === NULL) {
         self::$fd = fopen(Local::getinstance()->makebasepath('debug', 'debug.txt'), 'a');
     }
 }
Exemplo n.º 16
0
<?php

$this->breadcrumbs = array('Ver Local' => array('local/verLocalCliente', 'id' => $id_local), Yii::t('app', 'Manage'));
Yii::app()->clientScript->registerScript('search', "\r\n\$('.search-button').click(function(){\r\n\t\$('.search-form').toggle();\r\n\treturn false;\r\n});\r\n\$('.search-form form').submit(function(){\r\n\t\$.fn.yiiGridView.update('recarga-grid', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n");
?>
<pre>
  <?php 
$publicidad = Publicidad::model()->random()->find();
echo $publicidad->mensaje;
?>
</pre>

<h1><?php 
echo Yii::t('app', 'Historial de Recargas');
?>
</h1>


<?php 
/*echo GxHtml::link(Yii::t('app', 'Busqueda Avanzada'), '#', array('class' => 'search-button')); ?>
<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); */
?>
</div><!-- search-form -->

<?php 
$this->widget('bootstrap.widgets.TbExtendedGridView', array('id' => 'recarga-grid', 'dataProvider' => new CArrayDataProvider($model, array('pagination' => array('pageSize' => 50))), 'type' => 'striped bordered condensed', 'template' => "{extendedSummary}\n{items}{pager}", 'columns' => array(array('name' => 'user_id', 'value' => 'GxHtml::valueEx($data->user)', 'filter' => GxHtml::listDataEx(User::model()->findAllAttributes(null, true))), array('name' => 'local_id', 'value' => 'GxHtml::valueEx($data->local)', 'filter' => GxHtml::listDataEx(Local::model()->findAllAttributes(null, true))), 'celular', 'fecha', 'compania', 'monto', 'comentario', 'estado'), 'extendedSummary' => array('title' => 'TOTAL RECARGAS', 'columns' => array('monto' => array('label' => '$', 'class' => 'TbSumOperation'))), 'extendedSummaryOptions' => array('class' => 'well pull-right')));
Exemplo n.º 17
0
<?php

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Controle de jogadores e fichas de poker, na modalidade cash game. */
/*              Desenvolvido por: Reinaldo Silveira                  */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
include_once "../header.php";
require "../verifica.php";
include_once "../../model/class.local.php";
include_once "../../controller/class.local.php";
$local = new Local();
$acao = isset($_GET["acao"]) ? $_GET["acao"] : "";
$codigo = isset($_GET["id"]) ? $_GET["id"] : 0;
if ($codigo > 0) {
    if (!$local->buscar($codigo)) {
        echo "<script>\n                    alert('Registro não encontrado!');\n                    window.location = 'listagem.php';\n                  </script>";
        exit;
    }
}
if ($acao == "excluir" && $codigo > 0) {
    if ($local->excluir($codigo)) {
        echo "<script>window.location = 'listagem.php';</script>";
    } else {
        echo "<script>\n                    alert('Erro ao excluir o cadastro. Verifique as dependências e tente novamente.');\n                    window.location = 'listagem.php';\n                  </script>";
    }
}
if ($_POST) {
    if ($codigo == 0) {
        if ($local->incluir()) {
            echo "<script>window.location = 'listagem.php';</script>";
        } else {
Exemplo n.º 18
0
    $e_local = $local;
    $res = $local->create($user);
    if ($res == 0) {
        Header("Location: " . DOL_URL_ROOT . "/immobilier/local.php");
    } else {
        if ($res == -3) {
            $_error = 1;
            $action = "create";
        }
        if ($res == -4) {
            $_error = 2;
            $action = "create";
        }
    }
} elseif (GETPOST("action") == 'maj') {
    $local = new Local($db, GETPOST('id'));
    $local->nom = GETPOST("nom");
    $local->adresse = GETPOST("adresse");
    $local->commentaire = GETPOST("commentaire");
    $local->statut = GETPOST("statut");
    $local->immeuble_id = GETPOST("immeuble_id");
    $e_local = $local;
    $res = $local->update();
    header("Location: " . DOL_URL_ROOT . "/immobilier/local/fiche_local.php?id=" . $local->id);
    if ($res >= 0) {
        setEventMessage($langs->trans("SocialContributionAdded"), 'mesgs');
    } else {
        dol_print_error($db);
    }
}
/*
Exemplo n.º 19
0
        </section>

        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-lg-12">
              <!-- Horizontal Form -->
              <div class="box box-success">
                <div class="box-header with-border">
                  <h3 class="box-title">Cadastro de locais</h3>
                </div><!-- /.box-header -->
                <!-- form start -->
                <?php 
$id = $_POST["id"];
if (isset($_POST["editar"])) {
    $edit = new Local();
    $comp = $edit->editar($id);
    if ($edit != null) {
        ?>
                <form class="form-horizontal" id="form" method="post" action="CrudLocal.php">
                  <div class="box-body">
                      <div class="form-group">
                        <label for="local" class="col-sm-2 control-label">Local:</label>
                        <div class="col-sm-10">
                          <input type="text" class="form-control" name="sala" id='local' $ placeholder="Digite a sala aqui" autofocus required>
                        </div>
                      </div>
                  </div><!-- /.box-body -->
                  <div class="box-footer">
                    <input type="hidden" name="id" value="<?php 
        echo $comp->id;
Exemplo n.º 20
0
		<?php 
echo $form->labelEx($model, 'user_id');
?>
		<?php 
echo $form->dropDownList($model, 'user_id', GxHtml::listDataEx(User::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'user_id');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'local_id');
?>
		<?php 
echo $form->dropDownList($model, 'local_id', GxHtml::listDataEx(Local::model()->findAllAttributes(null, true)));
?>
		<?php 
echo $form->error($model, 'local_id');
?>
		</div><!-- row -->
		<div class="row">
		<?php 
echo $form->labelEx($model, 'celular');
?>
		<?php 
echo $form->textField($model, 'celular', array('maxlength' => 45));
?>
		<?php 
echo $form->error($model, 'celular');
?>
Exemplo n.º 21
0
<?php

require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'Db' . DIRECTORY_SEPARATOR . 'Local.php';
// 红包ID
$bonus_id = isset($_POST['bonus_id']) ? $_POST['bonus_id'] : 0;
// 用户ID
$uid = isset($_POST['uid']) ? $_POST['uid'] : 0;
try {
    Local::beginTransaction();
    $userBonus = Local::fetchOne('SELECT * FROM `user_bonus` WHERE user_id=:user_id AND bonus_id=:bonus_id LIMIT 1', [':user_id' => $uid, ':bonus_id' => $bonus_id]);
    if (isset($userBonus['id']) == false || $userBonus['status'] == 1) {
        throw new Exception('红包已经使用或者不存在.', 100);
    }
    // 插入订单表
    Local::exec('INSERT INTO orders(uid,bonus_id) VALUES ("' . $uid . '","' . $bonus_id . '")');
    // 更新红包的使用状态
    if (Local::exec('UPDATE user_bonus SET status = 1, version=version+1 WHERE id=:id AND version=:version', [':id' => $userBonus['id'], ':version' => $userBonus['version']]) == false) {
        throw new Exception('系统异常,请重试.', 200);
    }
    Local::commit();
    echo '{"code":"0","message":"订单生成成功"}';
} catch (Exception $e) {
    Local::rollBack();
    echo '{"code":"' . $e->getCode() . '","message":"' . $e->getMessage() . '"}';
}
Exemplo n.º 22
0
<?php

define('NET_CLIENT_PATH', __DIR__);
require __DIR__ . '/libs/local.php';
include_once NET_CLIENT_PATH . '/libs/loader.php';
if (!empty($argv) && !empty($argv[1])) {
    $action = $argv[1];
} else {
    // TODO: Убрать
    $action = filter_input(INPUT_GET, 'a');
}
if (!$action) {
    return false;
}
// TODO: Переделать в демона.
$local = new Local();
$conn_data = $local->get_connection_data();
$loader = new Loader($local);
$loader->load_api($conn_data['key'], $conn_data['domain']);
$return = $loader->action($action);
if (!empty($return['log'])) {
    echo 'Action: ' . $action . '(' . date('y-m-d H:i') . ')' . "\n";
    echo json_encode($return['log']) . "\n";
}
Exemplo n.º 23
0
<?php

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Controle de jogadores e fichas de poker, na modalidade cash game. */
/*              Desenvolvido por: Reinaldo Silveira                  */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
include_once "../header.php";
require "../verifica.php";
include_once "../../model/class.local.php";
include_once "../../controller/class.local.php";
$local = new Local();
$locais = $local->listar();
$cont = 0;
?>

  <script type="text/javascript" src="../js/jquery.dataTables.min.js"></script>
  <script type="text/javascript" src="../js/jquery-DT-pagination.js"></script>
  
  <script type="text/javascript">
  /* Table initialisation */
  $(document).ready(function() {
    $('#listagem').dataTable( {
        "bSort": true,          //sorting
        "iDisplayLength": 10,   //records per page
        "sDom": "t<'row'<'col-md-6'i><'col-md-6'p>>",
        "sPaginationType": "bootstrap"
      });
    });
  </script>
  
  <style>
Exemplo n.º 24
0
	/**
	 * @param \OCP\Files\Storage $sourceStorage
	 * @param string $sourceInternalPath
	 * @param string $targetInternalPath
	 * @return bool
	 */
	public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
		if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) {
			/**
			 * @var \OC\Files\Storage\Local $sourceStorage
			 */
			$rootStorage = new Local(['datadir' => '/']);
			return $rootStorage->rename($sourceStorage->getSourcePath($sourceInternalPath), $this->getSourcePath($targetInternalPath));
		} else {
			return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
		}
	}
Exemplo n.º 25
0
include_once "../header.php";
require "../verifica.php";
include_once "../../model/class.jogos.php";
include_once "../../controller/class.jogos.php";
include_once "../../model/class.local.php";
include_once "../../controller/class.local.php";
include_once "../../model/class.tickets.php";
include_once "../../controller/class.tickets.php";
include_once "../../model/class.jogador.php";
include_once "../../controller/class.jogador.php";
include_once "../../model/class.caixa.php";
include_once "../../controller/class.caixa.php";
$ticket_id = isset($_GET["id"]) ? $_GET["id"] : 0;
$jogo_id = isset($_GET["jogo"]) ? $_GET["jogo"] : 0;
$jogo = new Jogo();
$local = new Local();
$jogador = new Jogador();
$ticket = new Ticket();
$caixa = new Caixa();
if ($jogo_id == 0 || !$jogo->buscar($jogo_id)) {
    echo "<script>\n                alert('Registro não encontrado!');\n                window.location = 'listagem.php';\n              </script>";
    exit;
}
if ($ticket_id == 0 || !$ticket->buscar($ticket_id)) {
    echo "<script>\n                alert('Registro não encontrado!');\n                window.location = 'cadastro.php?id={$jogo_id}';\n              </script>";
    exit;
}
if ($ticket->getJogoId() != $jogo_id) {
    echo "<script>\n                alert('Registro não encontrado!');\n                window.location = 'listagem.php';\n              </script>";
    exit;
}
Exemplo n.º 26
0
<?php

$local = new Local();
if (isset($_GET['local_id'])) {
    $local->getLocal($_GET['local_id'], 10);
} else {
    $local->getLocalAll(90, false);
}
Exemplo n.º 27
0
 public function __destruct()
 {
     parent::__destruct();
     $this->cleanUp();
 }
Exemplo n.º 28
0
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
    $page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) {
    $sortorder = "ASC";
}
if (!$sortfield) {
    $sortfield = "name";
}
$object = new Local($db);
$object->fetch($id);
$upload_dir = $conf->immobilier->dir_output . '/local/' . dol_sanitizeFileName($object->id);
$modulepart = 'immobilier';
/*
 * Actions
 */
if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) {
    dol_add_file_process($upload_dir, 0, 1, 'userfile');
}
if ($action == 'delete') {
    $file = $upload_dir . '/' . GETPOST("urlfile");
    // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
    $ret = dol_delete_file($file);
    if ($ret) {
        setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
Exemplo n.º 29
0
         if (!$r->optionnel) {
             if ($conformes) {
                 echo "<div class=\"error\">\n";
             }
             echo "<p>Le fichier « {$r->nom} » manque.</p>\n";
             $conformes = FALSE;
         }
     }
 }
 // Vérification des adresses e-mail
 for ($i = 1; $i <= 3; $i++) {
     if (isset($_POST["email" . $i]) && trim($_POST["email" . $i]) != "") {
         $email = trim($_POST["email" . $i]);
         $teststr = "E-mail " . htmlspecialchars($email);
         $infos = array();
         if (Local::is_valid_email($_SESSION["login"], $email, $infos)) {
             echo "<!-- {$teststr} OK (";
             foreach ($infos as $k => $v) {
                 echo htmlspecialchars($k) . ": " . htmlspecialchars($v) . ", ";
             }
             echo ") -->\n";
             $email_check[$i] = "ok";
         } else {
             if ($conformes) {
                 echo "<div class=\"error\">\n";
             }
             echo "<p>{$teststr} invalide !</p>";
             $conformes = FALSE;
             $email_check[$i] = "nok";
         }
     }
Exemplo n.º 30
0
		<div class="row">
		<?php echo $form->labelEx($model,'fono'); ?>
		<?php echo $form->textField($model, 'fono', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'fono'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'mail'); ?>
		<?php echo $form->textField($model, 'mail', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'mail'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model, 'username', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'username'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model, 'password', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'password'); ?>
		</div><!-- row -->

		<label><?php echo GxHtml::encode($model->getRelationLabel('locals')); ?></label>
		<?php echo $form->checkBoxList($model, 'locals', GxHtml::encodeEx(GxHtml::listDataEx(Local::model()->findAllAttributes(null, true)), false, true)); ?>
		<label><?php echo GxHtml::encode($model->getRelationLabel('userPlans')); ?></label>
		<?php echo $form->checkBoxList($model, 'userPlans', GxHtml::encodeEx(GxHtml::listDataEx(UserPlan::model()->findAllAttributes(null, true)), false, true)); ?>

<?php
echo GxHtml::submitButton(Yii::t('app', 'Save'));
$this->endWidget();
?>
</div><!-- form -->