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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1d9b4a90e22b20178d3e1ca417e56c54be0a8884 | PHP | mohsenkiani1371/artica-core | /src/Controllers/CrudController.php | UTF-8 | 3,649 | 2.875 | 3 | [] | no_license | <?php
namespace Artica\Controllers;
use Artica\ApiViews\CrudApiView;
use Artica\Entities\Entity;
use Artica\Exceptions\Entity\EntityNotFoundException;
use Artica\Exceptions\Entity\EntityValidationException;
use Artica\Exceptions\Model\ValidationException;
use Artica\Forms\CrudForm;
use Yii;
use yii\web\BadRequestHttp... | true |
dc7119c8ec65736b345a629ebb0e91dd9a563a46 | PHP | xp-framework/xp-framework | /core/src/test/php/net/xp_framework/unittest/soap/SoapTest.class.php | UTF-8 | 4,139 | 2.78125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php namespace net\xp_framework\unittest\soap;
use unittest\TestCase;
use webservices\soap\xp\XPSoapMessage;
/**
* Test SOAP api
*
* @purpose Unit Test
*/
class SoapTest extends TestCase {
/**
* Assertion helper
*
* @param string messageSource
* @param string fragment
* @param string m... | true |
3f6b063b4f45ab70381e89378ce5a2bd6cd0678f | PHP | kepchuk08/web-bhop-stats | /application/models/Main.php | UTF-8 | 3,143 | 2.53125 | 3 | [] | no_license | <?php
/**
* @author kepchuk <support@game-lab.su>
* @link https://steamcommunity.com/id/kepchuk/
*/
namespace application\models;
use application\core\Model;
use application\lib\SteamAPI;
class Main extends Model
{
public function getUsers($route)
{
$max = 10;
$params = [
'max' => $max,
'start' => ... | true |
a0a96d06ed0234aa14b3cac6393c8d2b01b44d5e | PHP | gclavell-neit/PHPClassSpring2017 | /week2/lab/part-2/add-address.php | UTF-8 | 2,662 | 2.609375 | 3 | [] | no_license | <!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.b... | true |
f8d86bcb15b1679654f64997699b092f65e8a811 | PHP | LxiaoGirl/jxq | /application/core/MY_Input.php | UTF-8 | 3,580 | 2.765625 | 3 | [] | no_license | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* 自定义输入类
*
* 主要功能是过滤用户输入的前后空格,全半角转换,修复获取Cookie没前缀的问题
*
* @author Longjianghu Email:215241062@qq.com
* @copyright Copyright © 2013 - 2018 www.sohocn.net All rights reserved.
* @created 2013-11-11
* @updated 2013-11-11... | true |
b9ddd2a26cc74cd95c0594988b7eebf3b31b1365 | PHP | olekukonko/CommonIterators | /src/html/MenuIterator.class.php | UTF-8 | 4,928 | 3.171875 | 3 | [] | no_license | <?php
if (!class_exists("RecursiveArrayIterator"))
{
class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
{
/** @return whether the current element has children
*/
function hasChildren()
{
return is_array($this->current());
... | true |
ca3244fe8d7beb2ed0a791eec69c1f77cba39f98 | PHP | vi-kon/laravel-wiki | /src/ViKon/Wiki/Model/PageContent.php | UTF-8 | 2,071 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace ViKon\Wiki\Model;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use ViKon\Auth\Model\User;
/**
* \ViKon\Wiki\Model\PageContent
*
* @property integer $id
* @property string $title
* @property strin... | true |
90af986b48c11098756e10f35efcc7624f0a0177 | PHP | proconpbti/naopertube | /model/mysql.php | UTF-8 | 636 | 2.640625 | 3 | [] | no_license | <?php
DEFINE ('DB_USER', 'root');
DEFINE ('DB_PASSWORD', 'fabioadmin');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'nao_pertube');
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$dbc){
echo '<script>alert("Falha na conexao com o bando de dados!")</script>';
}else{
$select = mysqli_select... | true |
3a28997af9984916e3c7ca2e4a1a211e23c0d416 | PHP | quyquoc/rmt-studio.com | /apps/backend/models/Permission_resource_config.php | UTF-8 | 758 | 2.59375 | 3 | [] | no_license | <?php
namespace Modules\Backend\Models;
use Phalcon\Mvc\Model;
class Permission_resource_config extends Model {
/**
*
* @var integer
*/
public $id;
/**
*
* @var string
*/
public $resource_id;
/**
*
* @var string
*/
public $config_id;
public function columnMap()
{
return array(
... | true |
42dad4119633cb3d0f2217e79f78514fa1fa40d9 | PHP | adrianmihaipaun/Lockers | /src/Entity/LockersSchedule.php | UTF-8 | 1,575 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Entity;
use App\Repository\LockersScheduleRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LockersScheduleRepository::class)
*/
class LockersSchedule
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
... | true |
e4400758f340b12341be4a45949577e0715e7212 | PHP | cityuderek/laravel-fa | /src/Fa/Helpers/StrHelper.php | UTF-8 | 5,895 | 2.84375 | 3 | [] | no_license | <?php
namespace Fa\Helpers;
/*
use Fa\Helpers\StrHelper;
*/
class StrHelper {
public static function test() {
$arr = array();
$str = "aabbccddeeff";
$str2 = "aabbccddeeffaabbccddeeffaabbccddeeff";
$arr['str'] = $str;
$arr['getLeftByKey_def_f'] = StrHelper::getLeftByKey($str, "b");
$arr['getLeftByKey_def... | true |
bd4c6dd083e2b5402a43c5845c9bc76a804a4535 | PHP | Stolz/php-stubs | /res/php/zlib/functions/gzpassthru.php | UTF-8 | 267 | 2.6875 | 3 | [
"Apache-2.0",
"CC-BY-3.0"
] | permissive | <?php
/**
* Output all remaining data on a gz-file pointer
*
* @phpstub
*
* @param resource $zp
*
* @return int The number of uncompressed characters read from
* and passed through to the input, or false on error.
*/
function gzpassthru($zp)
{
} | true |
3a2d06badd772dc2cccada0cd0e6a192996ba4e5 | PHP | nicekak1/login | /resetpass.php | UTF-8 | 849 | 2.5625 | 3 | [] | no_license | <?php
if(isset($_GET['code'])) {
$acode = $_GET['code'];}
echo $acode;
if(isset($_POST['pass'])){
$pass = $_POST['pass'];
$con=mysqli_connect("localhost", "root", "", "loginadminuser");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
... | true |
61aacb44cf722928f8552185604f7c420b9601f0 | PHP | brugnara/storycrossing-old | /application/apis/Local.php | UTF-8 | 772 | 2.671875 | 3 | [] | no_license | <?php
class Engine_Api_Local {
public static function isValid($local) {
if (empty($local)) {
return false;
}
$tLocal = new Application_Model_DbTable_Languages();
return count($tLocal->fetchAll($tLocal->select()->where("language_name = ?",$local)));
}
... | true |
d1466ff8392f2fca77f1bf36f83119d8eb8a10d6 | PHP | jjmmgarden/plants-api | /app/Eloquent/Eloquent.php | UTF-8 | 547 | 2.65625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: sueysok
* Date: 15/11/3
* Time: 上午11:11
*/
namespace App\Eloquent;
use App\Contracts\Model;
use Illuminate\Database\Eloquent\Model as BaseEloquent;
/**
* Class Eloquent
*
* @package App\Eloquent
* @author sueysok
*/
abstract class Eloquent extends BaseEloquent imp... | true |
488e4f4bcfa8a7b6e0384cab876e925a7bf139bf | PHP | vuong93st/w-game | /libraries/core/models/expo.php | UTF-8 | 669 | 2.578125 | 3 | [] | no_license | <?php
class Expoes extends PbModel {
var $name = "Expo";
var $info;
function Expoes()
{
parent::__construct();
}
function checkExist($id, $extra = false)
{
$id = intval($id);
$info = $this->dbstuff->GetRow("SELECT * FROM {$this->table_prefix}expoes WHERE id={$id}");
if (empty($info) or !$i... | true |
6b07d2aac6ba84920aab9d38547bacd6cac95e6a | PHP | azurecorn/animal_farm | /execute.php | UTF-8 | 1,992 | 2.984375 | 3 | [] | no_license | <?php
/**
*@author Milan Nikolic linkedin.com/in/milan1nikolic
*/
use AnimalChoir\AnimalGroup;
use AnimalChoir\Animal;
use AnimalChoir\Choir;
use AnimalChoir\ChoirSimulator;
//autoload
function autoloadClasses($className) {
$file = str_replace('\\',DIRECTORY_SEPARATOR,$className);
include "{$file}.php";
}
s... | true |
e7cd1447c56d40aa8e6b6fa11c22e83917d997de | PHP | philwebkronus/PeGS-3.0-NEW | /Kronus/Cashier.mz/app/frontend/models/BankTransactionLogsModel.php | UTF-8 | 1,183 | 2.640625 | 3 | [] | no_license | <?php
/**
* Description of BankTransactionLogsModel
*
* @author jdlachica
*/
class BankTransactionLogsModel extends MI_Model {
public function insertBankTransaction($trlID, $traceNumber, $referenceNumber, $paymentType){
try {
$this->beginTransaction();
$stmt... | true |
8ccb6a5a0b0811f5bffb0abc23fa5de581360464 | PHP | MiroslavMarjanovic91/phpOsnove | /phpKompleksniTipoviPodataka/index.php | UTF-8 | 621 | 3.390625 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>ArryListe</title>
</head>
<body>
<?php
//array
//object
//resource
$numbers = [1,2,3,4,5];
$numbers2 = Array(6,7,8,9,10);
$mix = ["Mikica",29,true,null,[100,200,300]];
$lotoBroje... | true |
5ac8a53fe63e8ad4e2dd8c2c735b07c032b7c660 | PHP | carpoint-nrw/carpoint | /src/AdminBundle/Services/ExportPdf/ExportPdfInterface.php | UTF-8 | 395 | 2.515625 | 3 | [] | no_license | <?php
namespace AdminBundle\Services\ExportPdf;
use AdminBundle\Entity\Car;
use Doctrine\ORM\EntityManagerInterface;
/**
* Interface ExportPdfInterface
*
* @package AdminBundle\Services\ExportPdf
*/
interface ExportPdfInterface
{
/**
* @param Car $car
* @param array $params
*
* @return... | true |
d6a3349cd703b1e72fbf4ed067f34cc0522c9fad | PHP | TyperEJ/Crawler | /app/Models/Crawlers/PttCrawler.php | UTF-8 | 2,110 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models\Crawlers;
use Goutte\Client;
use Symfony\Component\DomCrawler\Crawler;
class PttCrawler
{
const INDEX_SPLIT = 'INDEX_SPLIT';
protected $client;
protected $articles = [];
protected $page;
public function __construct(Client $client)
{
$this->client = $client... | true |
90a1845991ac274677721a006cf305dc1b1ad870 | PHP | Martincic/iste341-event-manager | /app/view/pages/home.php | UTF-8 | 838 | 2.8125 | 3 | [] | no_license | <!--
// neki home nakon logina?
- welcome, {user} message
- simple navigacija na ostale stranice
-->
<form>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>HOMEPAGE</h1>
<?php
//TODO: implement the code to render this page conte... | true |
6acd1e7ea5760ef1facd460dd708bb9ca701e373 | PHP | samhol/SPHP-framework | /sphp/php/Sphp/Foundation/Sites/Buttons/ButtonTrait.php | UTF-8 | 2,779 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* SPHPlayground Framework (https://playgound.samiholck.com/)
*
* @link https://github.com/samhol/SPHP-framework for the source repository
* @copyright Copyright (c) 2007-2018 Sami Holck <sami.holck@gmail.com>
* @license https://opensource.org/licenses/MIT The MIT License... | true |
537880fd068d34e2cd6e223bf05613c372f53201 | PHP | nkendrick101/codetube | /app/Http/Controllers/AccountController.php | UTF-8 | 4,473 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Hash;
use App\Models\Card;
use App\Models\Channel;
use Illuminate\Http\Request;
use Illuminate\Support\MessageBag;
use App\Http\Requests\AccountUpdateRequest;
use App\Http\Controllers\CostumerController;
class AccountController extends Controller
{
public function index (R... | true |
3e7281aa963e36db7f2779cd76c70d561d092c87 | PHP | chrisrocco/meta-research-engine | /lib/adj_list/NoParentException.php | UTF-8 | 454 | 2.59375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Chris Rocco
* Date: 7/11/2017
* Time: 2:26 PM
*/
namespace uab\mre\lib;
use Exception;
class NoParentException extends \Exception
{
public $node;
public $parent_id;
public function __construct($node, $parent_id)
{
$this->parent_id = $parent_id;
... | true |
b99be818cce06737a1656c20011fb51ed16e8a97 | PHP | xoxzo/xoxzo.cloudphp | /src/XoxzoClient.php | UTF-8 | 6,382 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace xoxzo\cloudphp;
require 'vendor/autoload.php';
use \GuzzleHttp\Client as HttpClient;
use \GuzzleHttp\Exception\TransferException as TransferException;
define("XOXZO_HTTP_EXCEPTION", 499);
class XoxzoResponse
{
public $errors;
public $messages;
function __construct($errors, $messages = a... | true |
da69906bf8e80d7067da2627984b805d62d37909 | PHP | slimanemd/myblog | /myblog03/utiles/Utile.php | UTF-8 | 698 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
//Utile
class Utile
{
//Test DB connection
public static function readProcessEntity(
$entityParams,
$fc_entityFactory,
$fc_preProcess,
$fc_onProcess)
{
global $db;
//invoke read on CategoryConnected Utile::getEntityConnected($entityFactory)->read(); //loop on resul... | true |
b6f88beacd0c3631ee4f32306143d1154e63a825 | PHP | Nakzz/Dairy-Diet-Formulation-Tool | /update/GoodQualityHay.php | UTF-8 | 481 | 2.828125 | 3 | [] | no_license | <?php
class GoodQualityHay extends FeedValIngredientType2 {
// The row and column numbers correspond to the average price of a large square in
// the price table.
const PRICE_TABLE_ROW_NUM = 3;
const PRICE_TABLE_COL_NUM = 2;
/**
* Gets the cell in the price table that contains the price for ... | true |
2292a68fe15eeefb2253e7fa88814f0cf796d536 | PHP | sergeyugai/backpack-fields-as-classes | /src/Fields/CustomHtmlField.php | UTF-8 | 1,110 | 2.9375 | 3 | [
"MIT"
] | permissive | <?php
namespace SergeYugai\Laravel\Backpack\FieldsAsClasses\Fields;
use SergeYugai\Laravel\Backpack\FieldsAsClasses\Common\Arrayable;
/**
* Class CustomHtmlField
* @package SergeYugai\Laravel\Backpack\FieldsAsClasses\Fields
* @link https://backpackforlaravel.com/docs/4.1/crud-fields#custom_html Documentation
* ... | true |
08e4d15dc2682c5989fe2aebeb318c7a2a1e8f0f | PHP | djw8605/condor | /nmi_tools/www/results-newNMI/NMI.php | UTF-8 | 1,601 | 2.984375 | 3 | [
"Apache-2.0",
"DOC",
"LicenseRef-scancode-unknown-license-reference",
"OpenSSL"
] | permissive | <?php
define("NMI_CONFIG_PATH", "/usr/local/nmi/etc/nmi.conf");
class NMI {
var $config; // Array containing configuration information from file
var $db;
// Constructor
function NMI() {
return $this->load_config();
}
// Destructor
function _NMI() {
// Close MySQL socket if it was opened
... | true |
daf5d679f614ed0084c61c84cb02bf71e1b3f8e9 | PHP | Assaduzzaman1503/project_aurgania | /mailcheck.php | UTF-8 | 483 | 2.703125 | 3 | [] | no_license | <?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$name = $_POST['name'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$msg = $_POST['message'];
}
$to_email = "rokan.faith@gmail.com";
$subject = "Email Test";
$message_body = $msg."\r\n\r\n-".$name."\r\nEmail: ".$email."\r\nPhone Number: ". $mobile... | true |
1495007c7088d4fff1e1fb0fada46e68f9425a78 | PHP | markomihajlovic3/nerodoc | /src/app/controllers/BaseController.php | UTF-8 | 3,258 | 3.015625 | 3 | [] | no_license | <?php
namespace Nero\App\Controllers;
use Nero\Core\Database\QB;
/*******************************************************
* Base controller implements validation logic for now
******************************************************/
class BaseController
{
/**
* Validate input data against specified rules,... | true |
ab3a34daec135b80e3a8a790c551e9ab6b08127f | PHP | alexrogeriodj/Projeto-de-Algoritmos-em-PHP | /upload/executa_upload_ftp.php | ISO-8859-1 | 2,149 | 2.765625 | 3 | [] | no_license | <html>
<head>
<title>Livro de PHP - Upload de arquivo por FTP</title>
</head>
<body>
<h2 align="center">Upload de Arquivos</h2>
<?php
// elimina o limite de tempo de execuo
set_time_limit (0);
// inclui o arquivo com as configuraes
include 'config_upload_ftp.inc';
$nome_arquivo = $_FILES['arquivo']['... | true |
60463df875a156dfec01d0bf573d9badd79609f5 | PHP | LoraMS/TechModule | /FunctionsAndFormsExercise/longer-line.php | UTF-8 | 1,020 | 3.6875 | 4 | [
"MIT"
] | permissive | <?php
$x1 = readline();
$y1 = readline();
$x2 = readline();
$y2 = readline();
$x3 = readline();
$y3 = readline();
$x4 = readline();
$y4 = readline();
$lenghtLine1 = calculateLineLenght($x1, $y1, $x2, $y2);
$lenghtLine2 = calculateLineLenght($x3, $y3, $x4, $y4);
if ($lenghtLine1 >= $lenghtLine2) {
$isClosest = ch... | true |
ba16521b49c41ff13894479e50cf7e8709162ae5 | PHP | IdeaLeaper/U-API | /Class/SYSTEM/Mysql.Class.php | UTF-8 | 6,251 | 3 | 3 | [] | no_license | <?php
//PDO MySQL Controller
//Author: Shokaku
//Version: 1.0
//Create Date: 2015-7-10 19:33:06
//Last Modify: 2015-7-11 22:43:34
//注意:只有当调用本操作类封装好的方法时才可以免过滤并不会造成注入,如直接调用execute方法执行拼接好的SQL语句请做好过滤
class Mysql{
private $pdo;
/*
公有方法,构析函数
接收参数:None
返回参数:None
作用:初始化pdo对象
*/
public function __construct(){
try... | true |
aa4105b2d184f25620ba261613b7ca901df95d4a | PHP | brianmacmillan/FPP | /scripts/php/users/login_orig.php | UTF-8 | 9,126 | 2.6875 | 3 | [] | no_license | <?php
# There is a need to separate the SQL from the functionality
# Note - capitalized variables function like constants and are imported from config_*.php files
# lower case variables function like regular variables
// Test for ip information. Need to secure the site.
#http://localhost:8888/brianmacmilla... | true |
df255f3d48ff86efb3ae92129f05dd6450aae6e0 | PHP | lupermanasseh/app.midas.local | /database/migrations/2019_12_09_174844_create_savingmasters_table.php | UTF-8 | 923 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSavingmastersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('savingmas... | true |
a6003de5617b466d3b596aba0b7c0475d1d60c57 | PHP | jorgeayllon1/Piscine-ING3-ECE-Paris | /code/panier.php | UTF-8 | 16,072 | 2.75 | 3 | [] | no_license | <?php
session_start();
if (isset($_SESSION["id_user"])) {
if ($_SESSION["rang"] != 1) {
header("location: connexion_client.php");
}
} else {
header("location: connexion_client.php");
}
$database = "ebayece";
$db_handle = mysqli_connect('localhost', 'root', '');
$db_found = mysqli_select_db($db_handle, $data... | true |
b96a19b3ab76309fa7d9ec8c1bbe9cd7e011858e | PHP | BerilBBJ/scraperwiki-scraper-vault | /Users/F/flowsnake/bp_view.php | UTF-8 | 990 | 2.78125 | 3 | [] | no_license | <?php
print "This is a <em>fragment</em> of HTML.";
scraperwiki::attach("school_life_expectancy_in_years");
$data = scraperwiki::select(
"* from school_life_expectancy_in_years.swdata
order by years_in_school desc limit 10"
);
print_r($data);
print "<table>";
print "<tr><th>Country</th><th>Years in school</th>... | true |
10fc305fd84504dd95a8c4842c09298402a1fa67 | PHP | amine-elghazali/STUDIO_NEW | /app/Http/Controllers/AdminSongs.php | UTF-8 | 6,748 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Song;
use App\Models\Artist;
use App\Models\Album;
use DataTables;
class AdminSongs extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function inde... | true |
68d7b2ccc41337831ffde942f7f435b5844bfcd6 | PHP | teamgonuts/electrofriends | /classes/ArtistFilter.php | UTF-8 | 308 | 2.953125 | 3 | [] | no_license | <?php
class ArtistFilter extends Filter {
private $artist;
public function ArtistFilter($art)
{
$this->artist = $art;
}
function genSQL()
{
return 'artist = \''. $this->artist . '\'';
}
function getName()
{
return $this->artist;
}
}
?> | true |
0e367b738c60b7ed1d39bd5dfb3324f8671762af | PHP | chitanka/chitanka | /app/Util/Number.php | UTF-8 | 2,341 | 3.46875 | 3 | [
"MIT"
] | permissive | <?php namespace App\Util;
class Number {
private static $phpIniSuffixValues = [
// suffix => multiplier as bit shift, e.g. 1k = 1 << 10
'k' => 10,
'm' => 20,
'g' => 30,
];
public static function normInt($val, $max, $min = 1) {
if ($val > $max) {
$val = $max;
} else if ($val < $min) {
$val = $min... | true |
60d2aa86c1525784cb666e8308d579bee0f7152b | PHP | comodorop/boutiqueC | /utilerias/enviarPHPMail.php | UTF-8 | 1,292 | 2.828125 | 3 | [] | no_license | <?php
$mensaje = "<h1>Bienvenido $nombre $apellidoP $apellidoM</h1> <br>
Tu Usuario es : $usuario <br>
Tu password para tu acceso es : $pass<br>
<h2>Recuerda que los datos que proporcionaste no van a ser accedidos por personas
ajenas a tí</h2><br>
<h1>... | true |
aa84f3e79fee81ef15afc5ce574ecab19858b6a2 | PHP | bleedkaga/tedu | /htdocs/star.php | UTF-8 | 259 | 2.890625 | 3 | [] | no_license | <?php
$rows = $_REQUEST['rows'];
$cols = $_REQUEST['cols'];
$cols = (int)$cols;
$rows = (int)$rows;
for($i = 0; $i < $rows; $i++){
for($j = 0; $j < $cols; $j++){
echo '※ ';
}
echo '<br>';
}
echo(min(7.25,7.30, 9 ,1 ));
?> | true |
033669300ba3fe0ded0661e7250fa841e659b7e9 | PHP | dorislazaro/scitec | /application/models/DbTable/Alumnos.php | UTF-8 | 1,379 | 2.609375 | 3 | [] | no_license | <?php
class Application_Model_DbTable_Alumnos extends Zend_Db_Table_Abstract
{
protected $_name = 'alumnos';
// Funcion trabajando al 100%
public function getAlumno($num_control)
{
$row = $this->fetchRow('num_control=\''.$num_control.'\'');
if (!$row)
{
throw new Exception("No se pudo encontrar ning... | true |
574e3f188155c9c6ff07146b815c8929f854c8b6 | PHP | b4us/aliyun-openapi-php-sdk | /aliyun-php-sdk-gpdb/gpdb/Request/V20160503/SwitchDBInstanceNetTypeRequest.php | UTF-8 | 1,468 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace gpdb\Request\V20160503;
/**
* Request of SwitchDBInstanceNetType
*
* @method string getConnectionStringPrefix()
* @method string getPort()
* @method string getDBInstanceId()
*/
class SwitchDBInstanceNetTypeRequest extends \RpcAcsRequest
{
/**
* @var string
*/
protected $method... | true |
bb025cff187490aa893f2dc20d9f9647a40d0f34 | PHP | deepak-webonise/PHP-Assignments | /Assignment2/edit.php | UTF-8 | 2,410 | 2.8125 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration Page</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<h3>Registration Form</h3>
<?php
if(isset($_POST['flag']))
{
require_once("vali... | true |
939de25b034315016dd67adcf80e3953dc54909d | PHP | immakid/code-examples | /laravel/piece-of-code-4/app/Providers/ErrorReportingServiceProvider.php | UTF-8 | 1,109 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Log;
use Monolog\Handler\StreamHandler;
use Trellis\ErrorReporting\Factory;
/**
* Class ErrorReportingServiceProvider
*
* @author Ivan Hunko <ivan@vinelab.com>
*/
class ErrorReportingServiceProvider extends ServiceProvider
{
/**
... | true |
ee5da084e9124751167144a5efc255959c3dbe25 | PHP | vnuness/gtechzone | /app/Library/Menu/Options/SubMenu.php | UTF-8 | 1,472 | 2.9375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: MeetaWeb
* Date: 07/05/2018
* Time: 10:51
*/
namespace App\Library\Menu\Options;
use App\Library\Menu\MenuInterface;
/**
* Class SubMenu
* @package App\Library\Menu\Options
*/
class SubMenu implements MenuInterface
{
/**
* @var array
*/
private $iten... | true |
2f0609f1955f6b0d1d10bbc084f730455e7492b8 | PHP | HouseWorked/project | /backend/modules/marketing/controllers/ServiceController.php | UTF-8 | 3,758 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace backend\modules\crm\controllers;
use yii;
use yii\web\Controller;
use common\models\User;
use app\modules\crm\models\Task;
use app\modules\crm\models\Responsible;
/**
* Default controller for the `crm` module
*/
class ServiceController extends Controller{
public function actionGraficProfit(){
... | true |
51d85bf9034be1ac544c7c5f64359d3e45be11f0 | PHP | nitsuDustin/Astronomy-Club-Website | /login/login.php | UTF-8 | 2,938 | 2.71875 | 3 | [] | no_license | <?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type = "text/css" href="login.css">
<title>Login</title>
<meta name="viewport" content="width=... | true |
3f2f4037d128cc4106b4164e0c193ece3f50bdc7 | PHP | Kirill-Zhernakov/learning.Movie | /controllers/controller_feedback.php | UTF-8 | 690 | 2.515625 | 3 | [] | no_license | <?php
class Controller_Feedback extends Controller
{
function __construct()
{
$this->model = new Model_Feedback();
$this->view = new View();
}
function action_index()
{
$this->view->generate('feedback_view.php', 'template_view.php');
}
function action_send() {
if (isset($_POST['user'])) {
$feedback['use... | true |
fa381e310db40f763ddf57b9d9284ca5c7eb7b67 | PHP | lkmadushan/simple-application | /app/Http/Controllers/CitiesController.php | UTF-8 | 2,080 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Domain\City\City;
use App\Domain\State\State;
use Exception;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Validation\Rule;
class CitiesController extends Controller
{
/**
* List all cities.
*
* @return View
... | true |
f83146e6ce3546d402587774ab806f99f8f9972a | PHP | hrmoore927/intro-programming-logic | /Test2/myCDs.php | UTF-8 | 954 | 2.875 | 3 | [] | no_license | <!-- Author: Heather Moore
Date: 10/17/16
File: My CDs.php
-->
<html>
<head>
<title>My CDs</title>
<link rel ="stylesheet" type="text/css" href="sample.css" />
</head>
<body>
<?php
$myCDs = fopen("myCDs.txt", "r");
$salesInfo1 = fgets($myCDs);
$salesInfo2 = fgets($myCDs);
$salesInfo3 = fge... | true |
b2ef014e29ad626ad6c35cb936200e2bcedb3c23 | PHP | PrzemekTkaczyk/laravel-fb-messenger | /src/Controllers/WebhookController.php | UTF-8 | 2,185 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
/**
* User: casperlai
* Date: 2016/8/31
* Time: 上午12:35
*/
namespace Casperlaitw\LaravelFbMessenger\Controllers;
use Casperlaitw\LaravelFbMessenger\Contracts\WebhookHandler;
use Casperlaitw\LaravelFbMessenger\Contracts\Debug\Debug;
use Casperlaitw\LaravelFbMessenger\Messages\Receiver;
use Casperlaitw\Larave... | true |
a67bd9c64ac49329c00003f4e76f513173e5b7da | PHP | microsoftgraph/msgraph-beta-sdk-php | /src/Generated/Models/Security/InformationProtectionPolicySetting.php | UTF-8 | 5,532 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace Microsoft\Graph\Beta\Generated\Models\Security;
use Microsoft\Graph\Beta\Generated\Models\Entity;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
class InformationPro... | true |
f387fa4af2a0c0c13e267318a9c8854902295386 | PHP | drx/django-ide | /test/libreteca/func.php | UTF-8 | 6,122 | 2.75 | 3 | [] | no_license | <?php
// Constants
define("QTE",chr(34));
// ***********************************
// Functions
// ***********************************
function ssql($v){
$valo="'".$v."'";
return $valo;
}
function resetpassword($email,$id){ // Checks data for password change
include("cn.php");
$sql="SELECT pass FROM Us... | true |
ef68b2a21cca77841307a012391287989546c85c | PHP | Webscr/Webproject | /Backend/config/config.php | UTF-8 | 467 | 2.703125 | 3 | [] | no_license | <?php
// Datenbankinformationen:
$host = "localhost"; // Name, Adresse oder IP des MySQL Servers. Standardm��ig: localhost
$user = "root";// Username zum einloggen am MySQL Server
$pass = ""; // Passwort zum einloggen am MySQL Server
$dbname = "doodle"; // Name der... | true |
c03dfd5b4d4fe7deb00e0702807af38352e98d1c | PHP | wp-deepak/wp-plugins | /wp-post-formats/formats/quote.php | UTF-8 | 1,139 | 2.953125 | 3 | [] | no_license | <?php
/**
* Quote
*/
add_filter( 'the_content', 'post_formats_quote_content' );
function post_formats_quote_content( $content ) {
/* Check if we're displaying a 'quote' post. */
if ( has_post_format( 'quote' ) ) {
/* Match any <blockquote> elements. */
preg_match( '/<blockquote.*?>/', $content, $matches );... | true |
a645d3a072d1ca4d34eda130d49b22a14b37313f | PHP | palmmicro/web | /php/stock/mysqlref.php | UTF-8 | 2,499 | 2.84375 | 3 | [] | no_license | <?php
// ****************************** MysqlReference class *******************************************************
class MysqlReference extends StockReference
{
var $strSqlId = false; // ID in mysql database
var $bConvertGB2312 = false;
var $fFactor = 1.0; // 'close' field in calibrationhistory tabl... | true |
53ddebdb7f035a590bd8f7f5fed408ec28b5dade | PHP | lec2017-idehara-lab-webpro/simple-bbs-kazukazu215 | /list.php | UTF-8 | 379 | 2.546875 | 3 | [] | no_license | <?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>List</title>
</head>
<body>
<a href='login.php'>Login</a></br>
<a href='home.php'>Home</a></br><hr />
<h1>書き込み一覧ページ</h1>
<?php
$name =$_SESSION['name']; // ここ書き換え
print($name . "さんでログイン中");
?>
</b... | true |
424bba1289de2bd6c635446968674fb5784685a0 | PHP | AkhilVinayakp/zenferz | /app/database.php | UTF-8 | 1,757 | 2.921875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: NANDHU
* Date: 1/10/2019
* Time: 10:51 PM
*/
class database
{
private $host="localhost";
private $user="root";
private $pass="";
private $dbname="project";
private $dbh;
public $error;
private $stmt;
public function __constr... | true |
12378924641e7f85947cde98ed98ac951c337e8a | PHP | jrdncchr/merlinleads | /application/models/api_model.php | UTF-8 | 18,846 | 2.546875 | 3 | [] | no_license | <?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Api_Model extends CI_Model {
/*
* GET ALL SECRET CONSTANTS
*/
public function load() {
$this->load->database();
$secrets = $this->db->get('ml_secrets');
foreach($secrets->result() as $s) {
... | true |
844621ee6e482b5bcba2e37a93333e7b93969ebc | PHP | tsorelle/austinquakers.net | /web.root/tops/site_lib/model/TFdsClass.php | UTF-8 | 1,428 | 2.765625 | 3 | [] | no_license | <?php
require_once("tops_lib/model/TEntityObject.php");
class TFdsClass extends TEntityObject {
// -- Generated by tools/newentity.php
public function __construct()
{
$this->tableName = 'fdsclasses';
$this->idFieldName = 'id';
$this->addField('id',INT_FIELD);
$this->addFie... | true |
d53249ca82be37bc5fa62238953df5f3bdd8fac0 | PHP | NathanApple/e-service-api | /app/Http/Middleware/IsMerchant.php | UTF-8 | 1,262 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Middleware;
use App\Models\Merchant;
use Closure;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class IsMerchant
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
... | true |
b67e0a8423f683d52461171f62acea2e0a6baebf | PHP | Omrani-Mahmoud/Gestion-d-assurance-automobile-Symfony | /src/AppBundle/Entity/User.php | UTF-8 | 1,486 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as FosUser;
/**
* User
*
* @ORM\Table(name="user", indexes={@ORM\Index(name="INDEX_Reference_type", columns={"type"})})
* @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
* @ORM\InheritanceType(va... | true |
677a4dd04ef75d5a566f730412f92e26d4e65e48 | PHP | 123ritu123/sagepay | /old/2.20/PHPDirectKit/test-create-database-execute.php | UTF-8 | 1,875 | 2.640625 | 3 | [] | no_license | <?
/************************************
Script to create demo MySQL table
************************************/
// *** Include the initialisation files
include ("init-includes.php");
$myPass = $_POST['pass'];
$myUser = $_POST['user'];
$dbname = $_POST['dbname'];
$tablename = $_POST['tablename'];
$dbError = '';
$tab... | true |
47685388a9981d20db0e9b61981785b7a5175e4c | PHP | amkdev/server-path-field | /src/fields/ServerPathFieldType.php | UTF-8 | 4,712 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Server Path Field plugin for Craft CMS 3.x
*
* @author Ryan Whitney, Alexander M. Korn
* @link https://github.com/amkdev
*/
namespace amkdev\serverpathfield\fields;
use Craft;
use craft\base\ElementInterface;
use craft\base\Field;
use craft\base\PreviewableFieldInterface;
use craft\fields\... | true |
d5256f09f43ee495ef57cc37afa8a8c794b94628 | PHP | huetm93/ExercicePHP | /ExercicePhp/boucle/exercice2.php | UTF-8 | 156 | 3.390625 | 3 | [] | no_license | <?php
$nombre1= (integer) 0;
$nombre2= (integer) 23;
while ($nombre1<20){
echo 'Nombre 1 * Nombre 2= ' . $nombre1*$nombre2 . '.</br>';
$nombre1++;
}
?> | true |
69adf6f99c9478764eadaa7f463f6eff5891b548 | PHP | ShaguftaShamsi/abc | /user_login.php | UTF-8 | 2,177 | 2.59375 | 3 | [] | no_license | <?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
class User_login extends CI_Controller
{
/*
* This function load Login Form
*/
function index($parm = null)
{
if($parm!= null){
$data['error'] =$parm;
}
$d... | true |
f42a42d3ed1ac9fe246c2ba5e7461e09b8e50a44 | PHP | Kak2X/jul | /lib/datetime.php | UTF-8 | 5,000 | 2.90625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
function timedelta($array1, $array2) {
$time = array();
$time['seconds'] = 60 - abs($array1['seconds'] - $array2['seconds']);
$time['minutes'] = abs($array1['minutes'] - $array2['minutes']);
$time['hours'] = abs($array1['hours'] - $array2['hours']);
return $time;
}
function timeunits($sec) {... | true |
b093ab7c8f26930c781e4ed0b37e577682af9ae5 | PHP | robwilde/wc-shipping-method | /includes/PEP_Services.php | UTF-8 | 801 | 2.8125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: robert
* Date: 21/05/2018
* Time: 5:16 PM
*/
class PEP_Services {
/**
* @return array
*/
public static function services(): array {
return self::get_pep_codes();
}
/**
* pull the codes from the csv file in the plugin directory
* will be migrated to sheet o... | true |
173b1cc66d3477defc042383b7acd3233b42104c | PHP | mkubincova/petapp | /petsociety/animalcare-add.php | UTF-8 | 3,482 | 2.703125 | 3 | [] | no_license | <?php
include "partials/header.php";
?>
<?php
if ($_SESSION) {
if ($_SESSION["userType"] == "admin") { ?>
<main class="animalcare-add-page">
<div class="addanimal-container">
<h2 class="addanimal-h1">Add Animal</h2>
<form method="post" enctype="multipart/form-data">
... | true |
ecfd70311a62e52942bd2799b65d6446ef1ded00 | PHP | lacockj/mysqlez | /mysqlez.php | UTF-8 | 9,996 | 3.15625 | 3 | [] | no_license | <?php class mysqlez extends mysqli {
# Properties #
public $errors = array();
protected $safeFunctions = array("CURRENT_TIMESTAMP()", "NOW()");
/**
* Connect to a database and use functions to SELECT, UPDATE and INSERT data.
* @param {string} $dbHost - Database host address.
* @param {string} $dbUser - Database ... | true |
2963c01abc8cd82409553a2db48783657b3474b9 | PHP | ValentinCiceu/VBooks | /unreserveController.php | UTF-8 | 656 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
//this will be the code to update and unreserve the book you choose
//the user will not be able to see this page unless something goes wrong
include 'config.php';//connect to the database
session_start();
$user_check=$_SESSION['login_ID'];//gets the userID number
$myIsbn=(int)$_GET['book_id']; //gets the chosen b... | true |
214af8ff033ce62024057e4700f71473891bf1e1 | PHP | reagordi/framework-1.0 | /src/base/Security.php | UTF-8 | 1,906 | 2.75 | 3 | [] | no_license | <?php
namespace Reagordi\Framework\Base;
use Reagordi;
class Security
{
protected static $obj = null;
public function generatePasswordHash(string $password)
{
return password_hash($password, PASSWORD_DEFAULT);
}
public function validatePassword($password, $hash)
{
return pas... | true |
635f79c10c07b3a19b4d954a1131439a6e368847 | PHP | lukasbp/php | /controle/foreach.php | UTF-8 | 522 | 4.21875 | 4 | [] | no_license | <div class="titulo">For each</div>
<?php
$array = [
1000 => 'Domingo',
'Segunda',
'Terça'
];
foreach($array as $valor){
echo "$valor <br>";
}
foreach ($array as $indice => $valor) {
echo "$indice => $valor <br>";
}
$matrix = [
['a','b','c'],
['d','e','f']
];
foreach ($matrix as $linha) {... | true |
400e06665a23c536517cde84df088d4b7da72f77 | PHP | danielgasser/concrete5-5.6-List-your-bookmarks | /blocks/pc_shooter_ch_list_favorites/tools/save_bookmarks.php | UTF-8 | 889 | 2.59375 | 3 | [] | no_license | <?php
/**
* List Your Bookmarks Tool file: parses bookmark file
* @author This addon creates a list of indiviual blocks,<br>with your bookmarks in it.
<ul><li>Export the Bookmarks from your browser(s)</li>
<li>Import your bookmarks into a list.</li>
<li>Add a small text and an image to each of the bookmarks.</li>
<li... | true |