add price

This commit is contained in:
Andrey Kuvshinov
2020-04-07 17:39:07 +03:00
parent 3cbaef6398
commit 11e22806f5
3 changed files with 46 additions and 4 deletions

View File

@@ -3,5 +3,14 @@
ini_set('display_errors','off'); ini_set('display_errors','off');
error_reporting(E_ALL); error_reporting(E_ALL);
define('SITE', 'http://'.$_SERVER['HTTP_HOST'].'/'); if (isset($_SERVER['HTTP_HOST']))
define('SITEPATH', $_SERVER['DOCUMENT_ROOT'].'/'); define('SITE', 'http://'.$_SERVER['HTTP_HOST'].'/');
if (isset($_SERVER['HTTP_HOST']))
define('SITEPATH', $_SERVER['DOCUMENT_ROOT'].'/');
else
define('SITEPATH', dirname(__FILE__));
db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'newser', 'Chjk90yuiREY');
db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'reader', 'ghjyjkUIOhg56Fh');

View File

@@ -1,12 +1,12 @@
<?php <?php
require 'vendor/autoload.php'; require 'vendor/autoload.php';
require 'confg.php';
require 'modules/anpdf/anpdf.php'; require 'modules/anpdf/anpdf.php';
require 'routes/price.php';
_kuri(); _kuri();
function index_kuri(){ function index_kuri(){
return anpromo_kuri(1); return anpromo_kuri(1);
} }

33
app/routes/price.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
function priceid_kuri($id){
$price = db_get("SELECT `pricename` FROM price WHERE `price_id` = $id");
if (is_array($price))
return $price;
}
function addhash_kuri(){
$ssql = "SELECT `price_id`, `BeginDate` FROM `price` WHERE `pricehash` = '' LIMIT 10";
$items = dbl_get($ssql);
foreach ($items as $item) {
$id = $item['price_id'];
$date = $item['BeginDate'];
$hash = md5("$id$date");
$usql = "UPDATE `price` SET `pricehash` = '$hash' WHERE `price_id` = '$id'";
dbl_get($usql, 'reader');
echo $usql."\n";
}
}