修改或新增 應用程式目錄/tables/table_name/table_name.php
class tables_survey_y100 {
function beforeSave(&$record){ //存檔前先寫入cookie
$cookie_arr = array('depart'=>'填表單位', 'section'=>'填表科別', 'user_name'=>'填表人', 'tel'=>'聯絡分機');
foreach ($cookie_arr as $id => $value) {
setcookie($id,$record->strval($value),time()+60*60*24*30);
}
}
function block__after_new_record_form(){ //新增資料時讀入cookie值
echo "<script language='javascript'><!--"
$cookie_arr = array('depart'=>'填表單位', 'section'=>'填表科別', 'user_name'=>'填表人', 'tel'=>'聯絡分機');
foreach ($cookie_arr as $id => $value) {
echo "document.new_survey_y100_record_form.$value.value='".$_COOKIE[$id]."';";
}
echo "//--></script>"
ps:大於、小於符號請換成半型
沒有留言:
張貼留言