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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
aba262c1a6392eeabca9e926a47b1b53e02997f9 | PHP | igorivacic/IT255-DZ12-IgorIvacic2740 | /php/functions.php | UTF-8 | 3,431 | 2.703125 | 3 | [] | no_license | <?php
include("config.php");
function checkIfLoggedIn(){
global $conn;
if(isset($_SERVER['HTTP_TOKEN'])){
$token = $_SERVER['HTTP_TOKEN'];
$result = $conn->prepare("SELECT * FROM users WHERE token=?");
$result->bind_param("s",$token);
$result->execute();
$result->store_result();
$num_rows = $result->num_rows;
if($num... | true |
f62111b8d7c1e45893c3c3471bad4574c207387b | PHP | Reed-Sarah/showMyHome | /web/model/accounts.php | UTF-8 | 1,772 | 2.96875 | 3 | [] | no_license | <?php
/* Accounts Model */
//registers user
function regUser($first_name, $last_name, $isRealtor, $mlsNum, $phone, $email, $user_password, $db){
$sql = 'INSERT INTO users (first_name, last_name, is_realtor, MLS_num, phone, email, user_password)
VALUES (:first_name, :last_name, :isRealtor, :mlsNum, :phone, ... | true |
00501a59c30240672d8b87a8dcc34b7b37493a66 | PHP | edw-rys/backend_app_samoyed | /app/models/PersonaModel.php | UTF-8 | 665 | 3.109375 | 3 | [] | no_license | <?php
class PersonaModel extends Model
{
public $id;
public $name;
public $last_name;
public $created_at;
/**
* Método para agregar un nuevo usuario
*
* @return integer
*/
public function add()
{
$sql = 'INSERT INTO datos (name, last_name, created_at) VALUES (:name, :last_name, now())'... | true |
4beffc443c3ced7bab4782308b1f9f794af5bb16 | PHP | dalvarad/consultoraAlpha | /app/Http/Requests/EmpleadoRequest.php | UTF-8 | 638 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class EmpleadoRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation ru... | true |
28d25317ea203a528e5c6534a956fd188b5495a3 | PHP | Rajat001/Inter-Code-Base | /Program-Test-Case/prime1.php | UTF-8 | 173 | 3.453125 | 3 | [] | no_license | <?php
$num = 5;
$flag = 0;
for($i = 2; $i < $num / 2; $i++){
if($num % $i == 0){
$flag = 1;
break;
}
}
if($flag == 0){
echo "Prime";
}else{
echo "Not Prime";
}
?> | true |
4109b9eef92e2fcbbca07bbef4155364798aab91 | PHP | NaufalHSyahputra/jakmall-test | /src/Commands/HistoryListCommand.php | UTF-8 | 1,738 | 2.578125 | 3 | [] | no_license | <?php
namespace Jakmall\Recruitment\Calculator\Commands;
use Illuminate\Console\Command;
use Jakmall\Recruitment\Calculator\History\Infrastructure\CommandHistoryManagerInterface;
class HistoryListCommand extends Command
{
/**
* @var string
*/
protected $signature;
/**
* @var string
*... | true |
0d29433f3a0eafee5620445a046a7e1e1f41ed1f | PHP | SophB/WasteManager_Back | /src/Services/Composter.php | UTF-8 | 955 | 2.859375 | 3 | [] | no_license | <?php
namespace App\Services;
use App\Business\Report;
use App\Entity\Waste;
class Composter implements CentersInterface
{
public string $name;
public float $capacity;
public array $wasteTypeTreated;
public float $CO2Rejected;
public function __construct(string $name, float $capacity)
{
... | true |
94ce694b5645b8539e4c77ca050d75e8cdd9fde3 | PHP | adiungo/core | /lib/Interfaces/Has_Location.php | UTF-8 | 412 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
namespace Adiungo\Core\Interfaces;
use Adiungo\Core\Factories\Location;
interface Has_Location
{
/**
* Gets the location
*
* @return Location
*/
public function get_location(): Location;
/**
* Sets the location
*
* @param Location $location The location to set.
... | true |
ee11e353991fbd01d6452295ccf682191bb68801 | PHP | jaffle-be/mantelzorg | /database/seeds/Data/Ouderen.php | UTF-8 | 2,456 | 2.625 | 3 | [] | no_license | <?php namespace Data;
// Composer: "fzaninotto/faker": "v1.3.0"
use App\Mantelzorger\Oudere;
use App\Meta\Context;
use Illuminate\Database\Seeder;
class Ouderen extends Seeder
{
protected $mantelzorgerRelation;
protected $woonSituatie;
protected $oorzaakHulpbehoefte;
protected $belProfiel;
pu... | true |
ed4c1968bc8bacb93c273568ddb5483d25026d9e | PHP | Em0An/php.github.io | /index.php | UTF-8 | 5,042 | 2.984375 | 3 | [] | no_license | <?php
// Check If User Coming From A Request
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Assign Variable
$user = filter_var($_POST['username'], FILTER_SANITIZE_STRING);
$mail = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
$cell = filter_var($_POST['cellp... | true |
0b2bf4f733fa11210b95ecd261d42768436d2806 | PHP | kaaaaaaaaaaai/broaden-theme | /app/Models/Themes.php | UTF-8 | 763 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class Themes
* @package App\Models
* @var close_time
*/
class Themes extends Model
{
protected $table = "themes";
protected $fillable = ["summary", "detail", "close_time"];
/**
* @return \Illuminate\Dat... | true |
9106edd5aa70c99cebd1907f466b045f6085c65c | PHP | Jean-CharlesLedioron/sortir-eymfony-eni | /src/Repository/VilleRepository.php | UTF-8 | 1,358 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Repository;
use App\Entity\Ville;
use App\Model\SearchFilter;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method Ville|null find($id, $lockMode = null, $lockVersion = null)
* @method Ville|null findOneBy(array $criteria... | true |
e959c38d80adc0ebda35ac03ffd0af029f91165e | PHP | parshuramreddysudda/Fest-Website-For-Engineering-College | /verify.php | UTF-8 | 5,853 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "user";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error)
{
die("Connection failed: " . $conn->connect_error);
}
if(isset($_GET['idNumber']))
{
... | true |
b907dac07130c174eba00501dfd8cfa986ad948d | PHP | JohnSoutar-ColeAD/Soak | /soak-core/class/page.php | UTF-8 | 1,259 | 3.03125 | 3 | [] | no_license | <?php
class Page {
var $pageID = '';
var $siteID = '';
var $pageSlug = '';
var $userID = '';
var $templateID = '';
var $parentID = '';
var $pageTitle = '';
var $pageDescription = '';
var $pageContent = '';
var $parsedContent;
var $Template;
function Page($pageID = '', $using_slug = FALSE) {
$this->... | true |
b5cec5ec6591d0628c256a20aefbef250925faa5 | PHP | DavidBinaud/VIZUIC | /model/ModelFormulaire.php | UTF-8 | 2,224 | 3 | 3 | [] | no_license | <?php
require_once File::build_path(array("model", "Model.php"));
class ModelFormulaire extends Model {
private $idFormulaire;
private $nomFormulaire;
private $descriptionFormulaire;
private $idCreateur;
protected static $object = "formulaire";
protected static $primary = "i... | true |
8a7e3e28a3041853a607983dd0a02aa1d89083a2 | PHP | ampproject/amp-toolbox-php | /tests/Cli/AmpExecutableTest.php | UTF-8 | 5,515 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace AmpProject\Cli;
use AmpProject\Tests\PrivateAccess;
use AmpProject\Tests\TestCase;
/**
* Test the executable file logic.
*
* @covers \AmpProject\Cli\Executable
* @covers \AmpProject\Cli\AmpExecutable
* @package ampproject/amp-toolbox
*/
class AmpExecutableTest extends TestCase
{
use Private... | true |
c7b8a64239e28a6201f278e57f3a355b3ddaec60 | PHP | NikitaSNS/Web | /phpLesson7/singleton.php | UTF-8 | 678 | 3 | 3 | [] | no_license | <?php
class Database
{
private static $db = null;
private $mysqli;
public function __construct()
{
$this->mysqli = new mysqli('localhost', 'root', '', 'pract6');
$this->mysqli->set_charset('utf8');
}
public static function getDb()
{
if (self::$db === null) {
... | true |
a0b9b13e788c1048a92df56d110b945ca3add2d5 | PHP | ruschoni02/laravel-sqs-queue-connector | /tests/Jobs/ConsumerJob.php | UTF-8 | 557 | 2.515625 | 3 | [] | no_license | <?php
namespace SqsQueueConnector\Tests\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
use SqsQueueConnector\Queue\Contracts\SqsQueueInterface;
/**
* Class ConsumerJob
* @package SqsQueueConnector\Tests\Jobs
*/
class ConsumerJob implements ShouldQueue, SqsQueueInterface
{
/*
* Implements traits queue
... | true |
3d1a4c3762e5fbc7191f6c7efb044ffb303d528d | PHP | weizhongli/webMGA | /contact/request.php | UTF-8 | 1,654 | 2.90625 | 3 | [] | no_license | <?php
function isvalidemail( $email ) {
if( preg_match( "/[a-zA-Z0-9-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email ) > 0 ) //TODO recheck this pattern!
return true;
else
return false;
}
//people receiving messages from the web form
//multiple addresses must be seperated by comma
$to='liwz@sd... | true |
a157c647b4569ff8cfc97782e780e815722d3944 | PHP | ahmedmamdouh886/our-hotels | /app/Http/Controllers/API/OurHotelsController.php | UTF-8 | 1,062 | 2.734375 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Requests\SearchRequest as SearchRequest;
use App\Services\Interfaces\OurHotelsAggregatorInterface as OurHotelsAggregatorInterface;
class OurHotelsController extends Controller
{
/**
* Co... | true |
7c4019cac11dde8572345fc01b76b67bcc58ecad | PHP | StenopePHP/Stenope | /src/ReverseContent/RelativeLinkContext.php | UTF-8 | 710 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <thomas.jarrand@gmail.com>
*/
namespace Stenope\Bundle\ReverseContent;
/**
* Context to resolve a link to a content relative to the current one.
*/
class RelativeLinkContext extends Context
{
private array $currentM... | true |
832fb72e92182a31336236b691bfd078b6ca06cd | PHP | ABPAM/fashion-app | /api/app/Http/Controllers/ProductController.php | UTF-8 | 4,577 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Product;
use App\Set;
use App\Rating;
use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\Model;
class ProductController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
... | true |
c2d03b6380cbeb02fcbe61a4c2522b616f5ae360 | PHP | dadaxiao/jiaolianyuan | /APP/Home/Controller/IndexController.class.php | UTF-8 | 3,614 | 2.5625 | 3 | [] | no_license | <?php
namespace Home\Controller;
use Think\Controller;
use Think\Model;
class IndexController extends Controller {
public function index(){
$name = $_SESSION['name'];
$face = $_SESSION['face'];
$this->assign('name',$name);
$this->assign('face',$face);
<<<<<<< HEAD
=======
>>>>>>> 115c513af13... | true |
cacb8452035f165ba359dd1035d88d37c90c992d | PHP | hjpbarcelos/gd-wrapper | /src/Resource/ImageResourceFactory.php | UTF-8 | 3,480 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Defines ReaderFactory class.
*
* @author Henrique Barcelos
*/
namespace Hjpbarcelos\GdWrapper\Resource;
use Hjpbarcelos\GdWrapper\Resource\AbstractResourceFactory;
use Hjpbarcelos\GdWrapper\Io\Reader\ReaderFactory;
use Hjpbarcelos\GdWrapper\Resource\ImageResource;
/**
* Factory for `\Hjpbarcelos\GdWr... | true |
9cf10eefc968ffda236436ecf49d88e0f8902eea | PHP | VoDongMy/xenforo-laravel5.1 | /plug/[VNNET]-[Dong My]sonnbXenGallery_2.1.3/upload/library/sonnb/XenGallery/ModerationQueueHandler/Album.php | UTF-8 | 2,861 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
/**
* @category XenForo
* @package sonnb - XenGallery
* @version 2.1.3
* @copyright: sonnb
* @link www.sonnb.com
* @version One license is valid for only one nominated domain.
* @license You might not copy or redistribute this addon. Any action to public or redistribute must be ... | true |
3add53da07227a3da4df3788833ad7d9c89cbb8c | PHP | raselkarim7/DesignPatterns-And-SolidPrinciples-PHP | /solid-principles/single-responsibility/src/Reporter/HtmlOutput.php | UTF-8 | 211 | 2.859375 | 3 | [] | no_license | <?php
namespace App\Reporter;
use App\Interfaces\SalesOutputInterface;
class HtmlOutput implements SalesOutputInterface {
public function output($sales) {
return "<h1>Sales: $sales $</h1>";
}
} | true |
181dbee7fba396f953f84c3b1eb2b8b0cd16b33e | PHP | DevelopFer/active-campaign-v3-api-php | /src/Exceptions/ParametersRequiredException.php | UTF-8 | 292 | 2.71875 | 3 | [] | no_license | <?php
namespace WebforceHQ\Exceptions;
use Exception;
class ParametersRequiredException extends Exception
{
protected $message = "Parameters can not be null";
public function __construct($msg = null)
{
if ($msg) {
$this->message = $msg;
}
}
}
| true |
234c790c075ab20057ff5f6139cc18165be94449 | PHP | himanshubat/hms | /admin/setting.php | UTF-8 | 3,972 | 2.578125 | 3 | [] | no_license | <?php
/*================Author : Mukesh Kumar====================*/
/*================Date : 15.12.2017========================*/
$title = 'Setting';
include('header.php');
if(isset($_POST) && !empty($_POST) && $_SERVER["REQUEST_METHOD"] == "POST"){
$old_password = $_POST['old_password'];
$... | true |
83cf05a94dbfe58940811b2b3b24e22e6b34e64d | PHP | xxGus/select2 | /model/Pizza.php | UTF-8 | 1,121 | 3.09375 | 3 | [] | no_license | <?php
namespace model;
class Pizza{
private $id;
private $nome;
private $ingrediente;
private $valor;
private $id_cliente_sistema;
/**
* @return mixed
*/
public function getIdClienteSistema()
{
return $this->id_cliente_sistema;
}
/**
... | true |
c95ab0b75d940d69d786a205e79e28894ae83244 | PHP | zacfukuda/minamoto | /inc/posts_on_front.php | UTF-8 | 1,310 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Example but practical use of Options API and Settings API.
* Custom options for indexing certain number of posts on front page,
* other than the default posts-per-page setting.
* @link https://codex.wordpress.org/Options_API
* @link https://codex.wordpress.org/Settings_API
*/
function posts_on_front()... | true |
85cc0014c7924961e9fb4265ac89d297fc685aeb | PHP | Bechma/proyecto-final-tw | /proyecto/templates/operaciones_db.php | UTF-8 | 16,188 | 2.96875 | 3 | [] | no_license | <?php
/**
* Funcion que nos permite establecer una conexion con la base de datos
*/
function db_conectar(){
$servername = "localhost";
$username = "mianbr1718";
$password = "mA29PIX8";
$dbname = "mianbr1718";
// $servername = "localhost";
// $username = "root";
// $password = "admin";
// $dbname = "mia... | true |
b475ac83731015dda06741ac09e92fdc3ce29b5e | PHP | BrandConstantin/php | /tema-08/01/index.php | UTF-8 | 2,965 | 2.796875 | 3 | [] | no_license | <?php session_start(); ?>
<!DOCTYPE html>
<!--
Crea una aplicación web que permita hacer listado, alta, baja y modificación sobre la tabla cliente
de la base de datos banco .
• Para realizar el listado bastará un SELECT, tal y como se ha visto en los ejemplos.
• El alta se realizará mediante un formulario donde s... | true |
27f5da0041ce24e52360517269b4b9302c18b91e | PHP | LaithHaleem/sua | /edit.php | UTF-8 | 1,261 | 2.59375 | 3 | [] | no_license | <?php
include('includes/header.php');
include('config.php');
if(isset($_GET) && !empty($_GET)) {
$ided = $_GET['edit'];
$sqled = "SELECT * FROM shrt_u WHERE id_u = '$ided'";
$resed = mysqli_query($con, $sqled);
$rowed = mysqli_fetch_assoc($resed);
if(isset($_POST['editurl'])) {
... | true |
0018b0157527d36201da71d8b0563aa5f08ab2dd | PHP | fsw/old_eve | /evelibs/core.lib/controller/Controller.php | UTF-8 | 2,039 | 3.015625 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | <?php
/**
* Actions.
*
* @package Framework
* @author fsw
*/
abstract class Controller
{
public static $allowRobots = true;
/**
* @var Request
*/
protected $request = null;
protected $method = null;
protected $path;
private $headers = [];
public function __construct(Request $request, $method... | true |
10be027a827b804b1311a21879a4000ec9db1e9a | PHP | cosmos3/Anassa | /src/CContentPage/CContentPage.php | UTF-8 | 1,083 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This is class CContentPage
*
*/
class CContentPage {
public function __construct($db) {
$this->content=new CContent($db);
$this->user=new CUser($db);
$this->filter=new CTextFilter();
}
public function getPage($url) {
$sql="SELECT * FROM ".ANASSA_TABLE_CONTENT."... | true |
acb69be8f45f1cc79ecf4d4882e98e43db46fd21 | PHP | rahulyhg/php-3 | /rew/rew-framework-dev/httpdocs/builders/classes/State.php | UTF-8 | 4,638 | 2.75 | 3 | [] | no_license | <?php
/*
* BDX State
*/
namespace BDX;
class State
{
/**
* USA State List
* @var array
*/
private static $statesUSA = array(
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorad... | true |
749d818110cdc9fa5837fba2bab3712c6fbb7067 | PHP | hridoyn/seek-wedding-photographer | /CustomerHandler.php | UTF-8 | 2,229 | 2.796875 | 3 | [] | no_license | <?php
//$name=$_GET['name'];
//$username=$_GET['username'];
//$email=$_GET['email'];
//echo "Your name:".$name."<br>";
//echo "Your name:".$username."<br>";
//echo "your email:".$email."<br>";
$con=mysqli_connect('localhost','root','');
if(!$con){
echo 'Not connected to server';
}
if(!mysqli_select_db($con,'hridoy')... | true |
d75a0a30e680407f8753ee9a2ea6601a2bc3e49b | PHP | phacility/phabricator | /src/applications/phriction/controller/PhrictionDocumentController.php | UTF-8 | 20,399 | 2.703125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
final class PhrictionDocumentController
extends PhrictionController {
private $slug;
public function shouldAllowPublic() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$this->slug = $request->getURIData('slug');
$slug = Ph... | true |
c541f0fb82f7b4e9a64b8f4f0cba66a4efff891d | PHP | SanzaTS/Society_Management_System | /funtions.php | UTF-8 | 1,231 | 2.609375 | 3 | [] | no_license | <?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
function sendMail($sendTo,$subject,$message)
{
$mail = new PHPMailer(true);
try {
$mail = new PHPMailer();
$mail->isSM... | true |
d1a8edda185dd6ea8b34992c634c6ba9473e43c7 | PHP | jrodrig30/vital-signs-control | /site/app/plugins/OwCore/src/Shell/CoreShell.php | UTF-8 | 629 | 2.609375 | 3 | [] | no_license | <?php
namespace OwCore\Shell;
use Cake\Console\Shell;
use Cake\Utility\Inflector;
class CoreShell extends Shell {
public $tasks = ['OwCore.CarregaActions','OwCore.PopularTabelas'];
function main() {
$this->print_instructions();
$this->CarregaActions->main();
}
function print_instructions() {... | true |
452c22e3d60629e37c4136743adcb2c6be7b2739 | PHP | edwardstd/STS | /sts02/db_edit_shipments.php | UTF-8 | 8,396 | 2.859375 | 3 | [] | no_license | <?php
// edit_shipments.php
// edits the selected row in the shipment table if the Update button was clicked
// it replaces only those items where a new value was submitted
// generate a javascript line to display the table name
print '<script>document.getElementById("table_name").innerHTML = "Shipments";</... | true |
29b5e6519a7bd18a466ac650ef836bae98ba13ce | PHP | async-aws/aws | /src/Service/MediaConvert/src/Enum/AudioNormalizationPeakCalculation.php | UTF-8 | 453 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace AsyncAws\MediaConvert\Enum;
/**
* If set to TRUE_PEAK, calculate and log the TruePeak for each output's audio track loudness.
*/
final class AudioNormalizationPeakCalculation
{
public const NONE = 'NONE';
public const TRUE_PEAK = 'TRUE_PEAK';
public static function exists(string $value)... | true |
6badadb7565598dc4ddefc92a24e79b028f26cbd | PHP | satejkokate/BlogHive | /signup.php | UTF-8 | 1,848 | 2.5625 | 3 | [] | no_license | <?php
include('App/Database/db.php');
if(isset($_POST['submit-button'])) {
unset($_POST['submit-button'], $_POST['passwordConf']);
$_POST['password'] = password_hash($_POST['password'], PASSWORD_DEFAULT);
$user_id = create('users', $_POST);
$user = selectOne('users', ['id'=>$user_id]);
$_SESSION['id'] = $user_i... | true |
d7b0aa20bafc9c3caf1f94c897081745477b3af0 | PHP | wvoelcker/project-example-app | /datasets/TaskDataset.php | UTF-8 | 746 | 2.59375 | 3 | [] | no_license | <?php
namespace ProjectExampleApp\Datasets;
use WillV\Project\Dataset;
class TaskDataset extends Dataset {
protected function setUp() {
$this->fields = array(
"id" => array(
"customValidation" => array($this, "is_integer_or_string_containing_integer"),
),
"title" => array(
"required" => true,
"... | true |
d140819e6ecb69f903412d75d0fa4f0e95dfeae3 | PHP | amaleena123/php-codility | /src/Lesson 06 - Sorting/Triangle.php | UTF-8 | 2,554 | 3.3125 | 3 | [
"MIT"
] | permissive | <?php
/*
A zero-indexed array A consisting of N integers is given.
A triplet (P, Q, R) is triangular if 0 ≤ P < Q < R < N and:
A[P] + A[Q] > A[R],
A[Q] + A[R] > A[P],
A[R] + A[P] > A[Q].
For example, consider array A such that:
A[0] = 10 A[1] = 2 A[2] = 5
A[3] = 1 A[4] = 8 A... | true |
dab05ccfc156eb62090b77575cf6bf693b6bd178 | PHP | elberos/wp-elberos-slider | /slider.php | UTF-8 | 6,957 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | <?php
/*!
* Elberos Slider Plugin
*
* (c) Copyright 2019-2020 "Ildar Bikmamatov" <support@elberos.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apac... | true |
bb9e91c10ebac5e8b2cdc04e37bafb83167c480d | PHP | buithithao99/quanlynhahang | /vms/EditProfileFormPage.php | UTF-8 | 5,245 | 2.5625 | 3 | [] | no_license | <?php
namespace vms;
use vms\templates\AdminTemplate;
use api\v1\UserAPI;
use models\UserModel;
class EditProfileFormPage
{
public $rows;
public $city;
public $orders;
public function __construct($params = null)
{
session_start();
$this->title = "Sửa thông tin";
$this->row... | true |
0dc01b707e2c840bcf8c16f78bde28d9f5800e0b | PHP | Twipsi/framework | /src/Twipsi/Support/Applicables/Request.php | UTF-8 | 677 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* This file is part of the Twipsi package.
*
* (c) Petrik Gábor <twipsi@twipsi.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Twipsi\Support\Applicables;
use Twipsi\Components\Http\Http... | true |
2617b68901cd7836992375f85bb1ca0803c1698a | PHP | Starfish-Internet-Solutions-imat/eldercare | /Project/Code/System/Calendar/calendarEvents.php | UTF-8 | 5,594 | 2.75 | 3 | [] | no_license | <?php
require_once FILE_ACCESS_CORE_CODE.'/Objects/Database/starfishDatabase.php';
require_once 'Project/Code/System/Active_Record/dbQuery.php';
require_once 'calendarEvent.php';
class calendarEvents extends dbQuery
{
private $array_of_calendar_events;
private $select_statement;
//-----------------------------... | true |
b57a2fa87810ac35883c467ca573da984205477a | PHP | adriannh48/goat-me-backend | /app/Http/Resources/Response.php | UTF-8 | 3,249 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
use Exception;
use App\Exceptions\ApiException;
class Response extends JsonResource
{
protected $model;
protected $statusHttp;
public function __construct($model, $statusHttp = 200)
{
parent::__construct($... | true |
89d6c1713e325c3d3e5179ef3a767cbaab703c65 | PHP | rcuevasg/ControlVehicularRTV | /admin/vehiculos.php | UTF-8 | 11,574 | 2.609375 | 3 | [] | no_license | <?php session_start(); ?>
<?php
include "utilitiesVehiculos.php";
$opt = $_GET['opt'];
switch ($opt) {
case 1:
//Opcion para agregar un Vehiculo
?>
<script type="text/javascript">
$(function(){
$('#frmAgregaVehiculo').form({
url:'accionesVehiculos.php',
onSubmit:function(){
... | true |
345ee55ccf9a9efe61eab1b6498d4ad3ce2e41e2 | PHP | ikscher/g0551 | /cyadmin/model/setting/enviorment.php | UTF-8 | 2,171 | 2.65625 | 3 | [] | no_license | <?php
//更新环境变量setting表的配置
class ModelSettingEnviorment extends Model {
public function addEnviorment($data){
$group=$this->db->escape($data['group']);
$key =$this->db->escape($data['key']);
$value=$this->db->escape($data['val']);
$serial=$this->db->escape($data['serial']);
if($serial==1) $value=ser... | true |
2e2137b3da15ae884471abbf84a12ec1da9a7452 | PHP | newga/newga | /public_html/protected/views/campaign/_textOptions.php | UTF-8 | 1,514 | 2.546875 | 3 | [] | no_license | <span>
<?php
switch($Question->option_id)
{
// Venue
case QueryQuestion::OPTION_VENUE:
$Venue = Venue::model()->findByPk($query_option);
print $Venue->title;
break;
// Organisation
case QueryQuestion::OPTION_ORGANISATION:
$Organis... | true |
7468bb4982976e5ad0df97d7f9dcb0c76f0d8334 | PHP | hamroy/berlatih-php | /tentukan-deret-aritmatika.php | UTF-8 | 677 | 3.46875 | 3 | [] | no_license | <?php
function tentukan_deret_aritmatika($arr) {
// kode di sini
$count=count($arr);
$cekBeda = $arr[0];
$hasil = 'true';
for ($i=0; $i < $count ; $i++) {
if (isset($arr[$i+1])) {
$b = ($arr[$i+1]-$arr[$i]);
if ($b != $cekBeda) {
$hasil = 'false';
}
$cekBeda = $b;
}
}
return $hasil;
}
//... | true |
bfa0af4e180141946d5a468b8fa64d0ea92e469d | PHP | imflippy/medium | /models/users/exportExcel.php | UTF-8 | 1,400 | 2.53125 | 3 | [] | no_license | <?php
require "../../config/connection.php";
require "functions.php";
$getUsers = getAllUsers();
$excel = new COM("Excel.Application");
$excel->Visible = 1;
$excel->DisplayAlerts = 1;
$workbook = $excel->Workbooks->Add();
$sheet = $workbook->Worksheets('Sheet1');
$sheet->activate;
$br = 1;
foreach ($getUsers a... | true |
d399c20a66fbc815470c5efaa247ee867a7a50fb | PHP | LorenzoS92/pokemon-backend | /app/Repository/PokemonRepository.php | UTF-8 | 2,016 | 2.984375 | 3 | [] | no_license | <?php
namespace App\Repository;
use App\Exceptions\PokemonApiException;
use App\Exceptions\ShakespearApiException;
use App\Http\Resources\PokemonResource;
use App\Services\PokemonApiRetrieverService;
use App\Services\ShakespeareanApiDescriptionService;
use Illuminate\Support\Facades\Cache;
// PokemonRepository retrie... | true |
d5b3215be459c085fcff5b82f5c5fc2e6e15eb42 | PHP | kociap/php | /admin_dashboard/admin_dashboard_items.php | UTF-8 | 801 | 2.59375 | 3 | [] | no_license | <?php
include "../database/database_config.php";
include "../database/database_manager.php";
$method = ''; // Get method type from request
$db = new DatabaseManager();
$db->connect($database_connection_config["HOST"], $database_connection_config["USERNAME"], $database_connection_config["PASSWORD"... | true |
0b69c1d8b0834e865d54917add07b26176337317 | PHP | nobody1986/tinymvc | /app/model/tag.php | UTF-8 | 1,973 | 2.59375 | 3 | [] | no_license | <?php
/**
* Description of blog
*
* @author hp1
*/
class Tag_Model extends Model{
private function getSource(){
if($this->_source == null){
Core::import('lib.database');
$this->_source = Database::singleton('tag');
}
return $this->_source;
}
function ... | true |
355f9db3516a8b0544a0f0a203973eed9b88545b | PHP | tundedotnet/recdemo | /rate.php | UTF-8 | 2,222 | 2.609375 | 3 | [] | no_license | <?php
@session_start();
include 'class/connectDB.php';
extract($_POST);
$movieid = $ref;
$userid = $_SESSION['userid'];
/*print($userid);
echo "<br>";*/
$date = new DateTime();
$timestamp = $date->getTimestamp();
// echo $timestamp; exit();
if (isset($_SESSION['accesstag']) AND $_SESSION['accesstag'] ==... | true |
a3d616d2b4b49e3a9dae40866b8ac49c430b638f | PHP | Ashwood3708/Casis | /ex4.php | UTF-8 | 4,217 | 2.71875 | 3 | [] | no_license |
<?php
//echo $_POST["txt"];
$ser = "localhost";
$user = "root";
$pass = "A255175a!";
$db = "casis_study";
$con = mysqli_connect($ser,$user, $pass, $db) or die("connection Failed");
$myArray = explode(',', $_GET['id']);
$JsArray = $myArray;
//print_r( array_values( $myArray )); //this is used to see all ... | true |
391e3567adc391842666996e9f634131bf83f3c2 | PHP | yangboz/finna-be-octo-ninja | /tests/HomeHandlerTest.php | UTF-8 | 468 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
//
class HomeHandlerTest extends PHPUnit_Framework_TestCase
{
// ...
public function testGet()
{
$db = Database::Instance();
$pdo = $db::$pdo;
//
$pdo -> beginTransaction();
$sth = $pdo -> prepare('SELECT * FROM articles');
$sth -> execute();
$articles = $sth -> fetchAll(PDO::F... | true |
54ea7032c0c1a6da3dee8536adeed11f04eadf58 | PHP | freezer278/laravel_admin_panel | /src/app/Utils/EntitiesExtractor.php | UTF-8 | 3,864 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace Vmorozov\LaravelAdminGenerator\App\Utils;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Pagination\Paginator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ModelNotFoundException;
/**
* Cla... | true |
d11942b02f7cd2c45f2f4913d8df270a4277afc1 | PHP | concretecms/concretecms | /concrete/src/SiteInformation/Question/RoleQuestion.php | UTF-8 | 721 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace Concrete\Core\SiteInformation\Question;
class RoleQuestion extends AbstractSelectQuestion
{
const CONTENT_CREATOR = 'CC';
const DESIGNER = 'DE';
const PRODUCT_OWNER = 'M';
const DEVELOPER = 'DV';
public static function getKey(): string
{
return 'role';
}
publi... | true |
c865b43a8dd84bd975c1f1c515fd70f668e7383f | PHP | MindyPHP/Payment | /FormBuilder.php | UTF-8 | 1,258 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* Studio 107 (c) 2018 Maxim Falaleev
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mindy\Payment;
class FormBuilder
{
public static function build($url, array $data)
{
... | true |
232b52cc3f7082e5e1324403f225467bc45d2c6d | PHP | brosbunbo/shorten-url | /app/Fillers/ShortenUrlFiller.php | UTF-8 | 424 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Fillers;
use Illuminate\Support\{
Arr,
Str
};
class ShortenUrlFiller {
public static function forCreate(array $data): array {
$attrs = Arr::only($data, ['url', 'expired_at']);
/**
* Simple logic for generating code
* More complex unique validation co... | true |
d474538dfa8b757e5ae3626c9a254d7b29d8feeb | PHP | carousel/l4blog | /app/controllers/PasswordResetsController.php | UTF-8 | 1,168 | 2.609375 | 3 | [] | no_license | <?php
//basic password recovery controller
class PasswordResetsController extends BaseController {
//show html form for email
public function create()
{
return View::make('passwordresets.create');
}
//send confirmation token on users address
public function store()
{
Password::remind(["... | true |
f367c77b75edd3e158743f430f6e73e73a2718c0 | PHP | FNVI/mongo | /tests/SchemaTest.php | UTF-8 | 3,209 | 2.71875 | 3 | [] | no_license | <?php
use PHPUnit\Framework\TestCase;
use FNVi\Mongo\Database;
use FNVi\Mongo\Collection;
use FNVi\Mongo\Schema;
use FNVi\Mongo\BSON;
/**
* Description of SchemaTest
*
* @author Joe Wheatley <joew@fnvi.co.uk>
*/
class SchemaTest extends TestCase{
/**
* An FNVi Schema class
* @var Schema
*/
... | true |
55f38c66f7257895cf8d43c3f44bfda0f087ed50 | PHP | oh001738/Health | /gbook/ckimg.php | UTF-8 | 2,377 | 2.609375 | 3 | [] | no_license | <?php
//這隻php用途:調用GD產生圖片數字認証碼
//避免有些空間,系統session無作用,自建session檔案
$zusernum02 = './zdata/usernums.php'; //存放session索引檔路徑
$zuserdir02 = './zdata/b/'; //存放session資料目錄路徑
ob_start(); //啟用緩衝輸出,避免有的免空,開頭強制廣告,造成不明錯誤
session_start();
include_once('./myclass.php');
$zckimg = new zmyclass;
$userid03 = session_id();
... | true |
616e3608ead294456645ac74fe7e48baae6c4794 | PHP | pellebjerkestrand/airdog | /code/php/src/main/php/no/airdog/controller/parser/OyesykdomParser.php | UTF-8 | 4,303 | 2.609375 | 3 | [] | no_license | <?php
require_once "no/airdog/controller/Verktoy.php";
class OyesykdomParser
{
public function OyesykdomParser()
{
}
public function getArray($enOyesykdom)
{
$oyesykdomArray = split('[|]', trim($enOyesykdom));
if (sizeof($oyesykdomArray) == 27)
{
return array (
"oyId" => $oyesyk... | true |
48361bbb0b47b4654139c01f98ba3da13258c853 | PHP | ChiaHaoSun/line-bot | /app/Libraries/LINE.php | UTF-8 | 382 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Libraries;
use LINE\LINEBot\HTTPClient\CurlHTTPClient;
use LINE\LINEBot;
class LINE
{
public $httpClient, $bot;
public function __construct($channelAccessToken, $channelSecret)
{
$this->httpClient = new CurlHTTPClient($channelAccessToken);
$this->bot = new LINEBot($th... | true |
fa50f2c9e7acf66018471e9fb431a8303f1a569d | PHP | arifsavutage/belajarci3 | /application/models/admin/berita_model.php | UTF-8 | 1,106 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
class berita_model extends CI_Model{
public function __construct(){
$this->load->database();
}
#menampilkan data berita
public function daftar_berita(){
$query = $this->db->query('SELECT berita.judul, berita.status_berita,
berita.slug, berita.id_berita, berita.tanggal,
users.nama
FROM
berit... | true |
c891d71e97f8d54eeba6ba4eabe08bae55edc02e | PHP | gaderrick/p4 | /app/RosterType.php | UTF-8 | 425 | 2.546875 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class RosterType extends Model
{
public static function getForDropdown()
{
$rosterTypes = self::orderBy('id')->get();
$rosterTypesForDropdown = [];
foreach ($rosterTypes as $rosterType) {
$rosterTypesForDropdown... | true |
447ec5a33513a75e690f868c30413b7327f96065 | PHP | pritam-git/VSOH | /library/L8M/Mobile/Detector/PhpMobileDetect.php | UTF-8 | 3,153 | 2.75 | 3 | [] | no_license | <?php
/**
* L8M
*
*
* @filesource /library/L8M/Mobile/Detector/Phpmobiledetect.php
* @author Norbert Marks <nm@l8m.com>
* @version $Id: PhpMobileDetect.php 7 2014-03-11 16:18:40Z nm $
*/
/**
*
*
* L8M_Mobile_Detector_Phpmobiledetect
*
*
*/
class L8M_Mobile_Detector_Easy extends L8M_Mobile_Detector... | true |
ecef9302c878c57657f270a7b3bc3d0f01a30503 | PHP | H6yV7Um/dpa | /dpa/DataDriver/db/DAO.cls.php | UTF-8 | 4,916 | 3.03125 | 3 | [
"MIT"
] | permissive | <?php
/**
* DAO.cls.php
* @abstract 操作MySQL数据库,希望扩展出两个子类,分别是读写mysql的
*
* @author chengfeng<biosocial@gmail.com>
* @version 1.0
*/
class DAO{
// ----------------- public variable -------------- //
/**
* 结果常量 : 操作成功
* @access public
* @staticvar final
* @var integer
*/
//var $MYSQL_SUCCESS... | true |
b1a3572c539d6c38a0162573a3d4bd34149db46d | PHP | Mohamad-Ilham-Ramadhan/simple-ajax-CRUD | /api/objects/orders.php | UTF-8 | 2,998 | 3.546875 | 4 | [] | no_license | <?php
class Orders {
// contruct with $db as database connection
public function __construct($db) {
$this->conn = $db;
}
// Database connection and table name
private $conn;
private $table_name = 'orders';
// Object properties
public $id;
public $name;
public $drink;
// read orders
... | true |
e4caf768d35e9ca5adc7c117ca556fee46fccbea | PHP | Komche/laVoieDesSalaf | /model/database/livres.php | UTF-8 | 13,232 | 2.84375 | 3 | [] | no_license |
<?php
class livres {
public $id;
public $titre;
public $description;
public $date;
public $clivres_id;
public $auteur;
public $photo;
public $chemin;
public $livres=array();
public function __construct($livres=null) {
$this->livres = $livres;
... | true |
6877d88d06386553c7a8b1d0f96c53b930568389 | PHP | Shadowsun52/DubInfo_Gestion_immobilier | /data/DAOInvestisseur.php | UTF-8 | 10,801 | 2.828125 | 3 | [] | no_license | <?php
namespace DubInfo_gestion_immobilier\data;
use DubInfo_gestion_immobilier\model\Investisseur;
use DubInfo_gestion_immobilier\model\Adresse;
use DubInfo_gestion_immobilier\model\Ville;
use DubInfo_gestion_immobilier\model\Etat;
use DubInfo_gestion_immobilier\Exception\PDOException;
/**
* Classe permetta... | true |
995a639a9a402003310b45bc0f4a26f144b6110a | PHP | ferdiann/sim-bmw-1 | /unitclbangun_process.php | UTF-8 | 2,925 | 2.671875 | 3 | [] | no_license | <?
// file proses_data.php merupakan halaman untuk menangani request Ajax baik untuk proses tambah, ubah, maupun hapus
// respon balikan dari masing-masing proses tersebut adalah dalam format JSON.
include_once("config.php");
$action=$_POST['action'];
$idunitclbangun=$_POST['idunitclbangun'];
$cls... | true |
cc8035500799cb8bd32dcf21ecf2599e53c51304 | PHP | cheikhrim8/pfe | /database/seeds/VideosTableSeeder.php | UTF-8 | 1,060 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
use App\Video;
use Illuminate\Database\Seeder;
class VideosTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$title1 = 'Introduction';
$title2 = 'Get start';
$title3 = 'Install software';
$title4... | true |
61dc26d60ea5fb9d3ce2b68f47565bf1ac1ad8a9 | PHP | cloudwp/phpClickHouse | /src/Transport/CurlerRolling.php | UTF-8 | 8,817 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
namespace Curler;
class CurlerRolling
{
/**
* @var int
*
* Max number of simultaneous requests.
*/
private $simultaneousLimit = 5;
/**
* @var Request[]
*
* Requests currently being processed by curl
*/
private $activeRequests = array();
private $running... | true |
36963937a3cf0894f5ae536905834a82aa73636c | PHP | Terror404/NDLI2015 | /controller/ajout-question.php | UTF-8 | 279 | 2.546875 | 3 | [] | no_license | <?php
require '../class/class_question.php';
if (isset($_POST) && !empty($_POST)) {
$question = New Question();
$question->setContent($_POST['content']);
$question->setIdCategory($_POST["idCategory"]);
$question->create();
var_dump($question);exit;
}
?> | true |
9b99a4fc13892168bd3854968e58dadf2676836c | PHP | alek82/arrays_loops_tasks | /5.php | UTF-8 | 683 | 3.484375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Alek
* Date: 14.03.16
* Time: 09:28
*/
echo "Дан массив $ arr с ключами 'Коля', 'Вася', 'Петя' с элементами '200', '300', '400'. <br>";
echo "С помощью цикла foreach выведите на экран столбец строк такого формата: 'Коля — зарплата <br>";
echo "200 долларов.'. <b... | true |
8e274cbd1e01696b784adf45bd6865eed00a2289 | PHP | Ninbous/test-assigment | /components/platforms/Gitlab.php | UTF-8 | 1,817 | 2.8125 | 3 | [] | no_license | <?php
namespace app\components\platforms;
use Gitlab\Client;
use yii\base;
use app\components\platforms\api;
use app\interfaces;
use app\models;
/**
* Gitlab implementation of interfaces\IPlatform
*
* @see https://github.com/m4tthumphrey/php-gitlab-api/
*/
class Gitlab extends base\Component implements interfa... | true |
1161e48a1e75892910c1504cd358ccf7381e7349 | PHP | stockutils/swf2vid | /minute/Video/AutomaticUpload.php | UTF-8 | 1,201 | 2.5625 | 3 | [] | no_license | <?php
/**
* User: Sanchit <dev@minutephp.com>
* Date: 1/18/2017
* Time: 12:19 PM
*/
namespace Minute\Video {
use Minute\Event\Dispatcher;
use Minute\Event\Swf2VidEvent;
use Minute\Event\UploaderEvent;
class AutomaticUpload {
/**
* @var Dispatcher
*/
... | true |
bf2c7def6b9c2605b09f0cd7bf7f923eab7d06aa | PHP | Lyletimotheus/Cat-App-API | /index.php | UTF-8 | 1,712 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
$str = file_get_contents('https://cat-fact.herokuapp.com/facts');
$json = json_decode($str,true);
$text = $json;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cat Facts</title>
<link rel="stylesheet" ... | true |
3cc8b415ad26548b46e219b9ed962542a67a8f42 | PHP | PiaZaniboni/Palapenia | /pl-admin/views/product/AddView.php | UTF-8 | 4,805 | 2.546875 | 3 | [] | no_license |
<?php
require("views/View.php");
class AddView extends View {
/**
* Renderize the view.
*
* @return null
*/
public function render(Array $categories = null, Array $colors = null){
?>
<p>
<?php echo REQUIRED_FIELDS_TEXT ?>
</p>
<form action="<?php echo $this->generateU... | true |
a8a70df1f199f16aaff88736dcc48aa6d5852535 | PHP | GhiaC/uploader | /1.php | UTF-8 | 1,685 | 2.71875 | 3 | [] | no_license | <?php
/*
sleep(4);
file_put_contents('.htaccess','
php_value post_max_size 2000M
php_value upload_max_filesize 2500M
php_value max_execution_time 6000000
php_value max_input_time 6000000
php_value memory_limit 2500M
');
*/
$exArr=array('mp3','jpg','jpeg','png','mp4',"html");
$typeArr=array('audio/mp3','image/jpeg','im... | true |
5cbd0915fb9dd866d39629e7dfa2c2f89bf0bdf7 | PHP | EuAndreza/AgendaEscolar | /classes/Usuario.php | UTF-8 | 1,871 | 2.6875 | 3 | [] | no_license | <?php
require_once 'Conexao.php';
class UsuarioProf{
public $idProf;
public $nomeProf;
public $loginProf;
public $senhaProf;
public function carregarProf($loginProf){
$queryProf = "select * from professor where login_prof = '$this->login'";
$conexaoProf = Conexao::criar();
$usuarioProf = $conexaoProf->query($... | true |
5716cfb60e395bf332e0de82d4f0b61044233838 | PHP | gydraizkaz/practica | /calc.php | UTF-8 | 1,237 | 3.078125 | 3 | [] | no_license | <?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
$num1 = abs((int) $_POST['num1']);
$num2 = abs((int) $_POST['num2']);
$operator = trim(strip_tags($_POST['operator']));
}
switch($operator){
case "+":
$res=$num1+$num2;
break;
case "-":
$res=$num1-$num2;
break;
case "*":
$res=$num1*$num2;
bre... | true |
ee28a3c318f8cf549ec594e73e91912995b8d593 | PHP | messikiller/blog5.5 | /app/Http/Middleware/CheckLoginStatus.php | UTF-8 | 497 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Middleware;
use Closure;
class CheckLoginStatus
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$status = sessio... | true |
9c5078ae06550505ba54bdc160b306698e780346 | PHP | otbr/OTWorlds | /app/libraries/POT/OTS_Buffer.php | UTF-8 | 10,340 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/**
* @package POT
* @version 0.2.0+SVN
* @since 0.1.2
* @author Wrzasq <wrzasq@gmail.com>
* @copyright 2007 - 2009 (C) by Wrzasq
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU Lesser General Public License, Version 3
*/
/**
* Binary buffer container.
*
* <p>
* This is generic class for cla... | true |
5243a4d05f84f3816ee12a1fae1588d2ee1c4482 | PHP | Crown-Commercial-Service/CCS-Website-Strata-Frontend | /src/Content/BaseContent.php | UTF-8 | 7,890 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Strata\Frontend\Content;
use Strata\Frontend\Content\Field\ContentFieldCollection;
use Strata\Frontend\Content\Field\ContentFieldInterface;
use Strata\Frontend\Content\Field\DateTime;
use Strata\Frontend\Content\Field\Image;
use Strata\Frontend\ContentModel\ContentType;
clas... | true |
8fab075d845011327aee3e7f4d7cd91f7ab21657 | PHP | SplitVICE/Online-Notes | /app/database/delete.php | UTF-8 | 10,692 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
// CRUD -> Delete php file.
// Function that deletes a public note by the note's ID.
function delete_public_note($note_id)
{
require "../../memory.php";
$conn = new mysqli(
$_ENV['onlinenotes_database_server_name'],
$_ENV['onlinenotes_database_username'],
$_ENV['onlinenotes_datab... | true |
91b4642f9a2570975fda7d911abd5df3e6c83ac3 | PHP | hvt/psl | /src/Psl/Iter/filter_nulls.php | UTF-8 | 661 | 3.234375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace Psl\Iter;
use Generator;
use Psl\Vec;
/**
* Filter out null values from the given iterable.
*
* Example:
* Iter\filter_nulls([1, null, 5])
* => Iter(1, 5)
*
* @template T
*
* @param iterable<T|null> $iterable
*
* @return Iterator<int, T>
*
* @deprecate... | true |
fcc62056753c2c7c22e0fe743adb559e3678d72b | PHP | szepeviktor/wordpress-plugin-construction | /mu-totp-login/includes/OtpInterface.php | UTF-8 | 2,268 | 3.078125 | 3 | [
"GPL-2.0-only",
"GPL-2.0-or-later",
"MIT"
] | permissive | <?php
namespace Otp;
/**
* Interface for HOTP and TOTP
*
* HMAC-Based One-time Password(HOTP) algorithm specified in RFC 4226
* @link https://tools.ietf.org/html/rfc4226
*
* Time-based One-time Password (TOTP) algorithm specified in RFC 6238
* @link https://tools.ietf.org/html/rfc6238
*
* @author Christian R... | true |
f7b6c5a852aea8248bebefdf68aa501f49e321be | PHP | mobeendev/LaravelRestAPI | /app/Repositories/ProductRepository.php | UTF-8 | 527 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Repositories;
use App\Product;
use App\Interfaces\ProductRepositoryInterface;
class ProductRepository implements ProductRepositoryInterface {
public function all() {
return Product::all();
}
public function find($id) {
return Product::find($id);
}
public fun... | true |
dee28c8fc325f2f293eb171a825ce8c017d096c8 | PHP | Shoplo/sso-auth | /src/SSOAuth/Exception/ExceptionManager.php | UTF-8 | 595 | 2.6875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: adrianadamiec
* Date: 12.05.2017
* Time: 15:19
*/
namespace SSOAuth\Exception;
class ExceptionManager
{
public static function throwException(\Exception $e)
{
switch ($e->getCode()) {
case 400:
throw new ValidationException($e);... | true |
49413b99ace77f64009985614a06babe650fb0c6 | PHP | 1269085759/up6-discuz | /db/dz_attachment_db.php | UTF-8 | 2,458 | 2.75 | 3 | [] | no_license | <?php
/*
将附件信息添加到Discuz!X2数据表中
1.pre_forum_attachment
2.pre_forum_attachment_unused
更新记录:
2012-4-6
*/
/*
返回值:
新添加的附件ID。
*/
function InsertToAttachmentDB($uid)
{
$inf = array("aid"=>0
,"tid"=>0
,"pid"=>0
,"tableid"=>127);
$sql = "insert into pre_forum_attachment(";
$sql = $sql . " tid";
... | true |
183ec18cae0cb91cab6e5c9f593f94a036e55ea1 | PHP | QuentinJouet/Lynx1.1 | /Lynx1.1/classes/chiffre_affaires.php | UTF-8 | 6,058 | 2.640625 | 3 | [] | no_license | <?php
require_once(CLASS_PATH.DS.'database.php');
class ChiffreAffaires extends DatabaseObject {
public static $table_name="chiffre_affaires";
static public $database = 'db_cakeshop';
public static $champs_db=array('id', 'id_produit', 'point_de_vente','date','quantite', 'ca');
public $id;
public $id_produit;
... | true |
645e038f02c007af8cd9a2ec93fc1278db6f4cd0 | PHP | carlosviniciusm/Crud-study-debt | /src/controller/debtController.php | UTF-8 | 2,828 | 2.703125 | 3 | [] | no_license | <?php
namespace src\controller;
use Exception;
use framework\exceptions\InvalidAttributeException;
use src\dao\DebtDAO;
use src\dao\DebtorDAO;
use src\model\debt\Debt;
/**
* Class debtController
* @package src\controller
*/
class debtController
{
/** @var array */
private $aDados;
/**
* debtContr... | true |