?> </strong></td> <td width="100" align="right"><strong><?php echo _PAYMENT_LIST_CHARGE; ?> </strong></td> <td width="100" align="right"><strong><?php echo _PAYMENT_LIST_TOTAL; ?> </strong></td> </tr> </table> <?php $database = new SyncDatabase(); $colorRow = 1; foreach ($database->Select('contract', array('canceled' => 0), 0) as $contract) { $object = $database->Value('object_rental', array('object_id' => $contract['object_id']), 0); $objectType = $database->Value('object_type', array('type_id' => $object['type_id']), 0); $listCustomer[$contract['cus_id']] = array(); $listCustomer[$contract['cus_id']]['pay'] = 0; $listCustomer[$contract['cus_id']]['charge'] = 0; $listCustomer[$contract['cus_id']]['total'] = 0; $listCustomer[$contract['cus_id']]['list'] = 0; foreach ($database->Select('customer', array('cus_id' => $contract['cus_id']), 0) as $customer) { foreach ($database->Select('payment', array('contract_id' => $contract['contract_id'], 'paid' => 0), 0) as $payment) { $listCustomer[$customer['cus_id']]['list']++; $listCustomer[$customer['cus_id']]['pay'] += $payment['amount']; $listCustomer[$customer['cus_id']]['charge'] += $payment['charge']; $listCustomer[$customer['cus_id']]['total'] += $payment['amount'] + $payment['charge']; } }
</strong></td> <td width="350" align="left"><strong><?php echo _REGISTER_ADDRESS; ?> </strong></td> <td width="85" align="left"><strong><?php echo _REGISTER_TELEPHONE; ?> </strong></td> <td width="20" align="center"> </td> </tr> </table> <?php $database = new SyncDatabase(); $colorRow = 1; foreach ($database->Select('employee', 0, 0) as $user) { if ($colorRow % 2 == 0) { $style = 'style="background-color:#F7F7F7"'; } else { $style = ''; } echo '<a href="?employee=edit&username='******'username'] . '">'; echo '<table align="left" width="100%" border="0" cellspacing="0" cellpadding="3" id="user_' . $user['emp_id'] . '" ' . $style . '>'; echo '<tr style="height:30px" class="list-select">'; echo '<td align="center"><div style="width:35px;" id="img_' . $user['emp_id'] . '">' . $colorRow . '</div></td>'; echo '<td align="center"><div style="width:5px;" id="id' . $user['emp_id'] . '"></div></td>'; echo '<td align="left"><div style="width:90px;">' . $user['username'] . '</div></td>'; echo '<td align="left"><div style="width:120px;"><strong>' . $user['emp_name'] . '</strong></div></td>'; echo '<td align="left"><div style="width:350px;word-wrap:break-word;">' . $user['address'] . '</div></td>'; echo '<td align="left"><div style="width:85px;">' . $user['telephone'] . '</div></td>'; echo '<td align="center"><div style="width:20px;">';
<?php $database = new SyncDatabase(); $vaildLogin = 0; $imageUser = '******'; if ($database->Select('employee', array('username' => $_POST['user_vaild']), 0)) { if ($database->Select('employee', array('username' => $_POST['user_vaild'], 'password' => $_POST['pass_vaild']), 0)) { $vaildLogin = 1; $error = '<strong>MD5: </strong>' . md5($_POST['user_vaild']); } else { $vaildLogin = 2; $error = _SUBMIT_FAIL_PASS; } foreach ($database->Select('employee', array('username' => $_POST['user_vaild']), 0) as $user) { if ($user['picture'] != NULL) { $imageUser = '******' . $user['picture'] . '" width="110" height="128" border="0" />'; } } } else { $vaildLogin = 0; $error = _SUBMIT_FAIL_USER; } echo json_encode(array('error' => $error, 'vaild' => $vaildLogin, 'image' => $imageUser));
<input type="button" id="action_back" class="button" value=" " title="<?php echo _IMAGE_TAG_BACK; ?> " /> </div> <br /><div align="left"><h1><?php echo _HEAD_LIST_OBJECT; ?> </h1></div> <table align="left" width="100%" border="0" cellspacing="0" cellpadding="0" style="border-top:#999 dashed 1px;"> <tr> <td valign="top" width="230" style="border-right:#666 solid 2px;"> <?php $objectCount = $database->Count('object_rental', array('type_id' => 2), 0); $objectRow = floor($objectCount / 3) + 1; $objectName = $database->Select('object_type', array('type_id' => 2), 0); $objectName = $objectName[0]['type_name']; ?> <table width="235" border="0" cellspacing="1" cellpadding="3"> <?php foreach ($database->Select('object_rental', array('type_id' => 2), 0) as $object) { ?> <tr> <td> <a href="?object=edit&id=<?php echo $object['object_id']; ?> "> <div <?php if (isset($_GET['id']) && $_GET['id'] == $object['object_id']) { echo 'id="object-block-select"';
<?php if (isset($_GET['action']) && isset($_POST['register_apply'])) { $database = new SyncDatabase(); if (!$database->Select('customer', array('idcard' => $_REQUEST['regis_idcard']), 0)) { $newCustomer = array('regis_date' => $_SERVER['REQUEST_TIME'], 'fullname' => $_REQUEST['regis_fullname'], 'address' => $_REQUEST['regis_address'], 'idcard' => $_REQUEST['regis_idcard'], 'telephone' => $_REQUEST['regis_telephone'], 'job' => $_REQUEST['regis_job']); $database->Insert('customer', $newCustomer); } ?> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td width="180" align="center" valign="top" style="border-right:#CCC dashed 1px;"> <input type="button" name="register_edit" id="register_edit" value=" " title="<?php echo _IMAGE_TAG_EDIT; ?> " /> <input type="button" name="register_success" id="register_success" value=" " title="<?php echo _IMAGE_TAG_SUBMIT; ?> " /> </td> <td align="left" valign="top"> <h4><?php echo _REGISTER_CUSTOMER_ADD; ?> </h4> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td align="right" valign="top"> </td> <td align="left" valign="top"> </td> </tr>
<?php $database = new SyncDatabase(); switch ($_GET['form']) { case 'username': if ($database->Select('employee', array('username' => $_POST['user_vaild']), 0)) { echo json_encode(array('error' => '<img src="images/fail.gif" width="16" height="16" border="0" align="absmiddle" />', 'vaild' => 0)); } else { echo json_encode(array('error' => '<img src="images/done.gif" width="16" height="16" border="0" align="absmiddle" />', 'vaild' => 1)); } break; case 'tmp_name': $isFile = pathinfo($_POST['name']); $isName = md5($isFile['filename']) . '.' . $isFile['extension']; $isPath = 'images/tmpuser/' . $isName; echo json_encode(array('filename' => md5($isFile['filename']) . '.' . $isFile['extension'], 'filepath' => $isPath)); break; case 'picture': if (!isset($_FILES['regis_picture_tmp'])) { echo '<style type="text/css">body { padding:0px;margin:0px; }</style>'; echo '<div class="preview"><img src="images/browse_pic.jpg" width="240" height="280" border="0" /></div>'; } else { $isFile = pathinfo($_FILES['regis_picture_tmp']['name']); list($isWidth, $isHeight) = getimagesize($_FILES['regis_picture_tmp']['tmp_name']); list($isX, $isY) = array(120 - $isWidth / 2, 140 - $isHeight / 2); echo '<style type="text/css">body { padding:' . $isY . 'px 0 0 ' . $isX . 'px;margin:0px;font-size:11px;color:#444444; }</style>'; $target_path = 'images/tmpuser/' . md5($isFile['filename']) . '.' . $isFile['extension']; if ($isFile['extension'] == 'jpg' || $isFile['extension'] == 'gif' || $isFile['extension'] == 'png') { if ($isWidth <= 240 && $isHeight <= 280 && $_FILES['regis_picture_tmp']['size'] <= 1048576) { move_uploaded_file($_FILES['regis_picture_tmp']['tmp_name'], $target_path); echo '<div class="preview"><img src="' . $target_path . '" border="0" /></div>';
<?php $control = new Session(); $database = new SyncDatabase(); $monList = array(_January, _February, _March, _April, _Mays, _June, _July, _August, _September, _October, _November, _December); foreach ($database->Select('object_type', 0, 0) as $type) { $listType[$type['type_id']] = array(); $listSignup[$type['type_id']] = array(); $listExpire[$type['type_id']] = array(); foreach ($database->Select('object_rental', array('type_id' => $type['type_id']), 0) as $object) { foreach ($database->Select('contract', array('object_id' => $object['object_id']), 0) as $contract) { // signup_date if ($contract['canceled'] == 0) { $date = getdate($contract['signup_date']); $found = false; foreach ($listSignup[$type['type_id']] as $list) { if ($list == $monList[$date['mon'] - 1] . ' ' . ($date['year'] + 543)) { $found = true; } } if (!$found) { $listSignup[$type['type_id']][$date['mon'] . '-' . $date['year']] = $monList[$date['mon'] - 1] . ' ' . ($date['year'] + 543); } } // cancel_date if ($contract['canceled'] == 1) { $date = getdate($contract['cancel_date']); $found = false; foreach ($listExpire[$type['type_id']] as $list) { if ($list == $monList[$date['mon'] - 1] . ' ' . ($date['year'] + 543)) { $found = true;
" /></td> <td align="left" valign="top"> <h4><?php echo _REGISTER_USER_DATA; ?> <span class="vaild_info2" id="form_comment"> </span></h4> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td width="200" align="right"><?php echo _REGISTER_FULLNAME; ?> </td> <td align="left"> <select name="regis_customer" id="regis_customer"> <?php foreach ($database->Select('customer', 0, 0) as $customer) { ?> <option value="<?php echo $customer['cus_id']; ?> "><?php echo $customer['fullname']; ?> </option> <?php } ?> </select> </td> </tr> <tr>
?> </strong></td> <td width="120" align="center"><strong><?php echo _CONTRACT_SINGUP; ?> </strong></td> <td width="120" align="center"><strong><?php echo _CONTRACT_EXPIRE; ?> </strong></td> <td width="32" align="center"> </td> </tr> </table> <?php $colorRow = 1; foreach ($database->Select('contract', 0, 0) as $contract) { $idContract = $contract['cus_id'] . $contract['object_id'] . $contract['emp_id'] . '-' . $contract['contract_id']; $customer = $database->Value('customer', array('cus_id' => $contract['cus_id']), 0); $object = $database->Value('object_rental', array('object_id' => $contract['object_id']), 0); $objectType = $database->Value('object_type', array('type_id' => $object['type_id']), 0); $costCharge = 0; foreach ($database->Select('payment', array('contract_id' => $contract['contract_id'], 'paid' => 0), 0) as $cost) { $costCharge += $cost['amount'] + $cost['charge']; } if ($colorRow % 2 == 0) { $style = 'style="background-color:#F7F7F7;"'; } else { $style = ''; } echo '<a href="?contract=edit&id=' . $contract['contract_id'] . '">'; echo '<table align="right" width="100%" border="0" cellspacing="0" cellpadding="3" id="list-user" ' . $style . '>';
copy($_REQUEST['regis_picture'], $folder_taget); foreach (glob("images/tmpuser/*.*") as $filename) { unlink($filename); } $imageVailds = true; } else { $imageVailds = false; $isFile['basename'] = 'user_none.jpg'; $isAttrImage = 'width="110" height="128"'; } } else { $imageVailds = false; $isFile['basename'] = 'user_none.jpg'; $isAttrImage = 'width="110" height="128"'; } if (!$database->Select('employee', array('username' => $_REQUEST['regis_username']), 0)) { $newUser = array('emp_name' => $_REQUEST['regis_fullname'], 'address' => $_REQUEST['regis_address'], 'telephone' => $_REQUEST['regis_telephone'], 'picture' => $isFile['basename'], 'username' => $_REQUEST['regis_username'], 'password' => $_REQUEST['regis_password']); $database->Insert('employee', $newUser); } ?> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td width="180" align="center" valign="top" style="border-right:#CCC dashed 1px;"> <input type="button" name="register_edit" id="register_edit" value=" " title="<?php echo _IMAGE_TAG_EDIT; ?> " /> <input type="button" name="register_success" id="register_success" value=" " title="<?php echo _IMAGE_TAG_SUBMIT; ?> " />
$('#error_massage').html(loginError); return false; } }); }); </script> <?php } else { if (isset($_POST['login_submit'])) { $control->setCookie('USER_RENTAL', $_POST['username'], $GLOBALS['TIME_COOKIE']); } if ($control->Value('USER_RENTAL')) { $control->setCookie('USER_RENTAL', $control->Value('USER_RENTAL'), $GLOBALS['TIME_COOKIE']); $control->setSession('LOGIN_VAILD', $_SERVER['REQUEST_URI']); foreach ($database->Select('contract', array('canceled' => 0), 0) as $contract) { $isToday = getdate(time()); $isCharge = 50; $isChargeMonth = 3; // Canceled Contract Expire if ($contract['cancel_date'] != 0 && $contract['cancel_date'] < time() || $contract['expire_date'] < time()) { $database->Update('contract', array('canceled' => 1), array('contract_id' => $contract['contract_id'])); $database->Update('object_rental', array('status_object' => 0), array('object_id' => $contract['object_id'])); } else { // Canceled Contract Over 3 Month if ($database->Count('payment', array('contract_id' => $contract['contract_id'], 'amount' => $contract['cost'], 'paid' => 0), 0) > $isChargeMonth) { $database->Update('contract', array('cancel_date' => time(), 'canceled' => 1), array('contract_id' => $contract['contract_id'])); $database->Update('object_rental', array('status_object' => 0), array('object_id' => $contract['object_id'])); } else { // Payment Month Insert if ($database->Count('payment', array('contract_id' => $contract['contract_id'], 'amount' => $contract['cost']), 0) == 0) {
<?php $database = new SyncDatabase(); $contract = $database->Value('contract', array('contract_id' => $_GET['id']), 0); $customer = $database->Value('customer', array('cus_id' => $contract['cus_id']), 0); $employee = $database->Value('employee', array('emp_id' => $contract['emp_id']), 0); $object = $database->Value('object_rental', array('object_id' => $contract['object_id']), 0); $type = $database->Value('object_type', array('type_id' => $object['type_id']), 0); $isPaydate = $database->Value('payment', array('contract_id' => $contract['contract_id'], 'amount' => $contract['cost']), array(0, 0, 'ORDER BY pay_date DESC LIMIT 0,1')); $payTotal = 0; $changeTotal = 0; foreach ($database->Select('payment', array('contract_id' => $contract['contract_id'], 'paid' => 0), 0) as $payment) { $changeTotal += $payment['charge']; $payTotal += $payment['amount'] + $payment['charge']; } ?> <form action="" method="POST" name="employee_register" id="employee_register"> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td width="180" align="center" valign="top" style="border-right:#CCC dashed 1px;"> <input type="reset" name="register_reset" id="register_reset" value="" title="<?php echo _IMAGE_TAG_BACK; ?> " /> <input type="button" name="register_print" id="register_print" value="" title="<?php echo _IMAGE_TAG_PRINT; ?> " /></td> <td align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="3"<?php
" /></td> <td align="left" valign="top"> <h4><?php echo _REGISTER_USER_DATA; ?> <span class="vaild_info2" id="form_comment"> </span></h4> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td align="right"><?php echo _REGISTER_TYPE; ?> </td> <td align="left"> <select name="regis_type" id="regis_type"> <?php foreach ($database->Select('object_type', 0, 0) as $type) { ?> <option value="<?php echo $type['type_id']; ?> "><?php echo $type['type_name']; ?> </option> <?php } ?> </select> </tr> <tr> <td width="150" align="right"><?php
<?php $database = new SyncDatabase(); $user = $database->Select('employee', 0, 0); ?> <table align="center" width="100%" border="0" cellspacing="0" cellpadding="10"> <tr> <td> <table align="center" width="400" border="0" cellspacing="0" cellpadding="5"> <tr> <td align="center"> <div id="wizard-menu"><a href="?customer=register" class="register"> <img id="icon-menu" src="images/IconRegister.png" width="128" height="128" border="0" /> <div id="wizard-text"><?php echo _WIZARD_REGISTER; ?> </div></a> </div> </td> <td align="center"> <div id="wizard-menu"><a href="?contract=register" class="rent"> <img id="icon-menu" src="images/IconRent.png" width="128" height="128" border="0" /> <div id="wizard-text"><?php echo _WIZARD_RENT; ?> </div></a> </div> </td> </tr> <tr> <td align="center">