今天我有一个问题修改程序“osTicket(v1.9.12)”的代码计算到期日
我想在论坛发帖询问:http://osticket.com/forum/discussions ..我不知道......如何使用帖子问这里? ......哪里?
请求:值$ row ['grace_period']到期日的计算器日期
行动:
示例:
class.sla.php
function getSLAs() {
$slas=array();
$sql='SELECT id, name, isactive, grace_period FROM '.SLA_TABLE.' ORDER BY name';
if(($res=db_query($sql)) && db_num_rows($res)) {
while($row=db_fetch_array($res))
$slas[$row['id']] = sprintf(__('%s (%d hours - %s) '
/* Tokens are <name> (<#> hours - <Active|Disabled>) */),
$row['name'],
$row['grace_period'],
$row['isactive']?__('Active'):__('Disabled'));
}
return $slas;
}
票证open.php
<td width="160">
<?php echo __('SLA Plan');?>:
</td>
<td>
<select id="slaId" name="slaId" onchange="choose_sla()">
<option value="0" selected="selected" >— <?php echo __('System Default');?> —</option>
<?php
if($slas=SLA::getSLAs()) {
foreach($slas as $id =>$name) {
echo sprintf('<option value="%d" %s>%s</option>',
$id, ($info['slaId']==$id)?'selected="selected"':'',$name);
}
}
?>
</select>
<font class="error"> <?php echo $errors['slaId']; ?></font>
</td>
//test selected
<p id="cal_due"></p>
<script>
function choose_sla() {
var x = document.getElementById("slaId").value;
document.getElementById("cal_due").innerHTML = "You selected: " + x;
}
退房:
print_r($slas);
//Array ( [1] => Default SLA (48 hours - Active)
//[6] => SLA 93.33% ( 2880 นาที - 48 ชม.) (48 hours - Active)
//[5] => SLA 99.10% (388.8 นาที - 6.29 ชม.) (6 hours - Active)
//[3] => SLA 99.40% (129.6 นาที - 5 ชม.) (5 hours - Active)
//[2] => SLA 99.80% (86.4 นาที - 1.26 ชม.) (1 hours - Active) )
结果当前:
您选择了:id = 1 {6,5,3,2}&lt;&lt;&lt;选择变更的价值
我无法查询并返回$ row ['grace_period'] = {48,6.29,5,1.26} ...
的值
您对我的建议是什么?
非常感谢...