| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- require_once("DataBase_Net/Priceset_Net.php");
- require_once("DataBase/Priceset.php");
- // sync Priceset database
- $priceset = new Priceset();
- $priceset_net = new Priceset_Net();
- $new_priceset_count = 0;
- $del_priceset_count = 0;
- $remote_pricesets = $priceset_net->get('', array('priceset_id'));
- foreach($remote_pricesets as $tmp)
- {
- if($priceset->exists($tmp[0]) == false)
- {
- $priceset_net->delete($tmp[0]);
- $del_priceset_count++;
- }
- }
- $remote_pricesets = $priceset_net->get('', array('priceset_id'));
- $local_pricesets = $priceset->get('', array('priceset_id'));
- foreach($local_pricesets as $tmp)
- {
- $found = false;
-
- foreach($remote_pricesets as $remote_tmp)
- {
- if($remote_tmp[0] == $tmp[0])
- {
- $found = true;
- break;
- }
- }
-
- $tmp_data = $priceset->get($tmp[0], array( "name",
- "netto"));
-
- if(!$found)
- {
- $priceset_net->create($tmp[0], $tmp_data[0]);
- $new_priceset_count++;
- }
- else
- {
- $priceset_net->update($tmp[0], $tmp_data[0]);
- }
- }
- $main_box->add(new NTKLabel("", "neue Pricesets online: ".$new_priceset_count), 200, 0, "background-color: #dfe7f3;");
- $main_box->add(new NTKLabel("", "online Pricesets gelöscht: ".$del_priceset_count), 200, 0, "background-color: #dfe7f3;");
- ?>
|