add price
This commit is contained in:
@@ -3,5 +3,14 @@
|
||||
ini_set('display_errors','off');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
define('SITE', 'http://'.$_SERVER['HTTP_HOST'].'/');
|
||||
define('SITEPATH', $_SERVER['DOCUMENT_ROOT'].'/');
|
||||
if (isset($_SERVER['HTTP_HOST']))
|
||||
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');
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
require 'confg.php';
|
||||
require 'modules/anpdf/anpdf.php';
|
||||
|
||||
require 'routes/price.php';
|
||||
|
||||
_kuri();
|
||||
|
||||
|
||||
function index_kuri(){
|
||||
return anpromo_kuri(1);
|
||||
}
|
||||
33
app/routes/price.php
Normal file
33
app/routes/price.php
Normal 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";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user