<?php

$database = new SyncDatabase();
$column = array('employee' => 'emp_id', 'customer' => 'cus_id', 'object_rental' => 'object_id');
foreach ($_POST['list_id'] as $id) {
    $database->Delete($_GET['table'], array($column[$_GET['table']] => $id));
}
Esempio n. 2
0
                        } elseif ($isPaydate['mon'] == $isToday['mon'] && $isPaydate['year'] == $isToday['year']) {
                            $chargeMoney = (int) floor((time() - $payment['pay_date']) / 86400) * $isCharge;
                            $database->Update('payment', array('charge' => $chargeMoney), array('pay_id' => $payment['pay_id']));
                        }
                    }
                }
                //endif
            }
            //endif
        }
        //endforeach
        foreach ($database->Select('contract', array('canceled' => 1), 0) as $contract) {
            // Payment Delete
            foreach ($database->Select('payment', array('contract_id' => $contract['contract_id'], 'amount' => $contract['cost'], 'paid' => 0), 0) as $payment) {
                if ($payment['pay_date'] > time()) {
                    $database->Delete('payment', array('pay_id' => $payment['pay_id']));
                }
            }
        }
    }
    $listMenu = array(_MENU_FRONTPAGE => '?', _MENU_OBJECT => '?object=view', _MENU_RENTAL => '?contract=list', _MENU_INVOICE => '?invoice=view', _MENU_PAY => '?pay=ment', _MENU_DATA_EMPLOYEE => '?employee=view', _MENU_DATA_CUSTOMER => '?customer=view', _MENU_REPORT => '?report=selected', _MENU_LOGOUT => '?logout=confirm');
    ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td background="images/bg_head.png" style="background-repeat:repeat-x;"><center>
    <table width="802" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" background="images/bg_logo.jpg" style="height:75px;"><img src="images/LogoAdmin.jpg" width="475" height="75" border="0" /></td>
      </tr>
      <tr>
        <td align="left" valign="top" style="height:32px;">