blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 116 | path stringlengths 2 241 | src_encoding stringclasses 31
values | length_bytes int64 14 3.6M | score float64 2.52 5.13 | int_score int64 3 5 | detected_licenses listlengths 0 41 | license_type stringclasses 2
values | text stringlengths 14 3.57M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
116a61c5050124bae6f412b0fef4800d6e324b4e | PHP | danielcaballero796/initial | /back/dao/interfaz/ICotizacionDao.php | UTF-8 | 1,778 | 2.765625 | 3 | [] | no_license | <?php
/*
-------Creado por-------
\(x.x )/ Anarchy \( x.x)/
------------------------
*/
// Trabajo individual singifica ganancia individual \\
interface ICotizacionDao {
/**
* Guarda un objeto Cotizacion en la base de datos.
* @param cotizacion objeto a gu... | true |
e026996386bde12d162cf07f7aa1d693db30823e | PHP | lstrojny/kesch | /src/Kesch/Exception/InvalidCallbackException.php | UTF-8 | 501 | 2.796875 | 3 | [] | no_license | <?php
namespace Kesch\Exception;
class InvalidCallbackException extends InvalidArgumentException
{
public static function assertValidCallback($value, $symbol, $position)
{
if (!is_callable($value)) {
throw new static(
sprintf(
'%s() expected parameter %d... | true |
b82594697d17cabe51f5ea01bf6fb82c18cf4467 | PHP | edinaldofox/dependency-injection | /src/Vox/Treinamento/Exercicio1/ImprimeTerminal.php | UTF-8 | 474 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace Vox\Treinamento\Exercicio1;
/**
* Description of ImprimeTerminal
*
* @author edinaldo <edinaldo@voxtecnologia.com.br>
*/
class ImprimeTerminal implements ImprimeInterface, \SplObserver
{
public function imprimir(Pedido $pedido)
{
foreach ($pedido->getProdutos() as $produto) {
... | true |
187bac27755ed02c75a30429466612852c051cdb | PHP | alphayax/BeeGame | /index.php | UTF-8 | 2,508 | 3.109375 | 3 | [] | no_license | <?php
require_once './bee.class.php';
session_start();
/// Nombre d'abeille par classe
define( 'BEE_QWEEN_NB' , 1);
define( 'BEE_WORKER_NB' , 5);
define( 'BEE_DRONE_NB' , 8);
/// Si il n'y a aucune abeille, on initialise
if( empty( $_SESSION['bee_s'])){
init_bee... | true |
e245bf76e60698c65f45f24c583fa8ba7158d573 | PHP | webjox/flowerbarcraft | /common/components/user/models/UserManage.php | UTF-8 | 2,198 | 2.546875 | 3 | [] | no_license | <?php
namespace common\components\user\models;
use common\models\User;
use Yii;
use yii\base\Exception;
use yii\behaviors\AttributeBehavior;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
/**
* Class UserManage
* @package common\components\user\models
*/
class UserManage extends User
{
const SC... | true |
986ab4df52c54cf3f4d07afd7293f371d1e82135 | PHP | CSAPHN/lodash-php | /tests/Array/ConcatTest.php | UTF-8 | 514 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* This file is part of the SolidWorx Lodash-PHP project.
*
* @author Pierre du Plessis <open-source@solidworx.co>
* @copyright Copyright (c) 2017
*/
use PHPUnit\Framework\TestCase;
use function _\concat;
class ContactTest extends TestCase
{
public function testChunk()... | true |
aa84e17e9cc678bcbf6cf4da7d3e3aecdb56791d | PHP | burgosa/server | /app/Http/Controllers/ProductController.php | UTF-8 | 3,291 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php namespace App\Http\Controllers;
//services
use Illuminate\Http\Request;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;
//models and Requests
use App\Product;
use App\CategoryProduct;
use App\BrandProduct;
use App\Http\Requests;
use \Session;
class ProductController extends Contro... | true |
276e0949c29213a7eae89ee843737ad93c552f91 | PHP | sparshturkane/be-project | /Admin/get_search.php | UTF-8 | 1,891 | 2.515625 | 3 | [] | no_license | <?php
session_start();
if(!$_SESSION['aid'])
{
header("Location: ../../home.php");//redirect to login page to secure the welcome page without login access.
}
?>
<?php
include 'conn.php';
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$... | true |
0d959e225423bf39c9d721e22f1a88231a19c822 | PHP | tianyayoucao/dbpedia | /trunk/extraction_php/php/util/FileProcessor.php | UTF-8 | 3,517 | 3.296875 | 3 | [] | no_license | <?php
namespace dbpedia\util
{
use dbpedia\util\StringUtil;
/**
*/
class FileProcessor
{
/**
* Absolute path to base dir, using forward slashes. Never null.
* @var string
*/
private $baseDir;
/**
* Names (not paths) of files and directories to skip, e.g. '.svn'.
* If empt... | true |
5024f70e4f8371062833d9707d52016015301b64 | PHP | wjbsyc/N1CTF_platform | /N1CTF/app/challenge.php | UTF-8 | 715 | 2.65625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class challenge extends Model
{
//
protected $table = 'Challenges';
protected $fillable = ['title', 'class', 'description', 'url', 'flag', 'info', 'score'];
protected $hidden = ['flag'];
public function users()
{
return $th... | true |
eee797a53ee3209afa2cc2fe60ff15432d08a82e | PHP | sciactive/pines-tools | /speedtests/for_while.php | UTF-8 | 790 | 3.578125 | 4 | [] | no_license | <pre>
What's faster for repeating conditional code?
<?php
$count = 10000;
// Array of 50,000 items.
$test = 1000;
$i = 0;
$start_time = microtime(true);
for ($i = 0; $i < $count; $i++) {
$i2 = 0;
while ($i2 < $test) {
$i2++;
}
}
$end_time = microtime(true);
echo 'while : '.($end_time - $start_time)."\n"... | true |
a264e6da00072897db770189f5b8ac33bffdc026 | PHP | antonio1530039/Practicas-TAW | /practica1/funcion_parametros.php | UTF-8 | 200 | 2.734375 | 3 | [] | no_license | <?php
function xde($name ,$lastname){
return "Hello $name $lastname! <br> Hello $name $lastname! <br>Greetings $name $lastname!!! <br>Greetings $name $lastname";
}
echo xde("John","Doe");
?> | true |
0cf8d080906222920b3806da4b8c7905d284e250 | PHP | f1r3starter/playground | /eaa/transaction_script/src/Factory/UpdateCommandFactory.php | UTF-8 | 846 | 2.890625 | 3 | [] | no_license | <?php
namespace App\Factory;
use App\Command\DatabaseRevenue;
use App\Command\SpreadsheetRevenue;
use App\Command\UpdateCommand;
use App\Command\WordRevenue;
use App\DB\MyPDO;
use InvalidArgumentException;
class UpdateCommandFactory
{
public const TYPE_WORD = 'w';
public const TYPE_DATABASE = 'd';
public... | true |
f89e6bb8c90b72a6bb72e9eb24084762b61200e1 | PHP | jputanier/validation_dwm11_poo | /classes/Mage.php | UTF-8 | 1,917 | 3.484375 | 3 | [] | no_license | <?php
class Mage extends Character {
public function __construct($pseudo) {
$this->pseudo = $pseudo;
$this->magicPoint = $this->magicPoint * 2;
$this->shield = false;
}
public function action($target) {
$rand = rand(1, 100);
if ($rand >= 1 && $rand <= 50) {
... | true |
0e649ba146defd898a9e1c634f831efee589ea30 | PHP | masattar/BASAAirlinesDBMS | /customerAccountInfo.php | UTF-8 | 4,017 | 2.53125 | 3 | [] | no_license | <!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<?php
session_start();
//connect to the database
$con = mysqli_connect("localhost","root","","basaairline") or die("So... | true |
e55ebbde91cf4b5f417d4f100c79af370d5cc741 | PHP | samsha1/scraping | /tests/libs/ParserTest.php | UTF-8 | 1,920 | 2.796875 | 3 | [] | no_license | <?php
use PHPUnit\Framework\TestCase;
require_once __DIR__ . '/../../libs/parser.php';
require_once __DIR__ . '/../../libs/exceptions.php';
use Scrape\Libs\Parser;
use Scrape\Exceptions\InvalidHttpException;
class ParserTest extends TestCase{
var $call;
protected function setUp()
{
$this->call = new... | true |
506adebbd5f1c7c68af46a88eade3d02f5d7beaa | PHP | Migdelia/gecko | /remoto/lastgames.php | UTF-8 | 4,267 | 2.765625 | 3 | [] | no_license | <?php
include "bd.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>Last Games</title>
<meta charset="utf-8">
<link rel="stylesheet" href="estilo.css">
<script type="text/JavaScript">
<!--
function doLoad()
{
setTimeout( "refresh()", 5*1000 );
}
function refresh()
{
window.locat... | true |
b4664de9850c2c9dc497cdbf75370db7ecb0089a | PHP | WebFiori/framework | /webfiori/framework/cli/helpers/ClassInfoReader.php | UTF-8 | 4,530 | 3.140625 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is licensed under MIT License.
*
* Copyright (c) 2019 Ibrahim BinAlshikh
*
* For more information on the license, please visit:
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
namespace webfiori\framework\cli\helpers;
use InvalidArgumentException;
use webfiori\cli\CLICommand;... | true |
01d7fa409841b295cb03ccaa0db79b58f2b3696d | PHP | 8mylez/platform | /src/Core/Content/Cms/SalesChannel/SalesChannelCmsPageRepository.php | UTF-8 | 2,815 | 2.6875 | 3 | [
"LicenseRef-scancode-generic-cla",
"MIT"
] | permissive | <?php declare(strict_types=1);
namespace Shopware\Core\Content\Cms\SalesChannel;
use Shopware\Core\Content\Cms\Aggregate\CmsBlock\CmsBlockEntity;
use Shopware\Core\Content\Cms\Aggregate\CmsSection\CmsSectionEntity;
use Shopware\Core\Content\Cms\CmsPageCollection;
use Shopware\Core\Framework\DataAbstractionLayer\Entit... | true |
7023f0c86ba6536ba697ae4f36180b27d8b3e893 | PHP | bangbambang/puspa | /src/TaxLaw/LawApplicable.php | UTF-8 | 1,416 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Generic Tax law interface.
* Part of Puspa tax library
* @author Bambang Catur Pamungkas <bambangcatuz@gmail.com>
* @license MIT
*/
namespace Puspa\TaxLaw;
use Puspa\TaxCalculator\Calculator;
/**
* Basic interface for tax laws.
* Specific contracts should be provided under child name... | true |
57948800adda17a17963d2fbb9a01e804395d0ee | PHP | orglman/fundamental | /src/security.class.php | UTF-8 | 22,297 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
/**
* @package orglman/fundamental
* @link https://github.com/orglman/fundamental/
* @author Tobias Jonson <git@orgelman.systems>
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (GNU GPL)
*/
namespace orgelman\fundamental\security {
class encrypt {
use \orge... | true |
1af7cd2767ceaca243a26bece3be5b25093f2e2e | PHP | dleo86/Login | /funciones/funciones.php | UTF-8 | 13,498 | 3.109375 | 3 | [] | no_license | <?php
/**********************helper functions******************************************/
//Con esta función la cadena se convierte en entidad HTML
function limpiar($cadena){
return htmlentities($cadena);
}
//Esta función dirige a la ubicación seleccionada
function direccionar($ubicacion){
return header("... | true |
5cf074111fc31d5567014dbf63954509b7122ca9 | PHP | MohabMohamed81/Yellow-Page-Task-Assignment | /App/Controllers/adsController.php | UTF-8 | 2,808 | 3.046875 | 3 | [] | no_license | <?php
require_once 'C:\xampp\htdocs\YellowAssignment\App\Models\Ads.php';
/**
* This is Advertisement Controller which have the methods related to advertisements
* @author Mohab
*/
class adsController {
/**
* @var object create object from advertisemnt model
* @var string to set and get value of ima... | true |
e1c11e3f14a350f2d02416d9df0534d9f95f4e70 | PHP | lolitaframework/lolitatheme | /app/widgets/menu/engine/Menu.php | UTF-8 | 2,336 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
namespace lolitatheme\app\widgets\menu\engine;
use \lolita\LolitaFramework\Core\View;
use \lolita\LolitaFramework\Core\Arr;
use \lolita\LolitaFramework\Core\Decorators\Post;
class Menu
{
/**
* Menu items
*/
private $items = null;
/**
* Menu graph
*/
private $graph = null;
... | true |
699c95c7af12fe6e47d26f24a680d626511a53f6 | PHP | TomckySan/nlp100 | /07.php | UTF-8 | 157 | 3.5625 | 4 | [] | no_license | <?php
function template($x, $y, $z): string
{
return printf('%s時の%sは%s', $x, $y, $z);
}
$x = 12;
$y = '気温';
$z = 22.4;
template($x, $y, $z);
| true |
86768e593028b472ebee4e02da8ed4048513db9e | PHP | glynnchaldecott/recruitment-task | /src/filehandlers/abstracthandler.php | UTF-8 | 3,024 | 3.28125 | 3 | [] | no_license | <?php
namespace glynnchaldecott\recruitmenttask\filehandlers;
/**
* An abstract file handler, outlining the functionality required to be returned by the classed which extend it.
**/
abstract class abstracthandler
{
protected $results = array(); //Allows for multiple files to be loaded before the results are re... | true |
03aa43d25c70066301826dc3eac415a7805ceac2 | PHP | letoan285/hua_hu | /oop_crud/edit.php | UTF-8 | 4,213 | 2.515625 | 3 | [] | no_license | <?php
require_once "Product.php";
require_once "Category.php";
$id = $_GET['id'];
$product = Product::find($id);
$categories = Category::all();
// var_dump($categories);die;
?>
<?php
include_once "partials/header.php";
?>
<div class="container">
<div class="row">
<div class="col-12">
... | true |
103b6db712c057118f9b136bed84032ac7ac307d | PHP | hvolschenk/fake-news | /api/src/Api/Query/Section/MySQL/Join.php | UTF-8 | 1,427 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Rwdg\Api\Query\Section\MySQL;
use Rwdg\Api\Query\QueryException;
use Rwdg\Api\Query\QueryAbstract;
class Join extends \Rwdg\Api\Query\Section\SectionAbstract {
private $joinedFilters = [];
protected function buildSection() {
$this->setSection(self::joinType($this->getType()) . $t... | true |
d8956e4f0ec25b4ef4b9516f672687d8bab4ac12 | PHP | taniaamalik/Web-Programming | /Pemweb/helloworld/server_client.php | UTF-8 | 319 | 3.03125 | 3 | [] | no_license | <!DOCTYPE html>
<html><body>
<?php
$var1 = 10;
$var2 = 20;
echo "Server output: ", $var1 * $var2;
?>
<div id="client"><?div>
<script>
var var1 = 10;
var var2 = 30;
var hasil = "Client output: " + var1 * var2;
document.querySelector("#client").innerHTML = hasil;
</script>
</body></html> | true |
1069b6a5ed2207e109692ddd5b9ca27324565f2d | PHP | yitasha/programming_project | /adminIndex.php | UTF-8 | 8,580 | 2.703125 | 3 | [] | no_license | <?php
session_start();
#Check if admin have logged in by detect SESSION variable
$admin = $_SESSION['adminName'];
if(!isset($admin))
{
print "<script type='text/javascript'>
alert('Admin you have not logged in!');
window.location.href = 'index.php';
</script>";
}
$page_title= "Admin Panel";
#... | true |
d4121eb0add2eb4d41f50e1ec5d10e0b0d16cc12 | PHP | haruka1997/g031o008 | /michinoeki/views/visitStation.php | UTF-8 | 11,030 | 2.71875 | 3 | [] | no_license | <?php
session_start();
// 訪問した駅の取得
try {
$dbh = new PDO('mysql:host=153.126.145.118; dbname=g031o008', 'g031o008', 'g031o008');
$stmt = $dbh->prepare('SELECT stationId, visitDate, category, memo FROM visitStation WHERE userId = :userId'); //ユーザIDに合致するユーザ情報の取得
$stmt->bindParam(':userId', $_SESSION['user... | true |
95cd5ef03fba8c3b34fdb4daa06c80db1a155c2d | PHP | MariamIslam/Web-Tech-E | /Lab6/Model.php | UTF-8 | 1,094 | 2.5625 | 3 | [] | no_license | <?php
require_once 'dbconn.php';
function addProduct($data)
{
$conn= db_conn();
$query = "INSERT INTO user_info(Name,Email,Username,Password,ConfirmPass,Gender) VALUES(:name,:email,:website,:comment,:conpass,:gender)";
try{
$stmt = $conn->prepare($query);
$stmt->execute([
':name' => $data['name']... | true |
69eca94b764fbb4d185948b2ca1564a4c599e244 | PHP | joosweb/cPanel-MT2D | /pages/edititem.php | UTF-8 | 3,096 | 2.515625 | 3 | [] | no_license | <?php
require("../clases/class.php");
$class = new Mysql();
$item = $_GET['id'];
$find = mysqli_query($class->conexion(), "SELECT * from player.item_shop_buy WHERE id='".$item."'");
$rows = mysqli_fetch_array($find,MYSQLI_ASSOC);
if($rows['id']){
?>
<div id="showedititem">
<div class="panel panel-red">
<div class="... | true |
1d1cbb14f215b53fb6aaa959c0407532a9eb6fa2 | PHP | DeruuK/Event-Calendar | /calendar/addevent_ajax.php | UTF-8 | 2,781 | 2.859375 | 3 | [] | no_license |
<?php
require 'database.php';
ini_set("session.cookie_httponly", 1);
header("Content-Type: application/json"); // Since we are sending a JSON response here (not an HTML document), set the MIME Type to application/json
session_start();
$username = $_SESSION['username'];
$title = htmlentities($_PO... | true |
cb16dcb5782bb890e2c7729f4eb1a993714680cb | PHP | btovee/Food-Vendor-Search-CLI | /tests/unit/CommandLineOptionsTest.php | UTF-8 | 1,093 | 2.609375 | 3 | [] | no_license | <?php
use Codeception\Test\Unit;
use FoodVendorSearchCli\CommandLineOptions;
/**
* Class CommandLineOptionsTest
*/
class CommandLineOptionsTest extends Unit
{
/**
* @var CommandLineOptions $mCommandLineOptions
*/
protected $mCommandLineOptions;
/**
* Create a Fresh instance before test
... | true |
b324764a3273232ea260e5d2541a56b3323a2b10 | PHP | mattiabilla/silvano-server | /models/vis_teach.php | UTF-8 | 641 | 2.84375 | 3 | [] | no_license | <?php
//leggo il secondo parametro della query string, se è vuoto leggo e restituisco le classi relative all' $id se c'è un valore vedremo...
if(empty($url[1])){
//connetto il database
require_once($_SERVER['DOCUMENT_ROOT']."/db.php");
//costruisco la query string, QUESTA PARTE E' DA MODIFICARE, INSICURA!!!... | true |
5ef414dce9c2d5a5d78bbaeaea1be7ea9a6c2705 | PHP | tcha87/backend | /app/Http/Controllers/AuthController.php | UTF-8 | 3,392 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Customer;
use DB;
use JWTAuth;
use Hash;
use Validator;
use Config;
use Illuminate\Http\Request;
class AuthController extends Controller
{
public function register(Request $request)
{
$user = Customer::create([
'email'=> $request->email,
... | true |
c008ba03d441e4c9c32de704aedc742879471559 | PHP | bluppblupp/DD1368---Databasteknik | /Lab 3/deleteBooks.php | UTF-8 | 735 | 3.046875 | 3 | [] | no_license | <?php
$isbn=isset($_GET['isbn']) ? $_GET['isbn'] : die('ERROR: ID not found'); //Aquire the ID
include 'connection.php'; //Init the connection
try {
$queries = ["DELETE FROM books WHERE isbn = :isbn"]; // Insert your DELETE query here
$finished = TRUE;
foreach ($queries as $query) {
$s... | true |
7dcdf6d8d2ee714ca9585bcfc66684432ec63541 | PHP | kamdjouduplex/ERP | /app/Observers/EmailObserver.php | UTF-8 | 2,092 | 2.625 | 3 | [] | no_license | <?php
namespace App\Observers;
use App\Email;
use App\GmailDataList;
use App\GmailDataMedia;
class EmailObserver
{
/**
* Handle the email "created" event.
*
* @param \App\Email $email
* @return void
*/
public function created(Email $email)
{
return $this->gmailData($ema... | true |
608339d4a4ae5ec48483a87592d5b10c96602a8b | PHP | Mohamed-Abbas-1/OFA | /admin-panal/add/addcategories.php | UTF-8 | 2,938 | 2.71875 | 3 | [] | no_license | <?php
if (isset($_GET['action']) && isset($_POST['search'])){
$movieid = $_GET['action'];
echo $movieid;
$conn = MySQLi_connect(
"localhost", //Server host name.
"root", //Database username.
"", //Database password.
"ofa" //Database name or anything you would like to call it.
);
//Check connection
if (M... | true |
600e545c5397f6a352217b04dcc1408957447629 | PHP | pgujie/hub | /app/User.php | UTF-8 | 1,763 | 2.625 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
protected $appends = ['full_name'];
protected static function boot()
{
pa... | true |
ec44c3e26f2cef3a91f217b2a3420b0025e2b083 | PHP | AdventureLookup/AdventureLookup | /src/AppBundle/Entity/AdventureDocument.php | UTF-8 | 10,260 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
namespace AppBundle\Entity;
class AdventureDocument
{
private $id;
private $title;
private $slug;
/**
* @var float|null
*/
private $score;
/**
* @var string[]
*/
private $authors;
/**
* @var string
*/
private $edition;
/**
* @var s... | true |
666605851a0dc73656e42fddc58b2b18072645e5 | PHP | artyom-beilis/cppcms | /contrib/integration/session/php/php7/cppcms.php | UTF-8 | 4,939 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
include 'cppcms_api.php';
class CppCMS_SessioBase {
protected $api = null;
protected function check()
{
$code = $this->api->error();
if($code == 0)
return;
$msg = $this->api->error_clear();
switch($code) {
case cppcms_api::ERROR_INVALID_ARGUMENT;
throw new InvalidArgumentException($msg);
cas... | true |
c47013cd26951cee20e43f64123c9a288b9ce203 | PHP | AbdelaliELMANTAGUI/Anonymous_Booking_website | /Codes/controllers/newsletter.controller.php | UTF-8 | 618 | 2.5625 | 3 | [] | no_license | <?php
if(isset($_POST['email'])){
if(!empty($_POST['email'])){
$email = $_POST['email'];
require "./models/newslleter.model.php"; // newsletters
// instance
$newsleter = new NewsLetter();//newsletter
// calls
$newsletters = $newsleter->setEmail($email);
... | true |
3254f6ff7b6d87e7bdaa5407f05dcd40758fb08a | PHP | a2thek26/oc-test-plugin | /updates/seed_tables.php | UTF-8 | 3,338 | 2.5625 | 3 | [] | no_license | <?php namespace October\Test\Updates;
use October\Test\Models\User;
use October\Test\Models\Role;
use October\Test\Models\Post;
use October\Test\Models\Phone;
use October\Test\Models\Person;
use October\Test\Models\Review;
use October\Test\Models\Plugin;
use October\Test\Models\Theme;
use October\Test\Models\Country;
... | true |
ddb44c0b481fe082f9e974f506fc46f301209ab1 | PHP | patjawat/officePro | /laravel8-api/app/Http/Controllers/Api/UploadController.php | UTF-8 | 1,948 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class UploadController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
... | true |
2012f83c70f1bcf8026ead25d275fd7d523a32b4 | PHP | NoHows/gitstore | /OnlineExperiment/application/helpers/compare_time_helper.php | UTF-8 | 269 | 3.28125 | 3 | [] | no_license | <?php
/**
* 比较两个时间的时间差差
*/
function compare_time_of_minute($start,$end)
{
if(strtotime($start)===false)
return -1;
if(strtotime($end)===false)
return -1;
$time1=strtotime($start);
$time2=strtotime($end);
return (($time2-$time1)/60);
} | true |
9d6cbafa54335cb68860ad984b1059ecb093afa0 | PHP | divinemanwah/seek | /database/seeds/RulesTableSeeder.php | UTF-8 | 1,693 | 2.53125 | 3 | [] | no_license | <?php
use Illuminate\Database\Seeder;
class RulesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('rules')->insert([
'group_id' => 1,
'type_id' => 1,
'description' => 'Gets a for 3 for 2 deal on Classic Ad... | true |
7e55a3a6eed917ab8352cfaafebc2497230354b8 | PHP | SuperDuperGruppe28/webprosjekt_eksamen17 | /database/tools/aktivitet.php | UTF-8 | 13,428 | 2.5625 | 3 | [] | no_license | <?php
// _ _ _ _ _ _ _
// / \ | | _| |_(_)_ _(_) |_ ___| |_
// / _ \ | |/ / __| \ \ / / | __/ _ \ __|
// / ___ \| <| |_| |\ V /| | || __/ |_
// /_/ \_\_|\_\\__|_| \_/ |_|\__\___|\__|
//
require_once __DIR__ . '/../models.ph... | true |
388c825f3868ed19105c870ed31d50be04aa9ac7 | PHP | leonardodeabreu/api-lumen | /src/app/Api/Auth/Services/LoginService.php | UTF-8 | 1,324 | 2.75 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Api\Auth\Services;
use App\Api\Users\Models\UserModel;
use App\Api\Users\Repositories\UserRepository;
use Firebase\JWT\JWT;
use Illuminate\Support\Facades\Hash;
final class LoginService
{
/** @throws \Exception */
public static function authenticateUser(array $cr... | true |
f4c222ecbd44245baa549c6e440f409ca07eafc3 | PHP | emillosanti/test-common-bundle | /Manager/LegalEntityManager.php | UTF-8 | 2,065 | 2.765625 | 3 | [] | no_license | <?php
namespace SAM\CommonBundle\Manager;
use Symfony\Component\HttpFoundation\Session\Session;
use Doctrine\ORM\EntityManagerInterface;
use SAM\CommonBundle\Entity\LegalEntity;
class LegalEntityManager
{
/**
* @var SessionInterface
*/
protected $session;
/** @var EntityManagerInterface */
... | true |
42084de505b5b471e28f2644f78f2b6b8d93990f | PHP | ThanhTrieu/OOP-PHP1903E | /b1/index3.php | UTF-8 | 948 | 3.890625 | 4 | [] | no_license | <?php
// ke thua - chong ke thua - override - chong override ...
// keyword : final : chong ke thua
class Person
{
public $name = 'Test';
public $age = 20;
private $money = 10000;
protected $address = 'Ha Noi';
// cam override : final
final public function getName()
{
return $this->name;
}
}
// ke thua l... | true |
83846a59bd3c24142d500b991d286481bad7f7eb | PHP | JoolsMcFly/kashidashi | /src/Service/Export/Exporter.php | UTF-8 | 1,531 | 2.8125 | 3 | [] | no_license | <?php
namespace App\Service\Export;
use Doctrine\ORM\EntityManagerInterface;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
abstract class Exporter
{
protected EntityManagerInterface $manager;
private Worksheet $worksheet... | true |
c3a656b1acde7c9eec2a6dc8556c098e94954459 | PHP | khinethazin053/project | /dbconnection.php | UTF-8 | 463 | 2.796875 | 3 | [] | no_license |
<!-- This file is for database connection to connect to the database -->
<?php
$servername ="localhost";
$dbname ="login";
$user ="root";
$password ="";
$dbn ="mysql:host=$servername;dbname=$dbname";
$pdo =new PDO($dbn,$user,$password);
try {
//echo "connnection successful";
$conn = ... | true |
9dd11ec06854e891dffd08d46d9b7ce48830e6bd | PHP | eulogix/cool-core-bundle | /Lib/Reminder/DSReminderProvider.php | UTF-8 | 4,106 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the Eulogix\Cool package.
*
* (c) Eulogix <http://www.eulogix.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Eulogix\Cool\Lib\Reminder;
use Eulogix\Cool\Lib\DataSource\DataSourceIn... | true |
355f867c22165df7762a8516aef551f8426094ce | PHP | batchnz/craft-commerce-untitled | /src/services/VariantConfigurations.php | UTF-8 | 7,064 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Craft Commerce Untitled plugin for Craft CMS 3.x
*
* Manage commerce variants by their field types and values
*
* @link https://www.batch.nz
* @copyright Copyright (c) 2020 Josh Smith
*/
namespace batchnz\craftcommerceuntitled\services;
use batchnz\craftcommerceuntitled\Plugin;
use batchnz\cra... | true |
049c37e8945f623797e0bbc25bfd1c8c866c8e39 | PHP | till/services_qype | /Services/Qype/Categories.php | UTF-8 | 3,590 | 2.609375 | 3 | [] | no_license | <?php
/**
* Copyright (c) 2008-2009, Till Klampaeckel
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, thi... | true |
89a5b7434cfd923635dfc5aa9233daf330efec63 | PHP | Emmanuel42/DHT11 | /readdata.php | UTF-8 | 524 | 2.734375 | 3 | [] | no_license | <?php
require_once 'connectDb.php';
try {
$db = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
$sql = 'SELECT datetime, temperature, humidity FROM dht11 ORDER BY datetime';
$q = $db->query($sql);
... | true |
84a3800f0b3e6c8a1d4de07d4da73813ff9c9ff9 | PHP | coder2318/New-Project-Laravel | /app/Http/Controllers/Api/PassportController.php | UTF-8 | 1,103 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Http\Request;
class PassportController extends Controller
{
public function register(Request $request)
{
$params = $request->validate([
'email' => 'required',
'name' => 'r... | true |
40f9c662ad8c615e4795cbe02b2e005bb96a43e8 | PHP | thobinh/php39_devpro | /Day11_PHP_Constant_Operator_Condition_Loop/Bai_tap_ve_nha_Day11_PHP_Constant_Operator_Condition_Loop/Danh_sach_nop_bai_ngay_11/php39_buoi 11_nguyễn tiến nghĩa/BaiTapVeNha/Bai7.php | UTF-8 | 95 | 3.296875 | 3 | [] | no_license | <?php
$sum = 0;
for ($i=0; $i <= 500 ; $i++) {
$sum += $i;
}
echo "tổng là: $sum";
?> | true |
ce29280cca9a59133723ec9f2e5ebdebfc96a01a | PHP | gerald0529/yf | /shop/shop/models/Goods/BaseModel.php | UTF-8 | 49,589 | 2.59375 | 3 | [] | no_license | <?php if (!defined('ROOT_PATH'))
{
exit('No Permission');
}
/**
* @author Yf <service@yuanfeng.cn>
*/
class Goods_BaseModel extends Goods_Base
{
const GOODS_UP = 1;//上架
const GOODS_DOWN = 2;//下架
const IS_DEL_YES = 2;//商品删除
const IS_DEL_NO = 1;//商品未删除
/**
* 读取分页列表
*
* @param int $goods_id 主... | true |
99593660830134d7ea5eb0f9d0c2b0ed79f4c022 | PHP | nathandf/sandbox | /App/Views/Components/Snippets/ResumeList.php | UTF-8 | 430 | 2.515625 | 3 | [] | no_license | <div>
<?php
if ( isset( $resumeList ) === false || !is_array( $resumeList ) ) {
$this->renderErrorMessage( "Error loading ResumeList" );
} else {
if ( empty( $resumeList ) ) {
echo( "<div>No Resumes to show</div>" );
}
echo( "<div class=\"g-std gg20\">" );
foreach ( $resumeList as $resume ) {
... | true |
427775bc3eb411c5d8d5b304cf4fc5101a86edcf | PHP | CoderKungfu/PHP-Queue-Windows-Azure-Queue-Demo | /workers/UploadCDNWorker.php | UTF-8 | 1,291 | 2.671875 | 3 | [] | no_license | <?php
class UploadCDNWorker extends PHPQueue\Worker
{
static private $data_source;
private $destination_container = 'photoscdn';
public function __construct()
{
parent::__construct();
$options = array(
'connection_string' => getenv('wa_blob_connection_string')
... | true |
f9378eb4a4d893b535fbee71c3a788cd7ce9ffde | PHP | ErvianDwiPutra/Tugas-1 | /pertama.php | UTF-8 | 464 | 2.640625 | 3 | [] | no_license | <?php
$nilai = "95";
if ($nilai > "86") {
echo "selamat... proses belajarnyamu sangat baik, tingkatkan terus kemempuan codingnya...";
}
elseif ($nilai > "71") {
echo "selamat... kamu sudah mulai memahami pemrograman PHP, tingkatkan terus skill codingmu...";
}
elseif ($nilai > "56") {
echo "upsss... skill co... | true |
97cdf3ea5972e56cffbbfde2154737b6c77979eb | PHP | rkcmorley/PHP-MYSQL-Photo-Gallery | /includes/openSQL.php | UTF-8 | 418 | 2.984375 | 3 | [] | no_license | <?php
/*
* This will open the connection of the database. If it failed to connect, it will exit and give an error message.
*
* If it's successful then it will select the tables and render the data.
*/
if (mysqli_connect_errno()) {
exit(mysqli_connect_error());
} else {
$table = $_GET['page'];
$table_esc... | true |
3226dc8ddd185c0bdf322ab630c6b4ef50310f4f | PHP | thivatm/WorkedUp | /logout.php | UTF-8 | 825 | 2.59375 | 3 | [] | no_license | <?php
session_start();
//create a variable called $pagename which contains the actual name of the page
$pagename="Logged Out";
//call in the style sheet called ystylesheet.css to format the page as defined in the style sheet
echo "<link rel=stylesheet type=text/css href=mystylesheet.css>";
//display window tit... | true |
cb386e2805f31b80a6f1fb95b9e88a9037cda151 | PHP | DeGraciaMathieu/Riddler | /src/Occurrences/Between.php | UTF-8 | 756 | 3.21875 | 3 | [] | no_license | <?php
namespace DeGraciaMathieu\Riddler\Occurrences;
use DeGraciaMathieu\Riddler\Contracts\Occurrence;
class Between extends BaseOccurrence implements Occurrence
{
protected $smaller;
protected $bigger;
protected $size;
public function __construct($smaller, $bigger)
{
$this->smaller = $s... | true |
e42be194f44505984d480c701256566f4742eb5b | PHP | julienknl/scaling-octo-garbanzo | /HTML/addDiscussion.php | UTF-8 | 1,662 | 2.65625 | 3 | [] | no_license | <?php
session_start();
include_once "../Database/database.php";
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$title = $_POST['title'];
$description = $_POST['description'];
$insertDiscussionQuery = "INSERT INTO discussion(title, description)
VALUES('$title', '$descr... | true |
63f929e5a91d2659c927a329043b7b6f8d204980 | PHP | foresitegroup/NicheSampling | /admin/womens-fitness-export.php | UTF-8 | 3,056 | 2.578125 | 3 | [] | no_license | <?php
include_once "../inc/dbconfig.php";
switch ($_REQUEST['a']) {
case "allrec":
$result = $mysqli->query("SELECT firstname,lastname,businessname,address,address2,city,state,zip,email,phone,numberstudents,hear FROM womensfitness ORDER BY lastname ASC");
$headings = array("First","Last","Women's Fitness ... | true |
aa25fea40b8c161af908db86e109bdb4512e8f28 | PHP | abeiro/ascore-v1 | /Framework/SubCore/core.php | UTF-8 | 13,329 | 2.65625 | 3 | [] | no_license | <?php
/* Some chars macros */
define("_ALMOHA","#");
class core
{
var $VERSION=_COREVER;
var $RELEASE_DATE;
function core(){
$this->RELEASE_DATE=time();
}
function version()
{
return $this->VERSION;
}
function release()
{
return $this->RELE... | true |
16b902127f40b039efd14d88c48246975f2405b2 | PHP | kangchenlin/company | /EasyMVC/models/special.php | UTF-8 | 1,896 | 2.84375 | 3 | [] | no_license | <?php
require_once("config.php");
class special{
public function __construct()
{
$db = new DB();
}
//新增
function create_machine($maName,$maClass,$maExplain,$updir,$updir1,$updir2){
$query = "insert into machine (maName,maClass,filename,maImage,maImage_... | true |
738b48798164aa43b577daff9830880ecdbb3f8c | PHP | sergigp/mpwar | /src/Oracle/Domain/Handler/Map/QueryHandlerMap.php | UTF-8 | 358 | 2.546875 | 3 | [] | no_license | <?php
namespace Oracle\Domain\Handler\Map;
use Oracle\Domain\Handler\Map\Exception\NoHandlerForQueryName;
use Oracle\Domain\Handler\QueryHandler;
interface QueryHandlerMap
{
/**
* @param string $queryName
*
* @throws NoHandlerForQueryName
*
* @return QueryHandler
*/
public funct... | true |
ec82d96793fab5a66a415115dd8418203be746bc | PHP | ruelrule05/westacton | /app/Http/Controllers/AppController.php | UTF-8 | 1,172 | 2.625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Models\Pin;
use Illuminate\Http\Request;
class AppController extends Controller
{
public function index()
{
$pins = Pin::all();
return view('home')
->with('pins', $pins);
}
public function deletePin(Request $request)
... | true |
d6c191a6edea18c579e53af9a4ec87ea1a507fa2 | PHP | andrea007/wp-pcs | /dhi-pcs/om-framework/classes/class-meta-box.php | UTF-8 | 17,305 | 2.609375 | 3 | [] | no_license | <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
class omfw_Meta_Box {
protected $post_type;
protected $metaboxes;
protected $args;
/**
* Constructor
*/
public function __construct($post_type, $metaboxes, $args=array()) {
if(!empty($post_type) && !empty($... | true |
a94e5b58eaf69cbae5ba6ea95e22726464ac8b8b | PHP | lipeng-wei/ForeShadowAlpha | /module/Refer.class.php | UTF-8 | 3,059 | 2.78125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: lipeng_wei
* Date: 15-11-21
* Time: 上午1:23
*
*
* 大盘指数 | 版块指数 | 股票价格 的索引管理 静态类
* market | section | stock
*
*/
require_once(MODULE_PATH. 'TableFile.class.php');
class Refer extends TableFile{
private static $_path = null;
private static $_market = ... | true |
de478ba6c42babdd05952e5fe58bcec6f2d49fe7 | PHP | swapnil0545/vtogether | /members.php | UTF-8 | 4,210 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php include("config.php");
$page_title='List of Members';
include("includes/header.php");
include("includes/menu.php");
?>
<!-- B.1 MAIN CONTENT -->
<div class="main-content">
<!-- Pagetitle -->
<h1 class="pagetitle"> <?php echo "$page_title"; ?> </h1>
<?php if(!$logged['id']){
... | true |
1ca1a16baab39e5fbec7557b5a7f20e948ad304d | PHP | LimberLogic/Learning | /library.php | UTF-8 | 1,686 | 3.40625 | 3 | [] | no_license | <?php
$var = 1.0;
/**
* Get a factor
* @return Integer
*/
function factor($sanitize=true) {
if(isset($_GET['factor']))
if($sanitize)
return htmlspecialchars($_GET['factor']);
else
return $_GET['factor'];
else
return 5;
}
/**
* We have a factor
* @return Boolean
*/
function hasFactor() {
return (... | true |
8a726c88968072c7497e831757bb475a02738f29 | PHP | sergeevizh/exampleSimplaCMS | /api/Sizes.php | UTF-8 | 2,782 | 2.953125 | 3 | [] | no_license | <?php
/**
* Simpla CMS
*
* @copyright 2011 Denis Pikusov
* @link http://simplacms.ru
* @author Denis Pikusov
*
*/
require_once('Simpla.php');
class Sizes extends Simpla
{
/*
*
* Функция возвращает массив размеров
* @param $filter
*
*/
public function get_sizes($fil... | true |
25466693d31173d1aa848161d3ff53f79eaa61a1 | PHP | linuxserver/Heimdall | /vendor/guzzlehttp/promises/src/Promise.php | UTF-8 | 8,944 | 3.03125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace GuzzleHttp\Promise;
/**
* Promises/A+ implementation that avoids recursion when possible.
*
* @link https://promisesaplus.com/
*/
class Promise implements PromiseInterface
{
private $state = self::PENDING;
private $result;
private $cancelFn;
private $waitFn;
private $waitList;
... | true |
8b0eda4394deb76b9b9fad60828266a7d321fe98 | PHP | sreikanth/open-swamp | /csaweb/var/www/csaweb_laravel/app/models/tools/ToolVersion.php | UTF-8 | 1,414 | 2.5625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <?php
namespace Models\Tools;
use Models\UserStamped;
use Models\Tools\Tool;
class ToolVersion extends UserStamped {
/**
* database attributes
*/
public $primaryKey = 'tool_version_uuid';
public $incrementing = false;
/**
* the database table used by the model
*/
protected $connection = 'tool_shed';
... | true |
49646b50fbaab3eeb939cbd6c39df809f39aa0f3 | PHP | vznet/vz_os_clientlibrary_php | /test/model/osapiNameTest.php | UTF-8 | 4,617 | 2.609375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | <?php
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"... | true |
3e93cd9d889837d963e32cc8bd5d98312c8fedea | PHP | dojet/be-global | /model/MJson.class.php | UTF-8 | 326 | 2.765625 | 3 | [] | no_license | <?php
/**
* description
*
* Filename: MJson.class.php
*
* @author liyan
* @since 2015 11 3
*/
class MJson {
protected $array = array();
function __construct($array) {
$this->array = $array;
}
public function toJson() {
return json_encode($this->array);
}
... | true |
ecd3d9e10c28a9ce21809f9406b382a3e15a1f53 | PHP | chenxianlong/DailyHealthStatusRport | /app/Console/Commands/WechatWork/UserRename.php | UTF-8 | 2,228 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands\WechatWork;
use App\Utils\Common;
use App\WeChatWork\Contract\ServerAPIFactory;
use App\WeChatWorkUsers;
use Illuminate\Console\Command;
class UserRename extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protecte... | true |
e0e1a71e74cd4f059390d28648be8b24facabbd0 | PHP | svakhg/driver-apis | /app/Console/Commands/TestNotification.php | UTF-8 | 1,019 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands;
use App\Notifications\NewPassenger;
use App\Passenger;
use App\User;
use Illuminate\Console\Command;
class TestNotification extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'notification:test {email}';
/... | true |
e2098e79cec8dc31427d7617dd7cc03a60a7c8f8 | PHP | php-amqp/php-amqp | /tests/amqpconnection_setSaslMethod.phpt | UTF-8 | 550 | 2.59375 | 3 | [
"PHP-3.01"
] | permissive | --TEST--
AMQPConnection setSaslMethod int
--SKIPIF--
<?php
if (!extension_loaded("amqp")) print "skip";
if (!getenv("PHP_AMQP_HOST")) print "skip";
?>
--FILE--
<?php
$cnn = new AMQPConnection();
$cnn->setHost(getenv('PHP_AMQP_HOST'));
$cnn->setSaslMethod(0);
var_dump($cnn->getSaslMethod());
$cnn->setSaslMethod(1);
var_... | true |
f71d94e1751cea64cd39a0cd485f8dd87395a662 | PHP | apuc/guild | /common/models/DocumentField.php | UTF-8 | 1,013 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace common\models;
use yii\helpers\ArrayHelper;
/**
* This is the model class for table "document_field".
*
* @property int $id
* @property string $title
* @property string $field_template
*/
class DocumentField extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static f... | true |
310430b7df572d017d3a9766e2b0c6a2fb177c13 | PHP | Tri-Ka/esftt | /plugins/ffttAPI/src/Model/Partie.php | UTF-8 | 2,115 | 3.140625 | 3 | [] | no_license | <?php
/**
* Created by Antoine Lamirault.
*/
namespace FFTTApi\Model;
class Partie
{
private $isVictoire;
private $journee;
private $date;
private $pointsObtenus;
private $coefficient;
private $adversaireLicence;
private $adversaireIsHomme;
private $adversaireNom;
private $adver... | true |
95deae957146fb872afdb1a153fdd74c781b8807 | PHP | DylanWacker/projetstore | /ProjetStore/Pages/Fonction.php | UTF-8 | 11,712 | 2.890625 | 3 | [] | no_license | <?php
/*
Page : fonction.php
Auteur : Carluccio Dylan
Fonction : Page qui contient toutes les fonctions nécessaire.
*/
function dbConnect() {
//fonction de connexion à la base
//--------------------------------------------------------------------------
global $dbc;
try {
$dbc = new PDO('m... | true |
095bce64315f8ef63e92da1b6d2175b1a3743e63 | PHP | laFreeFall/canteen | /app/Observers/DayDishPriceObserver.php | UTF-8 | 1,629 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Observers;
use App\DayDishPrice;
use App\DayDishPupil;
use Illuminate\Support\Facades\DB;
class DayDishPriceObserver
{
/**
* Handle to the day dish price "created" event.
*
* @param \App\DayDishPrice $dayDishPrice
* @return void
*/
public function created(DayDis... | true |
5c22f35da616ee27f5baec00942bda62bc2bd37e | PHP | Plonq/laravel-public | /app/Http/Controllers/AjaxController.php | UTF-8 | 2,120 | 2.71875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Movie;
use App\Cinema;
use App\MovieSession;
class AjaxController extends Controller
{
/**
* Searches movies
*
* @param $request
* @return string
*/
public function search(Request $request)
{
// va... | true |
8f65eb185a4cbd026eeaf131464e82cdaefd4865 | PHP | Rammslise/La-Belle-Campagne | /controllers/deleteClientCtrl.php | UTF-8 | 615 | 2.578125 | 3 | [] | no_license | <?php
if (isset($_SESSION['user_id']) && $_SESSION['user_id'] == $_GET['id']) {
$client = new Client();
if (isset($_GET['id']) && $_GET['id'] > 0) {
$client->id = htmlspecialchars($_GET['id']);
$success = $client->deleteClient();
if ($success) {
$_SESSION['message'] = 'Le... | true |
b7686fb398b9c558c542f75e8da1136109b33e1a | PHP | jiddyabd/healtylife | /application/models/Petugas_model.php | UTF-8 | 722 | 2.546875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
class Petugas_model extends Core_Model{
public function __construct(){
parent::__construct();
$this->table_name = 'petugas';
$this->table_id = 'petugas_id';
}
public function get_list($limit, $start){
$this->db->from('petugas', $limit, $start);
$this->db->orde... | true |
3dc034871c51fc6ffa7d780328f3f1e0090954e4 | PHP | brianseitel/oasis-bandit | /index.php | UTF-8 | 1,029 | 2.71875 | 3 | [] | no_license | <?
require_once('class.DB.php');
require_once('class.Saveable.php');
require_once('class.Multi_Armed_Bandit.php');
require_once('class.Bandit.php');
if ($_POST) {
if (array_key_exists('item_id', $_POST))
Bandit::reward($_POST['item_id']);
}
$sql = 'SELECT id, name, attempts, successes FROM options';
$items = DB::... | true |
b6f7476f0d61b7799513e2cbff4da1e220b83152 | PHP | gin0115/-Archived-pinkcrab_enqueue | /enqueue.php | UTF-8 | 7,424 | 2.71875 | 3 | [] | no_license | <?php declare(strict_types=1);
/**
* A chainable helper class for enqueuing scripts and styles.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PA... | true |
34d995b4ccb16947d7517c506a14abe7819b53bf | PHP | BagerManBG/PU-PHP-Cryptography | /src/SecureHasher.php | UTF-8 | 819 | 2.90625 | 3 | [] | no_license | <?php
namespace src;
class SecureHasher {
/**
* @var HashAlgorithm $hasher
*/
protected $hasher;
/**
* {@InheritDoc}
*/
public static function create() {
return new SecureHasher();
}
/**
* @return HashAlgorithm
*/
public function getHasher() {
return $this->hasher;
}
/**... | true |
b751519e7840fed25b9d26136969231db1b547b9 | PHP | escrotodefuego87/crud-basico-cliente-servidor | /app/Http/Controllers/PostController.php | UTF-8 | 3,179 | 2.609375 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Post;
use Illuminate\Http\request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\DB;
class PostController extends Controller
{
public function index(){
$post = new Post();
$post -> title = "Hola mundo";
$post -> body = "Cuerp... | true |
7af788b81de22e8796ed81a6f7dc9d84bfcdf998 | PHP | christianhanggra/bizzy-permission | /src/Repositories/PortalRepository.php | UTF-8 | 347 | 2.578125 | 3 | [] | no_license | <?php
namespace Christianhanggra\Bizzy\Permission\Repositories;
use Christianhanggra\Bizzy\Permission\Models\Portal;
class PortalRepository
{
protected $portal;
public function __construct(Portal $portal)
{
$this->portal = $portal;
}
public function find($id)
{
return $this-... | true |
2bf6715318ffe15a04655dc37cfedb5accd914d5 | PHP | rdlook04/kardex | /models/compraModel.php | UTF-8 | 2,840 | 2.515625 | 3 | [] | no_license | <?php
Class compraModel extends Model{
public function __construct(){
parent::__construct();
}
public function getCompras(){
$sql = "SELECT b.NOMBRE AS PRODUCTO, DATE_FORMAT(a.FECHA_COMPRA,'%d/%m/%Y') AS FECHA_COMPRA, (a.CANTIDAD*a.PRECIO_UNIDAD) AS PRECIO_TOTAL, a.IDCOMPRA, a.IDPRODUCTO, a.PRECIO_UNIDAD, ... | true |
910f2d255dab7756178905db7ff490c1227d1592 | PHP | gyKa/user-management-system | /migrations/20141023225222_create_user_groups.php | UTF-8 | 1,000 | 2.578125 | 3 | [] | no_license | <?php
use Phinx\Migration\AbstractMigration;
class CreateUserGroups extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
*/
public function change()
{
$ta... | true |
526aa4936717852d6a51176c159d842a3976c4d4 | PHP | joel-fragoso/projeto_tdd | /src/App/Shopping/Handler/MajorAndMinorProductPriceHandler.php | UTF-8 | 784 | 3 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Shopping\Handler;
use App\Shopping\Cart;
use App\Shopping\Product;
class MajorAndMinorProductPriceHandler
{
private Product $minor;
private Product $major;
public function find(Cart $cart)
{
foreach ($cart->getProducts() as $product) {
... | true |