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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f4cd93f119273e9a05197faade75f3aa46cac3ea | PHP | IsabelPolania/MVC | /model/MasterModel.php | UTF-8 | 1,097 | 2.828125 | 3 | [] | no_license | <?php
//El modelo obtiene datos, para obtenerlos debemos acceder por medio de la conexión directa a la BBDD
include_once '../lib/conf/Connection.php';
//la clase Master hereda metodos publicos y protegidos de la clase Connection
class MasterModel extends Connection{
public function insert($sql... | true |
e276a1b5d70c7be67822963079a24b2aa77a007f | PHP | safeservicejt/noblessecmsv3 | /includes/Theme.php | UTF-8 | 5,318 | 2.609375 | 3 | [] | no_license | <?php
/*
Theme struct
- controllers
- models
- views
- shortcodes.php
- install.php
- uninstall.php
------------------------------------------------------------------------
Theme install & uninstall: Create file functions.php in root dir of theme then call to below functions
Theme::install(function(){
// D... | true |
b6f3c298f08ef90444706f570ce4fbf0edd21127 | PHP | theolymp/diem | /dmAdminPlugin/modules/dmMediaLibrary/lib/DmAdminMoveMediaFolderForm.php | UTF-8 | 1,987 | 2.59375 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | <?php
class DmAdminMoveMediaFolderForm extends dmForm
{
protected
$folder;
public function __construct($folder, $options = array(), $CSRFSecret = null)
{
$this->folder = $folder;
parent::__construct(array('id' => $folder->id, 'parent_id' => $folder->nodeParentId), $options);
}
public function ... | true |
bfcccb76a321cfc4965a0d28f0d37a9ed0c306a2 | PHP | nhockizi/laravel-admin | /src/Auth/Database/News.php | UTF-8 | 605 | 2.546875 | 3 | [] | no_license | <?php
namespace Kizi\Admin\Auth\Database;
use Illuminate\Database\Eloquent\Model;
/**
* Class Menu.
*
* @property int $id
*
* @method where($parent_id, $id)
*/
class News extends Model
{
/**
* Create a new Eloquent model instance.
*
* @param array $attributes
*/
public function __co... | true |
1dd2547f93a5b5eb9ae106959486676279f02630 | PHP | cjtrowbridge/astria | /core/IsValidTable.php | UTF-8 | 523 | 2.578125 | 3 | [] | no_license | <?php
function IsValidTable($TestTable,$Alias){
global $ASTRIA;
$IsTable = false;
switch($ASTRIA['databases'][$Alias]['type']){
case 'mysql':
$Tables = Query('SHOW TABLES',$Alias);
foreach($Tables as $ThisTable){
$ThisTable = array_shift($ThisTable);
if($TestTable == $ThisTabl... | true |
cd69b96df8e9b03d5f9886afd61fe14087347481 | PHP | quanicetea/quan-econmmerce | /Modules/Site/Http/Controllers/Admin/SiteController.php | UTF-8 | 2,560 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Modules\Site\Http\Controllers\Admin;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Modules\Site\Entities\Site;
use Modules\Site\Http\Requests\CreateSiteRequest;
use Modules\Site\Http\Requests\UpdateSiteRequest;
use Modules\Site\Repositories\SiteRepository;
use Modules\Core\Http\Contro... | true |
e4d9178b8a82a49277324d3baa657db4cc8c87c9 | PHP | Sergei2014/hospital | /yii/common/models/Area.php | UTF-8 | 1,027 | 2.609375 | 3 | [] | no_license | <?php
namespace common\models;
use Yii;
/**
* This is the model class for table "area".
*
* @property int $id
* @property int $number
* @property int $id_typearea
*/
class Area extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'area'... | true |
f6b958925c17bcb56c3798300cb9f0ee494a3d36 | PHP | usamaajaved/seta_pdf_form | /SetaPDF-FormFiller-Full_2.32.0.1371_Ioncubed-PHP5.6/demos/SetaPDF/Core/Document/CombinePages.php | UTF-8 | 3,610 | 2.78125 | 3 | [] | no_license | <?php
/**
* This demo combines multiple pages of an existing document on new pages with a predefined grid size.
*
* Please notice that this will only work for flat, non-dynamic pdf documents.
*/
error_reporting(E_ALL | E_STRICT);
// list some files
$files = glob('../_files/*.pdf');
$files = array_merge($files, glo... | true |
8cd0ce68917d10f2a394ccfdae4df6568885b730 | PHP | hmimeee/article-management | /project.php | UTF-8 | 11,134 | 2.625 | 3 | [] | no_license | <?php
include_once "inc/header.php";
if (empty($_SESSION['id'])) {
header("Location: ./login.php");
}
?>
<!--View Project-->
<?php
if (isset($_POST['id'])) {
$result = update_project($connect,$_POST['name'],$_POST['description'],$_POST['deadline'],$_POST['id']);
if ($result == "1") {
message("Project upda... | true |
7c9a70838cbc565a0996054d5ffd62a4f8d033d3 | PHP | mitul88/php_assignment | /loop_assignments/divisable_finder_using_loop.php | UTF-8 | 434 | 3.671875 | 4 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Divisable finder using Loop</title>
</head>
<body>
<h1>3 and 4 Divisable Indices within 500 are below:</h1>
<?php
for ($i = 1; $i < 501; $i++) {
... | true |
60f0c589abbed9a40672de6e49c91860edc26db6 | PHP | MoT3rror/Personal-Blog-Lithium | /app/controllers/MyPostsController.php | UTF-8 | 1,565 | 3.015625 | 3 | [] | no_license | <?php
namespace app\controllers;
//Tell the controller about any models we may need
use app\models\MyPosts;
//Ensure our controller inherits the \lithium\action\Controller class
class MyPostsController extends \lithium\action\Controller
{
//Define a default 'index' for when a user accesses the /posts/ URL
public ... | true |
de903a5c0c331630c232f67b80b450565fc2ce98 | PHP | Minh-Khoi/Little_danang | /dist/LittleDanang/LittleDanangServerSide/addsession.php | UTF-8 | 6,459 | 2.640625 | 3 | [] | no_license | <?php
// header("Content-Type: multipart/form-data");
header("Access-Control-Allow-Origin: *");
session_start();
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;
// require("phpmailer-1.73/phpmailer/class.phpmailer.php");
require_once(dirname(__FILE__) . "/" . "dao/... | true |
c2021cd8b182fff1289837c97d14ed5220be3aa5 | PHP | christophemaymard/php-xml-schema | /test/PhpXmlSchema/Test/Dom/FormChoiceTypeProviderTrait.php | UTF-8 | 1,676 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the PhpXmlSchema library.
*
* @copyright 2018-2020, Christophe Maymard <christophe.maymard@hotmail.com>
* @license http://opensource.org/licenses/MIT MIT
*/
namespace PhpXmlSchema\Test\Dom;
/**
* Represents a trait that provides datasets to unit test "formChoice" type.
*... | true |
02f9f540d9bd56dbfcaa38b33a2f9a3f028953f3 | PHP | SuichiNagi/Intro-PHP | /Checkerboard/index.php | UTF-8 | 1,220 | 2.75 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Checkerboard</title>
<style>
div{
display: inline-block;
width:... | true |
b8fc85f66f8993e07705d90c50d4438c5b46d21d | PHP | ntzm/PHP-CS-Fixer-Playground | /tests/Run/RunRepositoryTest.php | UTF-8 | 2,670 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace PhpCsFixerPlayground\Tests\Run;
use Doctrine\ORM\EntityManagerInterface;
use PhpCsFixerPlayground\Entity\Run;
use PhpCsFixerPlayground\Indent;
use PhpCsFixerPlayground\LineEnding;
use PhpCsFixerPlayground\Run\RunNotFoundException;
use PhpCsFixerPlayground\Run\RunRepository;
u... | true |
3d764a2700cb6358f4e4fa54731a6073c7fc1c05 | PHP | azrapiric/vicevi | /modules/admin/models/Comment.php | UTF-8 | 1,862 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\modules\admin\models;
use Yii;
/**
* This is the model class for table "comment".
*
* @property integer $id
* @property string $content
* @property integer $user_id
* @property string $datetime
* @property integer $joke_id
* @property integer $aprooved
* @property integer $active
*/
cla... | true |
87efe80cca0d0f2bb5391f9970c0f2ed5488928c | PHP | CCSDForge/CcsdCommon | /Ccsd/Dataprovider/Pubmedcentral.php | UTF-8 | 805 | 2.703125 | 3 | [] | no_license | <?php
/*
* La classe Ccsd_Dataprovider_Pubmedcentral permet de récupérer le XML de Pubmedcentral correspondant à un identifiant
*
*
* @author S. Denoux
*/
class Ccsd_Dataprovider_Pubmedcentral extends Ccsd_Dataprovider_Pubmed
{
protected $_baseurl = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?... | true |
653a0eb1685e3a1c65169d47ca542f32b3d4d52b | PHP | YutoHisada/sinsotu_teamA | /app/Http/Controllers/API/ItemController.php | UTF-8 | 3,616 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\API;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Http\Controllers\Controller;
use App\Http\Resources\ItemForList as ItemForListResource;
use App\Http\Resources\ItemForShow as ItemForShowResource;
use App\Http\Resources\ItemSelector as ItemSelectorResour... | true |
06e6cd9a3aaeefbb77f2524a9bd4e69d1f43ab7f | PHP | techichitoltek/techichi1 | /library/App/Time/Interval.php | UTF-8 | 4,093 | 3.03125 | 3 | [] | no_license | <?php
/**
* Time interval management
*
* @package App
* @package Measure
*/
/**
* Time interval management
*
* Original 'Lib_Measure_Time' class here: {@link http://www.zfsnippets.com/snippets/view/id/39}
* coded by {@link mailto:umpirsky@gmail.com Sasa Stamenkovic}.
*
* Exemple:
* <code>
* $n = 3600*24*4 + 36... | true |
f994508a39ca1aaa1729d12bec7202049f152de6 | PHP | readelobdill/belief-school | /app/Services/Cropper.php | UTF-8 | 1,840 | 2.921875 | 3 | [] | no_license | <?php
namespace App\Services;
use Imagick;
class Cropper {
public $image;
function __construct($image) {
$this->image = new Imagick($image);
}
function crop($x,$y,$width,$height) {
$this->image = $this->correctOrientation($this->image);
$this->image->cropImage($width, $height... | true |
c4ddb4ac8569fe6f0bd9affa177505f0957fdc63 | PHP | HK-veebirakendused-2021-KalevKask/vr | /home.php | UTF-8 | 1,187 | 2.546875 | 3 | [] | no_license | <?php
require_once "fnc_user.php";
require_once "usesession.php";
// session_start();
// //kas on sisse loginud
// if(!isset($_SESSION["user_id"])){//kui kasutaja pole sisse loginud
// header("Location: page.php"); // suunatakse kasutaja page leheküljele
// }
//Välja logimine
// if(isset($_GET["logout"... | true |
9274e5a38797fe4711745c9186a518230bd0890d | PHP | bmcgahee/PHP-Practice | /check.php | UTF-8 | 1,045 | 3 | 3 | [] | no_license | <?php
$host = "localhost";
$username = "root";
$password = "pichaser";
$db = "school";
$conn = new mysqli($host, $username, $password, $db);
$number = $_POST['id_search'];
$query = "SELECT *
FROM students
WHERE id = $number";
$result = mysqli_query($conn, $query);
if(mysqli_... | true |
4421ff8171f8d8137370f657b1acfe984af1898a | PHP | hu88312976/weibaner | /app/Http/Controllers/Api/StudentController.php | UTF-8 | 5,051 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Api;
use App\Models\Student;
use App\Models\City;
use Dingo\Api\Http\Request;
class StudentController extends BaseController
{
private $Student;
public function __construct(Student $Student)
{
$this->Student = $Student;
}
/**
* @api ... | true |
da920328d2e14a8b7e0b16f372293966356be3dc | PHP | xerun/echoframework | /script/userloadbytype.php | UTF-8 | 393 | 2.5625 | 3 | [] | no_license | <?php
$UserTypeUUID=GET('utid');
$ShowEcho="<option value=''>Select User</option>";
$sql=MySqlQuery("Select * from tbluser where UserTypeUUID='".$UserTypeUUID."' AND UserIsActive=1 Order By UserName ASC");
while($row=$sql->fetch_object()){
$ShowEcho .= '
<option value="'.$row->UserUU... | true |
24942dc069802ccdb43423b77b6879bcf93a9f6d | PHP | kesselshlosser/yii2-console-menu | /src/Behavior.php | UTF-8 | 696 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* @link https://github.com/vuongxuongminh/yii2-console-menu
* @copyright Copyright (c) 2019 Vuong Xuong Minh
* @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
*/
namespace vxm\consoleMenu;
use yii\base\Behavior as BaseBehavior;
/**
* Class Behavior
*
* @author Vuong Mi... | true |
292234e08c3df078dfe9b828af7ddc0cb31ecab3 | PHP | github4n/swoole-project- | /gauss/server/php/.svn/pristine/29/292234e08c3df078dfe9b828af7ddc0cb31ecab3.svn-base | UTF-8 | 6,725 | 2.515625 | 3 | [] | no_license | <?php
namespace Site\Task\Lottery\Settle;
use Lib\Config;
use Lib\Task\Context;
use Lib\Task\IHandler;
/*
* Base.php
* @description 结算基础任务/供彩种结算继承
* @Author nathan
* @date 2019-05-09
* @links Lottery/Settle/Base
* @modifyAuthor nathan
* @modifyTime 2019-05-09
*/
abstract class Base implements IHand... | true |
d4d1f8e6280a0f15e52ab4990767e9e6c82bfb77 | PHP | 17eyes/17eyes | /tests/parser/include_streams.phpt | UTF-8 | 2,670 | 2.671875 | 3 | [
"ISC",
"BSD-3-Clause"
] | permissive | --TEST--
Stream wrappers in include_path
?>
<?php
$data1 = $data2 = $data3 = $data4 = $data5 = $data6 = <<<'EOD'
<?php echo __FILE__ . "\n";?>
EOD;
/*<?*/
class mystream
{
public $path;
public $mode;
public $options;
public $position;
public $varname;
function url_stat($path, $flags) {
return array();
}
... | true |
f22389a032d6dce4fdd2ef16e15e6a7bba54738c | PHP | moronghui/blog | /app/Http/Controllers/Home/PersonalController.php | UTF-8 | 1,874 | 2.609375 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\Home;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Redirect;
use App\Http\Controllers\Controller;
class PersonalController extends Controller
{
/**
* 处理用户控制器
*/
/**
* 用户登录页面
* @return [type] [description]
*/
public ... | true |
9deaa812ddcd8c1e11d688cdb49c4cf982d52ddc | PHP | iohangp/bar-proj | /models/produtos/produtos-model.php | UTF-8 | 3,148 | 3 | 3 | [] | no_license | <?php
/**
* Modelo para gerenciar produtos
*
* @package TutsupMVC
* @since 0.1
*/
class ProdutosModel
{
/**
* Construtor para essa classe
*
* Configura o DB, o controlador, os parâmetros e dados do usuário.
*
* @since 0.1
* @access public
* @param object $db Objeto da nossa conexão PDO
* @param ... | true |
5ceb06eb5b260fb69882d5c58c7ca3d3565b69ad | PHP | Cerdic/spip-zone-plugins | /spip-bible/branches/spip-bible3/traduction/unbound.php | UTF-8 | 3,379 | 2.546875 | 3 | [] | no_license | <?php
function recuperer_passage_unbound($livre,$chapitre_debut,$verset_debut,$chapitre_fin,$verset_fin,$unbound,$lang){
$param_cache = array('livre'=>$livre,'chapitre_debut'=>$chapitre_debut,'verset_debut'=>$verset_debut,'chapitre_fin'=>$chapitre_fin,'verset_fin'=>$verset_fin,'unbound'=>$unbound,$url='unbound.biola'... | true |
eeb22aa3e43eab4a1437aa8175e1f423d593cb06 | PHP | javiloji/PHP2020 | /temas/funciones/comprobarDni.php | UTF-8 | 2,055 | 3.34375 | 3 | [] | no_license | <?php
/**
* 1. Escribe un script en php para calcular la letra del NIF a partir del número del DNI enviado en la URL: http://dominio.local/calculaletra?dni=30182410.
*
* La letra se obtiene calculando el resto de la división del número del DNI por 23. A cada resultado le corresponde una letra.
*
* 0=T; 1=R; 2=W... | true |
009631330ae5a5dd78c8cf78f499323677b21c5f | PHP | Furioustechie/japp | /database/migrations/2018_11_22_085704_create_prisoner_table.php | UTF-8 | 727 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePrisonerTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('prisoner', fun... | true |
5c741de136bd9657117980490439053cf194b8d0 | PHP | nburka/nate-go-search | /NateGoSearch/NateGoSearchField.php | UTF-8 | 2,864 | 3.03125 | 3 | [] | no_license | <?php
/* vim: set noexpandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
/**
* A field in a document to index
*
* @package NateGoSearch
* @copyright 2009 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @see NateGoSearchDocument
*/
class NateGoSearchField
{
// {{{... | true |
2634c7a2d60e336974030c1c0e767b23fa67f475 | PHP | lucasgomes005/teste_mundowap | /vendor/dmitrymomot/php-session/src/Adapter/Native.php | UTF-8 | 1,715 | 2.921875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Session\Adapter;
use \Helper\Cookie;
use \Session\Session;
class Native extends Session {
/**
* @return string
*/
public function id()
{
return session_id();
}
/**
* @param string $id session id
* @return null
*/
protected function _read($id = null)
{
// Sync up the sessi... | true |
6d89985c2a7467c110bba1ebfe821e1e02b4294d | PHP | supachaink/naja | /array.php | UTF-8 | 421 | 2.984375 | 3 | [] | no_license | <?php
/*
* 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.
*/
$a=array("toyota","honda","banz");
echo ('<br>');
print_r($a);
echo ('<br>');
echo ('<hr>');
$count_a = count($a);
echo $a[... | true |
2a44a029e292631438ba8e90529968a6c5d15b41 | PHP | JeannotM/PHP | /07/Inlog.php | UTF-8 | 1,675 | 2.609375 | 3 | [] | no_license | <?php
// error_reporting(1);
session_start();
$user=array(
"janjaap" => array("pwd"=>"1234", "rol"=>'Admin'),
"jeannot"=> array("pwd"=>"2001", "rol"=>'Admin'),
"bert"=> array("pwd"=>"2345", "rol"=>'Gebruiker')
);
if(isset($_POST["knop"])
&& isset($user[$_POST["login"]])
&& $user[$_POST["logi... | true |
eed30a435f41cf15c174002bd34b97a9b6c36963 | PHP | imlinfly/webman-annotation | /src/Util/AnnotationUtil.php | UTF-8 | 4,616 | 2.671875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: LinFei
* Created time 2022/10/21 21:08:44
* E-mail: fly@eyabc.cn
*/
declare (strict_types=1);
namespace LinFly\Annotation\Util;
use Closure;
use FilesystemIterator;
use Generator;
use LinFly\Annotation\Bootstrap\AnnotationBootstrap;
use SplFileInfo;
abstract class Annot... | true |
e28923733a01443a8bd40022eea7b222ee2f5bb0 | PHP | devtokenstars/tokenstars | /app/Repositories/TransferRepositoryEloquent.php | UTF-8 | 9,636 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories;
use App\Exceptions\Accounts\AccountException;
use App\Exceptions\Accounts\ClosedAccountException;
use App\Exceptions\Accounts\InsufficientFundsException;
use App\Exceptions\Accounts\InvalidAmountException;
use App\Models\Accounts\Account;
use App\Models\Accounts\Currency;
use App\Mod... | true |
02b2e82db44c53c9296b983372b816ff6729b4f2 | PHP | cartrabbit/fields | /src/Resource/Field.php | UTF-8 | 3,476 | 2.640625 | 3 | [] | no_license | <?php
/**
* @package J2Store
* @copyright Copyright (c)2018 Ramesh Elamathi / Cartrabbit
* @author Alagesan <support@j2store.org>
* @license GNU GPL v3 or later
*/
namespace Cartrabbit\Fields\Resource;
use J2Store\Helper\J2Store;
class Field
{
var $prefix = '';
var $suffix = '';
var ... | true |
07fc5c4f52bf2d2aa6f061beb7d38e241bd77091 | PHP | omnilight/yz2-admin | /widgets/MainMenu.php | UTF-8 | 5,370 | 2.671875 | 3 | [] | no_license | <?php
namespace yz\admin\widgets;
use Yii;
use yii\base\Widget;
use yz\admin\helpers\Rbac;
/**
* Class MainMenu renders main administration menu in the admin panel
* @package yz\admin\widgets
*/
class MainMenu extends Widget
{
/**
* @var string the route used to determine if a menu item is active or not.... | true |
31462da92bd647cdf20cc9d85c85b16800c72e14 | PHP | danieltj27/Cece | /Cece/Functions/URLs.php | UTF-8 | 2,350 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Cece
* (c) 2019, Daniel James
*
* URL functions
*
* @package Cece
*/
if ( ! defined( 'CECE' ) ) {
die();
}
/**
* Returns the site URL.
*
* Provides the blog homepage URL with an optional
* parameter to append to the end of the URL.
*
* @since 0.1.0
*
* @param string $path The ad... | true |
d9bcb0065cf3d9fa0a65e226da8994744916b4d5 | PHP | ledinhcanh/ngoaingu-ver2 | /app/Http/Requests/TaiKhoanRequest.php | UTF-8 | 1,474 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class TaiKhoanRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get t... | true |
e8c3ad5a1add82ea1cf08ca3110e2747e468d010 | PHP | cfmaniac/PHP-OSC | /quantity_price_breaks_per_product/catalog/admin/includes/classes/PriceFormatter.php | UTF-8 | 11,981 | 2.75 | 3 | [] | no_license | <?php
/*
$Id: PriceFormatter.php admin version,v 1.7 2006/12/23 JanZ Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
/*
PriceFormatter.php - module to support quantity pricing
Created 2003,... | true |
235e19a41ed5c89e2f376465d2518d7d4e9349f6 | PHP | Hertzian/AJAX | /listaClientes.php | UTF-8 | 351 | 2.625 | 3 | [] | no_license | <?php
require 'conexion.php';
$sql = "SELECT idCliente,Nombre FROM usuarios";
$result = mysqli_query($con,$sql);
echo "<select onchange='mostrarUsuario(this.value)'>";
while($row = mysqli_fetch_assoc($result)){
echo "<option value='" . $row["idCliente"] . "'>" . $row["Nombre"] . "</option>";
... | true |
faa63a025759b301ab037710071aebdee2696218 | PHP | sagar-acharya/set-top-box | /core/class/RegistrationController.php | UTF-8 | 1,192 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
require_once('databaseConfig.php');
class RegistrationController{
protected $host = DB_HOST;
protected $dbname = DB_NAME;
protected $user = DB_USER;
protected $pass = DB_PASSWORD;
protected $DBH;
function __construct() {
try {
$this->DBH = new PDO("mysql:host=$this->... | true |
a7b6e9f21823dda092adc6606d2adeaf15ad8505 | PHP | hatimmakki/my_portfolio_website | /hospitals/json/get/register.php | UTF-8 | 1,743 | 2.546875 | 3 | [] | no_license | <?php
include 'manager_functions.php';
$FName = $_GET['FName'];
$LName = $_GET['LName'];
$Email = $_GET['Email'];
$Password = $_GET['Password'];
//set vars
try {
checkPara($FName, $LName, $Email, $Password);
if(checkEmail($Email))
throw new Exception('The email is already registered! please try another one!');... | true |
3c593ec0688b80a401ae5f70e5559a2e671c7c81 | PHP | b2tradingclub/barsi | /database/migrations/2018_01_27_025612_create_operations_table.php | UTF-8 | 1,003 | 2.609375 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOperationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('operations',... | true |
a523a5138832aad52b9645913658af70a35a0f37 | PHP | predominant/cubex | /cubex/session/session.php | UTF-8 | 455 | 2.59375 | 3 | [] | no_license | <?php
/**
* User: Brooke
* Date: 14/10/12
* Time: 01:03
* Description:
*/
namespace Cubex\Session;
/**
* Session container
*/
use Cubex\ServiceManager\Service;
interface Session extends Service
{
public function init();
/**
* @param $key
* @param $data
*
* @return mixed
*/
public functio... | true |
0b0fcd813ffc7ed0f565f4e43162e8d7bd8b6b9b | PHP | SerhiiTsybulskyi/sql2mongo | /src/Commands/CLIMongoClient.php | UTF-8 | 3,398 | 3.21875 | 3 | [] | no_license | <?php
namespace mongoSQLClient;
use League\CLImate\CLImate;
use MongoDB\Client;
use League\CLImate\TerminalObject\Dynamic\Padding;
class CLIMongoClient implements ConsoleCommand
{
use Utils;
private $cli;
private $mongoClient;
private $currentDB;
private $commands = array('help', 'show dbs', 'sh... | true |
05c64d1d53f972207dd336d328dfed01f64c2717 | PHP | Nancypehe/ERPSI | /PHP/vistaEvaluacion.php | UTF-8 | 2,271 | 2.546875 | 3 | [] | no_license | <form action="" method="post">
Tipo:
<input type="text" name="tipo"><br>
Pregunta 1:
<input type="text" name="pregunta1"><br>
Pregunta 2:
<input type="text" name="pregunta2"><br>
Pregunta 3:
<input type="text" name="pregunta3"><br>
Pregunta 4:
<input type="text" name="pregunta4"><br>
Pregunta 5:
<input type="text" name... | true |
b054eb1d2cd87ad15d45c7d7c8a4c48bfb478d78 | PHP | mcrumm/wordy-api | /src/Wordy/Controller/WerdsController.php | UTF-8 | 916 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Wordy\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
class WerdsController extends AbstractController
{
/**
* Returns the collection... | true |
c409632effef8169598e96a2c98d82a96d81cf0f | PHP | stevenmahasin/PHP-and-MySQL-Learning | /PHP-and-MySQL-Learning-old/PHP-and-MySQL-Learning-83d8c58ff58b0fd73ebd76cad3031667cf5dad88/Project PPI/FinalProject/function.php | UTF-8 | 642 | 2.71875 | 3 | [] | no_license | <?php
function clean_string($db_server = null, $string){
$string = trim($string);
$string = utf8_decode($string);
$string = str_replace("#", "#", $string);
$string = str_replace("%", "%", $string);
if($db_server){
if (mysqli_real_escape_string($db_server, $... | true |
ebaf4bb8daa18eebf04caae9f452d5e0d7a1ad0e | PHP | sususudou/g031n091 | /bbs/thread/insert_message.php | UTF-8 | 999 | 2.625 | 3 | [] | no_license | <?php
//DBの設定ファイルから変数をロード
require_once("../../db_config.php");
// MySQLに接続
$mysqli = new mysqli('localhost', $db_user, $db_pass, $db_name);
$mysqli->set_charset("utf8");
$result_message = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// フォームで受け取ったメッセージをデータベースに登録
if (!empty($_POST['message']) and !empty($_POST['... | true |
afdf4bfc0bf93da46880e3cd1565ddbbff5c839c | PHP | GiantCowFilms/StackExchangeApiClient | /src/BenatEspina/StackExchangeApiClient/Model/Event.php | UTF-8 | 2,930 | 2.953125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
/*
* This file is part of the Stack Exchange Api Client library.
*
* (c) Beñat Espiña <benatespina@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of the Stack Exc... | true |
62d1ca8caa3de053f3dbb7c539427c5995ccc23b | PHP | dhikanbiya/frengers | /includes/options/library/development/factory/AdminPageFramework/AdminPageFramework_Form_Controller.php | UTF-8 | 15,578 | 2.59375 | 3 | [
"CC0-1.0",
"MIT"
] | permissive | <?php
/**
* Admin Page Framework
*
* http://en.michaeluno.jp/admin-page-framework/
* Copyright (c) 2013-2014 Michael Uno; Licensed MIT
*
*/
/**
* Provides public methods to add form elements.
*
* @abstract
* @since 2.0.0
* @since 3.3.1 Changed the name from `AdminPageFramework_S... | true |
d81f69d2261e7e93b07a4e3c35121c3816d72d3b | PHP | snowflakedb/pdo_snowflake | /tests/crud.phpt | UTF-8 | 3,441 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | --TEST--
pdo_snowflake - CRUD
--INI--
pdo_snowflake.logdir=/tmp/sflog
pdo_snowflake.cacert=libsnowflakeclient/cacert.pem
--FILE--
<?php
include __DIR__ . "/common.php";
$dbh = new PDO($dsn, $user, $password);
$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
echo "Connected to Snowflake\... | true |
d9fd4b856e40a6bbcc7150a4224f1beb058b756f | PHP | JosephAramburo/vendimia | /api/src/models/tableModel.php | UTF-8 | 345 | 2.953125 | 3 | [] | no_license | <?php
class TableModel {
protected $table;
protected $db;
function __construct($db, $table){
$this->db = $db;
$this->table = $table;
}
public function get($id = FALSE)
{
if(!$id){
return $this->db->table($this->table)->get();
}else{
return $this->db->table($this->table)->where('id','='... | true |
b5560655f88b4355ed9555478049e4cf271e89a0 | PHP | marchalscott/DGM-3760 | /Final-movie_review/updateDatabase.php | UTF-8 | 1,545 | 2.859375 | 3 | [] | no_license | <?php
require_once('superProtect.php');
require_once('variables.php');
$id = $_POST['id'];
$title = $_POST['title'];
$rating = $_POST['rating'];
$description = $_POST['description'];
//BUILD THE DATABASE CONNECTION WITH host, user, pass, database
$dbconnection = mysqli_connect(HOST,USER,PASSWORD,DB_NAME) or die ('conne... | true |
d56440796a46635fb4ec130ccd5358ab2b6486a5 | PHP | q2364678/practice | /app/Post.php | UTF-8 | 748 | 2.8125 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
// protected $table = "posts "; //指定資料表名稱
// public $timestamps = false; //若要取消時間戳記
protected $fillable=[//可建入之資料//
'title',
'content',
'user_id',
'views',
'admin',
] ;
//一個使用者可以發多個... | true |
559bf14cbf56ffdb6cd15c7163e2f856e7780e2f | PHP | wyrover/crypto-util | /lib/CryptoUtil/PBE/PRF/HMACSHA224.php | UTF-8 | 283 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace CryptoUtil\PBE\PRF;
/**
* Implements HMAC-SHA-224 as a pseudorandom function.
*/
class HMACSHA224 extends HMACPRF
{
/**
* Constructor.
*/
public function __construct() {
$this->_length = 28;
}
protected function _hashAlgo() {
return "sha224";
}
}
| true |
8ec762c953f97df1c51c6acdea965b61c5e0e4c5 | PHP | leoVitor/vendas | /dao/daocliente.class.php | UTF-8 | 4,891 | 2.59375 | 3 | [] | no_license | <?php
require_once "../con/conexao.class.php";
require_once "../class/cliente.class.php";
class DaoCliente{
public function save($cliente){
try{
$retorno = true;
$conexao = new Conexao();
$con = $conexao->connection();
$sql = "INSERT INTO `cliente`(`nome`, `cpf`, `nascimento`, `rg`, `telefone`, `... | true |
34460b67c4625d575b1e80d037fc6751a30f7329 | PHP | luisfbarajas/ServicioITT | /php/qrGenerator.php | UTF-8 | 2,819 | 2.8125 | 3 | [] | no_license | <?php
class qrgenerator
{
//propiedades
private $Id;
private $Nombre;
private $Apellidos;
private $Carrera;
private $Semestre;
private $F_Examen;
private $FolioPago;
private $email;
private $ncontrol;
//constructor
public function __construct($Id, $Nombre, $Semestre... | true |
813ccdc3e8b59e7969abf296eca38024744006d8 | PHP | l-essential/action-plan | /app/Models/ModelInit.php | UTF-8 | 2,766 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php namespace App\Models;
use DB;
class ModelInit
{
public $table = '';
public $conn = 'default';
public function table($as = '')
{
$table = $this->table;
$table .= !empty($as) ? " AS $as" : "";
return DB::connection($this->conn)->table($table);
}
public function d... | true |
34891e357a685fb65482f2020062456f27740daa | PHP | ShomyMagi/cakeproject | /app/Controller/GoodsController.php | UTF-8 | 3,206 | 2.609375 | 3 | [] | no_license | <?php
App::uses('AppController', 'Controller');
/**
* Goods Controller
*
* @property Good $Good
* @property PaginatorComponent $Paginator
*/
class GoodsController extends AppController {
/**
* Components
*
* @var array
*/
public $components = array('Paginator');
/**
* index method
*
* @return void
*/
p... | true |
9354d78927dbe25170936df9b03da9a4599dce21 | PHP | fishyx/cms | /inc/uploader.php | UTF-8 | 3,407 | 2.6875 | 3 | [] | no_license | <?php
if(!defined('UPLOAD_PATH')){
define('UPLOAD_PATH', ROOT_WWW . 'upload/');
}
if(!defined('UPLOAD_MAX_SIZE')){
define('UPLOAD_MAX_SIZE', 1024 * 1024); // 1 M
}
if(!defined('UPLOAD_EXTS_IMGS')){
define('UPLOAD_EXTS_IMGS', 'jpg|jpeg|gif|png');
}
if(!defined('UPLOAD_EXTS_ADS')){
define('UPLOAD_EXTS_ADS', 'jpg|... | true |
cb2a9bb8e90f04ba7ba3998b6cd5aeb7ae5e500b | PHP | swoft-cloud/swoft-component | /src/aop/src/Proxy.php | UTF-8 | 1,627 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | <?php declare(strict_types=1);
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://swoft.org/docs
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Swoft\Aop;
use Swoft\Aop\Ast\Visitor\ProxyVisitor;
use Swoft\Proxy\Ex... | true |
5d62d3c7476debff48149683081406f5b87afde8 | PHP | yifangyun/fangcloud-php-sdk | /src/Constant/Enum.php | UTF-8 | 1,509 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php
/**
* 自定义枚举类
*/
namespace Fangcloud\Constant;
use ReflectionClass;
/**
* Class Enum
* @package Fangcloud\Constant
*/
abstract class Enum {
/**
* @var array 定义的常量的缓存
*/
private static $constCacheArray = NULL;
/**
* 获取类中定义的所有缓存
*
* @return array
*/
private stat... | true |
a45e1015741335d5492180fc3957c8aeff77c612 | PHP | webuni/commonmark-attributes-extension | /src/Attributes.php | UTF-8 | 1,376 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* This is part of the webuni/commonmark-attributes-extension package.
*
* (c) Martin Hasoň <martin.hason@gmail.com>
* (c) Webuni s.r.o. <info@webuni.cz>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source cod... | true |
795146d7c1d2c6c77f6e419e201e94336233b58a | PHP | bowuting/yan18 | /03/code_me/02.php | UTF-8 | 299 | 2.984375 | 3 | [] | no_license |
<meta charset="utf-8">
<?php
$a = '';
$b = null;
if (isset($a)) {
echo "a存在";
}
else {
echo "a不存在";
}
if (isset($b)) {
echo "b存在";
}
else {
echo "b不存在";
}
if (isset($c)) {
echo "c存在";
}
else {
echo "c不存在";
}
?>
| true |
64f22edf565007749c213723f3cab1ceebacb644 | PHP | joshy24/Geniuses | /includes/UserPosts.php | UTF-8 | 5,071 | 3 | 3 | [] | no_license | <?php
require_once 'Database.php';
require_once 'Posts.php';
require_once 'FetchedPosts.php';
require_once 'Dates.php';
require_once 'Friends.php';
Class UserPosts{
protected static $table_name = "userpost";
public $id;
public $post_id;
public $user_type;
p... | true |
b841a20aea8696f8c2a89f2d7ee296d8ec6b279f | PHP | cnluckylee/pdf2html | /protected/models/PropertyFileMgt.php | UTF-8 | 9,956 | 2.6875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: living
* Date: 14-10-29
* Time: 下午3:58
*/
class PropertyFileMgt extends PropertyFile{
/**
* 首页图表
*/
public static function draw_housing_type()
{
//House 独立屋
$query_arr_1 = array(0,32,60);
$data = self::draw_data();
$q... | true |
cc16bd50d84edab6918e6592cd9b74eaae526052 | PHP | Ekopop/projet4 | /model/UsersManager.php | UTF-8 | 1,177 | 2.875 | 3 | [] | no_license | <?php
class UsersManager
{
private function dbConnect(): PDO
{
$conf = Config::getConfigByEnv('local');
return new PDO('mysql:host=' . $conf['host'] . ';dbname=' . $conf['dbname'] . ';charset=utf8', $conf['user'], $conf['password']);
}
private function userCheck($user)
{
// Récupérat... | true |
c24d135b2c247ff19636cb34f0f4baa86c2b0615 | PHP | MyLittleVerdant/Pena-Practice | /guestbook/classes/CaptchaVerify.php | UTF-8 | 1,438 | 2.859375 | 3 | [] | no_license | <?php
error_reporting(E_ERROR);
class CaptchaVerify
{
private $captcha_value = '';
private $captcha_field = '';
private $answer_time = '';
private function sessionRead()
{
session_start();
$this->captcha_value = $_SESSION['captcha_value'];
$this->captcha_field = $_SESSIO... | true |
41d286d6b6505ee514c5edeb58d58a679f9e5966 | PHP | JonMadVal/laravel-wubook | /src/Api/WuBookChannelManager.php | UTF-8 | 9,353 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of Laravel WuBook.
*
* (c) Filippo Galante <filippo.galante@b-ground.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace jonmadval\LaravelWubook\Api;
use jonmadval\LaravelWubook\Api\WuBook... | true |
456548f48daff36ad6851045d601462072f6f8f9 | PHP | pompa-group/pompaCMS | /index.php | UTF-8 | 2,818 | 2.8125 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="de">
<meta charset="utf-8">
<?php
include("info.php");
//Verbindung mit Datenbank
//sql Anfrage erstellen
$informations = "SELECT infos, inhalt FROM informations";
$informations_ergebnis = mysqli_query($db, $informations);
while($row = mysqli_fetch_object($informations_ergebnis))
{
... | true |
158f7b7ba7b0e854050b392d85742bdf4e6e2616 | PHP | Marvellanius/miscellany | /app/Observers/EntityObserver.php | UTF-8 | 3,560 | 2.625 | 3 | [] | no_license | <?php
namespace App\Observers;
use App\Facades\EntityPermission;
use App\Facades\Identity;
use App\Models\CampaignPermission;
use App\Models\Entity;
use App\Models\EntityLog;
use App\Models\Tag;
class EntityObserver
{
// not used
/**
* An entity has been saved from the crud
*/
public function ... | true |
7be8f946617496eae8cc024ccaf3c760771f2c3f | PHP | johnrich85/wp-related-posts | /wp-content/plugins/weeb-related-posts/includes/classes/weeb_related_posts_factory.php | UTF-8 | 1,470 | 2.875 | 3 | [] | no_license | <?php
/**
* weeb_related_posts_factory
*
* Instantiates and configures related posts object.
*
* @author John Richardson <johnrich85@hotmail.com>
*/
class weeb_related_posts_factory {
public static function create($post, $required_posts) {
//Instantiating object which retrieves pos... | true |
02ce22c9955fa2fd17e84faf1f6f05a25772411a | PHP | phpstan/phpstan-src | /tests/PHPStan/Rules/Comparison/data/bug-5317.php | UTF-8 | 232 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace Bug5317;
/**
* @param non-empty-string $in
*/
function nonEmptyString(string $in): void
{
var_dump(!$in);
}
/**
* @param non-falsy-string $in
*/
function nonFalsyString(string $in): void
{
var_dump(!$in);
}
| true |
74169edea117049b6286f93acba64a6e6c1258ef | PHP | f1mp3r/php-forum | /controller/boards.php | UTF-8 | 1,176 | 2.65625 | 3 | [] | no_license | <?php
namespace Controllers;
class Boards_Controller extends Base_Controller
{
public function __construct() {
$this->load_models(['questions', 'categories']);
}
public function index() {
$this->redirect('home');
}
public function view($slug, $page = 1) {
$slug = urldecode($slug);
$data = [];
$curren... | true |
f7fa04652e4e8e11fc45b5d8f937648abb05d78d | PHP | Antonio2133/agroseja | /Modelos/galeriaM.php | UTF-8 | 338 | 2.53125 | 3 | [] | no_license | <?php
require_once "admin/Modelos/ConexionBD.php";
class GaleriaM extends ConexionBD{
static public function MostrarGaleriaM($tablaBD){
$pdo = ConexionBD::cBD()->prepare("SELECT imagen, titulo, descripcion, subtitulo FROM $tablaBD ORDER BY orden ASC");
$pdo -> execute();
return $pdo -> fetchAll();
$pdo ... | true |
a73ab5f3f673e0a3aebef7d7af0d2389cc667f2e | PHP | Sina-Mahmoodmoradi/QueraPhpCourse | /objectOriented programming/resturant/restaurant-cashier-initial/Food/Hamburger.php | UTF-8 | 289 | 3.203125 | 3 | [] | no_license | <?php
namespace Food;
use Food\Food;
class Hamburger implements Food
{
private $price = 65000;
private $name = "Special Hamburger";
public function getPrice()
{
return $this->price;
}
public function getName()
{
return $this->name;
}
}
| true |
304cc7d3993359d2fd96670ea563311b6db955ac | PHP | subhojitgupta-cn/kong-helpdesk | /admin/class-kong-helpdesk-livechat-backend.php | UTF-8 | 17,502 | 2.546875 | 3 | [] | no_license | <?php
class Kong_Helpdesk_Livechat_Backend extends Kong_Helpdesk
{
protected $plugin_name;
protected $version;
/**
* Construct Livechat Class
* @author CN
* @version 1.0.0
* @since 1.0.0
* @param [type]
* @param [type]
... | true |
0adee2bc43edc251425854d5e2b3c41287469336 | PHP | johnelliotbaker/snahp | /service.php | UTF-8 | 836 | 2.765625 | 3 | [] | no_license | <?php
/**
*
* snahp. An extension for the phpBB Forum Software package.
*
* @copyright (c) 2018
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/
namespace jeb\snahp;
/**
* snahp Service info.
*/
class service
{
/** @var \phpbb\user */
protected $user;
/** @var string */
protec... | true |
9cd26d8c86586ef2cd4df8c830d78f69def70f31 | PHP | fhp/unicorn | /src/Unicorn/UI/Base/HtmlGlobalAttributes.php | UTF-8 | 4,554 | 2.65625 | 3 | [] | no_license | <?php
namespace Unicorn\UI\Base;
trait HtmlGlobalAttributes
{
use HtmlBasicAttributes;
public function data(string $name): string
{
return $this->property("data-" . $name);
}
public function hasData(string $name): bool
{
return $this->hasProperty("data-" . $name);
}
public function setData(string $n... | true |
451cdcba7cacc02b6238be6c0e3b10648b77f1fe | PHP | matiashrnndz/driving-lessons-app | /models/InstructorDao.php | UTF-8 | 1,797 | 2.8125 | 3 | [] | no_license | <?php
require_once($_SERVER['DOCUMENT_ROOT'] . 'driving-lessons/configs/configuration.php');
function addInstructor($instructorData) {
$connectionDb = getConnection();
$connectionDb->conectar();
$params = array(
array("name", $instructorData['name'], "string"),
array("lastname", $inst... | true |
4f780ec78985fa1f630945d22dee421cae9676cb | PHP | jordimanrique/patterns | /src/Command/Command.php | UTF-8 | 253 | 2.734375 | 3 | [] | no_license | <?php
namespace Patterns\Command;
abstract class Command
{
protected const KEY = 'root command';
public abstract function execute();
public abstract function undo();
public function getKey()
{
return static::KEY;
}
} | true |
6550fd3fa382dcd51aadfed449c3ff8d0e8557f9 | PHP | tuyen0395188667/hocphp | /phpbasic/bai12.php | UTF-8 | 172 | 3.09375 | 3 | [] | no_license | <?php
// Đệ quy tuyến tính
function tinhtong($n)
{
if ($n == 1){ return $n; }
return $n + tinhtong($n-1);
}
echo tinhtong(100);
?> | true |
e3686e592ee37f0b3a15012caa645d277087e6fb | PHP | pedromlcosta/LBAW | /Product/database/request.php | UTF-8 | 10,322 | 2.640625 | 3 | [] | no_license | <?php
/*
CREATE TABLE IF NOT EXISTS Request(
requestID SERIAL PRIMARY KEY,
studentCode INTEGER REFERENCES Person(academicCode),
adminCode INTEGER REFERENCES Person(academicCode),
newCourse_Code INTEGER REFERENCES Course(code),
approved BOOLEAN,
reasonForChange TEXT NOT NULL,
visible INTEGER DEFAULT 1,
CHECK(reasonForC... | true |
b2d14a8264693fd74c11d0992f8cbb18ad56326d | PHP | Trung-Jeager-2019/Team_Actcool_HackCovy_2020 | /inc/grimlock-login/customizer/class-cera-grimlock-login-customizer.php | UTF-8 | 1,141 | 2.59375 | 3 | [] | no_license | <?php
/**
* Cera_Grimlock_Login_Customizer Class
*
* @author Themosaurus
* @since 1.0.3
* @package grimlock
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* The Grimlock Customizer class for the single product.
*/
class Cera_Grimlock_Login_Customizer {
/**
* Setup class.
... | true |
1f08f53e44bc6c582da7ff1e33a61a1b09eb566d | PHP | Xutrurn/php-snacks-blocco-1 | /PHP Snack 1/index.php | UTF-8 | 2,318 | 2.890625 | 3 | [] | no_license | <!-- PHP Snack 1:
Creiamo un array 'matches' contenente altri array i quali
rappresentano delle partite di basket di un’ipotetica tappa
del calendario. Ogni array della partita avrà una squadra di
casa e una squadra ospite, punti fatti dalla squadra di casa
e punti fatti dalla squadra ospite.
Stampiamo a schermo ... | true |
10a05fb16da7d47141a362b55ecb629203343506 | PHP | huaquanqi/storage | /qioushu.php | UTF-8 | 278 | 3.1875 | 3 | [] | no_license | <?php
$arr = [5,2,7,6,3,41,22];
function get($arr){
$qi = [];
$ou = [];
for ($i=0; $i <count($arr) ; $i++) {
# code...
if($arr[$i] % 2 ==0){
$ou[] = $arr[$i];
}else{
$qi[] = $arr[$i];
}
}
return array_merge($qi,$ou);
}
echo "<pre>";
var_dump(get($arr));
?> | true |
788c5ccd99f14799fd1e729503abcd6a2388d12f | PHP | Vishalgarg3737/Security-Locker-using-PhP-and-IoT | /login_form.php | UTF-8 | 1,951 | 2.5625 | 3 | [] | no_license | <?php
session_start();
$username=$password="";
$usererr=$passerr="";
$count=0;
if($_SERVER["REQUEST_METHOD"] == "POST")
{
if(empty($_POST["user"]) || ctype_space($_POST["user"]))
{
$usererr = "Username is required";
}
else
{
$username = $_POST["user"];
$count++;
}
if(empty($_POST["pass"... | true |
fea5ff7de095341c68b3cdba0aba317cd7454026 | PHP | shuangjie/time-conversion | /TimeConversion.php | UTF-8 | 2,111 | 3.359375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: DoubleJack
* Date: 2018/4/19
* Time: 20:19
*
* @function getTimeConversion 对比时间戳(精确到秒) 转换成 几 分钟/小时/天/周/月/年 前/后
* @param string timeStamp1 时间戳1 必填
* @param string timeStamp2 时间戳2 非必填(若为空则对比now)
* @return array result ['before' => 'xxx前','after' => 'xxx后']
*/
CONST MINU... | true |
3752e869799971b5bc23fa1d1dfc8526df7b01cb | PHP | rukshn/hypertables-flavour-php | /app/Http/Controllers/HypertablesController.php | UTF-8 | 10,823 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use App\Models\HTColumnsModel;
use App\Models\HTCentralModel;
class HypertablesController extends Controller
{
// This is the HyperTables controller, which will handle a... | true |
d6c012712edc49396b49c8e36cc3d6a78133cbdb | PHP | wavixsan/homeworks | /functions_forms_tasks/11.php | UTF-8 | 1,220 | 3.125 | 3 | [] | no_license | <?php
function abcrus($s,$o=false){
$a="абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
$A="АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
if($o==true){
$t=$a;
$a=$A;
$A=$t;
}
$t="";
for($i=0;$i<strlen($s);$i++){
$p=true;
for($j=0;$j<strlen($a);$j++){
if(substr($s,$i... | true |
ae5f2961268b8f7cc0fc847d3604df254fb23758 | PHP | LarasAndriyani/OSS-GIT-FTIK-USMJAYA | /praktek 2.php | UTF-8 | 126 | 2.84375 | 3 | [] | no_license | <?php
$nama1 = "Tulis Nama Anda";
$nama2 = "Tulis Nama Teman";
echo "<br> Variabel \$nama1 = $nama1";
echo "<br> Variabel \$nama2 = $nama2";
?> | true |
0918d13b1478c0a183788bd71bb683d2520ad9db | PHP | astromzimmer/Nn | /Nn/Modules/Table/Table.php | UTF-8 | 1,897 | 2.6875 | 3 | [] | no_license | <?php
namespace Nn\Modules\Table;
use Nn;
use Utils;
class Table extends Nn\Modules\Attachment\Attachment {
protected $content;
public static $SCHEMA = array(
'title' => 'short_text',
'description' => 'text',
'filename' => 'short_text',
'content' => 'long_text',
'created_at' => 'double',
'update... | true |
13accde5a84597a8742e453fcea1100acf0cf396 | PHP | HireUkraine1/Projects-History | /ManagerSportSchool/database/migrations/2017_03_20_084528_school_courses.php | UTF-8 | 1,578 | 2.5625 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\sportport\Facades\Schema;
class SchoolCourses extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('school_courses', f... | true |
2e3e264113d5d4c987994637748dcabc3584d492 | PHP | RoySegall/dc | /dc_apps/includes/dc_apps.entity.inc | UTF-8 | 9,362 | 2.703125 | 3 | [] | no_license | <?php
class DrupalConnectApps extends Entity {
/**
* @var
* The primary identifier for a applications.
*/
public $id;
/**
* @var
* The title of this application.
*/
public $title;
/**
* @var
* A description of the application.
*/
public $description;
/**
* @var
* The ... | true |
8ca41bcefe9d49df8e57b34ab5e145a28ff45b46 | PHP | novitskiy-aleksei/zhmuh-framework-kernel | /src/Zhmuh/Input.php | UTF-8 | 889 | 3.15625 | 3 | [] | no_license | <?php
namespace Zhmuh;
/**
* POST/GET input wrapper
*
* Class Input
*/
class Input {
/**
* Retrieve $_GET value
*
* @param $key
* @param null $default
* @return null
*/
public static function get($key, $default = null)
{
return isset($_GET[$key]) ? $_POST[$key] :... | true |