<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<form name="f1" method="post" action="">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<tr>
<td colspan="3" height="20" class="title_heading" valign="top"></td>
<td colspan="4" height="20" class="title_heading" valign="top">Equipment Details</td>
</tr>
<tr>
<td class="txtbox_bgcolor" width="14%"> Equipment</td>
<td class="txtbox_bgcolor" width="14%">Serial</td>
<td class="txtbox_bgcolor" width="14%">Manufacturer</td>
<td class="txtbox_bgcolor" width="14%">Price</td>
<td class="txtbox_bgcolor" width="14%">Warranty </td>
<td class="txtbox_bgcolor" width="14%">Status</td>
<td class="txtbox_bgcolor" width="16%" >Change Status </td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" colspan="8">
<div id="eq_list" style="border:#000000 1px solid; height:140px;width:100%; display:inline;">
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
{assign var="sequence" value=1}
<input name="equi_id" type="text" size="20" value="{$equi_id}">
{section name=i loop=$equipment_name}
<tr>
<td class="txtbox_bgcolor" height="50%" width="14%"> <u><i>{$equipment_name[i]}</i></u></td>
<td class="txtbox_bgcolor" height="50%" width="14%"> {$serial_no[i]}</td>
<td class="txtbox_bgcolor" height="50%" width="14%"> {$man[i]}</td>
<td class="txtbox_bgcolor" height="50%" width="14%"> {$eq_price[i]} </td>
<td class="txtbox_bgcolor" height="50%" width="14%"> {$expiry_date[i]}</td>
<td class="txtbox_bgcolor" height="50%" width="14%">will be in future</td>
<td class="txtbox_bgcolor" height="50%" width="6%"></td>
<td class="txtbox_bgcolor" height="50%" width="10%">
<input type="checkbox" name="{'status_eq'|cat:$sequence}" id="{'status_eq'|cat:$sequence}" onclick="status_op(this,{$sequence})"></td>
</tr>
<tr>
<td class="txtbox_bgcolor" colspan="2"></td>
<td class="txtbox_bgcolor" colspan="6" >
<div id="{'eq_div_'|cat:$sequence}" style="border:#000000 1px solid; height:auto;width:400px; display:none;">
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<tr>
<td class="txtbox_bgcolor"></td>
<td class="txtbox_bgcolor">Status</td>
<td class="txtbox_bgcolor">
<select name="status[]" id="status">
<option value="" selected="selected">Select status</option>
<option value="1">OK</option>
<option value="2">Repairing</option>
<option value="3">Obsolete</option>
</select>
</td>
</tr>
<tr>
<td class="txtbox_bgcolor" width="15%"></td>
<td class="txtbox_bgcolor">Reason</td>
<td class="txtbox_bgcolor"><input type="hidden" name="ser" value="{$sequence}" size="2"/><textarea name="reason[]" id="reason" rows="5"></textarea></td>
</tr>
<tr><td class="btn_bg1" colspan="8"><input type="button" name="done" value="Done" onclick="return close_div({$sequence});" </td></tr>
</table>
</div>
<input type="text" name="seq[]" id="seq" value="{$sequence++}" size="2" />
</td>
<td class="txtbox_bgcolor" height="50%" colspan="1"></td>
</tr>
{/section}
<input type="text" name="total_rows" id="total_rows" value="{$sequence-1}" size="2" />
</table>
<table cellSpacing="1" cellPadding="0" width="100%" border="0">
<tr><td class="btn_bg1" colspan="8"><input type="submit" name="submit" value="submit" /></td></tr>
</table>
</div>
</td>
</tr>
</form>
</table>
{literal}
<script language="javascript">
function close_div(s)
{
//alert(s);
var obj_reason = document.f1.elements["reason"];
var obj_status = document.f1.elements["status"];
// alert(obj_reason);
var a= s-1;
if(obj_status[a].value=="")
{
alert("You Must Specify The Status ");
obj_status[a].focus();
return false;
}
if(obj_reason[a].value=="")
{
alert("You Must Specify The Reason ");
obj_reason[a].focus();
return false;
}
div_name = "eq_div_"+s;
document.getElementById(div_name).style.display="none";
all_show();
}
function all_show()
{
rows = document.f1.total_rows.value;
//alert(rows);
for(var i= 1; i<=rows ;i++)
{
chk_name = "status_eq"+i;
document.getElementById(chk_name).disabled = false;
}
}
function all_hide()
{
rows = document.f1.total_rows.value;
for(var i=1 ; i<=rows ;i++ )
{
div_name = "eq_div_"+i;
document.getElementById(div_name).style.display="none";
}
}
function status_op(obj,p)
{
if(obj.checked == true)
{
all_hide();
rows = document.f1.total_rows.value;
div_name = "eq_div_"+p;
document.getElementById(div_name).style.display="inline";
for(var i= 1; i<=rows ;i++)
{
chk_name = "status_eq"+i;
if( i != p)
{
document.getElementById(chk_name).disabled = true;
}
}
}
else
{
all_hide();
for(var i= 1; i<=rows ;i++)
{
chk_name = "status_eq"+i;
document.getElementById(chk_name).disabled = false;
}
}
}
</script>
{/literal}