break; /** * Display the preferences dialog. */ /** * Display the preferences dialog. */ case 'prefs': if (isset($kga['customer'])) { die; } $tpl->assign('skins', ls("../skins")); $tpl->assign('langs', langs()); $tpl->assign('timezones', timezoneList()); $tpl->assign('usr', $kga['usr']); $tpl->assign('rate', get_rate($kga['usr']['usr_ID'], NULL, NULL)); $tpl->display("preferences.tpl"); break; /** * Display the dialog to add or edit a customer. */ /** * Display the dialog to add or edit a customer. */ case 'add_edit_knd': if (isset($kga['customer']) || $kga['usr']['usr_sts'] == 2) { die; } if ($id) { // Edit mode. Fill the dialog with the data of the customer. $data = knd_get_data($id);
$CALL_LIST = '<table class="Tickets" cellspacing="0">'; $CALL_LIST .= '<tr class="TopR">'; $CALL_LIST .= '<td class="TableH">#</td>'; $CALL_LIST .= '<td class="TableH">Date</td>'; $CALL_LIST .= '<td class="TableH">Time</td>'; $CALL_LIST .= '<td class="TableH">Destination</td>'; $CALL_LIST .= '<td class="TableH">Rate</td>'; $CALL_LIST .= '<td class="TableH">Duration (sec)</td>'; $CALL_LIST .= '<td class="TableH">Charge</td>'; $CALL_LIST .= '</tr>'; while ($Usage = $aobs->fetch_array($BillQuery)) { $count = $stt++; $date = substr($Usage['calldate'], 0, 10); $time = substr($Usage['calldate'], -8); $number = get_number($Usage['dst']); $rate = get_rate($number, $uext); $duration = $Usage['duration']; $billsec = $Usage['billsec']; $charge = get_charge($rate, $billsec); if ($rate == "ICM") { $callin++; $timein = $timein + $billsec; $costin = $costin + $charge; } else if ($rate == "INT") { $callout++; $timeout = $timeout + $billsec; $costout = $costout + $charge; } else if ($rate == "CNF") { $callcon++; $timecon = $timecon + $billsec; $costcon = $costcon + $charge; } else if ($rate == "LDC") { $calllong++; $timelong = $timelong + $billsec; $costlong = $costlong + $charge; } $chargein = get_format($costin); $chargeout = get_format($costout); $chargelong = get_format($costlong); $chargecon = get_format($costcon); $chargettl = get_format($costin + $costout + $costlong + $costcon); $chargetax = get_format(($costin + $costout + $costlong + $costcon) * 0.13); $chargefnal = get_format(($costin + $costout + $costlong + $costcon) * 1.13);
/** * Save rate to database. * * @global array $kga kimai global array * @global array $conn MySQL connection * @author sl */ function save_rate($user_id, $project_id, $event_id, $rate) { global $kga, $conn; // validate input if ($user_id == NULL || !is_numeric($user_id)) { $user_id = "NULL"; } if ($project_id == NULL || !is_numeric($project_id)) { $project_id = "NULL"; } if ($event_id == NULL || !is_numeric($event_id)) { $event_id = "NULL"; } if (!is_numeric($rate)) { return false; } // build update or insert statement if (get_rate($user_id, $project_id, $event_id) === false) { $query = "INSERT INTO " . $kga['server_prefix'] . "rates VALUES({$user_id},{$project_id},{$event_id},{$rate});"; } else { $query = "UPDATE " . $kga['server_prefix'] . "rates SET rate = {$rate} WHERE " . ($user_id == "NULL" ? "user_id is NULL" : "user_id = {$user_id}") . " AND " . ($project_id == "NULL" ? "project_id is NULL" : "project_id = {$project_id}") . " AND " . ($event_id == "NULL" ? "event_id is NULL" : "event_id = {$event_id}"); } $result = $conn->Query($query); if ($result == false) { return false; } else { return true; } }
function get_hour($time_in, $time_out) { $data = round((strtotime($time_out) - strtotime($time_in)) / 3600, 1); $sum_hour = ceil($data); return $sum_hour; } $time_in = $car_log['time_in']; $time_out = $car_log['time_out']; $hour = get_hour($time_in, $time_out); //echo 'rate :'.get_rate($time_in, $time_out);//(วันเวลาเข้า, ชั่วโมงทั้งหมด) //echo '<br/>'; //print_r(cal(1500, get_rate($time_in, $time_out))); $rate = get_rate($time_in, $time_out); //(วันเวลาเข้า, ชั่วโมงทั้งหมด) //echo '<br/>'; $change = cal(1500, get_rate($time_in, $time_out)); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title aligne="left">Parkko</title> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet">
<td>$ <input type="text" name="rate_base_p3a" value="<?=get_rate($_GET["date1"],'salary','Aptc 3A', 92);?>" /></td> </tr> <tr> <td>Apprentice 3C</td> <td><input type="text" name="rate_name_p3c" value="<?=get_rate($_GET["date1"],'nmsalary','Aptc 3C');?>" /></td> <td>$ <input type="text" name="rate_base_p3c" value="<?=get_rate($_GET["date1"],'salary','Aptc 3C', 72.5);?>" /></td> </tr> <tr> <td>Apprentice 4A</td> <td><input type="text" name="rate_name_p4a" value="<?=get_rate($_GET["date1"],'nmsalary','Aptc 4A');?>" /></td> <td>$ <input type="text" name="rate_base_p4a" value="<?=get_rate($_GET["date1"],'salary','Aptc 4A', 100);?>" /></td> </tr> <tr> <td>Apprentice 4C</td> <td><input type="text" name="rate_name_p4c" value="<?=get_rate($_GET["date1"],'nmsalary','Aptc 4C');?>" /></td> <td>$ <input type="text" name="rate_base_p4c" value="<?=get_rate($_GET["date1"],'salary','Aptc 4C', 87.5);?>" /></td> </tr> </table> <input type="submit" name="rate_saving" value="SAVE" style="float:right; margin:35px 14px;" /> </div> </form> <form method="post" enctype="multipart/form-data"> <div style="padding:50px; float:left; clear:both;"> <p style="font-weight:bold; border-bottom:solid 0px; padding-bottom:10px;"> Tax Rate </p> <?php function csv_to_array($filename='', $delimiter=',') {
$rowcolour = '#CCC'; $rowcount = 0; } // echo out the contents of each row into a table echo '<tr style="background:' . $rowcolour . '" class="item" data-employee="' . $row['id'] . '">'; echo '<td align="left">' . $row['name'] . '</td>'; echo '<td align="center">' . $row['dob'] . '</td>'; echo '<td align="center">' . $row['bsb'] . '</td>'; echo '<td align="center">' . $row['acc'] . '</td>'; echo '<td align="center">' . $row['tfn'] . '</td>'; echo '<td align="left"> ' . strtoupper($row['addr']) . '<br/>' . $row['suburb'] . ' ' . $row['state'] . ' ' . $row['postcd'] . '</td>'; echo '<td align="center">' . $row['phone'] . '</td>'; echo '<td align="center">' . $row['mobile'] . '</td>'; echo '<td align="center"><a href="mailto:' . $row['mail'] . '" target="_blank">' . $row['mail'] . '</a></td>'; echo '<td align="left"> ' . strtoupper($row['emg_name']) . '<br/>' . $row['emg_phone'] . '</td>'; echo '<td align="center">' . (intval($row['start']) > 0 ? date('d/m/Y', $row['start']) : '-') . '</td>'; echo '<td align="center">' . (intval($row['ended']) >= time() ? date('d/m/Y', $row['ended']) : "<em style='color:gray'>" . (intval($row['ended']) > 0 ? date('d/m/Y', $row['ended']) : '-') . "</em>") . '</td>'; echo '<td align="center">' . get_rate(0, 'nmsalary', $row['pay_lvl']) . '</td>'; echo '<td align="center">' . $row['al'] . ' days</td>'; echo '<td align="center">' . $row['sl'] . ' days</td>'; echo '<td align="center">' . $row['level'] . '</td>'; echo '</tr>'; } } // close table> echo "</table>"; echo "<p>{$pagination}</p>"; // pagination ?> </div>
} if ($bn['pay_type'] == "point4") { // 쇼핑포인트로 결제처리해주기.. if ($mb['mb_point4'] >= $price) { $po_point_temp = $price * -1; $po_content = '쇼핑포인트결제:' . $bn['bn_id']; insert_point4($mb['mb_id'], $po_point_temp, $po_content, '@passive', $mb['mb_id'], $member[mb_id] . "-" . uniqid("")); } else { $msg .= $bn['bn_id'] . '번 구매건 쇼핑포인트(' . number_format($mb['mb_point4']) . 'P)가 결제할금액(' . number_format($price) . '원)보다 부족합니다.'; continue; } } if ($cd[rt_id]) { $result = get_rate($cd[rt_id]); } else { $result = get_rate('1'); } $cd_share_rate_array = array(); $cd_share_rate = explode(",", $cd[cd_share_rate]); $result_temp = array_keys($result); for ($j = 0; $j < count($cd_share_rate); $j++) { $sum = $j + 4; if ($cd_share_rate[$j] != "") { $result[$result_temp[$sum]] = $cd_share_rate[$j]; } } $mc = get_merchants($cd[mb_id2]); //echo $mc[mc_subject]; if ($mc[mc_manager_rate] > 0 && $mc[mc_manager]) { // $price_42_rate = $price_42_value / $price_1_value * 100; // $price_41_rate = $price_41_value / $price_1_value * 100;
value="1">1 (all access)</option> <option <?php echo $level == 2 ? 'selected="selected"' : ''; ?> value="2">2 (manager)</option> <option <?php echo $level == 3 ? 'selected="selected"' : ''; ?> value="3">3 (employee)</option> </select> <td> <b>Pay Rate</b><br /> <select name="pay_lvl" class="input1"> <option value=""></option> <?php foreach (get_rate(0, 'salary', '[array]') as $ratesal => $rateval) { echo "<option value='" . strtoupper($ratesal) . "' " . (strtoupper($pay_lvl) == strtoupper($ratesal) ? 'selected="selected"' : '') . " >{$rateval['name']}</option>"; } ?> </select> </td> <td> <b>Tax Free</b><br /> <select name="taxfree" class="input1"> <option <?php echo strtoupper($taxfree) == 'Y' ? 'selected="selected"' : ''; ?> value="Y">YES</option> <option <?php echo strtoupper($taxfree) != 'Y' ? 'selected="selected"' : ''; ?>
if (isset($_POST['occupancy'])) { $date_stopped = $_POST['occupancy']; } if (isset($_POST['minbook'])) { $minbook = $_POST['minbook']; } $rateitems = array(); $rcount = 0; $rooms = array(); $roomtypes = array(); $syncrate = 0; $guarantees = array(); $wassynced = ""; if ($ratesid) { $rate = array(); if (get_rate($ratesid, $rate)) { $description = $rate['description']; $code = $rate['ratecode']; $src = $rate['bookingsrc']; $occupancy = $rate['occupancy']; $ratetype = $rate['rate_type']; $minpax = $rate['minpax']; $maxpax = $rate['maxpax']; $minstay = $rate['minstay']; $maxstay = $rate['maxstay']; $currencycode = $rate['currency']; $date_started = $rate['date_started']; $date_stopped = $rate['date_stopped']; $minbook = $rate['minbook']; $rateitems = array(); $rcount = get_rateitems($ratesid, $rateitems);
/** * Get the rate summary detail for a specific rates id * * @ingroup RATE_MANAGEMENT * @param $ratesid [in] Rate id * @param $rate [in/out] Rate detail */ function get_ratebyratesid($ratesid, &$rate) { global $conn; global $_L; if (!$ratesid) { return 0; } if (!$conn) { $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT); } if (!$conn) { return 0; } $fullrate = array(); // print "get fullrate ".$ratesid."<br/>"; if (!get_rate($ratesid, $fullrate)) { return 0; } $rate = array(); $rate['rateid'] = $ratesid; $rate['name'] = $fullrate['description']; $rate['code'] = $fullrate['ratecode']; $rate['currency'] = $fullrate['currency']; $items = array(); get_rateitems($ratesid, $items); $rate['inclusions'] = ""; foreach ($items as $idx => $val) { $rate['inclusions'] .= $_L['RTS_product'] . " : " . get_itemname($items[$idx]['itemid']) . "<br/>"; $rate['inclusions'] .= $_L['RTS_valid'] . " : " . get_ratesperiodstring($items[$idx]['validperiod'], 1, 1, 1) . "<br/>"; $rate['inclusions'] .= $_L['RTS_ratetype'] . " : " . get_discounttypestring($items[$idx]['discounttype']) . "<br/>"; $rate['inclusions'] .= $_L['RTS_price'] . " : " . $rate['currency'] . " " . $items[$idx]['discountvalue'] . "<br/>"; if ($items[$idx]['discountvalue']) { if ($items[$idx]['service']) { $rate['inclusions'] .= $_L['RTS_including']; } else { $rate['inclusions'] .= $_L['RTS_excluding']; } $rate['inclusions'] .= " " . $_L['RTS_service'] . "<br/>"; if ($items[$idx]['tax']) { $rate['inclusions'] .= $_L['RTS_including']; } else { $rate['inclusions'] .= $_L['RTS_excluding']; } $rate['inclusions'] .= " " . $_L['RTS_tax'] . "<br/>"; } $rate['inclusions'] .= "<br/>"; $rate['price'] = $items[$idx]['discountvalue']; } $rate['requirements'] = $_L['RTS_occupancy'] . " " . get_occupancystring($fullrate['occupancy']) . "<br/>"; $rate['requirements'] .= $_L['RTS_commencing'] . " " . $fullrate['date_started'] . "<br/>"; $rate['requirements'] .= $_L['RTS_ending'] . " " . $fullrate['date_stopped'] . "<br/>"; $rate['requirements'] .= $_L['RTS_minnights'] . " " . $fullrate['minstay'] . "<br/>"; $rate['requirements'] .= $_L['RTS_maxnights'] . " " . $fullrate['maxstay'] . "<br/>"; $rate['requirements'] .= $_L['RTS_minpax'] . " " . $fullrate['minpax'] . "<br/>"; $rate['requirements'] .= $_L['RTS_maxpax'] . " " . $fullrate['maxpax'] . "<br/>"; $rate['requirements'] .= $_L['RTS_minbook'] . " " . $fullrate['minbook'] . "<br/>"; }
/** * Save rate to database. * * @global array $kga kimai global array * @global array $pdo_conn PDO connection * @author sl */ function save_rate($user_id, $project_id, $event_id, $rate) { global $kga, $pdo_conn; $p = $kga['server_prefix']; // validate input if ($user_id == NULL || !is_numeric($user_id)) { $user_id = "NULL"; } if ($project_id == NULL || !is_numeric($project_id)) { $project_id = "NULL"; } if ($event_id == NULL || !is_numeric($event_id)) { $event_id = "NULL"; } if (!is_numeric($rate)) { return false; } // build update or insert statement $query_string = ""; if (get_rate($user_id, $project_id, $event_id) === false) { $query_string = "INSERT INTO {$p}rates VALUES({$user_id},{$project_id},{$event_id},{$rate});"; } else { $query_string = "UPDATE {$p}rates SET rate = {$rate} WHERE " . ($user_id == "NULL" ? "user_id is NULL" : "user_id = {$user_id}") . " AND " . ($project_id == "NULL" ? "project_id is NULL" : "project_id = {$project_id}") . " AND " . ($event_id == "NULL" ? "event_id is NULL" : "event_id = {$event_id}"); } $query = $pdo_conn->prepare($query_string); $result = $query->execute(); if ($result == false) { return false; } else { return true; } }