Пример #1
0
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $app_strings;
    global $app_list_strings;
    global $mod_strings;
    global $currentModule;
    global $current_user;
    global $timedate;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $form = new XTemplate('modules/Campaigns/Forms.html');
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('MOD', $mod_strings);
    $form->assign('APP', $app_strings);
    $form->assign('THEME', SugarThemeRegistry::current()->__toString());
    $form->assign("JAVASCRIPT", get_set_focus_js() . get_validate_record_js());
    $form->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['campaign_status_dom'], "Planning"));
    $form->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['campaign_type_dom'], ""));
    $form->assign("USER_ID", $current_user->id);
    $form->assign("TEAM_ID", sprintf('<input type="hidden" name="team_id" value="%s">', $current_user->default_team));
    $form->assign("CALENDAR_LANG", "en");
    $form->assign("USER_DATEFORMAT", '(' . $timedate->get_user_date_format() . ')');
    $form->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
    $form->parse('main');
    $the_form .= $form->text('main');
    $focus = BeanFactory::getBean('Campaigns');
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
    function getFormBody($prefix, $mod = '', $formname = '', $size = '30', $script = true)
    {
        if (!ACLController::checkAccess('Notes', 'edit', true)) {
            return '';
        }
        global $mod_strings;
        $temp_strings = $mod_strings;
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        }
        global $app_strings;
        global $app_list_strings;
        $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
        $lbl_note_subject = $mod_strings['LBL_NOTE_SUBJECT'];
        $lbl_note_description = $mod_strings['LBL_NOTE'];
        $default_parent_type = $app_list_strings['record_type_default_key'];
        $form = <<<EOF
\t\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t\t<input type="hidden" name="{$prefix}parent_type" value="{$default_parent_type}">
<p>\t\t\t\t<table cellspacing="0" cellpadding="0" border="0">
\t\t\t\t<tr>
\t\t\t\t    <td class="dataLabel">{$lbl_note_subject} <span class="required">{$lbl_required_symbol}</span></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td class="dataField"><input name='{$prefix}name' size='{$size}' maxlength='255' type="text" value=""></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td class="dataLabel">{$lbl_note_description}</td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td class="dataField"><textarea name='{$prefix}description' cols='{$size}' rows='4' ></textarea></td>
\t\t\t\t</tr>
\t\t\t\t</table></p>


EOF;
        if ($script) {
            require_once 'include/javascript/javascript.php';
            require_once 'modules/Notes/Note.php';
            $javascript = new javascript();
            $javascript->setFormName($formname);
            $javascript->setSugarBean(new Note());
            $javascript->addRequiredFields($prefix);
            $form .= $javascript->getScript();
        }
        $mod_strings = $temp_strings;
        return $form;
    }
Пример #3
0
 function doSave()
 {
     $uid = (int) $_POST['uid'];
     $info = array();
     if ($_POST['pwd'] || $_POST['pwd1'] || $_POST['pwd2']) {
         $pwd = md5(trim($_POST['pwd']));
         $pwd1 = md5(trim($_POST['pwd1']));
         $pwd2 = md5(trim($_POST['pwd2']));
         if (!$_POST['pwd'] || !$_POST['pwd1'] || !$_POST['pwd2']) {
             javascript::alert("修改密码.原密码,新密码,确认密码不能为空");
         }
         $pwd != $user['password'] && javascript::alert("原密码错误!");
         $pwd1 != $pwd2 && javascript::alert("新密码与确认密码不一致!");
         iCMS_DB::query("UPDATE `#iCMS@__members` SET `password` = '{$pwd2}' WHERE `uid` ='{$uid}' LIMIT 1");
     }
     //	    $username=dhtmlspecialchars($_POST['name']);
     $_POST['email'] && !eregi("^([_\\.0-9a-z-]+)@([0-9a-z][0-9a-z-]+)\\.([a-z]{2,6})\$", $_POST['email']) && javascript::alert("E-mail格式错误!!");
     $email = stripslashes($_POST['email']);
     $gender = intval($_POST['gender']);
     $info['nickname'] = dhtmlspecialchars(stripslashes($_POST['nickname']));
     cstrlen($info['nickname']) > 12 && javascript::alert("昵称长度大于12");
     $info['icq'] = intval($_POST['icq']);
     $info['home'] = dhtmlspecialchars(stripslashes($_POST['home']));
     $info['year'] = intval($_POST['year']);
     $info['month'] = intval($_POST['month']);
     $info['day'] = intval($_POST['day']);
     $info['from'] = dhtmlspecialchars(stripslashes($_POST['from']));
     $info['signature'] = dhtmlspecialchars(stripslashes($_POST['signature']));
     $user['info'] = $info;
     iCMS_DB::query("UPDATE `#iCMS@__members` SET `info` = '" . addslashes(serialize($user['info'])) . "',`email`='{$email}',`gender`='{$gender}' WHERE `uid` ='{$uid}' LIMIT 1");
     javascript::dialog('用户编辑完成!', 'url:' . __SELF__ . '?mo=user&do=manage');
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct();
     javascript::add('editarea/edit_area_full.js');
     javascript::add('featurecode.js');
     stylesheet::add('featurecode.css');
 }
