Viewing file: v_addNews.php (5.75 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $rowNs = (isset($qu_ns) && $qu_ns!=NULL) ? $qu_ns->row() : NULL; $frDate = ($rowNs!=NULL) ? splitDateDb2(setValue('nsDate',$rowNs),'/') : ''; $UsID = $this->session->userdata('UsID'); ?> <table width="100%"> <tr> <td> <div align="center"><table width="100%"> <tr> <td align="center" colspan="2" class="h">แจ้งข่าวประกาศ</td> </tr> <tr> <td colspan="2"><table width="100%"> <tr> <td colspan="5" align="center"> <?php echo form_open($this->config->item("ea_folder")."news/ns_insert_update", array("name" => "myform", "id" => "myform"));?><table class="easzone"> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_easzone">ชื่อหัวข้อ</td> <td><textarea name="nsTopic" id="nsTopic" cols="55" rows="3"><?php echo setValue('nsTopic', $rowNs);?></textarea> <font color="<?php echo $this->config->item('font_color_err');?>" size="2">*</font> <br /><?php echo form_error('nsTopic');?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_easzone">รายละเอียด</td> <td><textarea name="nsDesc" id="nsDesc" cols="55" rows="4"><?php echo setValue('nsDesc', $rowNs);?></textarea> <font color="<?php echo $this->config->item('font_color_err');?>" size="2">*</font> <br /><?php echo form_error('nsDesc');?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_easzone">ประกาศเมื่อ</td> <td><script>DateInput('nsDate', true, 'DD/MM/YYYY', '<?php echo (set_value("nsDate",$frDate)=="") ? getNowDateFw2() : set_value("nsDate",$frDate);?>');</script> <?php echo form_error('nsDate');?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td align="center" colspan="2"> <input type="submit" name="add" id="add" value="ตกลง" /> <input type="reset" name="clear" id="clear" value="เคลียร์ข้อมูล" /> <input type="hidden" name="nsId" name="nsId" value="<?php echo setValue('nsId',$rowNs);?>" /> </td> </tr> </table><?php echo form_close();?></td> </tr> <tr> <td><br /></td> </tr> <tr> <?php echo form_open($this->config->item("ea_folder")."news/ns_search", array("name" => "searchform", "id" => "searchform"));?> <?php if(isset($rs_ns) && $rs_ns->num_rows() > $this->config->item("ea_max_row")) { ?> <td><div class="boxBlock leftBox"><font size="2"><b> แสดง <?php echo $this->config->item("ea_max_row");?> รายการจาก <?php echo isset($rs_ns) ? $rs_ns->num_rows() : '';?> รายการ</b></font> </div></td> <?php } ?> <td align="right"> <font size="2"><b>หัวข้อ</b></font> <input type="text" name="topicsearch" id="topicsearch" value="<?php echo set_value('topicsearch');?>"/> <input type="submit" name="search" id="search" value="ค้นหา" /> </font> <br /><?php echo form_error('topicsearch');?> </td><?php echo form_close();?> </tr> <tr> <td colspan="2"><table class="eaheadCol"> <tr> <th class="seqCol"><font size="2" color="<?php echo $font_color_table;?>"><b>ลำดับ</b></font></th> <th><font color="<?php echo $font_color_table;?>" size="2"><b>ชื่อหัวข้อ</b></font></th> <th><font color="<?php echo $font_color_table;?>" size="2"><b>ประกาศเมื่อ</b></font></th> <th><font color="<?php echo $font_color_table;?>" size="2"><b>แก้ไข</b></font></th> <th><font color="<?php echo $font_color_table;?>" size="2"><b>ลบ</b></font></th> </tr> <?php $i = 0; if(isset($rs_ns) && $rs_ns->num_rows()) { foreach($rs_ns->result() as $rs_ns) { if($i >= $this->config->item("ea_max_row")) break; echo "<tr onmouseover=\"bgColor='".$tr_color_even."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">"; ?> <td align="center"><font size="2"><?php echo $i+1;?></font></td> <td class="indent"><font size="2"><?php echo $rs_ns->nsTopic ;?></font></td> <td class="indent"><font size="2"><?php echo abbreDate2($rs_ns->nsDate);?></font></td> <td align="center"> <img class="hand" src="<?php echo base_url()."images/".$this->config->item("rg_folder")."picture/edit.gif";?>" align="absmiddle" border="0" onClick="sendPost('hidform',{'nsId':<?php echo $rs_ns->nsId;?>}, '<?php echo site_url($this->config->item('ea_folder').'news/ns_input');?>')" /></td> <td align="center"> <img class="hand" src="<?php echo base_url()."images/".$this->config->item("rg_folder")."picture/delete.gif";?>" align="absmiddle" border="0" onClick="confirmDel2({nsId:<?php echo $rs_ns->nsId;?>}, 'hidform','<?php echo site_url($this->config->item('ea_folder').'news/ns_delete');?>')" /></td> </tr> <?php $i++; } } else { ?> <tr> <td colspan="8" height="22" align="center"><font color="<?php echo $this->config->item('font_color_err');?>" size="2">** ไม่ปรากฏรายการในฐานข้อมูล **</font></td> </tr> <?php } ?> </table></td> </tr> <tr> <td colspan="4" align="right"><font size="2">รวม <?php echo $i;?> รายการ</font></td> </tr> </table></td> </tr> </table></div> <br><font color="<?php echo $this->config->item('font_color_err');?>" size="2"><b>หมายเหตุ : </b>* หมายถึง ต้องกรอกข้อมูลให้สมบูรณ์</font></td> </tr> </table>
|