<?php include_once 'pricelist_class.php'; $pricelist = new pricelist(); $result = $pricelist->plgJSON(); echo $result;
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> <script src="../../assets/js/ie-emulation-modes-warning.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <?php $pricelist = new pricelist(); echo $pricelist->group_html_table(); ?> </div> <div class="container"> <form class="form-signin" action="test-pricelistgroup-add.php" method="post"> <label for="NewGroupName" class="sr-only">имя новой группы</label> <input type="text" id="NewGroupName" name="NewGroupName" class="form-control" placeholder="имя новой группы" required autofocus> <button class="btn btn-lg btn-primary btn-block" type="submit" name="AddSubmit" value="TRUE">добавить</button> </form> </div>
function pricelistAdd() { $plg_name = trim($_POST['plgName']); $pl_name = trim($_POST['plName']); $pl_price = $_POST['plPrice']; //echo $pl_name ." == ". $plg_name . " == ". $pl_price. "<br>"; //echo "<p class=\"lead\">" . $plg_name ." == ". $pl_name . " == ". $pl_price. "<br>"; $pricelist = new pricelist(); $plg_id = $pricelist->pricelistgroupAdd($plg_name); //echo "<p class=\"lead\"> " . $plg_id . " == ". $plg_name. "<br>"; $database = new database(); $UserAccess = "mechanic"; $QueryText = "INSERT INTO `pricelist`(`pl_name`, `pl_plg_id`,`pl_price`) VALUES (\"{$pl_name}\",{$plg_id},{$pl_price})"; //echo $QueryText; if ($plg_id != -1) { $query = $database->query_with_access($QueryText, $UserAccess); if (!$query) { echo "<br>что то пошло не так: " . $query->error . "<br>"; } } //echo "addDone"; }
<?php include_once 'pricelist_class.php'; $pricelist = new pricelist(); echo $pricelist->pricelistGroupOptionList(); ?>
<?php include_once 'pricelist_class.php'; $pricelist = new pricelist(); echo $pricelist->pricelistAdd(); ?>
<?php include_once 'pricelist_class.php'; $pricelist = new pricelist(); echo "<h2>pricelistgroup query -> json</h2>"; $jsonResult = json_decode($pricelist->plgJSON(), TRUE); var_dump($jsonResult); foreach ($jsonResult as $json_key => $json_str) { echo "<p> {$json_key} :: <br>"; foreach ($json_str as $jKey => $jValue) { echo $jKey . " == " . $jValue . "<br>"; } echo "</p>"; } echo "<h2> mod pricelistgroup query -> json</h2>"; $jsonResult = json_decode($pricelist->modPlgJSON(), TRUE); var_dump($jsonResult); foreach ($jsonResult as $json_key => $json_str) { echo "<p> {$json_key} :: <br>"; foreach ($json_str as $jKey => $jValue) { echo $jKey . " == " . $jValue . "<br>"; } echo "</p>"; } echo $jsonResult[1]['name']; echo "<h2>pricelist query -> json</h2>"; $jsonResult = json_decode($pricelist->plJSON(), TRUE); foreach ($jsonResult as $json_key => $json_str) { echo "<p> {$json_key} :: <br>"; foreach ($json_str as $jKey => $jValue) { echo $jKey . " == " . $jValue . "<br>";
<?php include_once 'pricelist_class.php'; $pricelist = new pricelist(); echo $pricelist->pricelistTable("table text-lowercase", "bg-primary text-uppercase"); ?>