Пример #5
0
 public function index()
 {
     stylesheet::add('esl', 50);
     javascript::add('pubsub.js', 50);
     //CLEAR THE ESL SESSION
     $_SESSION['esl'] = array();
 }
Пример #6
0
 public function index()
 {
     $this->view->filetree = filetree::php_file_tree(Kohana::config('freeswitch.cfg_root'), "javascript:FileManager.load('[link]');", array('xml', 'conf', 'tpl'));
     javascript::add('php_file_tree_jquery.js');
     stylesheet::add('php_file_tree.css');
     javascript::add('editarea/edit_area_full.js');
 }
Пример #7
0
 public function addData($dataAX, $valueAX = null)
 {
     if (is_null(self::$mainJavaScriptCodeCStr)) {
         self::$mainJavaScriptCodeCStr = "";
     }
     if (is_null(self::$mainHtmlCodeCStr)) {
         self::$mainHtmlCodeCStr = "";
     }
     if (is_null($this->dataCArr)) {
         $this->dataCArr = array();
     }
     if (is_string($dataAX) && !is_null($valueAX)) {
         $pointerLPtr =& $this->dataCArr;
         $dataAX = explode('.', $dataAX);
         //$dataAX = array_reverse ( $dataAX );
         foreach ($dataAX as $dataKeyLUInt => $dataValueLStr) {
             if ($dataKeyLUInt == 0 && count($dataAX) == 1) {
                 $pointerLPtr[$dataAX[$dataKeyLUInt]] = $valueAX;
             } else {
                 if (count($dataAX) - 1 == $dataKeyLUInt) {
                     $pointerLPtr[$dataAX[$dataKeyLUInt]] = $valueAX;
                 } else {
                     if (!isset($pointerLPtr[$dataAX[$dataKeyLUInt]])) {
                         $pointerLPtr[$dataAX[$dataKeyLUInt]] = array();
                     }
                     $pointerLPtr =& $pointerLPtr[$dataAX[$dataKeyLUInt]];
                 }
             }
         }
     } else {
         if (is_array($dataAX) && is_null($valueAX)) {
             $this->dataCArr = array_merge_recursive($this->dataCArr, $dataAX);
         }
     }
 }
