This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button type="submit" value="1" name="frm_button" class="btn btn-primary">Submit</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "vendor/autoload.php"; // it is crap, I will explain it later. | |
include "dao/ProductDao.php"; | |
// view | |
$blade=new \eftec\bladeone\BladeOne(__DIR__."/view",__DIR__."/compile"); | |
$blade->setMode(\eftec\bladeone\BladeOne::MODE_DEBUG); | |
// persistence | |
$db=new \eftec\DaoOne("localhost","root","abc.123","bladeonetut1"); | |
$db->connect(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "vendor/autoload.php"; // it is crap, I will explain it later. | |
include "dao/ProductDao.php"; | |
// view | |
$blade=new \eftec\bladeone\BladeOne(__DIR__."/view",__DIR__."/compile"); | |
$blade->setMode(\eftec\bladeone\BladeOne::MODE_DEBUG); | |
// persistence | |
$db=new \eftec\DaoOne("localhost","root","abc.123","bladeonetut1"); | |
$db->connect(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "vendor/autoload.php"; // it is crap, I will explain it later. | |
include "dao/ProductDao2.php"; | |
// view | |
$blade=new \eftec\bladeone\BladeOne(__DIR__."/view",__DIR__."/compile"); | |
$blade->setMode(\eftec\bladeone\BladeOne::MODE_DEBUG); | |
// validation | |
$val=new \eftec\ValidationOne(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$button=$val | |
->type('integer') // it must be a number | |
->def(0) // default value is zero | |
->ifFailThenDefault() // if fails then, the button will be the default value=0 | |
->post('frm_button'); // fetch the value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="col-md-12"> | |
<form class="" method="post" > | |
<div class="form-group"> | |
<label class="">Name</label> | |
<input type="text" class="form-control" placeholder="Enter a Product" name="frm_name" | |
value="{{$product['name']}}"> | |
<small class="text-danger">{{$messages->get('frm_name')->firstError()}}</small> | |
</div> | |
<div class="form-group"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id_category | name | |
---|---|---|
1 | premium | |
2 | normal | |
3 | expensive | |
4 | other |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Jorge Patricio Castro Castillo <jcastro arroba eftec dot cl> | |
* @link https://github.com/EFTEC/StateMachineOne | |
*/ | |
use eftec\statemachineone\Job; | |
use eftec\statemachineone\StateMachineOne; | |
use eftec\statemachineone\Transition; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// it is specific for this project | |
define('INITIAL_STATE',1); | |
define('DRIVING_TO_BUY_MILK',2); | |
define('CANCEL_DRIVING',3); | |
define('PICKING_THE_MILK',4); | |
define('PAYING_FOR_THE_MILK',5); | |
define('UNABLE_TO_PURCHASE',6); | |
define('DRIVE_BACK_HOME',7); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// database configuration | |
$smachine->tableJobs="buymilk_jobs"; | |
$smachine->tableJobLogs="buymilk_logs"; // it is optional | |
$smachine->setDB('localhost',"root","abc.123","statemachinedb"); | |
$smachine->createDbTable(false); // you don't need to create this table every time. | |
$smachine->loadDBAllJob(); // we load all jobs, including finished ones. | |
//$smachine->loadDBActiveJobs(); // use this in production, we don't need stopped job every time. |