www/crontasks.php

Thu, 14 Feb 2019 14:42:52 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 14 Feb 2019 14:42:52 +0100
changeset 275
fb1e88f1c643
parent 257
62e294ab94f5
child 294
1e09d1d102a8
permissions
-rw-r--r--

Better fg estimation in product print.

257
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 require_once('config.php');
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 $mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 $query = "UPDATE products SET stage=7 WHERE stage = 6 AND DATEDIFF(CURDATE(), package_date) > 0";
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 $result = $mysqli->query($query);
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 $query = "UPDATE products SET stage=8 WHERE stage = 7 AND DATEDIFF(CURDATE(), package_date) > 13";
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 $result = $mysqli->query($query);
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 $query = "UPDATE products SET stage=9 WHERE stage = 8 AND DATEDIFF(CURDATE(), package_date) > 41";
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 $result = $mysqli->query($query);
62e294ab94f5 Version 0.0.6. Added a crontask that adjusts the stage of packaged beer depending on the days passed packaging
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14

mercurial