Пример #8
0
 function doSave()
 {
     $id = (int) $_POST['id'];
     $name = dhtmlspecialchars($_POST['name']);
     $table = dhtmlspecialchars($_POST['table']);
     $description = dhtmlspecialchars($_POST['desc']);
     $position2 = $_POST['pos'];
     $position = $_POST['position'];
     $binding = isset($_POST['binding']) ? 1 : 0;
     empty($name) && javascript::alert('模块名称不能为空!');
     empty($table) && $binding && javascript::alert('模块名不能为空!');
     if (!$binding && empty($id)) {
         if (empty($table)) {
             include iPATH . 'include/cn.class.php';
             $table = CN::pinyin($name);
         }
         $table = $table . '_content';
     }
     if ($id) {
         iCMS_DB::getValue("SELECT `id` FROM `#iCMS@__model` where `table` = '{$table}' and `id`!='{$id}'") && javascript::alert('该模块已经存在!请检查是否重复');
         iCMS_DB::query("UPDATE `#iCMS@__model` SET `name` = '{$name}', `table` = '{$table}', `binding` = '{$binding}', `description` = '{$description}', `position` = '{$position}', `position2` = '{$position2}' WHERE `id` = '{$id}';");
     } else {
         iCMS_DB::query("INSERT INTO `#iCMS@__model`(`name`, `table`, `binding`, `description`, `position`,`position2`, `addtime`)VALUES ('{$name}', '{$table}', '{$binding}', '{$description}', '{$position}','{$position2}', '" . time() . "');");
         $id = iCMS_DB::$insert_id;
     }
     model::cache();
     $moreaction = array(array("text" => "下一步添加字段", "url" => __SELF__ . "?mo=models&do=addfield&id=<?php echo {$id};?>"), array("text" => "返回模块列表", "url" => __SELF__ . "?mo=models&do=manage"));
     javascript::dialog('模块添加完成!<br />10秒后返回模块列表', "url:" . __SELF__ . "?mo=models&do=manage", $moreaction, 10);
 }
Пример #9
0
    public function __construct()
    {
        parent::__construct();

        stylesheet::add('autoattendant', 50);

        javascript::add('mustache');
    }
Пример #10
0
 function doStatus()
 {
     $id = intval($_GET['id']);
     $act = intval($_GET['act']);
     iCMS_DB::query("UPDATE `#iCMS@__advertise` SET `status` = '{$act}' WHERE `id` ='{$id}'");
     $this->create($id);
     javascript::dialog("操作完成!", 'url:1');
 }
Пример #11
0
 function doUpdate()
 {
     foreach ($_POST as $key => $value) {
         updateConfig(dhtmlspecialchars($value), $key);
     }
     CreateConfigFile();
     javascript::dialog('配置已更新!');
 }
Пример #12
0
 function doEdit()
 {
     $defArray['source'] = explode("\r\n", dhtmlspecialchars($_POST['source']));
     $defArray['author'] = explode("\r\n", dhtmlspecialchars($_POST['author']));
     $defArray['editor'] = explode("\r\n", dhtmlspecialchars($_POST['editor']));
     $this->iCMS->setCache('system/default', $defArray, 0);
     javascript::dialog('编辑完成!<br />3秒后返回', 'url:' . __SELF__ . '?mo=defaults');
 }
Пример #13
0
 public function qtipAjaxReturn($data)
 {
     if (!empty($data->user_id)) {
         $fullName = $data->first_name . ' ' . $data->last_name;
         javascript::codeBlock('$(\'.users_dropdown\').append(\'<option value="' . $data->user_id . '" selected="selected">' . $fullName . '</option>\');');
     }
     parent::qtipAjaxReturn($data);
 }
Пример #14
0
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $mod_strings;
    global $app_strings;
    global $app_list_strings;
    global $theme;
    global $current_user;
    global $sugar_version, $sugar_config;
    $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
    $lbl_subject = $mod_strings['LBL_SUBJECT'];
    $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
    $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
    $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
    $user_id = $current_user->id;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $the_form .= '<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s=' . $sugar_version . '&c=' . $sugar_config['js_custom_version'] . '"></script>';
    $the_form .= <<<EOQ
\t\t<form name="MachineSave" onSubmit="return check_form('MachineSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Machines">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="action" value="Save">



\t\t{$lbl_subject}&nbsp;<span class="required">{$lbl_required_symbol}</span><br>
\t\t<p><input name='name' type="text" size='27' maxlength="255"value=""><br>
EOQ;
    global $sugar_config;
    $the_form .= <<<EOQ
