function ref($a) { $b =& $a; var_dump(rvalue_sort(get_defined_vars())); modify(rvalue_sort(get_defined_vars())); var_dump($b); }
function modify() { global $lll, $siteDemo, $allowedMethods; $found = FALSE; if ($siteDemo || !class_exists('rss')) { // It is disabled to save these attributes in the demo version: foreach (array("extraHead", "extraBody", "extraTopContent", "extraBottomContent", "extraFooter", "logoImage", "headerBackground") as $attr) { if (!empty($this->{$attr})) { $found = TRUE; $this->{$attr} = ""; } } } foreach (array("homeLocation", "redirectFirstLogin", "redirectLogin", "redirectAdminLogin") as $attr) { $ctrl = new AppController(); if ($this->{$attr}) { if (!$ctrl->init($this->{$attr}) || !isset($allowedMethods[$ctrl->method]) || !class_exists($ctrl->getClass())) { return Roll::setFormInvalid("invalidInternalLink", $this->{$attr}); } } } modify($this); $this->uploadImages(); if ($found) { Roll::setInfoText("This feature is not available in the Lite (and demo) version of the program!"); } }
function executeCronJobs() { global $now; G::load($cronjobs, "SELECT * FROM @cronjob WHERE active='1' AND NOW()-INTERVAL frequency HOUR > lastExecutionTime"); foreach ($cronjobs as $cronjob) { eval($cronjob->function); $cronjob->lastExecutionTime = $now; modify($cronjob); } }
function generateModel($city, $state, $climateZone, $additionalOptions) { //additonalOptions is an associative array with specified options // ex. 'floor_height' => 5.675 $defaultContents = "{\"timestep\": 1, \"run_number\": 1, \"climate_zone\": \"{$climateZone}\", \"state\": \"{$state}\", \"city\": \"{$city}\", \"number_of_floors\": 3, \"floor_height\": 3.9624, \"plenums\": true, \"orientation\": 0.0, \"building_type\": \"medium_office\", \"geometry_configuration\": \"Rectangle\", \"zone_layout\": \"Five_Zone\", \"roof_style\": \"flat\", \"wall_type\": \"Steel_Frame_Non_Res\", \"roof_type\": \"iead_non_res\", \"south_wwr\": 0.477, \"east_wwr\": 0.477, \"north_wwr\": 0.477, \"west_wwr\": 0.477, \"south_win_type\": \"reference\", \"east_win_type\": \"reference\", \"north_win_type\": \"reference\", \"west_win_type\": \"reference\", \"hvac_type\": \"vav\", \"heating_coil\": \"Gas\", \"has_reheat\": true, \"reheat_coil\": \"Electric\", \"heating_efficiency\": 0.8, \"cooling_cop\": 3.23372055845678, \"fan_efficiency\": 0.5915, \"fan_static_pressure\": 1109.648, \"elec_plug_intensity\": 10.76, \"int_lighting_intensity\": 10.76, \"ext_lighting_intensity\": 14804, \"people_density\": 18.58, \"infiltration_per_ext_sur_area\": 0.000302, \"oa_vent_per_person\": 0.0125, \"oa_vent_per_area\": 0.0, \"length1\": 49.911, \"length2\": 0.0, \"width1\": 33.2738, \"width2\": 0.0, \"end1\": 0.0, \"end2\": 0.0, \"offset1\": 0.0, \"offset2\": 0.0, \"offset3\": 0.0, \"has_setback\": true, \"has_night_cycle\": true, \"night_cycle\": \"CycleOnAny\", \"has_dcv\": false, \"cooling_setback\": 26.7, \"heating_setback\": 15.6, \"cooling_setpoint\": 24.0, \"heating_setpoint\": 21.0, \"has_weekend_occupancy\": true, \"weekend_occupancy_type\": \"Saturday\", \"weekday_start_time\": \"06:00\", \"weekday_end_time\": \"22:00\", \"weekend_start_time\": \"06:00\", \"weekend_end_time\": \"18:00\", \"use_mechanical_vent\": false}"; $contents = modify($defaultContents, $additionalOptions); $contents = str_replace('"', "'", $contents); // replace double quotes with single quotes $generator = "python yourserverpath/autotune/backend/idfgenerator.py"; //on the server //$generator = "C:/xampp/htdocs/Git/backend/idfgenerator.py"; //testing locally $command = "{$generator} \"{$contents}\""; //call python script $modelContents = array(); exec($command, $modelContents); $strContents = implode("\n", $modelContents); //make array into a string return $strContents; }
function main() { global $result; switch ($_REQUEST['query']) { case "add": add(); break; case "modify": modify(); break; case "delete": del(); break; default: $result['status'] = 404; $result['msg'] = "No such query type" . $_REQUEST['query']; } echo json_encode($result); }
/** * * @param unknown $root * @param unknown $array * @param number $level * @return string */ function array2xml($root, $array, $level = 0) { if (is_integer($root)) { $root = "entry"; } if (!$level) { $xml = "<?xml version='1.0' encoding='utf-8'?><{$root}>"; } else { $xml = "<{$root}>"; } foreach ($array as $key => $value) { if (is_array($value)) { $xml .= array2xml($key, $value, $level + 1); } else { $xml .= "<{$key}>" . modify($value) . "</{$key}>"; } } $xml .= "</{$root}>"; return $xml; }
public static function expiry($type, $value) { $now = date("Y-m-d H:i:s"); //adjust the expiry by hours if ($type == 'H') { //$tz = new \DateTimeZone('Europe/London'); $date = new \DateTime($now); $date->modify('+' . $value . ' hours'); return $date->format('Y-m-d H:i:s'); } else { if ($type == 'D') { //$tz = new \DateTimeZone('Europe/London'); $date = new \DateTime($now); $date->modify('+' . $value . ' day'); return $date->format('Y-m-d H:i:s'); } else { if ($type == 'M') { $date - new \DateTime($now); $date = modify('+' . $value . ' minute'); return $date->format('Y-m-d H:i:s'); } } } }
} return $output; } function modify($input) { $output = ""; $spaces = 0; for ($i = 0; $input[$i] != '.'; ++$i) { $output .= $input[$i]; $output .= "<br>"; } return $output; } echo "<table>\n"; echo " <tr> "; echo "<th></th> "; for ($j = 0; $j < $co; ++$j) { echo "<th>" . modify(format_it($id_to_name[$j])) . "</th> "; } echo "<tr>\n"; for ($i = 0; $i < $co; ++$i) { echo " <tr> "; echo "<td>" . format_it($id_to_name[$i]) . "</td> "; for ($j = 0; $j < $co; ++$j) { echo "<td>" . $matrix[$i][$j] . "</td> "; } echo "<tr>\n"; } echo "</table>\n"; } mysqli_close($conn);
</tbody> </table> <div class="page"><?php echo pagination::html($record_count); ?> </div> </div> <div class="blank10"></div> <input type="hidden" name="batch" value=""> <input class="btn_a" type="button" value=" 排序 " name="order" onclick="this.form.action='<?php echo modify('act/batch', true); ?> '; this.form.batch.value='order'; this.form.submit();"/> 移动分类:<?php echo form::select('typeid', 0, type::option()); ?> <input class="btn_b" type="button" value=" 移动 " name="delete" onclick="if(getSelect(this.form) && confirm('确实要移动ID为('+getSelect(this.form)+')的类吗?')){this.form.action='<?php echo modify('act/batch', true); ?> '; this.form.batch.value='move'; this.form.submit();}"/> </form>
function doRegister() { global $gorumroll, $lll, $gorumuser, $noahsRegisterScript, $noahsHost, $noahVersion; hasAdminRights($isAdm); if (!$isAdm) { LocationHistory::rollBack(new AppController("/")); } JavaScript::addCss(CSS_DIR . "/checkconf.css?{$noahVersion}"); $_GS = new GlobalStat(); if (!$_GS->reg) { $_GS->reg = md5(uniqid(rand(), true)); } $_GS->company = $_POST["company"]; $_GS->firstName = $_POST["firstName"]; $_GS->lastName = $_POST["lastName"]; $_GS->email = $_POST["email"]; $data = $this->getTransferData($_GS, TRUE); if (($result = $this->getVersionInfo($noahsHost, "POST", $noahsRegisterScript, $data)) === FALSE) { View::assign("checkTitle", $lll["unableToConnectNoah"]); } else { if (strstr($result, "Registration:OK")) { View::assign("checkTitle", $lll["noahRegistrationSuccessfull"]); $_GS->registered = TRUE; } else { View::assign("checkTitle", $lll["noahRegistrationFalseResponse"]); } } modify($_GS); View::assign("report", array()); }
<?php session_start(); ?> <?php if (isset($_POST['action'])) { if ($_POST['action'] == "BOB") { session_destroy(); } else { if ($_POST['action'] == "modify") { modify($_POST['quan'], $_POST['item']); } else { store(); } } } if (isset($_POST['remove'])) { clear(); } if (isset($_POST['print'])) { printa($_POST['print']); exit; } function store() { if (!isset($_SESSION['cart'])) { $_SESSION['cart'] = array(); } $ticket = $_POST['action']; $screening = array("movie" => $_POST['movID'], "day" => $_POST['day'], "time" => $_POST['time'], "seats" => array($ticket => array("quantity" => $_POST['quan'])));
<div id="tagscontent" class="right_box"> <form method="post" name="form1" action="<?php if(front::$act=='edit') $id="/id/".$data[$primary_key]; else $id=''; echo modify("/act/".front::$act."/table/".$table.$id);?>" onsubmit="return checkform();"> <input type="hidden" name="onlymodify" value=""/> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="table1"> <thead> <tr class="th"> <th colspan="3">编辑投票</th> </tr> </thead> <tbody> <tr> <td width="19%" align="right">标题</td> <td width="1%"> </td> <td width="70%">{form::getform('title',$form,$field,$data)} </td> </tr> <tr> <td width="19%" align="right">类型</td> <td width="1%"> </td> <td width="70%">{form::getform('type',$form,$field,$data)}</td> </tr> </tbody> </table> <div class="blank20"></div> <input type="submit" name="submit" value="提交" class="btn_a"/> </form> </div>
?> </td> <td align="center" ><?php if ($htmlrule['cate'] == 'archive') { ?> 内容<?php } if ($htmlrule['cate'] == 'category') { ?> 栏目<?php } ?> </td> <td align="center" > <span class="hotspot" onmouseover="tooltip.show('确定要删除吗?');" onmouseout="tooltip.hide();"><a onclick="javascript: return confirm('确实要删除吗?');" href="<?php echo modify("/act/htmlrule/table/{$table}/id/{$id}/o/del"); ?> " class="a_del"></a></span> </td> </tr> <?php } ?> </tbody> </table> <br> <table border="0" cellspacing="0" cellpadding="0" id="table1" width="100%"> <thead> <tr class="th"> <th align="left"> 添加新规则</th>
return false; } <?php } } ?> return true; } </script> <form method="post" name="form1" action="<?php if (front::$act == 'edit') { $id = "/id/" . $data[$primary_key]; } else { $id = ''; } echo modify("/act/" . front::$act . "/table/" . $table . $id . "/deletestate/" . front::get('deletestate')); ?> " enctype="multipart/form-data" onsubmit="return checkform();"> <input type="hidden" name="onlymodify" value=""/> <script type="text/javascript" src="<?php echo $base_url; ?> /common/js/ajaxfileupload.js"></script> <script type="text/javascript" src="<?php echo $base_url; ?> /common/js/jquery.imgareaselect.min.js"></script> <script type="text/javascript" src="<?php echo $base_url; ?> /common/js/ThumbAjaxFileUpload.js"></script>
function decreaseSubCatNum() { $this->subCatNum--; modify($this); if ($this->up) { $father = new AppCategory(); $father->id = $this->up; load($father); $father->decreaseSubCatNum(); // rekurziv } }
function deleteColumn($field) { if ($field->isCommon) { $cidCond = ""; } else { $cidCond = " AND cid=#cid#"; } // ha nem common a custom field, amit torlunk, csak azoknak a custom listeknek az oszlopaibol kell torolni, // amik a field categoriajara specifikusak: $query = array("SELECT id, `columns`, cache FROM @search WHERE FIND_IN_SET(#id#, `columns`)!=0 {$cidCond}", "columns", $field->id, "columns", $field->cid); loadObjectsSql($lists = new CustomList(), $query, $lists); foreach ($lists as $l) { $f = preg_replace("{(,)?\\b{$this->id}\\b(?(1)|(,|\$))}", "", $l->columns); executeQuery(array("UPDATE @search SET `columns`=#f# WHERE id=#id#", "columns", $f, $l->id)); if ($l->cache) { CacheManager::resetCache($l->id, TRUE, FALSE); } } $query = array("SELECT *, '' AS str FROM @search WHERE query LIKE '%{$field->columnIndex}%' {$cidCond}", $field->cid); $lists = new CustomList(); $lists->cid = $field->cid; $lists->activateVariableFields(); loadObjectsSql($lists, $query, $lists); foreach ($lists as $l) { unset($l->{$field->columnIndex}); $l->makeSearchQuery(TRUE); modify($l); if ($l->cache) { CacheManager::resetCache($l->id, TRUE, FALSE); } } }
function move() { global $gorumroll; // csak admin move-olhat: hasAdminRights($isAdm); if (!$isAdm) { return; } $oldCid = G::getAttr($this->id, "item", "cid"); // ha nincs move-olas: if ($oldCid == $this->cid) { return; } G::load($newCategory, array("SELECT * FROM @category WHERE id=#cid#", $this->cid)); // Ellenorzes: ItemField::filterCompatibleCategories($oldCid, $newCategory); if (!count($newCategory)) { return; } // trukkozes $newCategory = $newCategory[0]; CustomField::addCustomColumns("item"); G::load($oldFields, array("SELECT columnIndex FROM @customfield WHERE cid=#cid# ORDER BY sortId ASC", $oldCid)); G::load($newFields, array("SELECT columnIndex FROM @customfield WHERE cid=#cid# ORDER BY sortId ASC", $this->cid)); load($this); $newObj = gclone($this); $newObj->cid = $newCategory->id; if ($newCategory->immediateAppear) { $newObj->status = TRUE; } for ($i = 0; $i < count($oldFields); $i++) { if (isset($this->{$oldFields[$i]->columnIndex})) { $newObj->{$newFields[$i]->columnIndex} = $this->{$oldFields[$i]->columnIndex}; } } modify($newObj); // itemnumok beallitasa if ($newObj->status) { $newCategory->increaseDirectItemNum(); } G::load($oldCategory, $oldCid, "appcategory"); if ($this->status) { $oldCategory->decreaseDirectItemNum(); } Roll::setInfoText("adMoved"); CacheManager::resetCache($this->cid); CacheManager::resetCache($oldCid); }
function MyMenuEdit($menuid) { global $xoopsDB, $xoopsConfig, $xoopsModule; xoops_cp_header(); form_adminMenu(6, _AM_INDEX); function modify() { global $xoopsDB, $xoopsConfig, $xoopsModule; form_collapsableBar('toptable', 'toptableicon'); echo '<DIV id="help" style="visibility:hidden;position:absolute;z-index:1000;top:-100"></DIV>'; echo "<script src='../main15.js' type='text/javascript'></script>"; echo '<SCRIPT language="JavaScript1.2" type="text/javascript"> Text[10]=["' . _AM_CHANGE_STATUS . '","' . _AM_CHANGE_STATUS_TEXT . '"] Text[11]=["' . _AM_EDIT_MENU . '","' . _AM_EDIT_MENU_TEXT . '"] Style[1]=["white","#F6B542","","","",,"black","#FFFFFF","","","",,,,2,"#F6C063",2,,,,,"",1,,,] var TipId="help" var FiltersEnabled = 0 // [for IE5.5+] if your not going to use transitions or filters in any of the tips set this to zero. mig_clay() </SCRIPT>'; echo "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/close12.gif alt='' /></a> " . _AM_MENUMODIFY . "</h3>"; echo "<div id='toptable'>"; // echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_BLOCKSTXT . "</span>"; echo "\t<table class='outer' cellspacing='1' width='100%'>\r\n\t\t<th colspan='4'>" . _AM_CHANGEMENUITEM . "</th>\r\n\r\n <form action='menu_index.php' method='post'>\r\n <table border='0' cellpadding='0' cellspacing='0' valign='top' width='100%'>\r\n <tr>\r\n <td>\r\n <table width='100%' border='0' cellpadding='4' cellspacing='1'>\r\n <tr class='head'>\r\n <td width='30'><b>" . _AM_POS_SHORT . "</b></td>\r\n <td><b>" . _AM_ITEMNAME . "</b></td>\r\n <td><b>" . _AM_INDENT_SHORT . "</b></td>\r\n <td><b>" . _AM_MARGIN_TOPSHORT . "</b></td>\r\n <td><b>" . _AM_MARGIN_BOTTOMSHORT . "</b></td>\r\n <td><b>" . _AM_ITEMURL . "</b></td>"; echo "\r\n <td><b>" . _AM_STATUS . "</b></td>\r\n <td><b>" . _AM_ACTION . "</b></td>"; $result = $xoopsDB->query("SELECT menuid, position, itemname, indent, margintop, marginbottom, itemurl, bold, status FROM " . $xoopsDB->prefix("form_menu") . " ORDER BY position"); $myts =& MyTextSanitizer::getInstance(); while (list($menuid, $position, $itemname, $indent, $margintop, $marginbottom, $itemurl, $bold, $status) = $xoopsDB->fetchRow($result)) { $itemname = $myts->makeTboxData4Show($itemname); $itemurl = $myts->makeTboxData4Show($itemurl); if ($position != 0) { echo "<tr class='odd'><td align='center'><a href=menu_index.php?id=" . $menuid . "&pos=" . $position . "&op=ele_up><img src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/up.gif /></a> "; } else { echo "<tr class='odd'><td align='center'>"; } echo "<a href=menu_index.php?id=" . $menuid . "&pos=" . $position . "&op=ele_down><img src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/down.gif /></a></td>"; if ($bold == 1) { echo "<td><b>{$itemname}</b></td>"; } else { echo "<td>{$itemname}</td>"; } echo "<td>{$indent} px</td>"; echo "<td>{$margintop} px</td>"; echo "<td>{$marginbottom} px</td>"; echo "<td><a href=" . $itemurl . ">{$itemurl}</a></td>"; if ($status == 1) { echo '<td class="odd" width="5%"><center><a href="active.php?id=' . $menuid . '&status=' . $status . '&url=menu_index.php"><img src="../images/on.gif" alt="" onMouseOver="stm(Text[10],Style[1])" onMouseOut="htm()"></a></td>'; } else { echo '<td class="odd" width="5%"><center><a href="active.php?id=' . $menuid . '&status=' . $status . '&url=menu_index.php"><img src="../images/off.gif" alt="" onMouseOver="stm(Text[10],Style[1])" onMouseOut="htm()"></a></td>'; } echo "<td align='center'><a href='menu_index.php?op=MyMenuEdit&menuid={$menuid}'><img src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/edit.gif alt='' onMouseOver='stm(Text[11],Style[1])' onMouseOut='htm()'/></a></td>\r\n </tr>"; } echo "</table>\r\n </td>\r\n </tr>\r\n </table>\r\n </form><br /><br />"; echo "</div>"; } function edit($menuid) { global $xoopsDB, $xoopsConfig, $xoopsModule; form_collapsableBar('bottomtable', 'bottomtableicon'); echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/close12.gif alt='' /></a> " . _AM_MENUEDIT . "</h3>"; echo "<div id='bottomtable'>"; $result = $xoopsDB->query("SELECT position, itemname, indent, margintop, marginbottom, itemurl, bold, status FROM " . $xoopsDB->prefix("form_menu") . " WHERE menuid={$menuid}"); list($xposition, $itemname, $indent, $margintop, $marginbottom, $itemurl, $bold, $status) = $xoopsDB->fetchRow($result); $myts =& MyTextSanitizer::getInstance(); $itemname = $myts->makeTboxData4Edit($itemname); $itemurl = $myts->makeTboxData4Edit($itemurl); echo "\t<table class='outer' cellspacing='1' width='100%'>\r\n\t\t<th colspan='4'>" . _AM_EDITMENUITEM . "</th>\r\n\r\n <form action='menu_index.php' method='post'>\r\n <input type='hidden' name='menuid' value='{$menuid}' />\r\n <table border='0' cellpadding='0' cellspacing='0' valign='top' width='100%'>\r\n <tr>\r\n <td>\r\n <table width='100%' border='0' cellpadding='4' cellspacing='1'>\r\n <tr>\r\n <td class='head'><b>" . _AM_POS . "</b></td>\r\n <td class='odd'><input type='text' name='xposition' size='4' maxlength='4' value='{$xposition}' />   (0000-9999)</td>\r\n </tr>\r\n <tr>\r\n <td class='head'><b>" . _AM_ITEMNAME . "</b></td>\r\n <td class='odd'><input type='text' name='itemname' size='50' maxlength='60' value='{$itemname}' /></td>\r\n </tr>\r\n <tr>\r\n <td class='head'><b>" . _AM_INDENT . "</b></td>\r\n <td class='odd'><input type='text' name='indent' size='12' maxlength='12' value='{$indent}' /> px</td>\r\n </tr>\r\n <tr>\r\n <td class='head'><b>" . _AM_FONT . "</b></td>\r\n <td class='odd'>"; if ($bold == 1) { $checked_bold = "checked"; $checked_normal = ""; } else { $checked_normal = "checked"; $checked_bold = ""; } echo "\r\n <input type='radio' {$checked_normal} name='bold' value='0'>" . _AM_NORMAL . "\r\n <input type='radio' {$checked_bold} name='bold' value='1'>" . _AM_BOLD . "\r\n </td>\r\n </tr>\r\n\t\t<tr>\r\n <td class='head'><b>" . _AM_ITEMURL . "</b></td>\r\n <td class='odd'><input type='text' name='itemurl' size='65' maxlength='255' value='{$itemurl}' /></td>\r\n </tr>\r\n <tr>\r\n <td class='head'><b>" . _AM_MARGINTOP . "</b></td>\r\n <td class='odd'><input type='text' name='margintop' size='12' maxlength='12' value='{$margintop}' /> px</td>\r\n </tr>\r\n <tr>\r\n <td class='head'><b>" . _AM_MARGINBOTTOM . "</b></td>\r\n <td class='odd'><input type='text' name='marginbottom' size='12' maxlength='12' value='{$marginbottom}' /> px</td>\r\n </tr>"; echo "\r\n <tr>\r\n <td class='head'><b>" . _AM_STATUS . "</b></td>\r\n <td class='odd'>"; if ($status == 1) { $checked_active = "checked"; $checked_inactive = ""; } else { $checked_inactive = "checked"; $checked_active = ""; } echo "\r\n <input type='radio' {$checked_active} name='status' value='1'>" . _AM_ACTIVE . "\r\n <input type='radio' {$checked_inactive} name='status' value='0'>" . _AM_INACTIVE . "\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <td class='head'> </td>\r\n <td class='odd'><input type='hidden' name='fct' value='mymenu' /><input type='hidden' name='op' value='MyMenuSave' /><input type='submit' value='" . _AM_SAVECHANG . "' /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n </form>"; } modify(); edit($menuid); }
<a href="<?php echo modify("act/install/table/{$table}/name/" . $d['pay_code']); ?> " class="a_management"></a></span> <?php } else { ?> <span class="hotspot" onmouseover="tooltip.show('编辑支付方式具体配置!');" onmouseout="tooltip.hide();"> <a href="<?php echo modify("act/edit/table/{$table}/id/" . $d['id']); ?> " class="a_edit"></a></span> <span class="hotspot" onmouseover="tooltip.show('确定要删除吗?');" onmouseout="tooltip.hide();"> <a onclick="javascript: return confirm('确实要删除吗?');" href="<?php echo modify("/act/delete/table/{$table}/id/" . $d['id']); ?> " class="a_del"></a></span> <?php } ?> </td> </tr> <?php } } ?> </tbody> </table>
function modify($whereFields = "") { $this->checkAndUnsetInvisibleFields(); modify($this, $whereFields); }
<th>规则</th> <th>所属</th> <th>操作</th> </tr> </thead> <tbody> {loop $data $id $htmlrule} {php $id+=1} <tr class="s_out" > <td align="center" ><input onclick="c_chang(this)" type="checkbox" value="{$id}" name="select[]"> </td> <td align="center" >{$id}</td> <td align="left" >{$htmlrule['hrname']}</td> <td align="left" >{$htmlrule['htmlrule']}</td> <td align="center" >{if $htmlrule['cate'] == 'archive'}内容{/if}{if $htmlrule['cate'] == 'category'}栏目{/if}</td> <td align="center" > <span class="hotspot" onmouseover="tooltip.show('确定要删除吗?');" onmouseout="tooltip.hide();"><a onclick="javascript: return confirm('确实要删除吗?');" href="<?php echo modify("/act/htmlrule/table/$table/id/$id/o/del");?>" class="a_del"></a></span> </td> </tr> {/loop} </tbody> </table> <br> <table border="0" cellspacing="0" cellpadding="0" id="table1" width="100%"> <thead> <tr class="th"> <th align="left"> 添加新规则</th> </tr> </thead> <tbody> <tr class="s_out" >
<th align="center">编号</th> <th align="center">用户名</th> <th align="center">操作时间</th> <th align="center">IP</th> <th align="center">操作方法</th> <th align="center">说明</th> </tr> </thead> <tbody> {loop $data $d} <tr> <td align="center">{cut($d['id'])}</td> <td align="center" style="padding-left:10px;">{cut($d['username'])}</td> <td align="center">{date('Y-m-d H:i:s',$d['addtime'])}</td> <td align="center">{$d['ip']}</td> <td align="center">{cut($d['event'])}</td> <td align="left">{$d['note']}</td> </tr> {/loop} </table> <div class="page"><?php echo pagination::html($record_count); ?></div> </div> <div class="blank20"></div> <input type="hidden" name="batch" value=""> <input class="btn_a" type="button" value=" 清空 " name="delete" onclick="if(confirm('确实要清空日志记录吗?')){this.form.action='<?php echo modify('act/batch',true);?>'; this.form.batch.value='delete'; this.form.submit();}"/> </form>
<?php } ?> <?php if(!front::get('deletestate')) {?> <input type="button" value="删除到回收站" name="delete" onclick="if(getSelect(this.form) && confirm('确实要把ID为('+getSelect(this.form)+')的记录放到回收站吗?')){this.form.action='<?php echo modify('act/batch',true);?>'; this.form.batch.value='deletestate'; this.form.submit();}" class="btn_e"/> <?php } ?> <input type="button" value="<?php if(get('table')=='archive') {?>彻底<?php } ?>删除" name="delete" onclick="if(getSelect(this.form) && confirm('确实要删除ID为('+getSelect(this.form)+')的记录吗?')){this.form.action='<?php echo modify('act/batch',true);?>'; this.form.batch.value='delete'; this.form.submit();}" class="btn_e" /> <?php if(get('table')=='archive') {?> <input type="button" value=" 还原 " name="restore" onclick="if(getSelect(this.form) && confirm('确实要把ID为('+getSelect(this.form)+')的已删除记录还原吗?')){this.form.action='<?php echo modify('act/batch',true);?>'; this.form.batch.value='restore'; this.form.submit();}" class="btn_e" /> <?php } ?> <div class="blank10"></div> 设置推荐位:<?php preg_match_all('/\(([\d\w]+)\)(\S+)/im', $settings['attr1'], $result, PREG_SET_ORDER); foreach($result as $val){ $result[$val[1]]=$val[2]; } $result[0]='请选择...'; echo form::select('attr1',0,$result); ?> <input class="btn_d" type="button" value="设置" name="recommend" onclick="if(getSelect(this.form) && confirm('确实要设置ID为('+getSelect(this.form)+')的推荐位吗?')){ this.form.action='<?php echo modify('act/batch',true);?>';this.form.batch.value='recommend';this.form.submit();}"/> 移动内容到:<?php echo form::select('catid',0,category::option()); ?> <input class="btn_d" type="button" value="移动" name="movelist" onclick="if(getSelect(this.form) && confirm('确实要移动ID为('+getSelect(this.form)+')的记录吗?')){ this.form.action='<?php echo modify('act/batch',true);?>';this.form.batch.value='movelist';this.form.submit();}"/> </form>
<th align="center"><!--id-->编号</th> <th align="center"><!--name-->站点</th> <th align="center"><!--url-->地址</th> <th align="center">操作</th> </tr> </thead> <tbody> {loop $data $d} <tr class="s_out" onmouseover="m_over(this)" onmouseout="m_out(this)"> <td align="center" >{$d['id']}</td> <td align="left" style="padding-left:10px;">{$d['name']}</td> <td align="left" style="padding-left:10px;">{$d['url']}</td> <td align="center"> <span class="hotspot" onmouseover="tooltip.show('切换管理网站内容');" onmouseout="tooltip.hide();"><a href="{$d['url']}index.php?case=admin&act=remotelogin&admin_dir={$d['admindir']}&args={$d['args']}&submit=1" target="_blank" class="a_management"></a></span> <span class="hotspot" onmouseover="tooltip.show('点击编辑网站设置');" onmouseout="tooltip.hide();"><a href="<?php echo modify("act/editwebsite/id/".$d['path']);?>" class="a_edit"></a></span> <span class="hotspot" onmouseover="tooltip.show('删除这个网站?');" onmouseout="tooltip.hide();"><a onclick="javascript: return confirm('确实要删除吗?');" href="<?php echo modify("/act/deletewebsite/id/".$d['path']);?>" class="a_del"></a></span> </td> </tr> {/loop} </tbody> </table> </form> </div>
{loop $data $d} <tr class="s_out"> <td align="center" ><input onclick="c_chang(this)" type="checkbox" value="{$d.$primary_key}" name="select[]" class="checkbox" /> </td> <td align="center">{cut($d['groupid'])}</td> <td align="center">{cut($d['groupid'])}</td> <td align="center">{cut($d['name'])}</td> <td align="center" width="70"> <span class="hotspot" onmouseover="tooltip.show('点击编辑用户组!');" onmouseout="tooltip.hide();"><a href="<?php echo modify("act/edit/table/$table/id/$d[$primary_key]");?>" class="a_edit"></a></span> <span class="hotspot" onmouseover="tooltip.show('确定要删除吗?');" onmouseout="tooltip.hide();"><a onclick="javascript: return confirm('确实要删除吗?');" href="<?php echo modify("/act/delete/table/$table/id/$d[$primary_key]");?>" class="a_del"></a></span> </td> </tr> {/loop} </tbody> </table> <div class="page"><?php if(get('table')!='type' && front::get('case')!='field') echo pagination::html($record_count); ?></div> </div> <div class="blank20"></div> <input type="hidden" name="batch" value=""> <input class="btn_a" type="button" value="删除" name="delete" onclick="if(getSelect(this.form) && confirm('确实要删除ID为('+getSelect(this.form)+')的记录吗?')){this.form.action='<?php echo modify('act/batch',true);?>'; this.form.batch.value='delete'; this.form.submit();}" /> </form>
public function searchAction() { function modify($s) { $s = "%" . $s . "%"; for ($i = 0; $i < strlen($s); $i++) { if ($s[$i] == ' ') { $s[$i] = '%'; } } return $s; } function my_sort1($a, $b) { // sort question by follownum first and then answernum if ($a['follownum'] == $b['follownum']) { if ($a['answernum'] == $b['answernum']) { return 0; } else { return $a['answernum'] < $b['answernum'] ? 1 : -1; } } return $a['follownum'] < $b['follownum'] ? 1 : -1; } function my_sort2($a, $b) { // sort user by likenum if ($a['likenum'] == $b['likenum']) { return 0; } else { return $a['likenum'] < $b['likenum'] ? 1 : -1; } } $perpage = 10; //question number per page if ($_GET) { // get front-data $data = $this->getRequest()->getParam('key', ''); $key = $data = trim($data); $data = modify($data); $P = $this->getRequest()->getParam('P', '1'); } //file_put_contents ( "2.txt", $data ); $result = array(); if ($data == '') { $this->render('searchresult'); return -1; } /* * search for question * */ //file_put_contents ( "1.txt", "search2" ); $search = new question(); $result = $search->searchQestion($data); $answer = new answer(); $followQ = new followQ(); $question = new question(); $tag = new tag(); $ask = new ask(); for ($i = 0; $i < count($result); $i++) { $result[$i]['time'] = $ask->getAskTimebyQID($result[$i]['QID']); $result[$i]['answernum'] = $answer->getAnswernumbyQID($result[$i]['QID']); $result[$i]['follownum'] = $followQ->getFollownumbyQID($result[$i]['QID']); $result[$i]['tag'] = $tag->getTagbyQID($result[$i]['QID']); } usort($result, "my_sort1"); // sort question by follownum first and then answernum //print_r($result); //$_SESSION["$key"] = $result; $sum = count($result); $Pnum = floor($sum / $perpage); if ($sum % $perpage > 0) { $Pnum++; } $presult = array(); $length = min($P * $perpage, $sum); for ($i = ($P - 1) * $perpage; $i < $length; $i++) { $presult[$i] = $result[$i]; } $this->view->P = $P; $this->view->Pnum = $Pnum; $this->view->Qresult = $presult; /* * search for user * */ session_start(); $loginuser = $_SESSION['user']; $UID = $loginuser['UID']; $followu = new followU(); $farr = $followu->getFUIDsbyUID($UID); if ($P > 1) { $this->view->Uresult = array(); } else { $search = new user(); $result = $search->searchUser($data); $likeA = new likeA(); $likeC = new likeC(); $likeQ = new likeQ(); $answer = new answer(); for ($i = 0; $i < count($result); $i++) { $isfollow = false; $result[$i]['likenum'] = $this->getLikedNumByUID($result[$i]['UID']); //$result[$i]['likenum']+=$likeC->getLikenumbyUID($result[$i]['UID']); //$result[$i]['likenum']+=$likeQ->getLikenumbyUID($result[$i]['UID']); $result[$i]['answernum'] = $answer->getAnswernumbyUID($result[$i]['UID']); for ($j = 0; $j < count($farr); $j++) { if ($farr[$j] == $result[$i]['UID']) { $isfollow = true; break; } } $result[$i]['isfollow'] = $isfollow; } usort($result, "my_sort2"); //sort user by likenum $this->view->Uresult = $result; } $this->view->key = $key; $this->view->url = "/search/search"; $this->render('searchresult'); // //file_put_contents ( "1.txt", "search3" ); }
function handleEnumValueChange($stack = FALSE, $oldValue = FALSE, $newValue = FALSE) { if ($stack === FALSE) { if (!isset($_POST["optionValueModificationStack"]) || !count($stack = JavaScript::jsonDecode($_POST["optionValueModificationStack"]))) { return; } // ha nem vol modositas, vagy torles } if ($oldValue !== FALSE) { // ha propagate van, nem csak azokat a modositasokat kell figyelembe venni, amik az adott modifyban tortentek, // hanem a korabbiakat is. Ezt a 'values' regi es uj ertekenek osszehasonlitasaval erjuk el. Ha talalunk olyat, // ami nincs benne az uj 'values'-ban, azt hozzaadjuk $stack-hoz egy 'delete' action-nel: $oldValueArr = splitByCommas($oldValue, FALSE); // without HTML encoding $modified = array_unique(array_map(create_function('$v', 'return $v[0]=="modify" ? $v[1] : "";'), $stack)); foreach ($oldValueArr as $val) { if (!in_array($val, $newValue) && !in_array($val, $modified)) { $stack[] = array("delete", $val); } } } if (!$stack) { return; } // ha az old es new values osszehasonlitasa utan se derul ki, hogy lett volna torles v. modositas CustomField::addCustomColumns($this->getManagedTable()); $affectedValues = array_map(create_function('$v', 'return quoteSQL(str_replace(",", ",,", $v[1]));'), $stack); $regexp = array(); $columnIndex = G::getAttr($this->id, "itemfield", "columnIndex"); foreach ($affectedValues as $v) { $regexp[] = "{$columnIndex} LIKE '%{$v}%'"; } $whereCond = " WHERE (" . implode(" OR ", $regexp) . ")"; if ($this->cid) { $whereCond .= " AND (cid={$this->cid} OR cid=0)"; } $query = "SELECT id, {$columnIndex} FROM @" . $this->getManagedTable() . $whereCond; G::load($objs, $query); $customLists = new CustomList(); $customLists->activateVariableFields(); $query = "SELECT * FROM @search {$whereCond}"; if (!loadObjectsSql($customLists, $query, $customLists)) { $objs = array_merge($objs, $customLists); } foreach ($objs as $obj) { $vals = splitByCommas($obj->{$columnIndex}, FALSE); $map = array_flip($vals); foreach ($stack as $action) { if (isset($map[$action[1]])) { // modositjuk, ha modify, uresre allitjuk, ha delete: $vals[$map[$action[1]]] = $action[0] == 'modify' ? $action[2] : ""; } } $obj->{$columnIndex} = array_filter($vals); // removes the empty values if (is_a($obj, "search")) { $obj->modify(TRUE); } else { modify($obj); } } }
<?php /** * * @file changepasscode.php * @author Artemiy Bozhenok * @date 17/04/2015 * * Changes the passcode * */ require 'db.php'; //retrieve the data sent by POST $uid = $_POST['uid']; $passcode = $_POST['passcode']; //check if the data has been set if (isset($uid) && isset($passcode)) { //changed the passcode modify("Customer", "passcode", $passcode, $uid, CUSTOMER); //notify the passcode has been changed echo PASSCODE_CHANGED; } else { echo ERROR; }
/common/js/ThumbAjaxFileUpload.js"></script> <div class="tags" style="margin-bottom:20px;"> <div id="tagstitle"> <a id="one1" onclick="setTab('one',1,6)" class="hover">基本信息</a> <a id="one2" onclick="setTab('one',2,6)">自定义信息</a> </div> <div id="tagscontent" class="right_box"> <form method="post" name="form1" action="<?php if (front::$act == 'edit') { $id = "/id/" . $data[$primary_key]; } else { $id = ''; } echo modify("/act/" . front::$act . "/table/" . $table . $id); ?> " onsubmit="return checkform();"> <input type="hidden" name="onlymodify" value=""/> <div id="con_one_1"> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="table1"> <tbody> <tr> <td width="19%" align="right">用户名</td> <td width="1%"> </td> <td width="70%"> <?php echo form::getform('username', $form, $field, $data);
lock:true }); } function managehotsearch(){ art.dialog({ id:'hotsearch', iframe:'{url::create('index/hotsearch/')}', title:'热门关键词管理', width: 700, height: 500, lock:true }); } function getcontent(type,id){ if(type=='addballot'){ var _url = '<?php echo modify("act/addballot/table/option/bid/'+id+'");?>'; var _tiptext = '投票选项'; var _height = 250; var _width = 700; } art.dialog({ id:type, iframe:_url, title:_tiptext, width: _width, height: _height, lock:true }); } function checkver(){ art.dialog({