[ Index ] |
PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10) |
[Summary view] [Print] [Text view]
1 <?php 2 3 // ---------------------------------------------------------------- 4 // obligate check for phpwcms constants 5 if (!defined('PHPWCMS_ROOT')) { 6 die("You Cannot Access This Script Directly, Have a Nice Day."); 7 } 8 // ---------------------------------------------------------------- 9 10 11 $action = clean_slweg($_GET["t"]); 12 $sendbutton = ($action == "add") ? $BL['be_gt_button_add'] : $BL['be_gt_button_update']; 13 $color_id = empty($_GET["color_id"]) ? 0 : intval($_GET["color_id"]); 14 $color_name = empty($_POST["color_name"]) ? '' : clean_slweg($_POST["color_name"]); 15 $color_info = empty($_POST["color_info"]) ? '' : strtoupper(clean_slweg($_POST["color_info"])); 16 17 if (isset($_GET["doit"]) && intval($_GET["doit"]) == 1) 18 { 19 if (!empty($color_name) && !empty($color_info)) 20 { 21 if (preg_match('/^[0-9a-fA-F]{6}$/', $color_info) == 1) 22 { 23 if ($action == "add") { 24 $query = "INSERT INTO ".DB_PREPEND."phpwcms_fonts_colors SET color_name='"; 25 $query .= aporeplace($color_name)."', color_value='".aporeplace($color_info)."'"; 26 } else { 27 $query = "UPDATE ".DB_PREPEND."phpwcms_fonts_colors SET color_name='"; 28 $query .= aporeplace($color_name)."', color_value='".aporeplace($color_info)."' WHERE color_id = ".$color_id." LIMIT 1"; 29 } 30 31 mysql_query($query, $db) or die ("Graphical Text - Error in query:$query"); 32 33 header("Location:phpwcms.php?do=modules&p=2&s=colors"); 34 } 35 else 36 echo "<span style=\"color:#FF0000\">".$BL['be_gt_only_six_numbers']."</span>"; 37 } 38 else 39 echo "<span style=\"color:#FF0000\">".$BL['be_gt_edit_empty_fields']."</span>"; 40 } 41 42 43 if (!empty($color_id)) 44 { 45 $query = "SELECT * FROM ".DB_PREPEND."phpwcms_fonts_colors WHERE color_id = ".$color_id; 46 $result = mysql_query($query, $db); 47 48 while ($row = mysql_fetch_assoc($result)) 49 { 50 $color_name = $row["color_name"]; 51 $color_info = $row["color_info"]; 52 } 53 } 54 ?> 55 56 <form action="phpwcms.php?do=modules&p=2&s=colors&t=<?php echo $action; ?>&color_id=<?php echo $color_id;?>&doit=1" method="post"> 57 <table width="538" border="0" cellpadding="0" cellspacing="0" summary=""> 58 <tr><td colspan="2" class="title"><img src="img/leer.gif" alt="" width="1" height="5" /></td> 59 </tr> 60 <tr><td colspan="2" class="title"><?php echo $BL['be_gt_color_edit_title']; ?></td></tr> 61 <tr><td colspan="2" class="title"><img src="img/leer.gif" alt="" width="1" height="5" /></td> 62 </tr> 63 <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td> 64 </tr> 65 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td> 66 </tr> 67 <tr> 68 <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_color_name'] ?>: </td> 69 <td><input name="color_name" type="text" id="font_name" class="f11b" style="width: 350px" value="<?php echo html_specialchars($color_name); ?>" size="50" maxlength="16" /></td> 70 </tr> 71 <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr> 72 <tr> 73 <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_color_info'] ?>: </td> 74 <td># 75 <input name="color_info" type="text" id="font_shortname" class="f11b" style="width: 100px" value="<?php echo $color_info; ?>" size="10" maxlength="6" /></td> 76 </tr> 77 <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr> 78 <tr> 79 <td class="chatlist"></td> 80 <td><input name="Submit" type="submit" class="button10" value="<?php echo $sendbutton ?>" /> 81 82 <input name="donotsubmit" type="button" class="button10" value="<?php echo $BL['be_gt_button_cancel'] ?>" onclick="location.href='phpwcms.php?do=modules&p=2&s=colors'" /></td> 83 </tr> 84 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td> 85 </tr> 86 <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td> 87 </tr> 88 <tr><td colspan="2"><?php subnavback($BL['be_gt_color_back'], "phpwcms.php?do=modules&p=2&s=colors", 6) ?></td></tr> 89 </table> 90 </form>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Nov 16 22:51:00 2010 | Cross-referenced by PHPXref 0.7 |