<p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " ></p>
\t\t
\t\t</form>
EOQ;
    require_once 'include/javascript/javascript.php';
    require_once 'modules/Machines/Machine.php';
    $javascript = new javascript();
    $javascript->setFormName('MachineSave');
    $javascript->setSugarBean(new Machine());
    $javascript->addRequiredFields('');
    $the_form .= $javascript->getScript();
    $the_form .= get_left_form_footer();
    return $the_form;
}
Пример #15
0
 function dostatus0()
 {
     empty($_POST['id']) && javascript::dialog("请选择要操作的评论!");
     foreach ($_POST['id'] as $k => $id) {
         $indexId = $_POST['indexId'][$id];
         iCMS_DB::query("UPDATE `#iCMS@__comment` SET `status` = '0' WHERE `id` ='{$id}'");
         iCMS_DB::query("UPDATE `#iCMS@__article` SET `comments` = comments-1  WHERE `id` ='{$indexId}'");
     }
     javascript::dialog("取消审核!", "url:0");
 }
Пример #16
0
 function doEdit()
 {
     $disable = explode("\r\n", dhtmlspecialchars($_POST['disable']));
     $filter = explode("\r\n", dhtmlspecialchars($_POST['filter']));
     foreach ($filter as $k => $val) {
         $filterArray[$k] = explode("=", $val);
     }
     $this->iCMS->setCache('system/word.filter', $filterArray, 0);
     $this->iCMS->setCache('system/word.disable', $disable, 0);
     javascript::dialog('更新完成!<br />3秒后返回', 'url:' . __SELF__ . '?mo=filter');
 }
Пример #17
0
 function doSave()
 {
     strpos($_POST['tplpath'], '..') !== false && javascript::alert("文件路径不能带有..");
     preg_match("/\\.([a-zA-Z0-9]{2,4})\$/", $_POST['tplpath'], $exts);
     $FileExt = strtolower($exts[1]);
     strstr($FileExt, 'ph') && javascript::alert("文件格式错误!");
     in_array($FileExt, array('cer', 'htr', 'cdx', 'asa', 'asp', 'jsp', 'aspx', 'cgi')) && javascript::alert("文件格式错误!");
     $FileData = stripslashes($_POST['html']);
     FS::write(iPATH . 'templates' . $_POST['tplpath'], $FileData);
     javascript::dialog('保存成功!', 'url:' . __SELF__ . $_POST['REFERER']);
 }
    function getFormBody($prefix, $mod = '', $formname = '', $size = '30')
    {
        global $mod_strings;
        $temp_strings = $mod_strings;
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        }
        global $app_strings;
        global $app_list_strings;
        $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
        $lbl_subject = $mod_strings['LBL_NOTE_SUBJECT'];
        $lbl_description = $mod_strings['LBL_NOTE'];
        $default_parent_type = $app_list_strings['record_type_default_key'];
        $form = <<<EOF
\t\t\t\t<input type="hidden" name="{$prefix}record" value="">
\t\t\t\t<input type="hidden" name="{$prefix}parent_type" value="{$default_parent_type}">
\t\t\t\t<p>
\t\t\t\t<table cellspacing="0" cellpadding="0" border="0">
\t\t\t\t<tr>
\t\t\t\t    <td scope="row">{$lbl_subject} <span class="required">{$lbl_required_symbol}</span></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td ><input name='{$prefix}name' size='{$size}' maxlength='255' type="text" value=""></td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td scope="row">{$lbl_description}</td>
\t\t\t\t</tr>
\t\t\t\t<tr>
\t\t\t\t    <td ><textarea name='{$prefix}description' cols='{$size}' rows='4' ></textarea></td>
\t\t\t\t</tr>
\t\t\t\t</table></p>
EOF;
        $javascript = new javascript();
        $javascript->setFormName($formname);
        $javascript->setSugarBean(new EmailTemplate());
        $javascript->addRequiredFields($prefix);
        $form .= $javascript->getScript();
        $mod_strings = $temp_strings;
        return $form;
    }
Пример #19
0
 public static function updateOnPageObjects()
 {
     $update = Event::$data;
     if (empty($update['numbermanager'])) {
         return;
     }
     $update = $update['numbermanager'];
     $objectTemplate = new View('numbermanager/targetObject.mus', $update);
     $objectTemplate->mustache_escape_apostrophes = TRUE;
     javascript::codeBlock("\$('.number_target_objects.{$update['short_name']}').append('{$objectTemplate}');");
     javascript::codeBlock("selectDestination('{$update['object_number_type']}', {$update['object_id']});");
 }
