Viewing file: v_NewsFileAttach.php (3.4 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<script language="JavaScript1.2">
function checkDocFile() {
var docFile, docName;
docFile = document.getElementById('docFile').value;
docName = document.getElementById('docName').value;
if(docFile!="" && docName=="") {
alert("กรุณากป้อนชื่อเอกสาร!!");
return false;
}
}
</script>
<?php
$row_nw = (isset($qu_nw) && $qu_nw!=NULL) ? $qu_nw->row() : NULL;
?>
<table width="100%">
<tr>
<td align="center"><span class="h error">แนบ/ลบเอกสารประกอบข่าว</span></td>
</tr>
<tr>
<td><br /></td>
</tr>
<tr>
<td><table class="szone">
<?php echo form_open_multipart($this->config->item("rg_folder")."faq/nw_attachFile_insert_update", array("name" => "myform", "id" => "myform"));?>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td height="25px" colspan="2" class="indent"><b>หัวเรื่องข่าว :</b>
<?php echo setValue('nwTitle',$row_nw);?></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td height="25px" colspan="2" class="indent"><b>เอกสารที่แนบแล้ว : </b>
<?php
$i = 0;
if(isset($rs_nwu) && $rs_nwu->num_rows()) {
foreach($rs_nwu->result() as $row_nwu) {
?>
<a href="<?php echo base_url().$this->config->item('rg_docNews').$row_nwu->nwuPath;?>"><?php echo $row_nwu->nwuFileName." ";?></a>
<span onClick="confirmDel2({nwuId:<?php echo $row_nwu->nwuId;?>, nwuNwId:<?php echo $row_nwu->nwuNwId;?>}, 'm_form1','<?php echo site_url($this->config->item('rg_folder').'faq/nwu_deleteFile');?>')" /><img src="<?php echo base_url()."images/".$this->config->item("rg_folder")."picture/delete.gif";?>" align="absmiddle" border="0" width="16" height="19" class="hand"/></span>
<?php
}
} else {
echo "ไม่มีการแนบไฟล์";
}
?>
</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td colspan="2" class="coltd_szone">แนบเอกสารประกอบข่าว</td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td><table class="szone">
<tr>
<td width="20px"></td>
<td class="coltd_szone">ชื่อเอกสาร</td>
<td><input type="text" name="docName" id="docName" size="30" maxlength="70" value="<?php echo set_value('docName');?>" />
<span class="error"> *</span>
<?php echo form_error('docName');?></td>
</tr>
<tr>
<td></td>
<td class="coltd_szone">แนบเอกสาร</td>
<td><input type="file" name="docFile" id="docFile" value="<?php echo set_value('docFile');?>" />
<span class="error"> (ขนาดไฟล์ไม่เกิน 2 MB)</span>
<span class="error"><?php echo form_error('docFile');?></td>
</tr>
</table></td>
</tr>
<tr bgcolor="<?php echo $tr_color_even;?>">
<td align="center" colspan="2" class="coltd_szone">
<input type="submit" name="add" id="add" value="บันทึก" onClick="return checkDocFile()" />
<input type="button" name="back" id="back" value="ย้อนกลับ" onclick="location.href='<?php echo site_url()."/".$this->config->item('rg_folder').'faq/nw_show';?>'" />
<input type="hidden" name="nwId" id="nwId" value="<?php echo setValue('nwId', $row_nw);?>" />
</tr>
<?php echo form_close();?></table></td>
</tr>
<tr>
<td><br /></td>
</tr>
</table>
|