max_stars_repo_path
stringlengths 4
587
| max_stars_repo_name
stringlengths 5
118
| max_stars_count
int64 0
39.9k
| id
stringlengths 1
8
| content
stringlengths 1
1.05M
| score
float64 -1.14
3.53
| int_score
int64 0
4
|
---|---|---|---|---|---|---|
application/views/Auth/Blog/list.php | beaprogrammer1980/demoblogwebsite | 0 | 3 |
<?php $this->load->view('Auth/header'); ?>
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">View Blog</h1>
</div>
<!--
1.create controller blogc and load view listv.php
2.create view listv.php and copy dashboard common code and add form tag for title,descrition
-->
<div class="table-responsive">
<table class="table table-striped">
<tr>
<th>ID</th>
<th>Title</th>
<th>Description</th>
<th>Author</th>
<th width="200">Action</th>
</tr>
<?php foreach($query as $row): ?>
<tr>
<td><?php echo $row->blog_id; ?></td>
<td><?php echo $row->title; ?></td>
<td><?php echo $row->description; ?></td>
<td><?php echo $row->author; ?></td>
<td>
<a href="#" class="btn btn-primary">Edit</a>
<a href="#" class="btn btn-danger">Delete</a>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
</main>
<?php $this->load->view('Auth/footer'); ?>
| 1.132813 | 1 |
update/2992/postupdate.php | webdepp/pimcore | 1 | 11 | <?php
function sendQuery ($sql) {
try {
$db = Pimcore_Resource::get();
$db->query($sql);
} catch (Exception $e) {
echo $e->getMessage();
echo "Please execute the following query manually: <br />";
echo "<pre>" . $sql . "</pre><hr />";
}
}
$tableNames = array(
"documents_doctypes",
"glossary",
"keyvalue_groups",
"keyvalue_keys",
"properties_predefined",
"redirects",
"sites",
"staticroutes"
);
foreach ($tableNames as $tableName) {
sendQuery("ALTER TABLE `" . $tableName . "` ADD COLUMN `creationDate` bigint(20) unsigned DEFAULT 0;");
sendQuery("ALTER TABLE `" . $tableName . "` ADD COLUMN `modificationDate` bigint(20) unsigned DEFAULT 0;");
}
| 1.164063 | 1 |
src/Handlers/DifferentCountryHandler.php | devtoolboxuk/cerberus | 0 | 19 | <?php
namespace devtoolboxuk\cerberus\Handlers;
use devtoolboxuk\cerberus\Wrappers\DifferentCountryWrapper as DifferentCountryWrapper;
class DifferentCountryHandler extends Handler
{
public function __construct($value = '')
{
parent::__construct($value);
$this->setHandlerName(str_replace(__NAMESPACE__ . '\\', '', __CLASS__));
$this->pushWrapper(new DifferentCountryWrapper());
}
} | 1 | 1 |
src/DaPigGuy/PiggyFactions/tasks/UpdatePowerTask.php | CortexPE/PiggyFactions | 0 | 27 | <?php
declare(strict_types=1);
namespace DaPigGuy\PiggyFactions\tasks;
use DaPigGuy\PiggyFactions\event\member\PowerChangeEvent;
use DaPigGuy\PiggyFactions\PiggyFactions;
use DaPigGuy\PiggyFactions\players\PlayerManager;
use pocketmine\scheduler\Task;
class UpdatePowerTask extends Task
{
const INTERVAL = 5 * 60 * 20;
/** @var PiggyFactions */
private $plugin;
public function __construct(PiggyFactions $plugin)
{
$this->plugin = $plugin;
}
public function onRun(int $currentTick)
{
foreach ($this->plugin->getServer()->getOnlinePlayers() as $p) {
$member = PlayerManager::getInstance()->getPlayer($p->getUniqueId());
$ev = new PowerChangeEvent($member, PowerChangeEvent::CAUSE_TIME, $member->getPower() + $this->plugin->getConfig()->getNested("factions.power.per.hour", 2) / (72000 / self::INTERVAL));
$ev->call();
if ($ev->isCancelled()) return;
$member->setPower($ev->getPower());
}
}
} | 1.40625 | 1 |
modules/admin/views/index/head.php | beyondamos/yiicms | 0 | 35 | <?php
use yii\helpers\Url;
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Document</title>
<link rel="stylesheet" href="/admin/lib/bootstrap/css/bootstrap.css">
</head>
<body>
<!-- <!-- 导航栏 -->
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a href="" class="navbar-brand">DayDayLearn</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="news_list.html" target="main-frame">欢迎回来,<?php echo $this->params['user_info']['nickname'];?></a></li>
<li><a href="<?php echo Url::home();?>" target="_blank" >网站首页</a></li>
<li><a href="<?php echo Url::to(['login/logout']);?>" target="_top">退出</a></li>
</ul>
</div>
</nav>
<!-- /导航栏 -->
<script src="/admin/lib/jquery/jquery-1.11.3.js"></script>
<script src="/admin/lib/bootstrap/js/bootstrap.min.js"></script>
</body>
</html> | 0.84375 | 1 |
src/Form/Type/TaskType.php | frusciante1988/XLF-Generator | 2 | 43 | <?php
// src/Form/Type/TaskType.php
namespace App\Form\Type;
use App\Entity\Task;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class TaskType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('save', SubmitType::class, ['label' => 'Create Xliff File']);
$builder->add('xlfFile', FileType::class, ['required' => false, 'label' => 'Please upload the XLF File to insert automatically the elements.']);
$builder->add('sourceLanguage');
$builder->add('targetLanguage');
$builder->add('productName');
$builder->add('xliffElements', CollectionType::class, [
'entry_type' => XliffElementType::class,
'entry_options' => ['label' => false],
'allow_add' => true,
'by_reference' => false,
'allow_delete' => true,
]
);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'data_class' => Task::class,
]
);
}
}
| 1.140625 | 1 |
application/views/admin/tambah_mobil_form.php | nrdajisnrd/masjo | 0 | 51 | <div class="main-content">
<section class="section">
<div class="section-header">
<h1>Input Mobil</h1>
</div>
</section>
<div class="container-fluid">
<div class="card">
<div class="card-body">
<form method="post" action="<?php echo base_url().'admin/data_mobil/tambah_mobil_aksi' ?>" enctype="multipart/form-data">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nama Mobil</label>
<input type="text" name="nama_mobil" class="form-control">
<?php echo form_error('nama_mobil', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<label>Deskripsi</label>
<textarea class="form-control" name="deskripsi" rows="3"></textarea>
<?php echo form_error('deskripsi', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<label>Harga /hari</label>
<input type="text" name="harga" class="form-control">
<?php echo form_error('harga', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<label>Tahun Produksi</label>
<input type="text" name="tahun" class="form-control">
<?php echo form_error('tahun', '<div class="text-small text-danger">', '</div>') ?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Merk Mobil</label>
<select class="form-control" name="nama_merk">
<option value="">-- PILIH MERK --</option>
<?php foreach ($merk as $mrk) : ?>
<option value="<?php echo $mrk->nama_merk ?>"><?php echo $mrk->nama_merk ?></option>
<?php endforeach; ?>
</select>
<?php echo form_error('nama_merk', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<label>No. Polisi</label>
<input type="text" name="nopol" class="form-control">
<?php echo form_error('nopol', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<label>Jenis Bahan Bakar</label>
<select class="form-control" name="bbm">
<option value="">-- PILIH BAHAN BAKAR --</option>
<option value="Premium">Premium</option>
<option value="Pertalite">Pertalite</option>
<option value="Pertamax">Pertamax</option>
<option value="Diesel">Diesel</option>
</select>
<?php echo form_error('bbm', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<label>Kapasitas</label>
<input type="text" name="seating" class="form-control">
<?php echo form_error('seating', '<div class="text-small text-danger">', '</div>') ?>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<h5><b>Upload Gambar</b></h5>
</div>
</div>
<div class="row">
<div class="form-group">
<div class="col-md-4">
Gambar 1 <input type="file" name="image1">
</div>
<?php echo form_error('image1', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<div class="col-md-4">
Gambar 2 <input type="file" name="image2">
</div>
<?php echo form_error('image2', '<div class="text-small text-danger">', '</div>') ?>
</div>
<div class="form-group">
<div class="col-md-4">
Gambar 3 <input type="file" name="image3">
</div>
<?php echo form_error('image3', '<div class="text-small text-danger">', '</div>') ?>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading mb-2"><h5>Accessories</h5></div>
<div class="panel-body d-flex justify-content-left">
<div class="form-group">
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[1]" value="1">
<label> Air Conditioner </label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[2]" value="1">
<label> Power Door Locks </label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[3]" value="1">
<label> AntiLock Braking System </label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[4]" value="1">
<label> Brake Assist </label>
</div>
</div>
<div class="form-group ml-5">
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[5]" value="1">
<label> Power Steering </label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[6]" value="1">
<label> Driver Airbag</label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[7]" value="1">
<label> Passenger Airbag </label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[8]" value="1">
<label> Power Windows </label>
</div>
</div>
<div class="form-group ml-5">
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[9]" value="1">
<label> CD Player </label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[10]" value="1">
<label> Central Locking</label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" name="aksesoris[11]" value="1">
<label> Crash Sensor </label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox"name="aksesoris[12]" value="1">
<label> Leather Seats </label>
</div>
</div>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Simpan</button>
</form>
</div>
</div>
</div>
</div> | 0.972656 | 1 |
public/quizresult/classes/question/sequence/SequenceQuestion.class.php | vikasshekhawat/Cybersecurity_Assessment_Tool | 0 | 59 | <?php
class SequenceQuestion extends SequenceSurveyQuestion
{
public function isGradedByDefault()
{
return true;
}
public function initFromXmlNode(DOMElement $node)
{
parent::initFromXmlNode($node);
$correctAnswer = array();
foreach ($this->answers as $answer)
{
$correctAnswer[$this->getCorrectAnswerIndex($answer)] = $answer;
}
$answersCount = count($correctAnswer);
for ($i = 0; $i < $answersCount; ++$i)
{
if ($this->correctAnswer != '')
{
$this->correctAnswer .= '; ';
}
$this->correctAnswer .= $i + 1 . '. ' . $correctAnswer[$i]->text;
}
}
protected function createAnswer($index)
{
$answer = new SequenceAnswer();
$answer->index = $index;
return $answer;
}
/**
* @param SequenceAnswer $answer
* @return int
*/
private function getCorrectAnswerIndex($answer)
{
return isset($answer->originalIndex)
? $answer->originalIndex
: $answer->index;
}
}
| 1.617188 | 2 |
index.php | dlepera88-php/framework-dlx | 0 | 67 | <?php
/**
* framework-dlx
* @version: v1.17.07
* @author: <NAME>
*
* Created by <NAME> on 2017-07-28. Please report any bug at
* https://github.com/dlepera88-php/framework-dlx/issues
*
* The MIT License (MIT)
* Copyright (c) 2017 <NAME> http://diegolepera.xyz/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
# Máscaras
define('MASK_CPF', '000.000.000-00');
define('MASK_CNPJ', '00.000.000/0000-00');
define('MASK_TELEFONE_CELULAR_8', '(00) 0000-0000');
define('MASK_TELEFONE_CELULAR_9', '(00) 0 0000-0000');
define('MASK_CEP', '00000-000');
# Expressões regulares
define('EXPREG_CPF', '~^(\d{3}\.){2}\d{3}-\d{2}$~');
define('EXPREG_CNPJ', '~^\d{2}(\.\d{3}){2}-\d{2}$~');
define('EXPREG_TELEFONE_GERAL', '~^\(\d{2}\)\s([6-9]\s)?\d{4}-\d{4}$~');
define('EXPREG_CEP', '~^\d{4}-\d{3}$~');
define('EXPREG_IDIOMA', '~^[a-z]{2,3}([-_][A-Za-z]{2,3})?$~');
require_once 'dlx/dlx.classe.php';
try {
$dlx_conf = filter_input_array(INPUT_GET, [
'dlx-aplicativo' => ['filter' => FILTER_SANITIZE_STRING, 'flags' => FILTER_FLAG_EMPTY_STRING_NULL],
'dlx-ambiente' => ['filter' => FILTER_SANITIZE_STRING, 'flags' => FILTER_FLAG_EMPTY_STRING_NULL],
'dlx-url' => ['filter' => FILTER_SANITIZE_STRING, 'flags' => FILTER_FLAG_EMPTY_STRING_NULL]
]);
$__dlx = new DLX($dlx_conf['dlx-aplicativo'], $dlx_conf['dlx-ambiente'], $dlx_conf['dlx-url']);
$__dlx->executar();
} catch (\DLX\Excecao\DLX $ex) {
echo $ex->obterMensagem();
} catch (Exception $ex) {
echo $ex->getMessage();
} // Fim try ... catch
| 1.226563 | 1 |
resources/views/res/actu.blade.php | LeCitronVert/reallifequest | 0 | 75 | <!--<div class="news">
<img src="{{$a->User()->avatar}}" alt="Avatar de {{$a->User()->name}}" />
<span class="news_group">
<span class="news_user">{{$a->User()->name}}</span>
<span class="news_text">{{ __('fil.' . $a->type) }}</span>
@if($a->type == "questaccepted" || $a->type == "questrefused" || $a->type == "questtimeout")
<span class="news_value">{{\App\Quest::find($a->newsValue)->prompt}}</span>
@endif
@if($a->type == "levelup")
<span class="news_value">{{$a->newsValue}}</span>
@endif
</span>
</div>-->
<div class="notification">
<div class="notification__image" style="background-image: url('{{$a->User()->avatar}}')" alt="Avatar de {{$a->User()->name}}"></div>
<div class="notification__content">
<span class="notification__content__name">{{$a->User()->name}}</span>
<p class="notification__content__description">{{ __('fil.' . $a->type) }}
@if($a->type == "questaccepted" || $a->type == "questrefused" || $a->type == "questtimeout")
<strong>{{\App\Quest::find($a->newsValue)->prompt}}</strong>
@endif
@if($a->type == "levelup")
<strong>{{$a->newsValue}}</strong>
@endif</p>
<span class="notification__content__date">22/05/2020</span>
</div>
</div> | 1.039063 | 1 |
lib/PHPGit/Command.php | juankp3/export_commitfile | 18 | 83 | <?php
class PHPGit_Command
{
/**
* @var string Real filesystem path of the repository
*/
protected $dir;
/**
* @var string Git command to run
*/
protected $commandString;
/**
* @var boolean Whether to enable debug mode or not
* When debug mode is on, commands and their output are displayed
*/
protected $debug;
/**
* Instanciate a new Git command
*
* @param string $dir real filesystem path of the repository
* @param array $options
*/
public function __construct($dir, $commandString, $debug)
{
$commandString = trim($commandString);
$this->dir = $dir;
$this->commandString = $commandString;
$this->debug = $debug;
}
public function run()
{
$commandToRun = sprintf('cd %s && %s', escapeshellarg($this->dir), $this->commandString);
if($this->debug) {
print $commandToRun."\n";
}
ob_start();
passthru($commandToRun, $returnVar);
$output = ob_get_clean();
if($this->debug) {
print $output."\n";
}
if(0 !== $returnVar) {
// Git 1.5.x returns 1 when running "git status"
if(1 === $returnVar && 0 === strncmp($this->commandString, 'git status', 10)) {
// it's ok
}
else {
throw new GitRuntimeException(sprintf(
'Command %s failed with code %s: %s',
$commandToRun,
$returnVar,
$output
), $returnVar);
}
}
return trim($output);
}
}
class GitRuntimeException extends RuntimeException {}
| 1.835938 | 2 |
public_html/wp-content/plugins/optimole-wp/inc/compatibilities/cache_enabler.php | isabelffernandes/assistente_virtual | 0 | 91 | <?php
/**
* Class Optml_cache_enabler.
*
* @reason Cache_enabler stores the content of the page before Optimole starts replacing url's
*/
class Optml_cache_enabler extends Optml_compatibility {
/**
* Should we load the integration logic.
*
* @return bool Should we load.
*/
function should_load() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
return is_plugin_active( 'cache-enabler/cache-enabler.php' );
}
/**
* Register integration details.
*/
public function register() {
add_filter( 'cache_enabler_before_store', [ Optml_Main::instance()->manager, 'replace_content' ], PHP_INT_MAX, 1 );
}
}
| 1.007813 | 1 |
app/Http/Controllers/categoryController.php | aminaminamin93/price-scales | 0 | 99 | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class categoryController extends Controller
{
public function index(){
$categories = \DB::table('category')
->get();
return $categories;
}
public function allcategory(){
$categories = \DB::table('products')
->join('category','products.category_id','=','category.id')
->join('condition','products.condition_id','=','condition.id')
->select('products.*','category_title','condition.condition_title')
->get();
$newcategories = array();
foreach ($categories as $category) {
$compareproducts = \DB::table('products')
->select(\DB::raw('count(*) as counter'))
->where('id' , '<>', $category->id)
->where('brand_id', '=', $category->brand_id)
->where('category_id','=',$category->category_id)
->whereRaw('MATCH(product_name) AGAINST(? IN BOOLEAN MODE)', array($category->product_name))
->get();
foreach ($compareproducts as $compareproduct) {
if($compareproduct->counter >= 1){
$comparetable = true;
}else{
$comparetable = false;
}
}
$newcategories[] = [ 'id'=>$category->id,
'product_name'=>$category->product_name,
'product_price'=>$category->product_price,
'product_price_temp'=>$category->product_price_temp,
'product_favorite'=>$category->product_favorite,
'product_reviews'=>$category->product_reviews,
'picture_link'=>$category->picture_link,
'shopper_link'=>$category->shopper_link,
'comparetable'=>$comparetable
];
}
return $newcategories;
}
public function category(Request $request){
if($request->get('id') == 0){
$categories = \DB::table('products')
->join('category','products.category_id','=','category.id')
->join('condition','products.condition_id','=','condition.id')
->select('products.*','category_title','condition.condition_title')
->get();
$newarr = array();
foreach ($categories as $category) {
$compareproducts = \DB::table('products')
->select(\DB::raw('count(*) as counter'))
->where('id' , '<>', $category->id)
->where('brand_id', '=', $category->brand_id)
->where('category_id','=',$category->category_id)
->whereRaw('MATCH(product_name) AGAINST(? IN BOOLEAN MODE)', array($category->product_name))
->get();
foreach ($compareproducts as $compareproduct) {
if($compareproduct->counter >= 1){
$comparetable = true;
}else{
$comparetable = false;
}
}
$newarr[] = [ 'id'=>$category->id,
'product_name'=>$category->product_name,
'product_price'=>$category->product_price,
'product_price_temp'=>$category->product_price_temp,
'product_favorite'=>$category->product_favorite,
'product_reviews'=>$category->product_reviews,
'picture_link'=>$category->picture_link,
'shopper_link'=>$category->shopper_link,
'comparetable'=>$comparetable
];
}
return $newarr;
}else{
$categories = \DB::table('products')
->join('category','products.category_id','=','category.id')
->join('condition','products.condition_id','=','condition.id')
->where('products.category_id','=',$request->get('id'))
->select('products.*','category_title as title','condition.condition_title')
->get();
$newarr = array();
foreach ($categories as $category) {
$compareproducts = \DB::table('products')
->select(\DB::raw('count(*) as counter'))
->where('id' , '<>', $category->id)
->where('brand_id', '=', $category->brand_id)
->where('category_id','=',$category->category_id)
->whereRaw('MATCH(product_name) AGAINST(? IN BOOLEAN MODE)', array($category->product_name))
->get();
foreach ($compareproducts as $compareproduct) {
if($compareproduct->counter >= 1){
$comparetable = true;
}else{
$comparetable = false;
}
}
$newarr[] = [ 'id'=>$category->id,
'product_name'=>$category->product_name,
'product_price'=>$category->product_price,
'product_price_temp'=>$category->product_price_temp,
'product_favorite'=>$category->product_favorite,
'product_reviews'=>$category->product_reviews,
'picture_link'=>$category->picture_link,
'shopper_link'=>$category->shopper_link,
'comparetable'=>$comparetable
];
}
return $newarr;
}
}
}
| 1.34375 | 1 |
vendor/willdurand/hateoas/src/Hateoas/Serializer/JMSSerializerMetadataAwareInterface.php | TestamentsDePoilus/api | 1 | 107 | <?php
namespace Hateoas\Serializer;
use Metadata\MetadataFactoryInterface;
/**
* @author <NAME> <<EMAIL>>
*/
interface JMSSerializerMetadataAwareInterface
{
public function setMetadataFactory(MetadataFactoryInterface $metadataFactory);
}
| 0.847656 | 1 |
src/AstuteoPulse.php | astuteo-llc/astuteo-pulse | 0 | 115 | <?php
/**
* Astuteo Pulse plugin for Craft CMS 3.x
*
* Connecting Astuteo client sites to our monitor.
*
* @link https://astuteo.com
* @copyright Copyright (c) 2020 Astuteo
*/
namespace astuteo\astuteopulse;
use Craft;
use craft\base\Plugin;
use astuteo\astuteopulse\jobs\services\BroadcastStatusService;
use yii\base\Event;
/**
* @author Astuteo
* @package AstuteoPulse
* @since 1.0.0
*
* @property Settings $settings
* @method Settings getSettings()
*/
class AstuteoPulse extends Plugin
{
// Static Properties
// =========================================================================
/**
* Static property that is an instance of this plugin class so that it can be accessed via
* AstuteoPulse::$plugin
*
* @var AstuteoPulse
*/
public static $plugin;
// Public Properties
// =========================================================================
public $schemaVersion = '3.0.0';
public $hasCpSettings = false;
public $hasCpSection = false;
// Public Methods
// =========================================================================
public function init()
{
parent::init();
self::$plugin = $this;
}
}
| 1.101563 | 1 |
frontend/views/layouts/main.php | Felixatika/Felix-portfolio-landing | 0 | 123 | <?php
/* @var $this \yii\web\View */
/* @var $content string */
use yii\helpers\Url;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;
AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<meta content="Felix-portfolio-landing" name="descriptison">
<meta content="Felix-portfolio-landing" name="keywords">
<!-- Favicons -->
<link href="images/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<body id="page-top">
<!-- ======= Header/ Navbar ======= -->
<nav class="navbar navbar-b navbar-trans navbar-expand-md fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll" href=""><img src="<?= Yii::$app->request->baseUrl;?>/images/felo1.png" height="70px" width="70px"></a>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarDefault" aria-controls="navbarDefault" aria-expanded="false" aria-label="Toggle navigation">
<span></span>
<span></span>
<span></span>
</button>
<div class="navbar-collapse collapse justify-content-end" id="navbarDefault">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link js-scroll active" href="<?= Url::to(['site/index'])?>">Home</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll" href="#service">Services</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll" href="#work">Work</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link js-scroll" href="#blog">Blog</a>
</li> -->
<li class="nav-item">
<a class="nav-link js-scroll" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<?= Alert::widget() ?>
<?= $content ?>
<main id="main">
<!-- ======= About Section ======= -->
<section id="about" class="about-mf sect-pt4 route">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="box-shadow-full">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-sm-6 col-md-5">
<div class="about-img">
<img src="<?= Yii::$app->request->baseUrl;?>/images/felo.jpg" height="150px" width="150px">
<!-- <img src="images/felo.jpg" class="img-fluid rounded b-shadow-a" alt=""> -->
</div>
</div>
<div class="col-sm-6 col-md-7">
<div class="about-info">
<p><span class="title-s">Name: </span> <span><NAME></span></p>
<p><span class="title-s">Profile: </span> <span>full stack developer</span></p>
<p><span class="title-s">Email: </span> <span><EMAIL></span></p>
<p><span class="title-s">Phone: </span> <span>+254-72-296-5680</span></p>
</div>
</div>
</div>
<div class="skill-mf">
<p class="title-s">Skill</p>
<span>HTML</span> <span class="pull-right">85%</span>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 85%;" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<span>CSS3</span> <span class="pull-right">75%</span>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<span>PHP</span> <span class="pull-right">80%</span>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 80%" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<span>JAVASCRIPT</span> <span class="pull-right">90%</span>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 90%" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<span>MOBILE DEVELOPMENT</span> <span class="pull-right">50%</span>
<div class="progress">
<div class="progress-bar" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="about-me pt-4 pt-md-0">
<div class="title-box-2">
<h5 class="title-left">
About me
</h5>
</div>
<p class="lead">
I am a millenial computer sciencist.
I love computing since its a great career field and a nice outlet for my creativity.
I spend most of my time coding, surfing the web, listening to reggae music and most recently electronic music.
At this point you must be thinking, “Wow! What a nerd!”
</p>
<p class="lead">
I beg to differ. I am not a nerd. Well, not in the sense of being opinionated and politically acute.
I do enjoy doing a couple of other things that don't involve Data structures,
vscode and staring at my terminal for a couple of hours. These things are: <b><em><a href= "favoritethings.html"> click here to see</a></em></b>;
</p>
<p class="lead">
To get to know more about my educational background and my work experience,
have a look at my <b><em><a href= "resume.html">résumé.</a></em></b>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section><!-- End About Section -->
<!-- ======= Services Section ======= -->
<section id="service" class="services-mf pt-5 route">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="title-box text-center">
<h3 class="title-a">
Services
</h3>
<p class="subtitle-a">
The main goal i strive for is to provide excellency in my services without compromising anything whatsoever.
</p>
<div class="line-mf"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="service-box">
<div class="service-ico">
<span class="ico-circle"><i class="ion-monitor"></i></span>
</div>
<div class="service-content">
<h2 class="s-title">Web Design</h2>
<p class="s-description text-center">
Turn your website into elegancy and attract more clients to your site.Web design is a crucial aspect
of web development.Making a first impression to the client matters alot.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="service-box">
<div class="service-ico">
<span class="ico-circle"><i class="ion-code-working"></i></span>
</div>
<div class="service-content">
<h2 class="s-title">Web Development</h2>
<p class="s-description text-center">
I can help turn your ideas into a new driving force of
your business to deliver projects on time and maintain top-notch code standards.I stress on quality,elegance and original.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="service-box">
<div class="service-ico">
<span class="ico-circle"><i class="ion-camera"></i></span>
</div>
<div class="service-content">
<h2 class="s-title">Photography</h2>
<p class="s-description text-center">
I do photography as a part time hobby.Thank God for the great camera quality our phones now come with.
It is because of such great technology that I am able to enjoy photography. I love taking photos of sunsets,
clouds and food (like the typical millenial that I am!).You Can hire me for beautiful photos.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="service-box">
<div class="service-ico">
<span class="ico-circle"><i class="ion-android-phone-portrait"></i></span>
</div>
<div class="service-content">
<h2 class="s-title">Responsive Design</h2>
<p class="s-description text-center">
Responsive design is an inevitable part of web design. Do you want your website to fit all device sizes either mobile or large desktopts,Worry no more!Reach out.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="service-box">
<div class="service-ico">
<span class="ico-circle"><i class="ion-paintbrush"></i></span>
</div>
<div class="service-content">
<h2 class="s-title">Graphic Design</h2>
<p class="s-description text-center">
Need cool graphics for either your business or advertisements,Reach out.Only quality.
At a both affordable and discounted price
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="service-box">
<div class="service-ico">
<span class="ico-circle"><i class="ion-stats-bars"></i></span>
</div>
<div class="service-content">
<h2 class="s-title">Marketing Services</h2>
<p class="s-description text-center">
Digital marketing is a special sector for maketing of your products to reach out to as my clients as possible.You can never go wrong by investing in
marketing services.Reach out and give your business a boost.
</p>
</div>
</div>
</div>
</div>
</div>
</section><!-- End Services Section -->
<!-- ======= Counter Section ======= -->
<div class="section-counter paralax-mf bg-image" style="background-image: url(assets/img/counters-bg.jpg)">
<div class="overlay-mf"></div>
<div class="container">
<div class="row">
<div class="col-sm-3 col-lg-3">
<div class="counter-box counter-box pt-4 pt-md-0">
<div class="counter-ico">
<span class="ico-circle"><i class="ion-checkmark-round"></i></span>
</div>
<div class="counter-num">
<p class="counter">450</p>
<span class="counter-text">WORKS COMPLETED</span>
</div>
</div>
</div>
<div class="col-sm-3 col-lg-3">
<div class="counter-box pt-4 pt-md-0">
<div class="counter-ico">
<span class="ico-circle"><i class="ion-ios-calendar-outline"></i></span>
</div>
<div class="counter-num">
<p class="counter">15</p>
<span class="counter-text">YEARS OF EXPERIENCE</span>
</div>
</div>
</div>
<div class="col-sm-3 col-lg-3">
<div class="counter-box pt-4 pt-md-0">
<div class="counter-ico">
<span class="ico-circle"><i class="ion-ios-people"></i></span>
</div>
<div class="counter-num">
<p class="counter">550</p>
<span class="counter-text">TOTAL CLIENTS</span>
</div>
</div>
</div>
<div class="col-sm-3 col-lg-3">
<div class="counter-box pt-4 pt-md-0">
<div class="counter-ico">
<span class="ico-circle"><i class="ion-ribbon-a"></i></span>
</div>
<div class="counter-num">
<p class="counter">36</p>
<span class="counter-text">AWARD WON</span>
</div>
</div>
</div>
</div>
</div>
</div><!-- End Counter Section -->
<!-- ======= Portfolio Section ======= -->
<section id="work" class="portfolio-mf sect-pt4 route">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="title-box text-center">
<h3 class="title-a">
Portfolio
</h3>
<p class="subtitle-a">
Welcome to my portifolio!
</p>
<div class="line-mf"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="work-box">
<img src="images/work1.jpg" class="img-fluid rounded b-shadow-a" alt="">
<!-- <a href="images/work1.jpg" data-gall="portfolioGallery" class="venobox"> -->
<div class="work-img">
<!-- <img src="assets/img/work1.jpg" alt="" class="img-fluid"> -->
<img src="<?= Yii::$app->request->baseUrl;?>/images/work1.jpg">
</div>
</a>
<div class="work-content">
<div class="row">
<div class="col-sm-8">
<h2 class="w-title"><NAME></h2>
<div class="w-more">
<span class="w-ctegory">Web Design</span> / <span class="w-date">18 Sep. 2018</span>
</div>
</div>
<div class="col-sm-4">
<div class="w-like">
<a href="portfolio-details.html"> <span class="ion-ios-plus-outline"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="work-box">
<!-- <a href="images/work2.jpg" data-gall="portfolioGallery" class="venobox"> -->
<div class="work-img">
<!-- <img src="images/work2.jpg" alt="" class="img-fluid"> -->
<img src="<?= Yii::$app->request->baseUrl;?>/images/work2.jpg">
</div>
</a>
<div class="work-content">
<div class="row">
<div class="col-sm-8">
<h2 class="w-title">Pyramids</h2>
<div class="w-more">
<span class="w-ctegory">Web Design</span> / <span class="w-date">18 Sep. 2018</span>
</div>
</div>
<div class="col-sm-4">
<div class="w-like">
<a href="portfolio-details.html"> <span class="ion-ios-plus-outline"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="work-box">
<a href="images/work3.jpg" data-gall="portfolioGallery" class="venobox">
<div class="work-img">
<!-- <img src="images/work3.jpg" alt="" class="img-fluid"> -->
<img src="<?= Yii::$app->request->baseUrl;?>/images/work3.jpg">
</div>
</a>
<div class="work-content">
<div class="row">
<div class="col-sm-8">
<h2 class="w-title"><NAME></h2>
<div class="w-more">
<span class="w-ctegory">Web Design</span> / <span class="w-date">18 Sep. 2018</span>
</div>
</div>
<div class="col-sm-4">
<div class="w-like">
<a href="portfolio-details.html"> <span class="ion-ios-plus-outline"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="work-box">
<a href="images/work8.jpg" data-gall="portfolioGallery" class="venobox">
<div class="work-img">
<!-- <img src="images/work8.jpg" alt="" class="img-fluid"> -->
<img src="<?= Yii::$app->request->baseUrl;?>/images/work4.jpg">
</div>
</a>
<div class="work-content">
<div class="row">
<div class="col-sm-8">
<h2 class="w-title">Giraffee</h2>
<div class="w-more">
<span class="w-ctegory">Web Design</span> / <span class="w-date">18 Sep. 2018</span>
</div>
</div>
<div class="col-sm-4">
<div class="w-like">
<a href="portfolio-details.html"> <span class="ion-ios-plus-outline"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="work-box">
<a href="images/work5.jpg" data-gall="portfolioGallery" class="venobox">
<div class="work-img">
<!-- <img src="images/work5.jpg" alt="" class="img-fluid"> -->
<img src="<?= Yii::$app->request->baseUrl;?>/images/work5.jpg">
</div>
</a>
<div class="work-content">
<div class="row">
<div class="col-sm-8">
<h2 class="w-title">Have a cool day</h2>
<div class="w-more">
<span class="w-ctegory">Web Design</span> / <span class="w-date">18 Sep. 2018</span>
</div>
</div>
<div class="col-sm-4">
<div class="w-like">
<a href="portfolio-details.html"> <span class="ion-ios-plus-outline"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="work-box">
<a href="images/work6.jpg" data-gall="portfolioGallery" class="venobox">
<div class="work-img">
<!-- <img src="images/work6.jpg" alt="" class="img-fluid"> -->
<img src="<?= Yii::$app->request->baseUrl;?>/images/work6.jpg">
</div>
</a>
<div class="work-content">
<div class="row">
<div class="col-sm-8">
<h2 class="w-title">Black Studio</h2>
<div class="w-more">
<span class="w-ctegory">Web Design</span> / <span class="w-date">18 Sep. 2017</span>
</div>
</div>
<div class="col-sm-4">
<div class="w-like">
<a href="portfolio-details.html"> <span class="ion-ios-plus-outline"></span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section><!-- End Portfolio Section -->
<!-- ======= Testimonials Section ======= -->
<div class="testimonials paralax-mf bg-image" style="background-image: url(assets/img/overlay-bg.jpg)">
<div class="overlay-mf"></div>
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="testimonial-mf" class="owl-carousel owl-theme">
<div class="testimonial-box">
<div class="author-test">
<img src="assets/img/testimonial-2.jpg" alt="" class="rounded-circle b-shadow-a">
<span class="author"><NAME></span>
</div>
<div class="content-test">
<p class="description lead">
Great work can sound like an understatement!Great Great services!
</p>
<span class="comit"><i class="fa fa-quote-right"></i></span>
</div>
</div>
<div class="testimonial-box">
<div class="author-test">
<img src="assets/img/testimonial-4.jpg" alt="" class="rounded-circle b-shadow-a">
<span class="author"><NAME></span>
</div>
<div class="content-test">
<p class="description lead">
Excellent services.I want to be coming for more and more.Thank you.
</p>
<span class="comit"><i class="fa fa-quote-right"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- End Testimonials Section -->
<!-- ======= Blog Section ======= -->
<!-- <section id="blog" class="blog-mf sect-pt4 route">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="title-box text-center">
<h3 class="title-a">
Blog
</h3>
<p class="subtitle-a">
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
</p>
<div class="line-mf"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="card card-blog">
<div class="card-img">
<a href="blog-single.html"><img src="assets/img/post-1.jpg" alt="" class="img-fluid"></a>
</div>
<div class="card-body">
<div class="card-category-box">
<div class="card-category">
<h6 class="category">Travel</h6>
</div>
</div>
<h3 class="card-title"><a href="blog-single.html">See more ideas about Travel</a></h3>
<p class="card-description">
Proin eget tortor risus. Pellentesque in ipsum id orci porta dapibus. Praesent sapien massa, convallis
a pellentesque nec,
egestas non nisi.
</p>
</div>
<div class="card-footer">
<div class="post-author">
<a href="#">
<img src="assets/img/testimonial-2.jpg" alt="" class="avatar rounded-circle">
<span class="author"><NAME></span>
</a>
</div>
<div class="post-date">
<span class="ion-ios-clock-outline"></span> 10 min
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card card-blog">
<div class="card-img">
<a href="blog-single.html"><img src="assets/img/post-2.jpg" alt="" class="img-fluid"></a>
</div>
<div class="card-body">
<div class="card-category-box">
<div class="card-category">
<h6 class="category">Web Design</h6>
</div>
</div>
<h3 class="card-title"><a href="blog-single.html">See more ideas about Travel</a></h3>
<p class="card-description">
Proin eget tortor risus. Pellentesque in ipsum id orci porta dapibus. Praesent sapien massa, convallis
a pellentesque nec,
egestas non nisi.
</p>
</div>
<div class="card-footer">
<div class="post-author">
<a href="#">
<img src="assets/img/testimonial-2.jpg" alt="" class="avatar rounded-circle">
<span class="author"><NAME></span>
</a>
</div>
<div class="post-date">
<span class="ion-ios-clock-outline"></span> 10 min
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card card-blog">
<div class="card-img">
<a href="blog-single.html"><img src="assets/img/post-3.jpg" alt="" class="img-fluid"></a>
</div>
<div class="card-body">
<div class="card-category-box">
<div class="card-category">
<h6 class="category">Web Design</h6>
</div>
</div>
<h3 class="card-title"><a href="blog-single.html">See more ideas about Travel</a></h3>
<p class="card-description">
Proin eget tortor risus. Pellentesque in ipsum id orci porta dapibus. Praesent sapien massa, convallis
a pellentesque nec,
egestas non nisi.
</p>
</div>
<div class="card-footer">
<div class="post-author">
<a href="#">
<img src="assets/img/testimonial-2.jpg" alt="" class="avatar rounded-circle">
<span class="author"><NAME></span>
</a>
</div>
<div class="post-date">
<span class="ion-ios-clock-outline"></span> 10 min
</div>
</div>
</div>
</div>
</div>
</div> -->
<!-- </section> -->
<!-- End Blog Section -->
<!-- ======= Contact Section ======= -->
<section class="paralax-mf footer-paralax bg-image sect-mt4 route" style="background-image: url(assets/img/overlay-bg.jpg)">
<div class="overlay-mf"></div>
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="contact-mf">
<div id="contact" class="box-shadow-full">
<div class="row">
<div class="col-md-6">
<div class="title-box-2">
<h5 class="title-left">
Send Message Us
</h5>
</div>
<div>
<form action="forms/contact.php" method="post" role="form" class="php-email-form">
<div class="row">
<div class="col-md-12 mb-3">
<div class="form-group">
<input type="text" name="name" class="form-control" id="name" placeholder="<NAME>" data-rule="minlen:4" data-msg="Please enter at least 4 chars" />
<div class="validate"></div>
</div>
</div>
<div class="col-md-12 mb-3">
<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Your Email" data-rule="email" data-msg="Please enter a valid email" />
<div class="validate"></div>
</div>
</div>
<div class="col-md-12 mb-3">
<div class="form-group">
<input type="text" class="form-control" name="subject" id="subject" placeholder="Subject" data-rule="minlen:4" data-msg="Please enter at least 8 chars of subject" />
<div class="validate"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<textarea class="form-control" name="message" rows="5" data-rule="required" data-msg="Please write something for us" placeholder="Message"></textarea>
<div class="validate"></div>
</div>
</div>
<div class="col-md-12 text-center mb-3">
<div class="loading">Loading</div>
<div class="error-message"></div>
<div class="sent-message">Your message has been sent. Thank you!</div>
</div>
<div class="col-md-12 text-center">
<button type="submit" class="button button-a button-big button-rouded">Send Message</button>
</div>
</div>
</form>
</div>
</div>
<div class="col-md-6">
<div class="title-box-2 pt-4 pt-md-0">
<h5 class="title-left">
Get in Touch
</h5>
</div>
<div class="more-info">
<p class="lead">
Reach me in any convenient way below,either social media handles.NB:Im lazy in checking my social medias,
it can take sometime, if urgent just drop your message in my direct line.
</p>
<ul class="list-ico">
<li><span class="ion-ios-location"></span> Kenya,Nairobi</li>
<li><span class="ion-ios-telephone"></span> +254-72-296-5680</li>
<li><span class="ion-email"></span><EMAIL></li>
</ul>
</div>
<div class="socials">
<ul>
<li><a href="https://www.facebook.com/felix.atique"><span class="ico-circle"><i class="ion-social-facebook"></i></span></a></li>
<li><a href="https://www.instagram.com/felixatique/"><span class="ico-circle"><i class="ion-social-instagram"></i></span></a></li>
<li><a href="https://www.linkedin.com/in/felix-atika-47309a124/"><span class="ico-circle"><i class="ion-social-linkedin"></i></span></a></li>
<li><a href="https://twitter.com/felix_atika"><span class="ico-circle"><i class="ion-social-twitter"></i></span></a></li>
<li><a href="https://github.com/Felixatika"><span class="ico-circle"><i class="ion-social-github"></i></span></a></li>
<li><a href="https://www.reddit.com/user/Felixatika"><span class="ico-circle"><i class="ion-social-reddit"></i></span></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section><!-- End Contact Section -->
</main><!-- End #main -->
<!-- ======= Footer ======= -->
<footer>
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="copyright-box">
<p class="copyright">© Copyright <strong>FelixFolio</strong>. All Rights Reserved</p>
<div class="credits">
<!--
All the links in the footer should remain intact.
You can delete the links only if you purchased the pro version.
Licensing information: https://bootstrapmade.com/license/
Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/buy/?theme=DevFolio
-->
Designed by <a href="https://bootstrapmade.com/">BootstrapMade</a>
</div>
</div>
</div>
</div>
</div>
</footer><!-- End Footer -->
<a href="#" class="back-to-top"><i class="fa fa-chevron-up"></i></a>
<div id="preloader"></div>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
| 1.117188 | 1 |
src/PHPCR/Util/Console/Command/WorkspaceCreateCommand.php | Brille24/phpcr-utils | 39 | 131 | <?php
namespace PHPCR\Util\Console\Command;
use PHPCR\RepositoryInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
* A command to create a workspace in the PHPCR repository.
*
* @license http://www.apache.org/licenses Apache License Version 2.0, January 2004
* @license http://opensource.org/licenses/MIT MIT License
* @author <NAME> <<EMAIL>>
* @author <NAME> <<EMAIL>>
*/
class WorkspaceCreateCommand extends BaseCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('phpcr:workspace:create')
->addArgument('name', InputArgument::REQUIRED, 'Name of the workspace to create')
->addOption(
'ignore-existing',
null,
InputOption::VALUE_NONE,
'If set, an existing workspace will return a success code'
)
->setDescription('Create a workspace in the configured repository')
->setHelp(
<<<'EOT'
The <info>workspace:create</info> command creates a workspace with the specified name.
It will fail if a workspace with that name already exists or if the repository implementation
does not support the workspace creation operation.
EOT
);
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$session = $this->getPhpcrSession();
$workspaceName = $input->getArgument('name');
$workspace = $session->getWorkspace();
$repo = $session->getRepository();
if (!$repo->getDescriptor(RepositoryInterface::OPTION_WORKSPACE_MANAGEMENT_SUPPORTED)) {
$output->writeln(
'<error>Your PHPCR implementation does not support '.
'workspace management. Please refer to the documentation '.
'of your PHPCR implementation to learn how to create a workspace.</error>'
);
return 1;
}
if (in_array($workspaceName, $workspace->getAccessibleWorkspaceNames())) {
$output->writeln(
sprintf('<comment>This repository already has a workspace called "%s"</comment>', $workspaceName)
);
return $input->getOption('ignore-existing') ? 0 : 2;
}
$workspace->createWorkspace($workspaceName);
$output->writeln(sprintf('<info>Created workspace "%s".</info>', $workspaceName));
return 0;
}
}
| 1.46875 | 1 |
backend/views/menu/update.php | jahongirX/certification | 0 | 139 | <?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
$this->title = Yii::t('main', 'Update Menu');
$this->params['breadcrumbs'][] = ['label' => Yii::t('main', 'Menu'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs']['title'] = $this->title;
$session = Yii::$app->session;
if( $session->has('tab') ) {
$tab = $session->get( 'tab' );
} else {
$tab = 0;
$session->set( 'tab', 0 );
}
$langs = [];
$langs[] = [
'id' => Yii::$app->params['main_language_id'],
'label' => Yii::t('main','На основном языке').' (' . Yii::$app->params['main_language'] . ')',
'content' => $this->render('_form', [
'id' => Yii::$app->params['main_language_id'],
'model' => $model,
'name' => Yii::$app->params['main_language'],
]),
'active' => $tab == 0 ? 'active' : '',
];
$languages = \common\models\Languages::find()->where('status>-1 AND NOT abb="' . Yii::$app->params['main_language'] . '"')->all();
foreach($languages as $language)
{
$lang_model = \common\models\MenuLang::find()->andFilterWhere(['parent' => $model->id, 'lang' => $language->id])->one();
if (empty($lang_model) || $lang_model == NULL) {
$lang_model = new \common\models\MenuLang();
$action = "/menu-lang/create";
} else {
$lang_model = \common\models\MenuLang::findOne($lang_model->id);
$action = "/menu-lang/update/" . $lang_model->id;
}
$lang_model->parent = $model->id;
$lang_model->lang = $language->id;
$langs[] = [
'id' => $language->id,
'label' => $language->name,
'content' => $this->render('/menu-lang/_form', [
'id' => $language->id,
'model' => $lang_model,
'action' => $action,
]),
'active' => $tab == $language->id ? 'active' : ''
];
}
?>
<div class="container-fluid container-fixed-lg m-t-20">
<div class="panel panel-transparent">
<div class="panel-heading no-padding">
<div class="panel panel-default">
<div class="panel-body page-header-block">
<h2><?= Html::encode($this->title) ?></h2>
</div>
</div>
</div>
<div class="panel-body no-padding row-default">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<ul class="nav nav-tabs nav-tabs-simple hidden-xs" role="tablist" data-init-reponsive-tabs="collapse">
<?php
foreach($langs as $lang){
?>
<li class="<?=$lang['active']?>">
<a href="#lang_<?=$lang['id']?>" data-toggle="tab"><?=$lang['label']?></a>
</li>
<?php
}
?>
</ul>
</div>
</div>
<div class="tab-content">
<?php
foreach($langs as $lang){
?>
<div class="tab-pane <?=$lang['active']?>" id="lang_<?=$lang['id']?>">
<div class="row column-seperation">
<?=$lang['content'];?>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
<?php $session->set('tab',0); ?> | 1.242188 | 1 |
app/Http/Controllers/QuestionController.php | Strong-Developer/FamilyStoryTeller | 0 | 147 | <?php
namespace App\Http\Controllers;
use App\Invite;
use App\Category;
use App\Question;
use SendGrid;
use Illuminate\Http\Request;
Use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class QuestionController extends Controller
{
//
public function index () {
$storytellers = Invite::where('type', 1)->get();
return view('question', compact('storytellers'));
}
public function getquery (Request $request) {
$category = $request->input("category");
$categoryID = (Category::where('title', $category)-> first())->id;
$queries = Category::where('parent', $categoryID)-> get();
return response()->json($queries);
}
public function sendmail(Request $request) {
$category_id = $request->input("selQuery");
$storyteller_id = $request->input("selTeller");
$content = $request->input("tempText");
$to = (Invite::where('id', $storyteller_id)-> first())->email;
$storyteller_name = (Invite::where('id', $storyteller_id)-> first())->first_name;
$from = Session::get('email');
$collaborator_name = (Invite::where('email', $from)-> first())->first_name;
$query = Question::where('storyteller_name', $storyteller_name)
->where('proceed', "0")->first();
if(isset($query->proceed)){
return response()->json(['status'=>$storyteller_name]);
die();
}
$collaborator_phone = (Invite::where('email', $from)-> first())->phone;
if($content == "") {
$question = (Category::where('id', $category_id)-> first())->title;
} else
{
$question = $content;
}
ini_set('display_errors',1);
error_reporting(E_ALL);
$header = "From:".$from;
$message = "Hi! " . $storyteller_name .
" There’s a new question for you in your FamilyStoryMaker.io project.
Please call ". "+17865162349" ." or reply to the email we sent to answer. '"
. $question . "' from " . $collaborator_name;
//mail($to,$from,$message,$header);
$senderEmail = "<EMAIL>";
$senderName = "A collaborator";
$email = new SendGrid\Mail\Mail();
$email->setFrom($senderEmail, $senderName);
$email->setSubject($header);
$email->addTo($to);
$email->addContent("text/plain", $message);
$sendgrid = new SendGrid(getenv('SENDGRID_API_KEY'));
try {
$response = $sendgrid->send($email);
$resultsend = $response->statusCode();
//echo($resultsend) ;
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
$question = new Question;
$question->category_id = $category_id;
$question->storyteller_name = $storyteller_name;
$question->collaborator_name = $collaborator_name;
$question->content = $content;
$question->proceed = "0";
$question->save();
return response()->json(['status'=>'success']);
}
}
| 1.148438 | 1 |
inf-server-side/organize/rate-rank.php | TianTcl/PathwaySpeechContest | 0 | 155 | <?php
$dirPWroot = str_repeat("../", substr_count($_SERVER['PHP_SELF'], "/")-1);
require($dirPWroot."e/Pathway-Speech-Contest/resource/hpe/init_ps.php");
$header_title = "จัดลำดับ";
$header_desc = "เรียงลำดับผลงานผู้เข้าประกวดตามสาย";
if (!(isset($_SESSION['evt2']) && $_SESSION['evt2']['EventID']==2)) header("Location: ./$my_url");
else if ($_SESSION['evt2']["force_pwd_change"]) header("Location: new-password$my_url");
$permitted = has_perm("judge"); if ($permitted) {
}
?>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require($dirPWroot."e/Pathway-Speech-Contest/resource/hpe/heading.php"); require($dirPWroot."e/Pathway-Speech-Contest/resource/hpe/init_ss.php"); ?>
<style type="text/css">
</style>
<style type="text/css" for="lb-submission">
.lightbox .s-wrapper { max-height: calc(100vh - 100px); }
.s-wrapper .load { padding: 12.5px 5px; }
.s-wrapper .message { font-size: 18.75px; }
.s-wrapper .video {
margin-bottom: 10px;
min-width: 640px; width: 100%; min-height: 360px; height: 360px;
}
.s-wrapper .video .wrapper { width: 100%; height: 100%; }
.s-wrapper .video .wrapper iframe {
width: inherit; height: inherit;
border: none;
}
.s-wrapper .mark.table thead { background-color: var(--fade-black-8); }
.s-wrapper .mark.table thead:not(:first-child) { border-top: 1.125px solid var(--clr-gg-grey-500); border-bottom: none; }
.s-wrapper .mark.table thead:not(:last-child) { border-bottom: 1.125px solid var(--clr-gg-grey-500); }
.s-wrapper .mark.table tbody { border: none; }
.s-wrapper .mark.table tr > *:nth-child(1) { text-align: left; }
.s-wrapper .mark.table :not(:first-child) tr > *:nth-child(2) { text-align: center; }
.s-wrapper .mark.table :not(:first-child) tr > *:nth-child(3) { text-align: right; }
.s-wrapper .mark.table tr td:nth-child(1) {
padding-left: 25px;
white-space: pre-wrap;
}
.s-wrapper .mark.table tr td:nth-child(3) { color: var(--clr-bs-gray); }
.s-wrapper .mark.table tr output[type="number"] { color: var(--clr-bs-blue); }
.s-wrapper .mark.table thead:last-child tr output[type="number"] { color: var(--clr-bs-green); }
.s-wrapper .comment { margin-top: 10px; }
.s-wrapper .comment ul { margin: 0px; padding: 0px; }
.s-wrapper .comment ul li { list-style-type: none; }
@media only screen and (max-width: 768px) {
.s-wrapper .message { font-size: 12.5px; }
.s-wrapper .video { min-width: 400; min-height: 320px; height: 320px; }
}
</style>
<script type="text/javascript">
var viewCustomSubmission = function() {
go_on(); return false;
function go_on() {
var idobj = document.querySelector('main form.tmp input[name="sbmtID"]'); const rawID = idobj.value.trim();
if (rawID.length) {
if (parseInt(rawID) < idobj.min || parseInt(rawID) > idobj.max) app.ui.notify(1, [2, "Invalid submission ID"]);
else {
app.ui.lightbox.open("top", {title: "<?=$_COOKIE['set_lang']=="th"?"ดูผลงานและคะแนน":"View Submission & Score"?>", allowclose: true, html: '<div class="s-wrapper"><center class="load"><img src="/resource/images/widget-load_spinner.gif" draggable="false" height="50"></center></div>'});
/* $(".lightbox .head label").on("click", function() {
history.replaceState(null, null, location.pathname+location.hash.replace(/&view=score$/, ""));
}); */
setTimeout(function() {
$(".lightbox .s-wrapper").load("/e/Pathway-Speech-Contest/resource/html/judge-grade.html?of=ID"+btoa((parseInt(rawID)*138).toString(36)));
// history.replaceState(null, null, location.pathname+location.hash+"&view=score");
}, 750);
}
} else app.ui.notify(1, [1, "Please enter submission ID"]);
}
};
</script>
</head>
<body>
<?php require($dirPWroot."e/Pathway-Speech-Contest/resource/hpe/header.php"); ?>
<main shrink="<?php echo($_COOKIE['sui_open-nt'])??"false"; ?>">
<?php if (!$permitted) echo '<iframe src="/error/901">901: No Permission</iframe>'; else { ?>
<div class="container">
<h2><?=$_COOKIE['set_lang']=="th"?"จัดลำดับสุนทรพจน์":"Rank speech"?></h2>
<form class="tmp form inline"><div class="group">
<span><?=$_COOKIE['set_lang']=="th"?"เลขที่รายการรับ":"Submission ID"?></span>
<input type="number" name="sbmtID" min="2" max="46">
<button onClick="return viewCustomSubmission()" class="blue" data-title="View" style="display: inline-flex; align-items: center;"><i class="material-icons">toc</i></button>
</div></form>
</div><?php } ?>
</main>
<?php require($dirPWroot."resource/hpe/material.php"); ?>
<footer>
<?php require($dirPWroot."e/Pathway-Speech-Contest/resource/hpe/footer.php"); ?>
</footer>
</body>
</html> | 1.234375 | 1 |
tests/InvoiceTest.php | voquis/pdfapi | 0 | 163 | <?php
namespace AppTest;
use Laravel\Lumen\Testing\DatabaseMigrations;
use Laravel\Lumen\Testing\DatabaseTransactions;
use Smalot\PdfParser\Parser;
class InvoiceTest extends TestCase
{
/**
* Test GET where POST is only allowed, expect 405 status code
*
* @return void
*/
public function testMethodNotAllowed(): void
{
$this->get('/invoice');
$this->assertEquals(
405,
$this->response->getStatusCode()
);
}
/**
* Test missing application/json Content-Type, expect 400 status code
*
* @return void
*/
public function testBadRequest(): void
{
$this->post('/invoice');
$this->assertEquals(
400,
$this->response->getStatusCode()
);
}
/**
* Test valid requests that returns PDF
*
* @return void
*/
public function testValidRequest(): void
{
$data = [
'company' => [
'name' => 'My Company',
'number' => 'OC123456',
'vatNumber' => 'GB1234567890',
'email' => '<EMAIL>',
'telephone' => '01234567890',
'website' => 'www.example.com',
'address' => [
'line1' => 'line 1',
'line2' => 'line 2',
'city' => 'City',
'postcode' => 'PO57 C0D',
]
],
'invoice' => [
'ref' => 'INV-1234',
'summary' => 'Invoice for some service',
'notes' => 'Invoice notes',
'instructions' => 'Invoice payment instructions',
'symbol' => '£',
'net' => 100.0,
'tax' => 20.0,
'gross' => 120.0,
'company' => [
'name' => 'Customer Company',
'address' => [
'line1' => 'line 1',
'line2' => 'line 2',
'city' => 'City',
'postcode' => 'PO57 C0D',
]
],
'items' => [
[
'quantity' => 1,
'description' => 'Description 1',
'net' => 1.5,
'taxPercent' => 20,
'gross' => 1.75,
]
],
'keyValuePairs' => [
[
'key' => 'k1',
'value' => 'v1',
]
],
],
'logoHeight' => 40,
'emailTelUnderLogo' => true,
];
$this->json('POST', '/invoice', $data);
// Assert HTTP status code
$this->assertEquals(201, $this->response->getStatusCode());
// Verify PDF contents
$parser = new Parser();
$pdf = $parser->parseContent($this->response->getContent());
$pdfText = $pdf->getText();
$this->assertStringContainsString($data['company']['name'], $pdfText);
$this->assertStringContainsString($data['company']['telephone'], $pdfText);
$this->assertStringContainsString(implode("\n", $data['company']['address']), $pdfText);
$this->assertStringContainsString($data['invoice']['notes'], $pdfText);
}
}
| 1.328125 | 1 |
resources/views/Status/StatusEdit.blade.php | zulaa0722/UABZ | 0 | 171 |
<div id="modalStatusEdit" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
{{-- modal-lg --}}
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mt-0">Төлөв нэмэх</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="frmStatusEdit" action="" method="post">
@csrf
<input type="hidden" name="rowID" id="rowID">
<div class="form-group row">
<div class="col-md-12">
<label>Төлөв</label>
<input class="form-control" type="text" id="estatusName" name="statusName">
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="modal-footer">
<button type="submit" id="btnStatusUpdate" class="btn btn-primary">Хадгалах</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Хаах</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
| 0.628906 | 1 |
app/Entity/Article.php | railt/railt.org | 25 | 179 | <?php
/**
* This file is part of railt.org package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace App\Entity;
use App\Entity\Article\Content;
use App\Entity\Article\Image;
use App\Entity\Common\BaseContent;
use App\Entity\Common\Identifiable;
use App\Entity\Common\Identifier;
use App\Entity\Common\ProvidesContent;
use App\Entity\Common\Timestampable;
use App\Entity\Common\Timestamps;
use Illuminate\Support\Str;
use Renderer\RendererInterface;
/**
* Class Article
*/
class Article implements
Identifiable,
Timestampable,
ProvidesContent
{
use Identifier;
use Timestamps;
/**
* @var string
*/
protected $title;
/**
* @var string
*/
protected $urn = '';
/**
* @var Image
*/
protected $preview;
/**
* @var Content
*/
protected $content;
/**
* Article constructor.
* @param string $title
* @param string $content
*/
public function __construct(string $title, string $content)
{
$this->title = $title;
$this->urn = \str_slug($title);
$this->content = new Content($content);
$this->preview = new Image();
$this->actualize();
}
/**
* @return string
*/
public function getPreviewText(): string
{
$text = $this->getContent()->getBody();
$text = \strip_tags($text);
return Str::words($text, 60);
}
/**
* @return Image
*/
public function getPreview(): Image
{
return $this->preview;
}
/**
* @param string $title
*/
public function rename(string $title): void
{
$this->title = $title;
$this->urn = \str_slug($title);
}
/**
* @return string
*/
public function getTitle(): string
{
return $this->title;
}
/**
* @return string
*/
public function getUrn(): string
{
return $this->urn;
}
/**
* @return Content
*/
public function getContent(): BaseContent
{
return $this->content;
}
/**
* @param RendererInterface $renderer
*/
public function render(RendererInterface $renderer): void
{
$result = $renderer->render($this->content->getRawBody());
$this->content->update($result->getContent());
}
}
| 1.5 | 2 |
application/app/League/Models/Requests.php | josephmancuso/gbaleague | 0 | 187 | <?php
namespace App\League\Models;
use Mira\Models\Model;
class Requests extends Model
{
public $database = 'gbaleague';
}
| 0.363281 | 0 |
src/Oro/Bundle/WorkflowBundle/Entity/ProcessDefinition.php | umbrella-web/oro-platform | 1 | 195 | <?php
namespace Oro\Bundle\WorkflowBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField;
use Symfony\Component\Security\Acl\Model\DomainObjectInterface;
/**
* @ORM\Table("oro_process_definition")
* @ORM\Entity()
* @ORM\HasLifecycleCallbacks()
* @Config(
* routeName="oro_process_definition_index",
* routeView="oro_process_definition_view",
* defaultValues={
* "entity"={
* "icon"="icon-inbox"
* },
* "security"={
* "type"="ACL",
* "group_name"=""
* },
* "note"={
* "immutable"=true
* },
* "activity"={
* "immutable"=true
* },
* "attachment"={
* "immutable"=true
* }
* }
* )
*/
class ProcessDefinition implements DomainObjectInterface
{
/**
* @var string
*
* @ORM\Id
* @ORM\Column(name="name", type="string", length=255)
*/
protected $name;
/**
* @var string
*
* @ORM\Column(name="label", type="string", length=255)
*/
protected $label;
/**
* @var boolean
*
* @ORM\Column(name="enabled", type="boolean")
*/
protected $enabled = true;
/**
* @var string
*
* @ORM\Column(name="related_entity", type="string", length=255)
*/
protected $relatedEntity;
/**
* @var integer
*
* @ORM\Column(name="execution_order", type="smallint")
*/
protected $executionOrder = 0;
/**
* @var array
*
* @ORM\Column(name="exclude_definitions", type="simple_array", nullable=true)
*/
protected $excludeDefinitions;
/**
* @var array
*
* @ORM\Column(name="actions_configuration", type="array")
*/
protected $actionsConfiguration;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
* @ConfigField(
* defaultValues={
* "entity"={
* "label"="oro.ui.created_at"
* }
* }
* )
*/
protected $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime")
* @ConfigField(
* defaultValues={
* "entity"={
* "label"="oro.ui.updated_at"
* }
* }
* )
*/
protected $updatedAt;
/**
* @param string $name
* @return ProcessDefinition
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $label
* @return ProcessDefinition
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* @param boolean $enabled
* @return ProcessDefinition
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
return $this;
}
/**
* @return boolean
*/
public function isEnabled()
{
return $this->enabled;
}
/**
* @param string $relatedEntity
* @return ProcessDefinition
*/
public function setRelatedEntity($relatedEntity)
{
$this->relatedEntity = $relatedEntity;
return $this;
}
/**
* @return string
*/
public function getRelatedEntity()
{
return $this->relatedEntity;
}
/**
* @param integer $executionOrder
* @return ProcessDefinition
*/
public function setExecutionOrder($executionOrder)
{
$this->executionOrder = $executionOrder;
return $this;
}
/**
* @return integer
*/
public function getExecutionOrder()
{
return $this->executionOrder;
}
/**
* @param array $excludeDefinitions
* @return ProcessDefinition
*/
public function setExcludeDefinitions(array $excludeDefinitions)
{
$this->excludeDefinitions = $excludeDefinitions;
return $this;
}
/**
* @return array
*/
public function getExcludeDefinitions()
{
return (array)$this->excludeDefinitions;
}
/**
* @param array $configuration
* @return ProcessDefinition
*/
public function setActionsConfiguration($configuration)
{
$this->actionsConfiguration = $configuration;
return $this;
}
/**
* @return array
*/
public function getActionsConfiguration()
{
return $this->actionsConfiguration;
}
/**
* @param \DateTime $createdAt
* @return ProcessDefinition
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param \DateTime $updatedAt
* @return ProcessDefinition
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @ORM\PrePersist
*/
public function prePersist()
{
$this->createdAt = new \DateTime('now', new \DateTimeZone('UTC'));
$this->preUpdate();
}
/**
* @ORM\PreUpdate
*/
public function preUpdate()
{
$this->updatedAt = new \DateTime('now', new \DateTimeZone('UTC'));
}
/**
* @param ProcessDefinition $definition
* @return ProcessDefinition
*/
public function import(ProcessDefinition $definition)
{
// enabled flag should not be imported
$this->setName($definition->getName())
->setLabel($definition->getLabel())
->setRelatedEntity($definition->getRelatedEntity())
->setExecutionOrder($definition->getExecutionOrder())
->setActionsConfiguration($definition->getActionsConfiguration())
->setExcludeDefinitions($definition->getExcludeDefinitions());
return $this;
}
/**
* Returns a unique identifier for this domain object.
*
* @return string
*/
public function getObjectIdentifier()
{
return $this->getName();
}
}
| 1.242188 | 1 |
backend/views/site/login.php | phamngocson1988/vietnamopening | 0 | 203 | <?php
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
$this->title = 'Login';
?>
<div>
<div class="login_wrapper">
<div class="animate form login_form">
<section class="login_content">
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
<h1>Login Form</h1>
<?= $form->field($model, 'username', [
'template' => "{input}{error}",
])->textInput(['autofocus' => true, 'class' => 'form-control', 'placeholder' => 'Username']) ?>
<?= $form->field($model, 'password', [
'template' => "{input}{error}",
])->passwordInput(['class' => 'form-control', 'placeholder' => 'Password']) ?>
<div>
<?= Html::submitButton('Login', ['class' => 'btn btn-default submit', 'name' => 'login-button']) ?>
</div>
<div class="clearfix"></div>
<div class="separator">
<div class="clearfix"></div>
<br />
<div>
<h1><i class="fa fa-paw"></i> Gentelella Alela!</h1>
<p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 3 template. Privacy and Terms</p>
</div>
</div>
<?php ActiveForm::end(); ?>
</section>
</div>
</div>
</div>
| 1.054688 | 1 |
fckeditor/editor/plugins/kfm/scripts/update.1.1.php | WPPlugins/foliopress-wysiwyg | 0 | 211 | <?php
$version=$kfm_parameters['version'];
if($version==''||$version=='7.0'||$version<'1.0')require KFM_BASE_PATH.'scripts/update.1.0.php';
$kfm_parameters['version']='1.1';
$kfmdb->query("delete from ".KFM_DB_PREFIX."parameters where name='version'");
$kfmdb->query("insert into ".KFM_DB_PREFIX."parameters (name,value) values ('version','".$kfm_parameters['version']."')");
?>
| 1.140625 | 1 |
homepage.php | AmitHasanShuvo/Alif_project | 2 | 219 | <!DOCTYPE html>
<html>
<head>
<title>INFINITY SHOP</title>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/main.css"/>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scaleable=no">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" id="navbar">
<div class="container">
<a href="#" class="navbar-brand" id="text">INFINITY SHOP</a>
<ul class="nav navbar-nav">
<!--DROP DOWN MENU-->
</ul>
</div>
</nav>
<!--INSERTING IMAGES-->
<div id="background-image">
<div id="image-1"></div>
</div>
<!--REMOVING SPACE AND CENTERING IMAGES-->
<div class="col-md-2"></div>
<!--INSERTING FEATURED PRODUCTS-->
<div class="col-md-8">
<div class="row">
<h2 class="text-center"><b>LOG IN</b></h2><br />
<div class="col-md-3">
<img src="images/login.jpg" alt="LOG IN" id="images"/>
<form action="add_cart.php" method="post">
<div class="form-group">
<div class="form-group">
<label for="size">EMAIL:</label>
<input type="text" class="form-control" id="quantity"name="quantity" />
</div><br />
<div class="form-group">
<label for="size">PASSWORD:</label>
<input type="text" class="form-control" id="quantity"name="quantity" />
</div>
</div>
</form>
<a href="/project/index.php" <button type="button" class="btn btn-success">LOG IN</button></a>
</div>
</div>
<footer class="text-center" id="footer">©copyright 2018-2019 INFINITY SHOP</footer>
</div>
</body>
</html>
| 0.925781 | 1 |
resources/views/Alumni/daftarperusahaan.blade.php | dendinurmahmudi/smk_pasundan_2_banjaran | 0 | 227 | @extends('master')
@section('judul','Data perusahaan')
@section('class','fa fa-building-o fa-fw')
@section('label','Data perusahaan')
@extends('Alumni/sidebar')
@section('konten')
<div class="col-sm-12">
<div class="white-box">
<p class="text-muted m-b-30">Daftar perusahaan yang merekrut pekerja dari lulusan SMK Paundan 2 Banjaran untuk rekomendasi melamar pekerjaan ke perusahaan tersebut.</p>
<div class="table-responsive">
<table id="example23" class="display nowrap" cellspacing="0" width="100%">
<thead>
<tr>
<th>No</th>
<th>Perusahaan</th>
<th>Alumni bekerja</th>
<th>Sesuai kompetensi</th>
<th>Merasa puas</th>
</tr>
</thead>
<tbody>
<?php $no=1;
?>
@foreach($perusahaan as $p)
<tr>
@if($p->nama_perusahaan==null)
@else
<td>{{ $no++ }}</td>
<td>{{ $p->nama_perusahaan }}</td>
<td>{{ $p->jumlah }}</td>
<td>{{ $p->kesesuaian }}</td>
<td>{{ $p->kepuasan }}</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<script src="{{ asset('assets/templates/plugins/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<!-- start - This is for export functionality only -->
<script>
$(document).ready(function() {
$('#myTable').DataTable();
$(document).ready(function() {
var table = $('#example').DataTable({
"columnDefs": [{
"visible": false,
"targets": 2
}],
"order": [
[2, 'asc']
],
"displayLength": 25,
"drawCallback": function(settings) {
var api = this.api();
var rows = api.rows({
page: 'current'
}).nodes();
var last = null;
api.column(2, {
page: 'current'
}).data().each(function(group, i) {
if (last !== group) {
$(rows).eq(i).before('<tr class="group"><td colspan="5">' + group + '</td></tr>');
last = group;
}
});
}
});
// Order by the grouping
$('#example tbody').on('click', 'tr.group', function() {
var currentOrder = table.order()[0];
if (currentOrder[0] === 2 && currentOrder[1] === 'asc') {
table.order([2, 'desc']).draw();
} else {
table.order([2, 'asc']).draw();
}
});
});
});
$('#example23').DataTable({
dom: 'Bfrtip',
buttons: [
's'
]
});
</script>
@endsection | 1.148438 | 1 |
app/Model/Entity/LogEntity.php | inspira2015/laravel_inspira2015 | 1 | 235 | <?php
namespace App\Model\Entity;
use App\Model\Dao\LogDao;
class LogEntity extends LogDao
{
public $id;
public $users_id;
public $module;
public $action;
public $method;
public $description;
public function exchangeArray(array $valid_data)
{
$this->id = (isset($valid_data['id'])) ? trim($valid_data['id']) : 0;
$this->users_id = (isset($valid_data['users_id'])) ? trim($valid_data['users_id']) : null;
$this->module = (isset($valid_data['module'])) ? trim($valid_data['module']) : null;
$this->action = (isset($valid_data['action'])) ? trim($valid_data['action']) : null;
$this->method = (isset($valid_data['method'])) ? trim($valid_data['method']) : null;
$this->description = (isset($valid_data['description'])) ? trim($valid_data['description']) : null;
}
}
| 1.15625 | 1 |
database/migrations/2021_01_14_134402_create_nota_ventas_table.php | WillanHurtado-Dev-Pent/management_si | 0 | 243 | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNotaVentasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('nota_ventas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('descuento');
$table->string('fecha', 100)->default('23/02/2021');
$table->integer('monto');
$table->integer('tipo');
$table->integer('total');
/* $table->unsignedBigInteger('persona_id'); */
$table->unsignedBigInteger('paquete_id');
$table->unsignedBigInteger('bitacora_id');
$table->timestamps();
/* $table->foreign('persona_id')->references('id')->on('personas'); */
$table->foreign('paquete_id')->references('id')->on('paquetes');
$table->foreign('bitacora_id')->references('id')->on('bitacoras');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('nota_ventas');
}
}
| 1.03125 | 1 |
resources/views/layouts/one.blade.php | plwebdesigns/bluecrm | 0 | 251 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="<KEY>" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('sass/app.scss') }}" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="<KEY>" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<img class="my-0 mr-md-auto" src="{{ asset('images/blue-logo.png') }}" height="95px" />
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link text-white" href="{{ url('/') }}">Production</a>
</li>
<li class="nav-item">
<a class="nav-link text-white" href="{{ url('/#/admin') }}">Admin</a>
</li>
</ul>
</div>
</nav>
<main class="container-fluid add_sale_main mt-4">
@yield('content')
</main>
</body>
</html>
| 0.703125 | 1 |
Application/Runtime/Cache/Admin/c5e5a590f8def41735c09c7493f535ab.php | Dearzhumengren/TP3_APP | 0 | 259 | <?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--引入顶部-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>明日科技后台</title>
<link href="/APP/Public/css/module.css" rel="stylesheet"/>
<link href="/APP/Public/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
<link href="/APP/Public/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">
<link href="/APP/Public/css/animate.css" rel="stylesheet">
<link href="/APP/Public/css/admin-style.css?v=2.2.0" rel="stylesheet">
<!-- Mainly scripts -->
<script src="/APP/Public/js/jquery-2.1.1.min.js"></script>
<script src="/APP/Public/js/bootstrap.min.js?v=3.4.0"></script>
<!--Layer-->
<script src="/APP/Public/static/layer/layer.js"></script>
<script type="text/javascript" src="/APP/Public/js/admin.js"></script>
<script src="/APP/Public/js/jquery.metisMenu.js"></script>
<!-- Custom and plugin javascript -->
<script src="/APP/Public/js/hplus.js?v=2.2.0"></script>
</head>
<body>
<div id="wrapper">
<!--引入左则导航-->
<script>
$(function(){
var controller_name = "<?php echo CONTROLLER_NAME;?>";
var nav = $('.nav-second-level a');
nav.each(function(){
var url = $(this).attr('href');
console.log(url);
if(url.indexOf('/'+controller_name) > 0){
$(this).parent().addClass('active');
return false;
}
});
});
</script>
<nav class="navbar-default navbar-static-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="side-menu">
<li class="nav-header" style="padding: 25px 20px;">
<div class="dropdown profile-element">
<span>
<img alt="image" class="img-circle" height="60px" src="/APP/Public/images/profile_small.jpg" />
</span>
<a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
<span class="clear"> <span class="block m-t-xs"> <strong class="font-bold"><?php echo (session('admin_username')); ?></strong>
</span> <span class="text-muted text-xs block"><?php if(($_SESSION['admin_id']) == "1"): ?>超级管理员<?php else: ?>管理员<?php endif; ?> <b class="caret"></b></span> </span>
</a>
<ul class="dropdown-menu animated fadeInRight m-t-xs">
<li><a href="<?php echo U('Index/changePassword');?>">修改密码</a></li>
<li class="divider"></li>
<li><a href="<?php echo U('Public/logout');?>">安全退出</a>
</li>
</ul>
</div>
<div class="logo-element">
MR
</div>
</li>
<li class="active">
<a href="#"><i class="fa fa-edit" style="width: 18px"></i> <span class="nav-label">管理</span> <span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="<?php echo U('HighLevel/lists');?>">高级分类</a></li>
<li><a href="<?php echo U('MiddleLevel/lists');?>">中级分类</a></li>
<li><a href="<?php echo U('ElementaryLevel/lists');?>">初级分类</a></li>
<li><a href="<?php echo U('Datalist/lists');?>">数据管理</a></li>
<li><a href="<?php echo U('Hot/lists');?>">热门管理</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div id="page-wrapper" class="gray-bg dashbard-1">
<div class="row border-bottom">
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#">
<i class="fa fa-bars"></i>
</a>
</div>
<ul class="nav navbar-top-links navbar-right">
<li>
<span class="m-r-sm text-muted welcome-message">
<a href="<?php echo U('Datalist/lists');?>" title="返回首页"><i class="fa fa-home"></i>欢迎使用明日导航后台</a>
</span>
</li>
<li>
<a href="<?php echo U('Public/logout');?>">
<i class="fa fa-sign-out"></i> 退出
</a>
</li>
</ul>
</nav>
</div> <!--顶部-->
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>添加分类</h5>
</div>
<div class="ibox-content">
<form class="form-horizontal m-t " method="post" action="<?php echo U('add');?>">
<input type="hidden" name='id' value="<?php echo ($_GET['id']); ?>">
<div class="form-group">
<label class="col-sm-3 control-label">首页显示位置:</label>
<div class="col-sm-3">
<select name="layout">
<option value="left" <?php if(($data["layout"] == 'left')): ?>selected<?php endif; ?>>左侧</option>
<option value="bottom" <?php if(($data["layout"] == 'bottom')): ?>selected<?php endif; ?>>底部</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">名称:</label>
<div class="col-sm-3">
<input type="text" id="high_name" class="form-control" name="high_name" value="<?php echo ($data["high_name"]); ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序:</label>
<div class="col-sm-3">
<input type="text" id="sort" class="form-control" name="sort" value="<?php echo ($data["sort"]); ?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否显示:</label>
<input type="radio" value="0" name="is_display" <?php if(($data["is_display"] != 1)): ?>checked<?php endif; ?> />
否
<input type="radio" value="1" name="is_display" <?php if(($data["is_display"] == 1)): ?>checked<?php endif; ?> />
是
</div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-3">
<button class="btn btn-primary" type="submit">提交</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!--尾部-->
</div>
<script>
$('form').submit(function(){
var name = $('#high_name').val();
var sort = $("#sort").val();
if(name == ''){
layer.msg('请填写名称',{time:1000});
return false;
}
if(!sort || isNaN(sort)){
layer.msg('请填写排序,并且为数字',{time:1000});
return false;
}
});
</script>
</div>
</body>
</html> | 0.816406 | 1 |
src/Lits/Data/ShelfData.php | BGSU-LITS/depo | 0 | 267 | <?php
declare(strict_types=1);
namespace Lits\Data;
use Lits\Database;
use Lits\Exception\DuplicateInsertException;
use Lits\Exception\InvalidDataException;
use Lits\Settings;
final class ShelfData extends DatabaseData
{
public string $module;
public string $side;
public string $section;
public string $shelf;
public ?string $tray_id = null;
/**
* @param mixed[] $row
* @throws InvalidDataException
*/
public static function fromRow(
array $row,
Settings $settings,
Database $database
): self {
$shelf = new static($settings, $database);
$shelf->module = self::checkString($row, 'module');
$shelf->side = self::checkString($row, 'side');
$shelf->section = self::checkString($row, 'section');
$shelf->shelf = self::checkString($row, 'shelf');
if (
isset($row['tray_id']) &&
\is_string($row['tray_id']) &&
$row['tray_id'] !== ''
) {
$shelf->tray_id = $row['tray_id'];
}
return $shelf;
}
/**
* @throws \PDOException
* @throws DuplicateInsertException
*/
public function save(): void
{
$this->database->delete('shelf', [
'module' => $this->module,
'side' => $this->side,
'section' => $this->section,
'shelf' => $this->shelf,
]);
if (\is_null($this->tray_id)) {
return;
}
$this->database->insert('shelf', [
'module' => $this->module,
'side' => $this->side,
'section' => $this->section,
'shelf' => $this->shelf,
'tray_id' => $this->tray_id,
]);
}
/**
* @param mixed[] $row
* @throws InvalidDataException
*/
public static function checkString(array $row, string $key): string
{
if (
!isset($row[$key]) ||
!\is_string($row[$key]) ||
$row[$key] === ''
) {
throw new InvalidDataException(
'The ' . $key . ' must be specified'
);
}
return $row[$key];
}
}
| 1.5625 | 2 |
src/Captioning/Format/WebvttFile.php | danut007ro/captioning | 0 | 275 | <?php
namespace Captioning\Format;
use Captioning\File;
class WebvttFile extends File
{
const TIMECODE_PATTERN = '#^([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}) --> ([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}) ?(.*)$#';
protected $regions = array();
public function parse()
{
$handle = fopen($this->filename, "r");
$parsing_errors = array();
if ($handle) {
$case = 'header';
$i = 1;
while (($line = fgets($handle)) !== false) {
// checking header
if ($case === 'header' && trim($line) != 'WEBVTT') {
$parsing_errors[] = 'Missing "WEBVTT" at the beginning of the file';
} elseif ($case === 'header') {
$case = 'region';
continue;
}
if ($case !== 'header') {
// parsing regions
if ($case === 'region' && substr($line, 0, 7) == 'Region:') {
$this->addRegion(WebvttRegion::parseFromString($line));
continue;
}
if ($case === 'region' && trim($line) === '') {
$case = 'body';
continue;
}
if ($case === 'body') {
// parsing notes
if (substr($line, 0, 4) === 'NOTE') {
if (trim($line) === 'NOTE') {
$note = $this->lineEnding;
} else {
$note = trim(ltrim($line, 'NOTE ')).$this->lineEnding;
}
// note continues until there is a blank line
while (trim($line = fgets($handle)) !== '') {
$note .= trim($line).$this->lineEnding;
$i++;
}
continue;
}
// parsing cues
$id_match = !strstr($line, '-->') && trim($line) != '';
$matches = array();
$timecode_match = preg_match(self::TIMECODE_PATTERN, $line, $matches);
if ($id_match || $timecode_match) {
$id = null;
$start = null;
$stop = null;
$settings = null;
$text = '';
if ($id_match) {
$id = $line;
$line = fgets($handle);
$matches = array();
$timecode_match = preg_match(self::TIMECODE_PATTERN, $line, $matches);
}
if (!$timecode_match) {
$parsing_errors[] = 'Malformed cue detected at line '.$i;
} else {
$start = $matches[1];
$stop = $matches[2];
$settings = trim($matches[3]);
}
// cue continues until there is a blank line
while (trim($line = fgets($handle)) !== '') {
$text .= trim($line).$this->lineEnding;
}
// make the cue object and add it to the file
$cue = new WebvttCue($start, $stop, $text);
$tmp = explode(' ', trim($settings));
foreach ($tmp as $setting) {
$tmp2 = explode(':', $setting);
if (count($tmp2) !== 2) {
continue;
}
$cue->setSetting($tmp2[0], $tmp2[1]);
}
if ($id !== null) {
$cue->setIdentifier($id);
}
if (!empty($note)) {
$cue->setNote($note);
unset($note);
}
$this->addCue($cue);
unset($cue);
continue;
}
}
}
$i++;
}
} else {
throw new \Exception('Could not read the file "'.$this->filename.'".');
}
fclose($handle);
if (count($parsing_errors) > 0) {
throw new \Exception('The following errors were found while parsing the file:'."\n".print_r($parsing_errors, true));
}
return $this;
}
public function addRegion(WebvttRegion $_region)
{
$this->regions[] = $_region;
return $this;
}
public function getRegion($_index)
{
if (!isset($this->regions[$_index])) {
return;
}
return $this->regions[$_index];
}
public function getRegions()
{
return $this->regions;
}
public function buildPart($_from, $_to)
{
$this->sortCues();
$buffer = "WEBVTT".$this->lineEnding;
foreach ($this->regions as $region) {
$buffer .= $region.$this->lineEnding;
}
$buffer .= $this->lineEnding;
if ($_from < 0 || $_from >= $this->getCuesCount()) {
$_from = 0;
}
if ($_to < 0 || $_to >= $this->getCuesCount()) {
$_to = $this->getCuesCount()-1;
}
for ($j = $_from; $j <= $_to; $j++) {
$buffer .= $this->getCue($j).$this->lineEnding;
}
$this->fileContent = $buffer;
return $this;
}
}
| 1.921875 | 2 |
tests/bson/bug0347.phpt | kvwalker/mongo-php-driver | 2 | 283 | --TEST--
Test for PHPC-347: Memory leak decoding empty buffer
--FILE--
<?php
require_once __DIR__ . '/../utils/tools.php';
try {
var_dump(toPHP(''));
} catch (MongoDB\Driver\Exception\UnexpectedValueException $e) {
echo $e->getMessage(), "\n";
}
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
Could not read document from BSON reader
===DONE===
| 0.957031 | 1 |
72-acceptance-test/src/Backoffice/Auth/Application/Authenticate/AuthenticateUserCommandHandler.php | mlorente/symfony-maintainable-scalable-course | 15 | 291 | <?php
declare(strict_types=1);
namespace CodelyTv\Backoffice\Auth\Application\Authenticate;
use CodelyTv\Backoffice\Auth\Domain\AuthPassword;
use CodelyTv\Backoffice\Auth\Domain\AuthUsername;
use CodelyTv\Shared\Domain\Bus\Command\CommandHandler;
final class AuthenticateUserCommandHandler implements CommandHandler
{
public function __construct(private UserAuthenticator $authenticator)
{
}
public function __invoke(AuthenticateUserCommand $command): void
{
$username = new AuthUsername($command->username());
$password = new AuthPassword($command->password());
$this->authenticator->authenticate($username, $password);
}
}
| 1.242188 | 1 |
routes/web.php | arif98741/dust-management | 0 | 299 | <?php
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
Route::get('/', 'HomeController@index');
Route::get('/user-register', 'HomeController@userRegister');
Route::post('/user-register', 'HomeController@saveUser');
Route::get('/see-dust-request', 'HomeController@seeDustRequest');
Route::get('do/logout', function () {
Auth::logout();
return redirect('/');
});
/**
* Routes For Admin
*/
Route::namespace('Admin')
->middleware(['admin', 'web'])
->prefix('admin')
->as('admin.')
->group(function () {
Route::get('dashboard', 'AdminController@index');
Route::resource('driver', 'DriverController');
Route::resource('driver', 'DriverController');
Route::get('dust-request', 'DustController@Dustrequest');
Route::get('/payment-list', 'DustController@PaymentList');
Route::get('/change-payment-status/{status}', 'DustController@changePaymentStatus');
});
/**
* Routes For Driver
*/
Route::group(['middleware' => 'driver', 'prefix' => 'driver'], function () {
Route::get('dashboard', 'Driver\DriverController@index');
Route::get('request', 'Driver\DriverController@request');
Route::get('accept-request/{id}', 'Driver\DriverController@Acceptrequest');
});
/**
* Routes For User
* @prefix user
* @namespace
*/
Route::group(['middleware' => 'user', 'prefix' => 'user'], function () {
Route::get('dashboard', 'User\UserController@index');
Route::get('my-request', 'User\UserController@myRequest');
Route::get('add-new-request', 'User\UserController@addNewRequest');
Route::post('add-new-request', 'User\UserController@saveNewRequest');
Route::match(['get', 'post'], '/add-payment', 'User\UserController@AddPayment');
Route::get('/payment-list', 'User\UserController@PaymentList');
});
Auth::routes();
Route::get('denied', function () {
return view('errors.permission-denied');
})->name('denied');
| 0.859375 | 1 |
src/hitchLibrary/Hitch/Mapping/Annotation/XmlList.php | qutub11/Hotstar-Video-Download | 17 | 307 | <?php
/**
* This file is part of the Hitch package
*
* (c) <NAME> <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Hitch\Mapping\Annotation;
use Doctrine\Common\Annotations\Annotation;
/**
* XmlList maps a property to a collection of XML nodes
*
* @author marc
*/
class XmlList extends Annotation {
public $name;
public $type;
public $wrapper;
}
| 1 | 1 |
backend/models/Transaction.php | SeenSeens/perfumein | 0 | 315 | <?php
namespace backend\models;
use Yii;
/**
* This is the model class for table "Transaction".
*
* @property int $ID_Transaction
* @property string $Status
* @property int $ID_Users
* @property string $Full_Name
* @property string $Email
*/
class Transaction extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'Transaction';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['ID_Users'], 'integer'],
[['Status'], 'string', 'max' => 20],
[['Full_Name', 'Email'], 'string', 'max' => 200],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'ID_Transaction' => 'Mã giao dịch',
'Status' => 'Trạng thái',
'ID_Users' => 'Mã người dùng',
'Full_Name' => '<NAME>',
'Email' => 'Thư điện tử',
];
}
}
| 1.234375 | 1 |
src/User/HTMLForm/UserLoginForm.php | SpaceLenore/ramverk1-project | 0 | 323 | <?php
namespace Lenore\User\HTMLForm;
use Anax\HTMLForm\FormModel;
use Psr\Container\ContainerInterface;
use Lenore\User\User;
/**
* Example of FormModel implementation.
*/
class UserLoginForm extends FormModel
{
/**
* Constructor injects with DI container.
*
* @param Psr\Container\ContainerInterface $di a service container
*/
public function __construct(ContainerInterface $di)
{
parent::__construct($di);
$this->form->create(
[
"id" => __CLASS__,
"legend" => "User Login"
],
[
"user" => [
"type" => "text",
"placeholder" => "Username",
],
"password" => [
"type" => "password",
"placeholder" => "password",
],
"submit" => [
"type" => "submit",
"value" => "Login",
"callback" => [$this, "callbackSubmit"]
],
]
);
}
/**
* Callback for submit-button which should return true if it could
* carry out its work and false if something failed.
*
* @return boolean true if okey, false if something went wrong.
*/
public function callbackSubmit()
{
$username = $this->form->value("user");
$password = $this->form->value("password");
$user = new User();
$user->setDb($this->di->get("dbqb"));
$res = $user->verifyPassword($username, $password);
if (!$res) {
$this->form->rememberValues();
$this->form->addOutput("User or password did not match.");
return false;
}
$this->form->addOutput("User " . $user->username . " logged in.");
//Set session to active
$session = $this->di->get("session");
$response = $this->di->get("response");
$session->set("login", $user->id);
$response->redirect("profile");
// return true;
}
}
| 1.5625 | 2 |
config/setting.php | Socotoly/Stasis | 0 | 331 | <?php
return [
'roles' => [
'owner',
'admin',
'manage_users'
]
]; | 0.07666 | 0 |
app/AwardCategory.php | graspsoftwaresolutions/payroll | 0 | 339 | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class AwardCategory extends Model {
protected $fillable = [
'created_by', 'award_title', 'publication_status', 'deletion_status',
];
}
| 0.65625 | 1 |
bonfire/Modules/Guides/Language/en/Guides.php | mostafakhudair/Bonfire2 | 42 | 347 | <?php
/**
* This file is part of Bonfire.
*
* (c) <NAME> <<EMAIL>>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
return [
'invalidCollection' => 'The collection is invalid or misconfigured.',
'invalidPage' => 'That page is not valid.',
];
| 0.464844 | 0 |
resources/views/welcome.blade.php | aldirizaldi14/Orbitwebase2 | 0 | 355 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<!-- begin::Head -->
<head>
<meta charset="utf-8" />
<title>
{{ env('APP_NAME') }}
</title>
<meta name="description" content="{{ env('APP_DESC') }}">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!--begin:: Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('css/vendors.css') }}" rel="stylesheet">
<link href="{{ asset('themes/metronic/style.bundle.css') }}" rel="stylesheet">
<!--end:: Styles -->
<link rel="shortcut icon" href="{{ asset('images/icon.png') }}" />
</head>
<!-- end::Head -->
<!-- begin::Body -->
<body class="m-page--fluid m--skin- m-content--skin-light2 m-header--fixed m-header--fixed-mobile m-aside-left--enabled m-aside-left--skin-dark m-aside-left--offcanvas m-footer--push m-aside--offcanvas-default" >
<!-- begin:: Page -->
<div class="m-grid m-grid--hor m-grid--root m-page">
<!-- BEGIN: Header -->
@include('templates.header')
<!-- END: Header -->
<!-- begin::Body -->
<div class="m-grid__item m-grid__item--fluid m-grid m-grid--ver-desktop m-grid--desktop m-body">
<!-- BEGIN: Left Aside -->
@include('templates.sidebar')
<!-- END: Left Aside -->
@yield('content')
</div>
<!-- end:: Body -->
<!-- begin::Footer -->
@include('templates.footer')
<!-- end::Footer -->
</div>
<!-- end:: Page -->
<!-- begin::Scroll Top -->
<div id="m_scroll_top" class="m-scroll-top">
<i class="la la-arrow-up"></i>
</div>
<!-- end::Scroll Top -->
<!--begin::Base Scripts -->
<script src="{{ asset('js/app.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/vendors.js') }}" type="text/javascript"></script>
<!--end::Base Scripts -->
</body>
<!-- end::Body -->
</html>
| 0.734375 | 1 |
src/RESTFul/RESTService.php | PHPPlatform/restful | 0 | 363 | <?php
/**
* User: Raaghu
* Date: 20-10-2015
* Time: PM 10:51
*/
namespace PhpPlatform\RESTFul;
interface RESTService{
} | 0.380859 | 0 |
helper.createTransaction.php | eiriarte-mendez/php-sdk | 0 | 371 | <?php
require __DIR__ . '/vendor/autoload.php';
require_once "ratepay_credentials.php";
// Helper opens a new transaction (PaymentInit & PaymentRequest) to use it in further requests.
$mbHead = new RatePAY\ModelBuilder();
$mbHead->setArray([
'SystemId' => "Example",
'Credential' => [
'ProfileId' => PROFILE_ID,
'Securitycode' => SECURITYCODE
],
]);
$rb = new RatePAY\RequestBuilder(true);
$paymentInit = $rb->callPaymentInit($mbHead);
if (!$paymentInit->isSuccessful()) die("PaymentInit not successful");
$transactionId = $paymentInit->getTransactionId();
$mbHead->setTransactionId($transactionId);
$mbHead->setCustomerDevice(
$mbHead->CustomerDevice()->setDeviceToken("<PASSWORD>")
);
$mbContent = new RatePAY\ModelBuilder('Content');
$mbContent->setArray([
'Customer' => [
'Gender' => "f",
'FirstName' => "Alice",
'LastName' => "Nobodyknows",
'DateOfBirth' => "1975-12-17",
'IpAddress' => "127.0.0.1",
'Addresses' => [
[
'Address' => [
'Type' => "billing",
'Street' => "Hive Street 12",
'ZipCode' => "12345",
'City' => "Raccoon City",
'CountryCode' => "de",
]
]
],
'Contacts' => [
'Email' => "<EMAIL>",
'Phone' => [
'DirectDial' => "012 3456789"
],
],
],
'ShoppingBasket' => [
'Items' => [
[
'Item' => [
'Description' => "Test product 1",
'ArticleNumber' => "ArtNo1",
'Quantity' => 1,
'UnitPriceGross' => 300,
'TaxRate' => 19,
]
], [
'Item' => [
'Description' => "Test product 2",
'ArticleNumber' => "ArtNo2",
'Quantity' => 2,
'UnitPriceGross' => 100,
'TaxRate' => 19,
'Discount' => 10
]
]
]
],
'Payment' => [
'Method' => "invoice",
'Amount' => 480
]
]);
$rb = new RatePAY\RequestBuilder(true);
$paymentRequest = $rb->callPaymentRequest($mbHead, $mbContent);
if (!$paymentRequest->isSuccessful()) die("PaymentRequest not successful"); | 1.453125 | 1 |
vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php | hasanbasri2307/tata | 0 | 379 | <?php
namespace Mockery\Adapter\Phpunit;
/**
* Integrates Mockery into PHPUnit. Ensures Mockery expectations are verified
* for each test and are included by the assertion counter.
*/
trait MockeryPHPUnitIntegration
{
/**
* Performs assertions shared by all tests of a test case. This method is
* called before execution of a test ends and before the tearDown method.
*/
protected function assertPostConditions()
{
parent::assertPostConditions();
// Add Mockery expectations to assertion count.
if (($container = \Mockery::getContainer()) !== null) {
$this->addToAssertionCount($container->mockery_getExpectationCount());
}
// Verify Mockery expectations.
\Mockery::close();
}
}
| 1.21875 | 1 |
aula-06/exercicio-04.php | NicoCassio/cursoemvideo-php | 0 | 387 | <html>
<head>
<meta charset="utf-8" />
<title>Aprendendo PHP</title>
<link rel="stylesheet" href="../_css/estilo.css" />
</head>
<body>
<div id="interface">
<header id="cabecalho">
<h1>Aprendendo novidades em PHP</h1>
</header>
<section id="corpo">
<?php
$x = "abc";
$$x = "def";
echo "Conteúdo de 'x': $x";
echo "<br />Conteúde de 'abc': $abc";
?>
</section>
</div>
</body>
</html>
| 0.710938 | 1 |
rules/DeadCode/Contract/ConditionInterface.php | echo511/rector-src | 37 | 395 | <?php
declare(strict_types=1);
namespace Rector\DeadCode\Contract;
interface ConditionInterface
{
}
| 0.566406 | 1 |
resources/views/frontend/sliders/slider.blade.php | neyamulkn/ecom-multi | 0 | 403 | <div class="container-fluid page-builder-ltr">
<div class="row row_a90w row-style ">
<!--- SLider right-->
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 col_dg1b slider-right">
<div class="module sohomepage-slider so-homeslider-ltr ">
<div class="modcontent">
<div id="sohomepage-slider1">
<div class="so-homeslider sohomeslider-inner-1">
@foreach($sliders as $slider)
<div class="item">
<a href="{{$slider->btn_link}}" target="_self">
<img style="max-height: 350px" class="responsive" src="{{asset('upload/images/slider/'.$slider->phato)}}" alt="slider image">
</a>
<div class="slider-details">
<div class="slider-content-5 slider-animated-1 text-{{$slider->text_position}}">
<h1><strong style="font-size:{{$slider->title_size}}px; color:{{$slider->title_color}}; font-family: {{$slider->title_style}}"> {{ $slider->title }} </strong></h1>
<p style="font-size:{{$slider->title_size}}px; color:{{$slider->title_color}}; font-family: {{$slider->title_style}}">{{$slider->subtitle}}</p>
@if($slider->btn_text) <a href="{{$slider->btn_link}}" class="btn btn-info">{{($slider->btn_text) ? $slider->btn_text : 'SHOP NOW'}}</a>@endif
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
| 1.015625 | 1 |
tests/Feature/Page/MemberPasswordChangeTest.php | elrichuang/meedu | 1 | 411 | <?php
namespace Tests\Feature\Page;
use App\Services\Member\Models\User;
use Illuminate\Support\Facades\Hash;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class MemberPasswordChangeTest extends TestCase
{
public function test_member_password_change()
{
$user = factory(User::class)->create();
$this->actingAs($user)
->visit(route('member.password_reset'))
->assertResponseStatus(200);
}
public function test_member_password_change_action()
{
$password = '<PASSWORD>';
$user = factory(User::class)->create([
'password' => <PASSWORD>($password),
]);
$newPassword = '<PASSWORD>';
$this->actingAs($user)
->visit(route('member.password_reset'))
->type($newPassword, 'new_password')
->type($newPassword, 'new_password_confirmation')
->type($password, 'old_password')
->press('修改密码')
->assertResponseStatus(200);
// 断言密码修改成功
$user->refresh();
$this->assertTrue(Hash::check($newPassword, $user->password));
}
}
| 1.320313 | 1 |
src/datasource/vector.php | trialforce/blend | 7 | 419 | <?php
namespace DataSource;
/**
* Query datasource
*/
class Vector extends DataSource
{
/**
* Data
*
* @var array
*/
protected $data;
protected $fullData;
public function __construct($data)
{
if ($data instanceof \Db\Collection)
{
$data = $data->getData();
}
$this->setData($data);
}
public function getCount()
{
return count($this->fullData);
}
public function setData($data)
{
$this->data = $data;
$this->fullData = $data;
}
public function getData()
{
//make order if needed
if (!is_null($this->getOrderBy()))
{
usort($this->fullData, array($this, "compareToOrder"));
}
//make pagination work on array
if ($this->getLimit() && $this->getOffset() || $this->getOffset() == '0')
{
$this->data = array_slice($this->fullData, $this->getOffset(), $this->getLimit());
}
return $this->data;
}
public function compareToOrder($first, $second)
{
$columnName = $this->getOrderBy();
$orderWay = $this->getOrderWay();
$firstl = '';
$secondl = '';
if (isset($first->$columnName))
{
$firstl = strtolower($first->$columnName);
//obtém só os caracteres numéricos caso seja um valor numérico
if (\Type\Integer::isNumeric($firstl))
{
$firstl = \Type\Integer::onlyNumbers($firstl);
}
}
if (isset($second->$columnName))
{
$secondl = strtolower($second->$columnName);
if (\Type\Integer::isNumeric($secondl))
{
$secondl = \Type\Integer::onlyNumbers($secondl);
}
}
if ($firstl == $secondl)
{
return 0;
}
else if (strtoupper($orderWay) == \Db\Model::ORDER_ASC)
{
return ($firstl > $secondl) ? +1 : -1;
}
else
{
return ($firstl > $secondl) ? -1 : +1;
}
}
public function executeAggregator(Aggregator $aggregator)
{
$data = $this->fullData;
$columnName = $aggregator->getColumnName();
$money = false;
$total = 0;
if (is_array($data))
{
//TODO make other aggregation methods
if ($aggregator->getMethod() == Aggregator::METHOD_SUM)
{
foreach ($data as $item)
{
$value = $item->$columnName;
if ($value instanceof \Type\Generic)
{
$value = $value->toDb();
}
//add suporte for braizilian real
if (stripos($value, 'R$') === 0)
{
$money = true;
$value = \Type\Money::get($value)->toDb();
}
else
{
$value = \Type\Decimal::get($value)->toDb();
}
$total += $value;
}
}
else if ($aggregator->getMethod() == Aggregator::METHOD_COUNT)
{
$total = count($data);
}
}
if ($money)
{
$total = \Type\Money::get($total);
}
else
{
$total = \Type\Decimal::get($total);
}
return $aggregator->getLabelledValue($total);
}
}
| 1.617188 | 2 |
src/Snippets/MethodSignatures/ExecTrait.php | dereuromark/upgrade | 21 | 427 | <?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since CakePHP(tm) v 3.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Upgrade\Snippets\MethodSignatures;
trait ExecTrait {
/**
* @param string $string
* @param array $replacements
*
* @return string
*/
protected function exec(string $string, array $replacements): string {
return $this->_updateContents($string, $replacements);
}
}
| 1.085938 | 1 |
tests/swoole_http_server_coro/rawContent_get_big_data.phpt | luolaifa000/swoole-src | 18,795 | 435 | --TEST--
swoole_http_server_coro: rawContent get big data
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';
use Swoole\Coroutine\Http\Server;
use Swoole\Http\Request;
use Swoole\Http\Response;
use function Swoole\Coroutine\run;
$pm = new SwooleTest\ProcessManager;
$pm->initRandomData(1, 64 * 1024);
$pm->parentFunc = function () use ($pm) {
run(function () use($pm) {
httpRequest("http://127.0.0.1:{$pm->getFreePort()}/", [
'method' => 'POST',
'data' => $pm->getRandomData(),
]);
});
$pm->kill();
};
$pm->childFunc = function () use ($pm) {
run(function () use($pm) {
$server = new Server('127.0.0.1', $pm->getFreePort());
$server->handle('/', function (Request $request, Response $response) use ($pm) {
Assert::assert($request->rawContent() === $pm->getRandomData());
Assert::length($request->rawContent(), 64 * 1024);
});
$server->start();
});
};
$pm->childFirst();
$pm->run();
?>
--EXPECT--
| 1.445313 | 1 |
functions.php | soup-bowl/wordpress-headless-theme | 1 | 443 | <?php
add_action( 'login_enqueue_scripts', function() {
wp_enqueue_style( 'notheme-login-style', trailingslashit( get_stylesheet_directory_uri() ) . 'admin.css' );
});
add_action( 'admin_menu', function() {
remove_menu_page( 'edit.php' );
remove_menu_page( 'edit.php?post_type=page' );
remove_menu_page( 'edit-comments.php' );
remove_menu_page( 'upload.php' );
});
add_action( 'wp_dashboard_setup', function() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity'] );
});
add_action( 'wp_before_admin_bar_render', function() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu( 'site-name' );
$wp_admin_bar->remove_menu( 'view-site' );
$wp_admin_bar->remove_menu( 'comments' );
$wp_admin_bar->remove_menu( 'new-post' );
$wp_admin_bar->remove_menu( 'new-media' );
$wp_admin_bar->remove_menu( 'new-page' );
});
| 0.746094 | 1 |
tests/CodePageTest.php | karlerss/detect-encoding | 18 | 451 | <?php
namespace Onnov\DetectEncoding\Tests;
use Onnov\DetectEncoding\CodePage;
use Onnov\DetectEncoding\EncodingDetector;
use PHPUnit\Framework\TestCase;
class CodePageTest extends TestCase
{
public function testInstance()
{
$codePage = new CodePage();
$this->assertInstanceOf(CodePage::class, $codePage);
}
public function testGetRange()
{
$cyrillicUppercase = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФЧЦЧШЩЪЫЬЭЮЯ';
$cyrillicLowercase = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя';
$codePage = new CodePage();
$this->assertSame(
[
EncodingDetector::IBM866 => [
'upper' => '128-148, 150-159, 240',
'lower' => '160-175, 224-239, 241',
]
],
$codePage->getRange(
$cyrillicUppercase,
$cyrillicLowercase,
EncodingDetector::IBM866
)
);
$this->assertSame(
[
EncodingDetector::KOI8_R => [
'upper' => '179, 224-231, 233-255',
'lower' => '163, 192-223'
]
],
$codePage->getRange(
$cyrillicUppercase,
$cyrillicLowercase,
EncodingDetector::KOI8_R
)
);
}
}
| 1.3125 | 1 |
src/SuiviBundle/Controller/SuiviController.php | malekboussaa/PIDEV2020 | 0 | 459 | <?php
namespace SuiviBundle\Controller;
use Doctrine\ORM\EntityRepository;
use SuiviBundle\Entity\Classe;
use SuiviBundle\Entity\ListeAppel;
use SuiviBundle\Form\ListeAppelType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use UserBundle\Entity\User;
use UserBundle\Form\RegistrationType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class SuiviController extends Controller
{
function AfficherCAction(){
$classe=new Classe();
$cl=$this->getDoctrine()->getRepository(Classe::class)->findAll();
return $this->render('@Suivi/Suivi/afficherc.html.twig',array('cl'=>$cl));
}
function AjoutLAAction($id,Request $request){
$la=new ListeAppel();
$eleve=$this->getDoctrine()->getRepository(User::class)->FindCl($id);
$classe=$this->getDoctrine()->getRepository(Classe::class)->find($id);
return $this->render('@Suivi/Suivi/ajoutla.html.twig',array('e'=>$eleve,'cl'=>$classe,'la'=>$la));
}
function AjoutAAction(Request $request,$ide,$idc){
$la=new ListeAppel();
$eleve1=$this->getDoctrine()->getRepository(User::class)->Find($ide);
$classe=$this->getDoctrine()->getRepository(Classe::class)->find($idc);
$Form=$this->createFormBuilder($la)
->add('eleve', EntityType::class, [
'class' => User::class,
'query_builder' => function (EntityRepository $er) use ($ide) {
return $er->createQueryBuilder('u')
->where('u.id =:id')->setParameter('id',$ide);
},
'choice_label' => 'nom',
]
) ->add('date')
->add('Ajout',SubmitType::class,['attr'=>['formnovalidate'=>'formnovalidate']])
->getForm();
$Form->handleRequest($request);
$em=$this->getDoctrine()->getManager();
if($Form->isSubmitted() && $Form->isValid()) {
$la->setEleve($eleve1);
$la->setClasse($classe);
$la->setEtat('Absent');
$em->persist($la);
$em->flush();
return $this->redirectToRoute('affichela', array('id' => $idc));
}
return $this->render('@Suivi/Suivi/ajoutabsence.html.twig',array('form'=>$Form->createView()));
}
function AfficherLAAction($id){
$la=$this->getDoctrine()->getRepository(ListeAppel::class)->findC($id);
return $this->render('@Suivi/Suivi/afficherla.html.twig',array('la'=>$la));
}
function DeleteAction($id){
$em=$this->getDoctrine()->getManager();
$la = $em->getRepository(ListeAppel::class)->find($id);
$em->remove($la);
$em->flush();
$cl=$la->getClasse();
$idc=$cl->getId();
return $this->redirectToRoute('affichela',array('id'=>$idc));
}
function UpdateAction(Request $request,$id){
$em=$this->getDoctrine()->getManager();
$la = $em->getRepository(ListeAppel::class)->find($id);
$Form=$this->createForm(ListeAppelType::class,$la);
$Form->handleRequest($request);
if($Form->isSubmitted() && $Form->isValid()) {
$em->flush();
$cl=$la->getClasse();
$idc=$cl->getId();
return $this->redirectToRoute('affichela',array('id'=>$idc));
}
return $this->render('@Suivi/Suivi/update.html.twig',array('form'=>$Form->createView()));
}
public function searchAction(Request $request)
{
$em =$this->getDoctrine()->getManager();
$requestString = $request->get('q');
$rec=$em->getRepository(User::class)->ChercherNom($requestString);
if(!$rec) {
$result['rec']['error'] = "Eleve Non Trouvé :( ";
} else {
$result['rec'] = $this->getRealEntities($rec);
}
return new Response(json_encode($result));
}
public function getRealEntities($rec){
foreach ($rec as $rec){
$realEntities[$rec->getId()] = [$rec->getNom(),$rec->getPrenom(),$rec->getId(),$rec->getClasse()->getId()];
}
return $realEntities;
}
}
| 1.5 | 2 |
kontakt.php | artlessmaster/ostseebibelkonferenz | 0 | 467 | <?php
if ($_POST['inputName']!="" and $_POST['inputEmail']!="") {
$empf = "<EMAIL>";
$betreff = "Neue Anmeldung";
$from = "From: ";
$from .= $_POST['inputName'];
$from .= " <";
$from .= $_POST['inputEmail'];
$from .= ">\n";
$from .= "Reply-To: "
$from .= $_POST['inputEmail'];
$from .= "\n";
$from .= "Content-Type: test/html\n";
$text = "<h1>Neue Anmeldung von</h1><p>";
$text .= $_POST['inputName'];
$text .= "für <strong>";
$text .= $_POST['inputAnzahlErwachsene'];
$text .= "Erwachsene</strong> und für <strong>";
$text .= $_POST['inputAnzahlKinder'];
$text .= "Kinder</strong>.";
mail($empf, $betreff, $text, $from);
echo "Vielen Dank!";
} else {
echo "Bitte alle Felder ausfüllen.";
}
?> | 1.398438 | 1 |
knowledgebase/wp-includes/customize/class-wp-customize-nav-menu-setting.php | praveen2207/ZingUpLifeRepo | 23 | 475 | <?php
/**
* Customize API: WP_Customize_Nav_Menu_Setting class
*
* @package WordPress
* @subpackage Customize
* @since 4.4.0
*/
/**
* Customize Setting to represent a nav_menu.
*
* Subclass of WP_Customize_Setting to represent a nav_menu taxonomy term, and
* the IDs for the nav_menu_items associated with the nav menu.
*
* @since 4.3.0
*
* @see wp_get_nav_menu_object()
* @see WP_Customize_Setting
*/
class WP_Customize_Nav_Menu_Setting extends WP_Customize_Setting {
const ID_PATTERN = '/^nav_menu\[(?P<id>-?\d+)\]$/';
const TAXONOMY = 'nav_menu';
const TYPE = 'nav_menu';
/**
* Setting type.
*
* @since 4.3.0
* @access public
* @var string
*/
public $type = self::TYPE;
/**
* Default setting value.
*
* @since 4.3.0
* @access public
* @var array
*
* @see wp_get_nav_menu_object()
*/
public $default = array(
'name' => '',
'description' => '',
'parent' => 0,
'auto_add' => false,
);
/**
* Default transport.
*
* @since 4.3.0
* @access public
* @var string
*/
public $transport = 'postMessage';
/**
* The term ID represented by this setting instance.
*
* A negative value represents a placeholder ID for a new menu not yet saved.
*
* @since 4.3.0
* @access public
* @var int
*/
public $term_id;
/**
* Previous (placeholder) term ID used before creating a new menu.
*
* This value will be exported to JS via the customize_save_response filter
* so that JavaScript can update the settings to refer to the newly-assigned
* term ID. This value is always negative to indicate it does not refer to
* a real term.
*
* @since 4.3.0
* @access public
* @var int
*
* @see WP_Customize_Nav_Menu_Setting::update()
* @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()
*/
public $previous_term_id;
/**
* Whether or not update() was called.
*
* @since 4.3.0
* @access protected
* @var bool
*/
protected $is_updated = false;
/**
* Status for calling the update method, used in customize_save_response filter.
*
* When status is inserted, the placeholder term ID is stored in $previous_term_id.
* When status is error, the error is stored in $update_error.
*
* @since 4.3.0
* @access public
* @var string updated|inserted|deleted|error
*
* @see WP_Customize_Nav_Menu_Setting::update()
* @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()
*/
public $update_status;
/**
* Any error object returned by wp_update_nav_menu_object() when setting is updated.
*
* @since 4.3.0
* @access public
* @var WP_Error
*
* @see WP_Customize_Nav_Menu_Setting::update()
* @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()
*/
public $update_error;
/**
* Constructor.
*
* Any supplied $args override class property defaults.
*
* @since 4.3.0
* @access public
*
* @param WP_Customize_Manager $manager Bootstrap Customizer instance.
* @param string $id An specific ID of the setting. Can be a
* theme mod or option name.
* @param array $args Optional. Setting arguments.
*
* @throws Exception If $id is not valid for this setting type.
*/
public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
if ( empty( $manager->nav_menus ) ) {
throw new Exception( 'Expected WP_Customize_Manager::$nav_menus to be set.' );
}
if ( ! preg_match( self::ID_PATTERN, $id, $matches ) ) {
throw new Exception( "Illegal widget setting ID: $id" );
}
$this->term_id = intval( $matches['id'] );
parent::__construct( $manager, $id, $args );
}
/**
* Get the instance data for a given widget setting.
*
* @since 4.3.0
* @access public
*
* @see wp_get_nav_menu_object()
*
* @return array Instance data.
*/
public function value() {
if ( $this->is_previewed && $this->_previewed_blog_id === get_current_blog_id() ) {
$undefined = new stdClass(); // Symbol.
$post_value = $this->post_value( $undefined );
if ( $undefined === $post_value ) {
$value = $this->_original_value;
} else {
$value = $post_value;
}
} else {
$value = false;
// Note that a term_id of less than one indicates a nav_menu not yet inserted.
if ( $this->term_id > 0 ) {
$term = wp_get_nav_menu_object( $this->term_id );
if ( $term ) {
$value = wp_array_slice_assoc( (array) $term, array_keys( $this->default ) );
$nav_menu_options = (array) get_option( 'nav_menu_options', array() );
$value['auto_add'] = false;
if ( isset( $nav_menu_options['auto_add'] ) && is_array( $nav_menu_options['auto_add'] ) ) {
$value['auto_add'] = in_array( $term->term_id, $nav_menu_options['auto_add'] );
}
}
}
if ( ! is_array( $value ) ) {
$value = $this->default;
}
}
return $value;
}
/**
* Handle previewing the setting.
*
* @since 4.3.0
* @since 4.4.0 Added boolean return value
* @access public
*
* @see WP_Customize_Manager::post_value()
*
* @return bool False if method short-circuited due to no-op.
*/
public function preview() {
if ( $this->is_previewed ) {
return false;
}
$undefined = new stdClass();
$is_placeholder = ( $this->term_id < 0 );
$is_dirty = ( $undefined !== $this->post_value( $undefined ) );
if ( ! $is_placeholder && ! $is_dirty ) {
return false;
}
$this->is_previewed = true;
$this->_original_value = $this->value();
$this->_previewed_blog_id = get_current_blog_id();
add_filter( 'wp_get_nav_menus', array( $this, 'filter_wp_get_nav_menus' ), 10, 2 );
add_filter( 'wp_get_nav_menu_object', array( $this, 'filter_wp_get_nav_menu_object' ), 10, 2 );
add_filter( 'default_option_nav_menu_options', array( $this, 'filter_nav_menu_options' ) );
add_filter( 'option_nav_menu_options', array( $this, 'filter_nav_menu_options' ) );
return true;
}
/**
* Filter the wp_get_nav_menus() result to ensure the inserted menu object is included, and the deleted one is removed.
*
* @since 4.3.0
* @access public
*
* @see wp_get_nav_menus()
*
* @param array $menus An array of menu objects.
* @param array $args An array of arguments used to retrieve menu objects.
* @return array
*/
public function filter_wp_get_nav_menus( $menus, $args ) {
if ( get_current_blog_id() !== $this->_previewed_blog_id ) {
return $menus;
}
$setting_value = $this->value();
$is_delete = ( false === $setting_value );
$index = -1;
// Find the existing menu item's position in the list.
foreach ( $menus as $i => $menu ) {
if ( (int) $this->term_id === (int) $menu->term_id || (int) $this->previous_term_id === (int) $menu->term_id ) {
$index = $i;
break;
}
}
if ( $is_delete ) {
// Handle deleted menu by removing it from the list.
if ( -1 !== $index ) {
array_splice( $menus, $index, 1 );
}
} else {
// Handle menus being updated or inserted.
$menu_obj = (object) array_merge( array(
'term_id' => $this->term_id,
'term_taxonomy_id' => $this->term_id,
'slug' => sanitize_title( $setting_value['name'] ),
'count' => 0,
'term_group' => 0,
'taxonomy' => self::TAXONOMY,
'filter' => 'raw',
), $setting_value );
array_splice( $menus, $index, ( -1 === $index ? 0 : 1 ), array( $menu_obj ) );
}
// Make sure the menu objects get re-sorted after an update/insert.
if ( ! $is_delete && ! empty( $args['orderby'] ) ) {
$this->_current_menus_sort_orderby = $args['orderby'];
usort( $menus, array( $this, '_sort_menus_by_orderby' ) );
}
// @todo add support for $args['hide_empty'] === true
return $menus;
}
/**
* Temporary non-closure passing of orderby value to function.
*
* @since 4.3.0
* @access protected
* @var string
*
* @see WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus()
* @see WP_Customize_Nav_Menu_Setting::_sort_menus_by_orderby()
*/
protected $_current_menus_sort_orderby;
/**
* Sort menu objects by the class-supplied orderby property.
*
* This is a workaround for a lack of closures.
*
* @since 4.3.0
* @access protected
* @param object $menu1
* @param object $menu2
* @return int
*
* @see WP_Customize_Nav_Menu_Setting::filter_wp_get_nav_menus()
*/
protected function _sort_menus_by_orderby( $menu1, $menu2 ) {
$key = $this->_current_menus_sort_orderby;
return strcmp( $menu1->$key, $menu2->$key );
}
/**
* Filter the wp_get_nav_menu_object() result to supply the previewed menu object.
*
* Requesting a nav_menu object by anything but ID is not supported.
*
* @since 4.3.0
* @access public
*
* @see wp_get_nav_menu_object()
*
* @param object|null $menu_obj Object returned by wp_get_nav_menu_object().
* @param string $menu_id ID of the nav_menu term. Requests by slug or name will be ignored.
* @return object|null
*/
public function filter_wp_get_nav_menu_object( $menu_obj, $menu_id ) {
$ok = (
get_current_blog_id() === $this->_previewed_blog_id
&&
is_int( $menu_id )
&&
$menu_id === $this->term_id
);
if ( ! $ok ) {
return $menu_obj;
}
$setting_value = $this->value();
// Handle deleted menus.
if ( false === $setting_value ) {
return false;
}
// Handle sanitization failure by preventing short-circuiting.
if ( null === $setting_value ) {
return $menu_obj;
}
$menu_obj = (object) array_merge( array(
'term_id' => $this->term_id,
'term_taxonomy_id' => $this->term_id,
'slug' => sanitize_title( $setting_value['name'] ),
'count' => 0,
'term_group' => 0,
'taxonomy' => self::TAXONOMY,
'filter' => 'raw',
), $setting_value );
return $menu_obj;
}
/**
* Filter the nav_menu_options option to include this menu's auto_add preference.
*
* @since 4.3.0
* @access public
*
* @param array $nav_menu_options Nav menu options including auto_add.
* @return array (Kaybe) modified nav menu options.
*/
public function filter_nav_menu_options( $nav_menu_options ) {
if ( $this->_previewed_blog_id !== get_current_blog_id() ) {
return $nav_menu_options;
}
$menu = $this->value();
$nav_menu_options = $this->filter_nav_menu_options_value(
$nav_menu_options,
$this->term_id,
false === $menu ? false : $menu['auto_add']
);
return $nav_menu_options;
}
/**
* Sanitize an input.
*
* Note that parent::sanitize() erroneously does wp_unslash() on $value, but
* we remove that in this override.
*
* @since 4.3.0
* @access public
*
* @param array $value The value to sanitize.
* @return array|false|null Null if an input isn't valid. False if it is marked for deletion.
* Otherwise the sanitized value.
*/
public function sanitize( $value ) {
// Menu is marked for deletion.
if ( false === $value ) {
return $value;
}
// Invalid.
if ( ! is_array( $value ) ) {
return null;
}
$default = array(
'name' => '',
'description' => '',
'parent' => 0,
'auto_add' => false,
);
$value = array_merge( $default, $value );
$value = wp_array_slice_assoc( $value, array_keys( $default ) );
$value['name'] = trim( esc_html( $value['name'] ) ); // This sanitization code is used in wp-admin/nav-menus.php.
$value['description'] = sanitize_text_field( $value['description'] );
$value['parent'] = max( 0, intval( $value['parent'] ) );
$value['auto_add'] = ! empty( $value['auto_add'] );
if ( '' === $value['name'] ) {
$value['name'] = _x( '(unnamed)', 'Missing menu name.' );
}
/** This filter is documented in wp-includes/class-wp-customize-setting.php */
return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
}
/**
* Storage for data to be sent back to client in customize_save_response filter.
*
* @access protected
* @since 4.3.0
* @var array
*
* @see WP_Customize_Nav_Menu_Setting::amend_customize_save_response()
*/
protected $_widget_nav_menu_updates = array();
/**
* Create/update the nav_menu term for this setting.
*
* Any created menus will have their assigned term IDs exported to the client
* via the customize_save_response filter. Likewise, any errors will be exported
* to the client via the customize_save_response() filter.
*
* To delete a menu, the client can send false as the value.
*
* @since 4.3.0
* @access protected
*
* @see wp_update_nav_menu_object()
*
* @param array|false $value {
* The value to update. Note that slug cannot be updated via wp_update_nav_menu_object().
* If false, then the menu will be deleted entirely.
*
* @type string $name The name of the menu to save.
* @type string $description The term description. Default empty string.
* @type int $parent The id of the parent term. Default 0.
* @type bool $auto_add Whether pages will auto_add to this menu. Default false.
* }
* @return null|void
*/
protected function update( $value ) {
if ( $this->is_updated ) {
return;
}
$this->is_updated = true;
$is_placeholder = ( $this->term_id < 0 );
$is_delete = ( false === $value );
add_filter( 'customize_save_response', array( $this, 'amend_customize_save_response' ) );
$auto_add = null;
if ( $is_delete ) {
// If the current setting term is a placeholder, a delete request is a no-op.
if ( $is_placeholder ) {
$this->update_status = 'deleted';
} else {
$r = wp_delete_nav_menu( $this->term_id );
if ( is_wp_error( $r ) ) {
$this->update_status = 'error';
$this->update_error = $r;
} else {
$this->update_status = 'deleted';
$auto_add = false;
}
}
} else {
// Insert or update menu.
$menu_data = wp_array_slice_assoc( $value, array( 'description', 'parent' ) );
$menu_data['menu-name'] = $value['name'];
$menu_id = $is_placeholder ? 0 : $this->term_id;
$r = wp_update_nav_menu_object( $menu_id, wp_slash( $menu_data ) );
$original_name = $menu_data['menu-name'];
$name_conflict_suffix = 1;
while ( is_wp_error( $r ) && 'menu_exists' === $r->get_error_code() ) {
$name_conflict_suffix += 1;
/* translators: 1: original menu name, 2: duplicate count */
$menu_data['menu-name'] = sprintf( __( '%1$s (%2$d)' ), $original_name, $name_conflict_suffix );
$r = wp_update_nav_menu_object( $menu_id, wp_slash( $menu_data ) );
}
if ( is_wp_error( $r ) ) {
$this->update_status = 'error';
$this->update_error = $r;
} else {
if ( $is_placeholder ) {
$this->previous_term_id = $this->term_id;
$this->term_id = $r;
$this->update_status = 'inserted';
} else {
$this->update_status = 'updated';
}
$auto_add = $value['auto_add'];
}
}
if ( null !== $auto_add ) {
$nav_menu_options = $this->filter_nav_menu_options_value(
(array) get_option( 'nav_menu_options', array() ),
$this->term_id,
$auto_add
);
update_option( 'nav_menu_options', $nav_menu_options );
}
if ( 'inserted' === $this->update_status ) {
// Make sure that new menus assigned to nav menu locations use their new IDs.
foreach ( $this->manager->settings() as $setting ) {
if ( ! preg_match( '/^nav_menu_locations\[/', $setting->id ) ) {
continue;
}
$post_value = $setting->post_value( null );
if ( ! is_null( $post_value ) && $this->previous_term_id === intval( $post_value ) ) {
$this->manager->set_post_value( $setting->id, $this->term_id );
$setting->save();
}
}
// Make sure that any nav_menu widgets referencing the placeholder nav menu get updated and sent back to client.
foreach ( array_keys( $this->manager->unsanitized_post_values() ) as $setting_id ) {
$nav_menu_widget_setting = $this->manager->get_setting( $setting_id );
if ( ! $nav_menu_widget_setting || ! preg_match( '/^widget_nav_menu\[/', $nav_menu_widget_setting->id ) ) {
continue;
}
$widget_instance = $nav_menu_widget_setting->post_value(); // Note that this calls WP_Customize_Widgets::sanitize_widget_instance().
if ( empty( $widget_instance['nav_menu'] ) || intval( $widget_instance['nav_menu'] ) !== $this->previous_term_id ) {
continue;
}
$widget_instance['nav_menu'] = $this->term_id;
$updated_widget_instance = $this->manager->widgets->sanitize_widget_js_instance( $widget_instance );
$this->manager->set_post_value( $nav_menu_widget_setting->id, $updated_widget_instance );
$nav_menu_widget_setting->save();
$this->_widget_nav_menu_updates[ $nav_menu_widget_setting->id ] = $updated_widget_instance;
}
}
}
/**
* Updates a nav_menu_options array.
*
* @since 4.3.0
* @access protected
*
* @see WP_Customize_Nav_Menu_Setting::filter_nav_menu_options()
* @see WP_Customize_Nav_Menu_Setting::update()
*
* @param array $nav_menu_options Array as returned by get_option( 'nav_menu_options' ).
* @param int $menu_id The term ID for the given menu.
* @param bool $auto_add Whether to auto-add or not.
* @return array (Maybe) modified nav_menu_otions array.
*/
protected function filter_nav_menu_options_value( $nav_menu_options, $menu_id, $auto_add ) {
$nav_menu_options = (array) $nav_menu_options;
if ( ! isset( $nav_menu_options['auto_add'] ) ) {
$nav_menu_options['auto_add'] = array();
}
$i = array_search( $menu_id, $nav_menu_options['auto_add'] );
if ( $auto_add && false === $i ) {
array_push( $nav_menu_options['auto_add'], $this->term_id );
} elseif ( ! $auto_add && false !== $i ) {
array_splice( $nav_menu_options['auto_add'], $i, 1 );
}
return $nav_menu_options;
}
/**
* Export data for the JS client.
*
* @since 4.3.0
* @access public
*
* @see WP_Customize_Nav_Menu_Setting::update()
*
* @param array $data Additional information passed back to the 'saved' event on `wp.customize`.
* @return array Export data.
*/
public function amend_customize_save_response( $data ) {
if ( ! isset( $data['nav_menu_updates'] ) ) {
$data['nav_menu_updates'] = array();
}
if ( ! isset( $data['widget_nav_menu_updates'] ) ) {
$data['widget_nav_menu_updates'] = array();
}
$data['nav_menu_updates'][] = array(
'term_id' => $this->term_id,
'previous_term_id' => $this->previous_term_id,
'error' => $this->update_error ? $this->update_error->get_error_code() : null,
'status' => $this->update_status,
'saved_value' => 'deleted' === $this->update_status ? null : $this->value(),
);
$data['widget_nav_menu_updates'] = array_merge(
$data['widget_nav_menu_updates'],
$this->_widget_nav_menu_updates
);
$this->_widget_nav_menu_updates = array();
return $data;
}
}
| 1.109375 | 1 |
application/views/calendar.php | temilolakutelu/PlatinumVine | 0 | 483 | <link rel="stylesheet" href="http://fullcalendar.io/releases/fullcalendar/3.10.0/fullcalendar.min.css">
<script src='http://fullcalendar.io/releases/fullcalendar/3.10.0/lib/moment.min.js'></script>
<script src='http://fullcalendar.io/releases/fullcalendar/3.10.0/lib/jquery.min.js'></script>
<script src='http://fullcalendar.io/releases/fullcalendar/3.10.0/fullcalendar.min.js'></script>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Events Calendar</h2>
<div id="calendar">
</div>
</div>
</div>
</div>
<style>
/* The Modal (background) */
.modal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
padding-top: 100px;
/* Location of the box */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
outline: none !important;
}
#calendar>.fc-toolbar>.fc-left>*,
#calendar>.fc-toolbar>.fc-left>.btn-group>*,
#calendar>.fc-toolbar>.fc-right>*,
#calendar>.fc-toolbar>.fc-right>.btn-group>* {
color: white;
background: #080c12;
outline: none!important;
border: 1px solid;
}
#calendar>.fc-toolbar>.fc-left>.btn-group>*:hover,
#calendar>.fc-toolbar>.fc-left>.btn-group>*:active,
#calendar>.fc-toolbar>.fc-right>.btn-group>*:hover,
#calendar>.fc-toolbar>.fc-right>.btn-group>*:active,
{
background: grey;
outline: none !important;
}
</style>
<div class="modal" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel"></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var date_last_clicked = null;
$('#calendar').fullCalendar({
themeSystem: 'bootstrap4',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listMonth'
},
weekNumbers: true,
eventLimit: true,
eventSources: [{
events: function(start, end, timezone, callback) {
$.ajax({
url: '<?php echo base_url() ?>event/get_events',
dataType: 'json',
data: {
// our hypothetical feed requires UNIX timestamps
start: start.unix(),
end: end.unix()
},
success: function(msg) {
var events = msg.events;
callback(events);
}
});
}
}, ],
eventClick: function(event, jsEvent, view) {
$('.modal-title').html(event.title);
$('.modal-body').html(event.description);
// Get the modal
$('#editModal').css('display', 'block');
$('.close').click(function() {
$('#editModal').css('display', 'none');
})
// When the user clicks anywhere outside of the modal, close it
$(document).on("click", function(event) {
if ($(event.target).has(".modal-content").length) {
$('#editModal').css('display', 'none');
}
});
},
});
});
</script> | 1.03125 | 1 |
_OldExams/Exams/TODO-List/PHP/src/AppBundle/Controller/TaskController.php | lapd87/SoftUniSoftwareTechnologies | 0 | 491 | <?php
namespace AppBundle\Controller;
use AppBundle\Entity\Task;
use AppBundle\Form\TaskType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class TaskController extends Controller
{
/**
* @param Request $request
* @Route("/", name="index")
* @return \Symfony\Component\HttpFoundation\Response
*/
public function index(Request $request)
{
$taskRepo = $this->getDoctrine()->getRepository(Task::class);
$tasks = $taskRepo->findAll();
return $this->render('task/index.html.twig', ['tasks' => $tasks]);
}
/**
* @param Request $request
* @Route("/create", name="create")
* @return \Symfony\Component\HttpFoundation\Response
*/
public function create(Request $request)
{
$task = new Task();
$form = $this->createForm(TaskType::class, $task);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
if ($task->getTitle() !== null && $task->getComments() !== null) {
$em = $this->getDoctrine()->getManager();
$em->persist($task);
$em->flush();
}
return $this->redirectToRoute('index');
}
return $this->render('task/create.html.twig', ['form' => $form->createView()]);
}
/**
* @Route("/delete/{id}", name="delete")
*
* @param $id
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function delete($id, Request $request)
{
$taskRepository = $this->getDoctrine()->getRepository(Task::class);
$task = $taskRepository->find($id);
if ($task == null) {
return $this->redirectToRoute('index');
}
$form = $this->createForm(TaskType::class, $task);
$form->handleRequest($request);
if ($form->isValid() && $form->isSubmitted()) {
$em = $this->getDoctrine()->getManager();
$em->remove($task);
$em->flush();
return $this->redirectToRoute('index');
}
return $this->render('task/delete.html.twig', ['task' => $task, 'form' => $form->createView()]);
}
}
| 1.335938 | 1 |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 2,111