Пример #20
0
 function dodelete()
 {
     if (isset($_POST['delete'])) {
         foreach ($_POST['delete'] as $k => $id) {
             iCMS_DB::query("DELETE FROM `#iCMS@__plugins_message` WHERE `id` ='{$id}'");
             $js[] = '#mid' . $id;
         }
         javascript::dialog('全部成功删除!', 'js:parent.$("' . implode(',', $js) . '").remove();parent.iCMS.closeDialog();');
     } else {
         javascript::alert("请选择要删除的留言!");
     }
 }
Пример #21
0
 function doAdd()
 {
     $this->init();
     $name = dhtmlspecialchars($_POST['name']);
     $type = dhtmlspecialchars($_POST['type']);
     $val = intval($_POST['val']);
     $end = end($this->array);
     $id = $end['id'] + 1;
     $this->array[$id] = array('id' => $id, 'name' => $name, 'type' => $type, 'val' => $val);
     $this->iCMS->setCache('system/contentype', $this->array, 0);
     javascript::dialog('添加完成!<br />3秒后返回', 'url:' . __SELF__ . '?mo=contentype');
 }
Пример #22
0
function get_new_record_form()
{
    if (!ACLController::checkAccess('ProjectTask', 'edit', true)) {
        return '';
    }
    global $app_strings;
    global $mod_strings;
    global $currentModule;
    global $current_user;
    global $sugar_version, $sugar_config;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $form = new XTemplate('modules/ProjectTask/Forms.html');
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('mod', $mod_strings);
    $form->assign('app', $app_strings);
    $form->assign('module', $currentModule);
    $options = get_select_options_with_id(get_user_array(), $current_user->id);
    $form->assign('ASSIGNED_USER_OPTIONS', $options);
    ///////////////////////////////////////
    ///
    /// SETUP ACCOUNT POPUP
    $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => "quick_save", 'field_to_name_array' => array('id' => 'parent_id', 'name' => 'project_name'));
    $json = getJSONobj();
    $encoded_popup_request_data = $json->encode($popup_request_data);
    //
    ///////////////////////////////////////
    $form->assign('encoded_popup_request_data', $encoded_popup_request_data);
    $form->parse('main');
    $the_form .= $form->text('main');
    require_once 'modules/ProjectTask/ProjectTask.php';
    $focus = new ProjectTask();
    require_once 'include/javascript/javascript.php';
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
Пример #23
0
 function doUpdate()
 {
     include_once iPATH . 'include/forum.class.php';
     if ($_POST['forum']) {
         $forum = new forum();
         $forum->cache();
     }
     if ($_POST['adm']) {
         include_once iPATH . 'admin/advertise.mo.php';
         $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__advertise`", OBJECT);
         $_count = count($rs);
         for ($i = 0; $i < $_count; $i++) {
             adm($rs[$i]);
         }
     }
     $_POST['tpl'] && $this->iCMS->clear_compiled_tpl();
     $_POST['iCMS_list'] && FS::rmdir(iPATH . 'cache/list');
     $_POST['iCMS_forum'] && FS::rmdir(iPATH . 'cache/forum');
     $_POST['iCMS_tag'] && FS::rmdir(iPATH . 'cache/tags');
     if ($_POST['iCMS_ALL']) {
         FS::rmdir(iPATH . 'cache/list');
         FS::rmdir(iPATH . 'cache/forum');
         FS::rmdir(iPATH . 'cache/tags');
     }
     $_POST['keywords'] && keywords_cache();
     $_POST['tags'] && tags_cache();
     if ($_POST['model']) {
         include iPATH . 'include/model.class.php';
         model::cache();
     }
     $_POST['field'] && field_cache();
     $_POST['config'] && CreateConfigFile();
     if ($_POST['Re-Article-Count']) {
         $rs = iCMS_DB::getArray("SELECT fid FROM `#iCMS@__forum`");
         $_count = count($rs);
         for ($i = 0; $i < $_count; $i++) {
             $c = iCMS_DB::getValue("SELECT count(*) FROM #iCMS@__article where `fid`='" . $rs[$i]['fid'] . "' LIMIT 1 ");
             iCMS_DB::query("UPDATE `#iCMS@__forum` SET `count` ='{$c}' WHERE `fid` ='" . $rs[$i]['fid'] . "' LIMIT 1 ");
         }
     }
     if ($_POST['Re-Tag-Count']) {
         include_once iPATH . 'include/forum.class.php';
         $rs = iCMS_DB::getArray("SELECT id FROM `#iCMS@__tags`");
         $_count = count($rs);
         for ($i = 0; $i < $_count; $i++) {
             $_count = iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__taglist` WHERE `tid`='" . $rs[$i]['id'] . "'");
             iCMS_DB::query("UPDATE `#iCMS@__tags` SET `count` = '{$_count}'  WHERE `id` ='" . $rs[$i]['id'] . "'");
             tags_cache($rs[$i]['id']);
         }
     }
     javascript::dialog("执行完毕!", 'url:1');
 }
