foreach ($_POST as $key => $value) { echo $value . '<br/>'; } $newfilename = null; $location = 'images/product/'; /*if(move_uploaded_file($temp_name, $location.$img_name)){ echo 'uploaded'; }*/ $temp = explode(".", $_FILES["kep"]["name"]); $newfilename = round(microtime(true)) . '.' . end($temp); move_uploaded_file($_FILES["kep"]["tmp_name"], "images/product/" . $newfilename); $_POST["kep"] = $newfilename; $_POST["t_azon"] = null; $product = Product::createProductByArray($_POST); ///die("product: ".$product); $leader = new UserAsLeader($_SESSION["id"], $_SESSION["email"], $_SESSION["password"]); $message = $leader->productAddStore($product); $_SESSION["message"] = $message; header("Location: Leader_Add_Product.php"); } //kontruktor $id, $name, $package, $category, $weight, $price, $min_order, $min_stock, $discount, $highlight, $img, $description) //$product = Product::createProduct(null, $name,$package,$category,$weight,$price,$minO,$recQ,$action,$highlight,$newfilename,$details); //echo $product."<br>"; /* $conn = new ConnectionHandler(); $conn->preparedInsert("termekek", array("nev", "kat_azon", "kisz_azon", "suly", "egysegar", "min_keszlet", "min_rend", "kim_azon", "akcio", "reszletek"), array($name, $categ, $package, $weight, $price, $recQ,$minO,$highlight,$action,$details)); /* $stmt = $conn->preparedQuery("SELECT t_azon FROM termekek WHERE nev=?",array("$name")); $id = -1;
/** * UserAsLeader constructor. */ public function __construct($user_id, $email, $password) { parent::__construct($user_id, $email, $password); self::$conn = new ConnectionHandler(); }
function statistic($id, $nValue) { //echo var_dump($nValue); //echo ">>>" . $nValue . "<<<<"; $dates = preg_split('/[_]/', $nValue); //print_r($dates); $sD = date($dates[0]); // . " h:i:s"); $eD = date("Y-m-d"); // h:i:s"); if ($dates[1] != null || $dates[1] != "") { //var_dump($dates[1]); $eD = date($dates[1]); // . " h:i:s"); } if ($sD > $eD) { $helper = $sD; $sD = $eD; $eD = $helper; } $sD = date($sD . " 00:00:00"); $eD = date($eD . " 23:59:59"); //echo "sd: " . $sD . " eD: " . $eD; // echo "datetime: " . date("Y-m-d h:i:s"); $user = new UserAsLeader($_SESSION["id"], $_SESSION["email"], $_SESSION["password"]); echo $user->productSoldStatistic($id, $sD, $eD); /* while( $row = $ar->fetch(PDO::FETCH_NUM,PDO::FETCH_ORI_NEXT)){ echo "qty: ". $row[0]; } */ }