function proveedores() { $producto = $_POST["producto"]; $empresa = $_POST["empresa"]; $ID = $_POST["ID"]; base($producto, $empresa, $ID); }
function inventario() { $serial = $_POST["Txtserial"]; $nombre = $_POST["Txtnombre"]; $valor = $_POST["Txtvalor"]; $cantidad = $_POST["Txtcantidad"]; $proveedor = $_POST["Txtproveedor"]; base($serial, $nombre, $valor, $cantidad, $proveedor); }
function cliente() { $documento = $_POST["txtDocumento"]; $nombre = $_POST["txtNombre"]; $apellido = $_POST["txtApellido"]; $correo = $_POST["txtCorreo"]; $telefono = $_POST["txtTelefono"]; base($documento, $nombre, $apellido, $correo, $telefono); }
/** * Sets the component. * * @param \Interop\Container\ContainerInterface $container * @return void */ public function set(ContainerInterface &$container) { // Loads the environment variables from an .env file. (new Dotenv(base()))->load(); // Sets the default timezone date_default_timezone_set(env('timezone', 'Asia/Manila')); // Start the session session_start(); }
function recolectar() { $documento = $_POST['documento']; $fecha = $_POST['fecha']; $serial = $_POST['serial']; $producto = $_POST['nombre']; $cantidad = $_POST['cantidad']; $precio = $_POST['precio']; base($fecha, $documento, $serial, $cantidad, $precio, $producto); }
function deconnexion() { global $page; $page['gabarit'] = "base"; $page['vue'] = "connexion.vue.php"; if (isset($_SESSION['id_user'])) { session_unset(); session_destroy(); } base(); }
function inventario() { $id = $_POST["txtId"]; $docu = $_POST["txtDocu"]; $serial = $_POST["txtSerial"]; $cant = $_POST["txtCant"]; $precio = $_POST["txtPre"]; $nombre = $_POST["txtNom"]; $fecha = $_POST["txtFecha"]; base($id, $docu, $serial, $cant, $precio, $nombre, $fecha); }
/** * Gets the configuration from the specified file. * * @param string $key * @param string $defaultValue * @return mixed */ function config($key = null, $defaultValue = null) { $arrayKeys = explode('.', $key); $filePath = base('app/config/' . $arrayKeys[0] . '.php'); if (!file_exists($filePath)) { throw new InvalidArgumentException('File not found.'); } $value = (require $filePath); for ($i = 1; $i < count($arrayKeys); $i++) { $value =& $value[$arrayKeys[$i]]; } return empty($value) ? $defaultValue : $value; }
/** * Sets the component. * * @param \Interop\Container\ContainerInterface $container * @return void */ public function set(ContainerInterface &$container) { $entityManager = $container->get('Doctrine\\ORM\\EntityManager'); $path = base('src/Repositories/'); $files = glob($path . '*Repository.php'); foreach ($files as $item) { $entity = str_replace([$path, 'Repository.php'], ['', ''], $item); $model = 'App\\Models\\' . $entity; $name = 'App\\Repositories\\' . $entity . 'Repository'; $metadata = $entityManager->getClassMetadata($model); if ($container instanceof Container) { $container->add($name, new $name($entityManager, $metadata)); } } }
/** * Renders a view from a template. * * @param string $template * @param array $data * @return string */ function view($template, $data = []) { $loader = new Twig_Loader_Filesystem(base('app/views')); $twig = new Twig_Environment($loader); // Loads the filters $twig->addFilter(new Twig_SimpleFilter('url', 'url')); $twig->addFilter(new Twig_SimpleFilter('json', 'json')); // Loads the globals $twig->addGlobal('request', request()); $twig->addGlobal('session', session()); // Loads the functions $twig->addFunction(new Twig_SimpleFunction('carbon', 'carbon')); $twig->addFunction(new Twig_SimpleFunction('session', 'session')); $renderer = new Rougin\Slytherin\Template\Twig\Renderer($twig); session(['old' => null, 'validation' => null]); return $renderer->render($template, $data, 'twig'); }
function load_shots($dbc, $image_path, $path, $query) { $images = get_shots($dbc, $query); foreach ($images as $image) { ?> <div class="mt-shot-card"> <div class="mt-shot-image"> <a href="?id=<?php echo $image['shotID']; ?> " style="margin:0;"> <img src="<?php echo base($path) . '../../' . '/' . $image_path . $image['shotFileName'] . '.' . $image['shotFileType']; ?> "> </a> </div> </div> <?php } }
<div align="center">Titre : <input name="titre" id="titre" type="text" size="35"/> <br/><br/> <input name="maj" type="text" value="0" id="maj" style="display:none"/> <?php if (isset($_GET['info'])) { ?> <script type="text/javascript"> document.getElementById('maj').value="<?php echo $_GET['info']; ?> "; </script> <?php mysql_connect(hote(), user(), password()); mysql_select_db(base()); $reponse = mysql_query('SELECT * FROM tuto WHERE num="' . $_GET['info'] . '"') or die(mysql_error()); if ($donnees = mysql_fetch_array($reponse)) { ?> <script type="text/javascript"> document.getElementById('titre').value="<?php echo addslashes($donnees['titre']); ?> "; </script> <?php } } ?> <textarea name="txt"
<?php // имя модуля $module_name = 'site'; require_once base('modules/' . $module_name . '/tree_utils.class'); require_once base('modules/' . $module_name . '/main.class'); require_once base('modules/' . $module_name . '/page.class'); $module_loader =& Registry::get('TModuleLoader'); $module_loader->registerClassFile('TMenu', 'modules/' . $module_name . '/menu'); $module_loader->registerClassFile('TUserAuth', 'modules/' . $module_name . '/user_auth.class');
<?php describe('User interactions', function () { beforeEach(function () { clear_app(); }); describe('visiting the homepage as a visitor', function () { it('shows hello world', function () { browser()->visit(base() . '/'); expect(page())->toContainText('Hello world!'); }); }); describe('visiting the homepage as a logged in user', function () { beforeEach(function () { update_user('test', 'test', 'ROLE_USER'); }); it('is possible to login as the user', function () { browser()->visit(base() . '/login'); page()->fillField('Username', 'test'); page()->fillField('Password', 'test'); page()->pressButton('Login'); expect(page())->toContainText('Hello test!'); }); }); });
<?php /** * Configurations for Doctrine. * * @var array */ return ['developer_mode' => config('app.environment') == 'development', 'model_paths' => [base('src/Models')], 'proxy_path' => base('src/Proxies')];
<body class="mt-layout"> <?php include CONFIG . 'page.php'; ?> <!-- Transfer later --> <div class="mt-layout-black__cover"></div> <!--Main Plugins--> <script src="<?php echo base($path); ?> /assets/js/plugins.js"></script> <!-- Custom Scripts --> <script src="<?php echo base($path); ?> /assets/js/script.js"></script> <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-56825866-2', 'auto'); ga('send', 'pageview'); </script> </body> </html>
<?php /** * Returns a listing of configurations for Doctrine. * * @var array */ return ['developer_mode' => config('app.environment') == 'development', 'model_paths' => [base('{{ folders.models }}')], 'proxy_path' => base('{{ folders.proxies }}')];
<?php defined('__SIEVAL__') or die('Acces interdit'); global $session; switch ($tache) { case 'base': base(); break; case 'creer_session': creer_session(); break; case 'modifier_session': modifier_session(); break; case 'supprimer_session': supprimer_session(); break; case 'gerer_candidature': gerer_candidature(); break; case 'modifier_candidature': modifier_candidature(); break; case 'modifier_motif': modifier_motif(); break; case 'lister_session': lister_session(); break; case 'importer': importer();
function partager_item() { global $page; global $item; global $message; $page['gabarit'] = "administration"; if (isset($_SESSION['role_user']) && droit_acces($item['reponse_item'], $_SESSION['role_user'])) { $page['vue'] = "items/partage_item.vue.php"; $page['colonne'] = "items/sidebar_item.vue.php"; $page['etat'] = liste_etat(); $page['etat'] = liste_etat(); $page['categorie'] = liste_categorie(); $page['items'] = liste_item(); $page['lieu'] = liste_lieux_auteur(); $page['sphere'] = liste_sphere(); $page['facteur'] = liste_facteur(); $page['projet'] = liste_projet(); $page['organisme_auteur'] = liste_lieux_auteur(); if (isset($_POST['rech_item'])) { $page['items_recherche'] = json_encode(rechercher_item_partage_json(1, 0, $_POST['libelle_item'], $_POST['projet_item'], $_POST['difficulte_item'], $_POST['id_etat'], $_POST['duree_item'], $_POST['id_facteur'], $_POST['id_sphere'], $_POST['crea1'], $_POST['crea2'], $_POST['modif1'], $_POST['modif2'], $_POST['id_lieu'])); } elseif (isset($_POST['partager'])) { if (isset($_POST['items'])) { if ($_POST['organisme']) { foreach ($_POST['items'] as $it) { ajout_droit($it, $_POST['organisme']); } base(); } else { $page['message'] = $message['champs_obligatoire_2']; } } else { $page['message'] = $message['item_obligatoire']; } } } else { $page['vue'] = "erreur_droit.vue.php"; } }
?> "><?php echo $URL; ?> "><span>Home</span></a></li> <li id="nav-line<?php base("linecard"); ?> "><?php echo $URL; ?> linecard/"><span>Line Card</span></a></li> <li id="nav-contact<?php base("contact"); ?> "><?php echo $URL; ?> contact/"><span>Contact</span></a></li> <li id="nav-tech<?php base("techinfo"); ?> "><?php echo $URL; ?> techinfo/"><span>Tech Info</span></a></li> </ul> <!-- <?php echo "public_base= " . $public_base . "<br />selected = " . $selected; ?> -->
/* устанавливается document_status */ $GLOBALS['document_status'] = 200; require_once PATH_COMMON_LIBS . 'error.lib.php'; require_once PATH_COMMON_LIBS . 'path.lib.php'; //подключаем класс реестра объектов include_once common_class('registry.php5'); /* устанавливает соединение с базой данных */ // @todo нормальный обработчик ошибок при коннекте к БД (require_once DB_CONNECT) or log_error('Cannot find file "' . DB_CONNECT . '"to connect to DB'); @mysql_connect(MYSQL_HOST, MYSQL_LOGIN, MYSQL_PASSWORD) or die(mysql_error()); @mysql_select_db(MYSQL_DB) or die(mysql_error()); @mysql_query("SET NAMES \"" . DB_SET_NAMES . "\""); /* подключаем встроенный дебаггер */ require_once common_lib('debug'); timer_start('all'); //подключаем вывод страницы в gz require_once common_lib('cache'); ob_start('cache_handler'); /* подключается библиотека функций */ require_once common_lib('utils'); /* подгружаем контроллер, инициализирующий общие классы, для сайта и админки */ require_once common('main.init'); $main =& Registry::get('TMainInit'); require_once PATH_CONFIG . 'settings.cfg.php'; require_once PATH_CONFIG . 'lang.cfg.php'; /* Определение глобальных переменных */ require_once cfg('common'); require_once base('core.dispatcher'); timer_end('all'); echo showDebugInfo(); ob_end_flush();
<?php require_once 'appshed-extension-api/api/api.php'; require_once 'functions.php'; if (empty($_GET['username']) || empty($_GET['password'])) { $apiScreen = new AppBuilderAPIListScreen("Incorrect Login"); echo AppBuilderAPI::getScreenResponse($apiScreen); exit; } $file = fetchURL('http://community.computingatschool.org.uk/forums.json', null, false, array('username' => $_GET['username'], 'password' => $_GET['password'])); if (!$file) { $apiScreen = new AppBuilderAPIListScreen("Incorrect Login"); echo AppBuilderAPI::getScreenResponse($apiScreen); exit; } $data = json_decode($file, true); $apiScreen = new AppBuilderAPIListScreen("Discussion Forums"); $apiScreen->setBack(false); $base = base(); foreach ($data['normal'] as $forum) { $apiItem = new AppBuilderAPILinkItem($forum['name'], "http://images-resized.appshed.com/10148plain_x2.png"); $apiItem->setImageSize(array('width' => 40, 'height' => 40)); $query = http_build_query(array('url' => $forum['json_url'], 'name' => $forum['name'], 'username' => $_GET['username'], 'password' => $_GET['password'])); $apiItem->setRemoteLink("{$base}/forum.php?{$query}"); $apiScreen->addChild($apiItem); } echo AppBuilderAPI::getScreenResponse($apiScreen);
function loadClassByName($class_name) { if (class_exists($class_name)) { return true; } $filename = $this->getFileByClassName($class_name); if (!$filename) { return false; } include_once base($filename); if (!class_exists($class_name)) { return false; } return true; }
function base36($int) { static $digits = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); return base($int, $digits); }
echo $this->slot('CHARSET', 'UTF-8'); ?> "> <title>Administration : <?php echo $this->slot('TITLE'); ?> </title> <link rel="stylesheet" href="<?php echo base(); ?> /css/styles.css" media="screen, print"> <?php echo $this->slot('STYLES'); ?> <script src="<?php echo base(); ?> /js/scripts.js"></script> <?php echo $this->slot('SCRIPTS'); ?> </head> <body<?php echo $this->slot('ID', '', ' id="%s"'); ?> > <div id="container"> <?php echo $this->partial('flash'); echo $this->slot('CONTENT');
function miles($num) { if ($num < 1000) { return cientos($num); } $ends = $num - floor($num / 10000) * 10000; $end = $ends - ($num - floor($num / 1000) * 1000); switch ($end) { case 1000: if ($ends == 1000) { return "mil"; } else { return "mil " . cientos($num); } default: $mil = base(floor($num / 1000)); if ($mil == 0) { return cientos($num); } else { return $mil . " mil " . +cientos($num); } } }
function inc($name) { $ret = module($name, false); if (!$ret) { $ret = elem($name, false); } if (!$ret) { $ret = elem_inc($name, false); } if (!$ret) { $ret = core($name, false); } if (!$ret) { $ret = base($name); } return $ret; }
/** * Visit the login page and login with the given username and password. * @param string $username * @param string $password * @param array|string $roles * @param bool $update * @throws \Behat\Mink\Exception\ElementNotFoundException */ function login_as($username, $password, $roles = [], $update = false) { if ($update) { update_user($username, $password, $roles); } browser()->visit(base() . "/login"); page()->fillField("Username", $username); page()->fillField("Password", $password); page()->pressButton("Login"); }
<?php function base($str) { if ($str == '//') { return '/'; } else { return $str; } } define('DS', DIRECTORY_SEPARATOR); define('ROOT', realpath(dirname(__FILE__)) . DS); //to access filesystem define('APP', ROOT . 'app' . DS); $app_w = dirname($_SERVER['PHP_SELF']) . DS; define('APP_W', base($app_w)); //echo APP_W; // it could be in another file
function fullbase($p = "http") { if ($p == "http") { if (isset($_SERVER["HTTPS"])) { $p = "https"; } } if (isset($_SERVER["HOST_NAME"])) { $hostname = $_SERVER["HOST_NAME"]; } else { $hostname = $_SERVER["SERVER_NAME"]; } return $p . "://{$hostname}" . base(); }