Пример #24
0
 public function page($pagenum)
 {
     css::add(array('media/css/fee.css'));
     javascript::add(array('media/js/ext-base.js', 'media/js/ext-all.js', 'media/js/app.js'));
     $this->template->content = new View('content/fees');
     $db = new Database('fees');
     $query = $db->query("SELECT co_name FROM feesNew");
     $this->pagination = new Pagination(array('uri_segment' => 'page', 'total_items' => $query->count(), 'items_per_page' => 28, 'style' => 'punbb'));
     $b = $this->pagination->items_per_page;
     $offset = ($pagenum - 1) * $b;
     $result = $db->query("SELECT co_name FROM feesNew ORDER BY co_name ASC LIMIT {$b} OFFSET {$offset}");
     $this->template->content->result = $result;
 }
Пример #25
0
 function dosave()
 {
     $id = (int) $_POST['id'];
     $keyword = dhtmlspecialchars($_POST['keyword']);
     $replace = preg_replace("'<p>(.*?)<\\/p>'si", '\\1', $_POST['replace']);
     if (empty($id)) {
         iCMS_DB::query("INSERT IGNORE INTO `#iCMS@__keywords`(`keyword`,`replace`,`addtime`,`status`) values ('{$keyword}','{$replace}','" . time() . "','1')");
     } else {
         iCMS_DB::query("update `#iCMS@__keywords` set `keyword`='{$keyword}',`replace`='{$replace}' where id='{$id}'");
     }
     keywords_cache();
     javascript::dialog('操作完成!', 'url:' . __SELF__ . '?mo=keywords');
 }
Пример #26
0
 function doEdit()
 {
     foreach ($_POST['name'] as $id => $value) {
         iCMS_DB::query("update `#iCMS@__group` set `name`='{$value}',`order`='" . $_POST['order'][$id] . "' where `gid`='{$id}'");
     }
     if ($_POST['addnewname']) {
         iCMS_DB::query("INSERT INTO `#iCMS@__group`(`gid`,`name`,`order`,`power`,`cpower`,`type`) VALUES (NULL,'" . $_POST['addnewname'] . "','" . $_POST['addneworder'] . "','','','" . $_POST['type'] . "')");
         javascript::dialog('添加完成!', 'url:1');
         exit;
     }
     javascript::dialog('更新完成!', 'url:1');
     //_Header();
 }
Пример #27
0
 function doDel()
 {
     $mid = (int) $_GET['mid'];
     $__TABLE__ = 'article';
     if ($mid) {
         $model = $this->iCMS->getCache('system/models.cache', $mid);
         $__TABLE__ = $model['tbn'];
     }
     $id = intval($_GET['id']);
     $indexId = intval($_GET['indexId']);
     $id && iCMS_DB::query("DELETE FROM `#iCMS@__comment` WHERE `id` ='{$id}'");
     $indexId && iCMS_DB::query("UPDATE `#iCMS@__" . $__TABLE__ . "` SET `comments` = comments-1  WHERE `id` ='{$indexId}'");
     javascript::dialog('评论删除成功!', 'js:parent.$("#tr-' . $id . '").remove();parent.iCMS.closeDialog();');
 }
