Пример #1
0
function loadProduct($kod)
{
    $tab[] = extraction($kod);
    include_once 'connect.php';
    $rodzaj = $tab[0]['rodzaj'];
    $marka = $tab[0]['marka'];
    $model = $tab[0]['model'];
    $opis = $tab[0]['opis'];
    $query = "INSERT INTO produkt VALUES ('{$kod}', '{$rodzaj}' , '{$marka}', '{$model}', '{$opis}')";
    //print_r($query);
    mysql_query($query);
    return true;
}
Пример #2
0
<?php

session_start();
include_once 'head.html';
include_once 'nav.html';
echo '<div class="container theme-showcase" role="main">';
echo '<div class="jumbotron">';
if (!isset($_SESSION['kod'])) {
    echo "Brak kodu w zmiennej sesji";
} else {
    include_once 'funkcje.php';
    $kod = $_SESSION['kod'];
    $tab[] = extraction($kod);
    echo '<h3><span class="label label-success">Pobrano produkt z CENEO</span></h3>';
    //Pobieramy do zmiennych sesyjnych dane o produkcie
    $_SESSION['rodzaj'] = $tab[0]['rodzaj'];
    $_SESSION['marka'] = $tab[0]['marka'];
    $_SESSION['model'] = $tab[0]['model'];
    $_SESSION['opis'] = $tab[0]['opis'];
    //Wyświetlenie danych produktu
    echo '<table class="table table-striped"><tbody><tr><td>Kategoria: </td><td>';
    print_r($tab[0]['rodzaj']);
    echo '</td></tr><tr><td>Marka: </td><td>';
    print_r($tab[0]['marka']);
    echo '</td></tr><tr><td>Model: </td><td>';
    print_r($tab[0]['model']);
    echo '</td></tr><tr><td>Opis: </td><td>';
    print_r($tab[0]['opis']);
    echo '</td></tr></tbody>
          </table>';
    echo '<p><a href="transformation.php"><button type="button" class="btn btn-lg btn-primary">Krok 2: Transformation</button></a></p>';
Пример #3
0
 public function examiney()
 {
     if ($_POST) {
         if ($_POST['examiney'] == 3) {
             $ret = extraction($_POST['buy_money'], $_POST['interest'], $_POST['id']);
             if ($ret) {
                 alogs("doAdd", 0, 1, '管理员执行了审核通过操作成功!');
                 $this->success('审核成功!');
             } else {
                 alogs("doAdd", 0, 1, '管理员执行了审核通过操作失败!');
                 $this->error('审核失败!');
             }
         } elseif ($_POST['examiney'] == 4) {
             $savedata = array();
             $savedata['status'] = 1;
             $invest = M('current_investor')->where("id = {$_POST['id']}")->save($savedata);
             if ($invest) {
                 alogs("doAdd", 0, 1, '管理员执行了审核不通过操作成功!');
                 $this->success('审核不通过操作成功!');
             } else {
                 alogs("doAdd", 0, 1, '管理员执行了审核不通过操作失败!');
                 $this->error('审核不通过失败!');
             }
         }
     }
 }