Пример #28
0
 function dosave()
 {
     $id = (int) $_POST['id'];
     $search = dhtmlspecialchars($_POST['search']);
     $search = str_replace(array('%', '_'), array('\\%', '\\_'), $search);
     $times = (int) $_POST['times'];
     if (empty($id)) {
         iCMS_DB::query("insert into `#iCMS@__search`(`search`,`times`,`addtime`) values ('{$search}','{$times}','" . time() . "')");
     } else {
         iCMS_DB::query("update `#iCMS@__search` set `search`='{$search}',`times`='{$times}' where id='{$id}'");
     }
     search_cache();
     javascript::dialog('操作完成!', 'url:' . __SELF__ . '?mo=search');
 }
Пример #29
0
 public function index()
 {
     $this->template->content = new View('globalmedia/index');
     javascript::add('php_file_tree_jquery.js');
     stylesheet::add('php_file_tree.css');
     // Collect a list of paths in the system, to be displayed as a list
     $this->view->filetree = filetree::php_file_tree(Media::getMediaPath(), "javascript:filterPath('[link]');", FALSE, '/^8000$|^16000$|^32000$|^48000$/');
     // Build a grid with a hidden device_id, device_type, and add an option for the user to select the display columns
     $this->grid = jgrid::grid($this->baseModel, array('caption' => '&nbsp;', 'gridName' => 'MediaGrid'))->add('mediafile_id', 'ID', array('width' => '80', 'hidden' => true, 'key' => true))->add('file', 'Filename', array('width' => '40', 'search' => true, 'callback' => array('MediaFile', 'getBaseName')))->add('path', 'Path', array('width' => '80', 'hidden' => true, 'key' => true, 'search' => true))->add('description', 'Description', array('width' => '80', 'search' => true))->add('size', 'File Size', array('width' => '40', 'align' => 'right', 'callback' => array('function' => array('MediaFile', 'getSize'), 'arguments' => 'registry')))->add('length', 'Length', array('width' => '40', 'align' => 'right', 'callback' => array('function' => array('MediaFile', 'getLength'), 'arguments' => 'registry')))->navButtonAdd('Columns', array('onClickButton' => 'function () {  $(\'#{table_id}\').setColumns(); }', 'buttonimg' => url::base() . 'assets/css/jqGrid/table_insert_column.png', 'title' => 'Show/Hide Columns', 'noCaption' => true, 'position' => 'first'))->addAction('globalmedia/details', 'Details', array('arguments' => 'mediafile_id', 'attributes' => array('class' => 'qtipAjaxForm')))->addAction('globalmedia/download', 'Download', array('arguments' => 'mediafile_id'))->addAction('globalmedia/delete', 'Delete', array('width' => '60', 'arguments' => 'mediafile_id'));
     // dont foget to let the plugins add to the grid!
     plugins::views($this);
     // Produces the grid markup or JSON
     $this->view->grid = $this->grid->produce();
 }
Пример #30
0
 function dosetting()
 {
     $gender = intval($_POST['gender']);
     $nickname = dhtmlspecialchars($_POST['nickname']);
     $info['icq'] = intval($_POST['icq']);
     $info['home'] = dhtmlspecialchars(stripslashes($_POST['home']));
     $info['year'] = intval($_POST['year']);
     $info['month'] = intval($_POST['month']);
     $info['day'] = intval($_POST['day']);
     $info['from'] = dhtmlspecialchars(stripslashes($_POST['from']));
     $info['signature'] = dhtmlspecialchars(stripslashes($_POST['signature']));
     iCMS_DB::query("UPDATE `#iCMS@__members` SET `info` = '" . addslashes(serialize($info)) . "',`nickname`='{$nickname}',`gender`='{$gender}' WHERE `uid` ='" . member::$uId . "' LIMIT 1");
     javascript::dialog("资料修改完成!");
 }