function dbupdate_run(&$argv, &$argc) { global $a, $db; if (is_null($a)) { $a = new App(); } if (is_null($db)) { @(include ".htconfig.php"); require_once "include/dba.php"; $db = new dba($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data); } load_config('config'); load_config('system'); update_db($a); }
$Agility = 10; $Defense = 10; do { update_db('Caranille_Levels', array('Level_ID' => $Level, 'Level_Number' => $Level, 'Level_Experience_Required' => $Experience, 'Level_HP' => $HP, 'Level_MP' => $MP, 'Level_Strength' => $Strength, 'Level_Magic' => $Magic, 'Level_Agility' => $Agility, 'Level_Defense' => $Defense)); $HP += $_POST['HP_Level']; $MP += $_POST['MP_Level']; $Strength += $_POST['Strength_Level']; $Magic += $_POST['Magic_Level']; $Agility += $_POST['Agility_Level']; $Defense += $_POST['Defense_Level']; $Experience += $_POST['Experience_Level']; $Level++; } while ($Level <= $max['Level_Number']); update_db('Caranille_Configuration', array('Configuration_Name' => 'curve-Experience', 'Configuration_Value' => $_POST['Experience_Level'])); foreach ($array_character_type as $type) { update_db('Caranille_Configuration', array('Configuration_Name' => 'curve-' . $type, 'Configuration_Value' => $_POST[$type . '_Level'])); } } if (request_confirm('Delete')) { delete_db('Caranille_Levels', $_POST); $message = 'Le niveau a bien été supprimée'; } if (request_confirm('End_Add')) { if (valid_post_db('Caranille_Levels')) { insert_db('Caranille_Levels', addslashes_r($_POST)); $message = 'niveau ajouté'; } else { $message = 'Tous les champs n\'ont pas été remplis'; } } }
$message = "แก้ไขลิงค์เรียบร้อยแล้วค่ะ"; ?> <script type="text/javascript"> $(document).ready(function() { alertPopup('msg3','alert3','<?php echo $message; ?> ',0); }); </script> <?php break; case 'saveinfo': $Table_Name = 'garageinterface'; $data = array('garageAbout' => $wysiwg_full); $sql = update_db($Table_Name, array('garageId=' => $u_garage), $data); mysql_query($sql); $message = "แก้ไขข้อมูลเกี่ยวกับอู่เรียบร้อยแล้วค่ะ"; ?> <script type="text/javascript"> $(document).ready(function() { alertPopup('msg3','alert3','<?php echo $message; ?> ',0); }); </script> <?php break; } }
include_once 'mana/template_edit.php'; } elseif ($do == 'editsave') { $tplid = getGP('tplid', 'P', 'int'); $title = getGP('title', 'P'); $typeid = getGP('typeid', 'P'); $tplkey = getGP('tplkey', 'P'); if (getGP('tpluser', 'P') != '') { $tpluser = getGP('tpluser', 'P'); } else { $tpluser = '******'; } if (getGP('tpladmin', 'P') != '') { $tpladmin = getGP('tpladmin', 'P'); } else { $tpladmin = '0'; } $tpladdr = getGP('tpladdr', 'P'); //主表信息 $workclass_template = array('title' => $title, 'typeid' => $typeid, 'tplkey' => $tplkey, 'tpluser' => $tpluser, 'tpladmin' => $tpladmin, 'tpladdr' => $tpladdr); update_db('workclass_template', $workclass_template, array('tplid' => $tplid)); //更新表单 $workclass_from = array('typeid' => $typeid); update_db('workclass_from', $workclass_from, array('tplid' => $tplid)); //更新流程 $workclass_flow = array('typeid' => $typeid); update_db('workclass_flow', $workclass_flow, array('tplid' => $tplid)); $content = serialize($workclass_template); $title = '编辑工作流模板'; get_logadd($id, $content, $title, 35, $_USER->id); show_msg('工作流模板修改成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . ''); }
$name = getGP('name', 'P', 'array'); $content = getGP('content', 'P', 'array'); foreach ($bid as $id) { if ($name[$id] != '') { $wage_basis = array('username' => $username[$id], 'name' => $name[$id], 'content' => $content[$id]); update_db('wage_basis', $wage_basis, array('bid' => $id)); } //$sqlu = "SELECT tid,name FROM ".DB_TABLEPRE."wage_type order by tnumber asc"; //$results = $db->query($sqlu); //while ($type = $db->fetch_array($results)) { foreach ($_CACHE['wage_type'] as $type) { $contentdb = getGP('type_' . $type['tid'], 'P', 'array'); $wdb = $db->fetch_one_array("SELECT did FROM " . DB_TABLEPRE . "wage_data WHERE type=1 and viewid='" . $id . "' and tid='" . $type['tid'] . "'"); if ($wdb['did'] != '') { $wage_data = array('content' => $contentdb[$id]); update_db('wage_data', $wage_data, array('viewid' => $id, 'tid' => $type['tid'], 'type' => 1)); } else { $wage_data = array('viewid' => $id, 'tid' => $type['tid'], 'name' => $type['name'], 'content' => $contentdb[$id], 'type' => 1); insert_db('wage_data', $wage_data); } } } show_msg('薪资基础信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . ''); } elseif (getGP('id', 'G') != '') { $db->query("DELETE FROM " . DB_TABLEPRE . "wage_type WHERE tid = '" . getGP('id', 'G') . "' "); $content = getGP('id', 'G'); $title = '删除薪资项目'; get_logadd(getGP('id', 'G'), $content, $title, 36, $_USER->id); show_msg('薪资项目删除成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . ''); } else { $sql = "SELECT a.*,b.name FROM " . DB_TABLEPRE . "user a," . DB_TABLEPRE . "user_view b where a.ischeck!=0 and a.id!=1 and a.id=b.uid ORDER BY a.numbers asc";
$Id: user_count.php 1209087 2012-01-08 08:58:28Z baiwei.jiang $ */ define('IN_ADMIN', True); require_once '../include/common.php'; get_login($_USER->id); //更新在线数据到数据库中 $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "online where uid='" . $_USER->id . "' "); if ($blog["uid"] != '') { $online = array('startdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'enddate' => get_date('Y-m-d H:i:s', PHP_TIME + 600)); update_db('online', $online, array('uid' => $_USER->id)); } else { $online = array('uid' => $_USER->id, 'startdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'enddate' => get_date('Y-m-d H:i:s', PHP_TIME + 600)); insert_db('online', $online); } //更新在线状态 global $db; $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "online order by id desc"); while ($row = $db->fetch_array($query)) { $uid = $row['uid']; if ($row["enddate"] >= get_date('Y-m-d H:i:s', PHP_TIME)) { $user = array('online' => 1); update_db('user', $user, array('id' => $uid)); } else { $user = array('online' => 0); update_db('user', $user, array('id' => $uid)); } } //更新数据后取出当前总在线人数 $blog = $db->fetch_one_array("SELECT COUNT(*) as online FROM " . DB_TABLEPRE . "user WHERE online='1' "); echo $blog["online"]; exit;
<?php // l'utilisateur peut ajouter un titre pour chaque module different de Caranille -Accueil $title = "Historique"; $baseline = "vos actes passés"; load_css('corps.css', 'corps'); if (request_confirm('edit-role-play')) { if (verifier_token(600, get_link('diary', 'game'), "editor-role-play-" . request_post('Diary_ID'))) { update_db('Caranille_Diaries', array('Diary_Description' => request_post('roleplay'), 'Diary_ID' => request_post('Diary_ID'))); } } if (request_confirm('remove-role-play')) { if (verifier_token(600, get_link('diary', 'game'), "remover-role-play-" . request_post('Diary_ID'))) { delete_db('Caranille_Diaries', array('Diary_ID' => request_post('Diary_ID'))); } }
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!'); empty($do) && ($do = 'list'); if ($do == 'edit') { $id = getGP('id', 'G', 'int'); $workdate = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "book_type WHERE id = '{$id}' "); include_once 'template/file_type_edit.php'; } elseif ($do == 'save') { $savetype = getGP('savetype', 'P'); $id = getGP('id', 'P', 'int'); $title = getGP('title', 'P'); $father = getGP('father', 'P'); $keyuser = getGP('keyuser', 'P'); //$uid=$_USER->id; $book_type = array('title' => $title, 'father' => $father, 'keyuser' => $keyuser); update_db('book_type', $book_type, array('id' => $id)); $content = serialize($book_type); $title = '编辑图书类别'; get_logadd($id, $content, $title, 22, $_USER->id); show_msg('您要处理的信息操作成功!', 'admin.php?ac=file_type&fileurl=' . $fileurl . ''); } function GET_FILE_PUBLIC_LIST($fatherid = 0, $selid = 0, $layer = 0) { $str = ""; global $db; $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "book_type where father='{$fatherid}' ORDER BY id Asc "); if (count($query) > 0) { for ($i = 0; $i < $layer; $i++) { $str .= "├"; } while ($row = $db->fetch_array($query)) {
$baseline = "compte inconnu"; } } else { $baseline = "email invalide"; } } else { $baseline = "formulaire incomplet"; } } else { $baseline = "formulaire invalide"; } } if (request_confirm('Valid')) { $baseline = 'Restitution de votre mot de passe'; print_r($_RESQUEST); if (!empty($_GET)) { extract(addslashes_r($_GET)); } if (!empty($_POST)) { extract(addslashes_r($_POST)); } $user = get_db('valid_account', $_REQUEST); if (!empty($user)) { $Password = password_decode($prefixe_salt . $user['Account_Salt'] . $suffixe_salt, $user['Account_Password']); $filter = uniqid(); $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password); update_db('Caranille_Accounts', array('Account_ID' => $user['Account_ID'], 'Account_Password' => $pswd, 'Account_Salt' => $filter)); $user_record = get_db('request_account', $user); valid_renew_email($user_record); } }
if ($do == 'list') { $id = getGP('id', 'G', 'int'); $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "office_goods WHERE id = '{$id}' "); include_once 'template/edit.php'; } elseif ($do == 'save') { $savetype = getGP('savetype', 'P'); $id = getGP('id', 'P', 'int'); $goods_type = getGP('goods_type', 'P'); $title = getGP('title', 'P'); $specification = getGP('specification', 'P'); $unit = getGP('unit', 'P'); $price = getGP('price', 'P'); $number = getGP('number', 'P'); $content = getGP('content', 'P'); $office_goods = array('goods_type' => $goods_type, 'title' => $title, 'specification' => $specification, 'unit' => $unit, 'price' => $price, 'number' => $number, 'content' => $content); update_db('office_goods', $office_goods, array('id' => $id)); $content = serialize($office_goods); $title = '编辑办公用品信息'; get_logadd($id, $content, $title, 23, $_USER->id); show_msg('您要处理的信息操作成功!', 'admin.php?ac=index&fileurl=' . $fileurl . ''); } //读取部门 function GET_FILE_PUBLIC_LIST($fatherid = 0, $selid = 0, $layer = 0) { $str = ""; global $db; $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "goods_type where father='{$fatherid}' ORDER BY id Asc "); if (count($query) > 0) { for ($i = 0; $i < $layer; $i++) { $str .= "├"; }
} elseif ($do == 'add') { if ($_POST['view'] != '') { $id = getGP('id', 'P', 'int'); if ($id != '') { $title = check_str(getGP('title', 'P')); $content = getGP('content', 'P'); $startdate = getGP('startdate', 'P') . " " . getGP('starth', 'P') . ":" . getGP('starti', 'P') . ":00"; $enddate = getGP('enddate', 'P') . " " . getGP('endh', 'P') . ":" . getGP('endi', 'P') . ":00"; $otype = getGP('otype', 'P'); $department = getGP('department', 'P'); $participation = getGP('participation', 'P'); $person = getGP('person', 'P'); $note = check_str(getGP('note', 'P')); $type = getGP('type', 'P'); $plan = array('title' => $title, 'content' => $content, 'startdate' => $startdate, 'enddate' => $enddate, 'otype' => $otype, 'department' => $department, 'participation' => $participation, 'person' => $person, 'note' => $note, 'type' => $type); update_db('plan', $plan, array('id' => $id)); if (getGP('sms_info_box_person', 'P') != '') { $content = '您有一个计划需要执行,计划主题为:' . $title . ';请进行处理!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击查看>></a>'; SMS_ADD_POST($person, $content, 0, 0, $_USER->id); } if (getGP('sms_phone_box_person', 'P') != '') { $content = '您有一个计划需要执行,请登录OA进行处理!'; PHONE_ADD_POST(getGP('personphone', 'P'), $content, $person, 0, 0, $_USER->id); } ////////////////////////////////////////////////// if (getGP('sms_info_box_participation', 'P') != '') { $content = '您有一个计划需要参与,计划主题为:' . $title . ';请进行处理!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击查看>></a>'; SMS_ADD_POST($participation, $content, 0, 0, $_USER->id); } //手机短信 if (getGP('sms_phone_box_participation', 'P') != '') {
while ($row = $db->fetch_array($query)) { if ($row['inputtype'] == '4') { $inputvalues = ''; $inputvalue = getGP('' . $row["inputname"] . '', 'P', 'array'); foreach ($inputvalue as $arrsave) { $inputvalues .= $arrsave . ','; } $inputvalue = substr($inputvalues, 0, -1); } elseif ($row['inputtype'] == '2') { $inputvalue = trim(getGP('' . $row["inputname"] . '', 'P')); } else { $inputvalue = check_str(getGP('' . $row["inputname"] . '', 'P')); } $crm_db = array('content' => $inputvalue); //insert_db('crm_db',$crm_db); update_db('crm_db', $crm_db, array('viewid' => $vid, 'type' => 'crm_care', 'inputname' => $row["inputname"], 'formid' => $row["fid"])); $crm_log .= serialize($crm_db) . '|515158.com|'; } $content = serialize($crm_care); $title = get_realname($_USER->id) . '于' . get_date('Y-m-d H:i:s', PHP_TIME) . '编辑客户关怀信息'; get_logadd($vid, $content, $title, 36, $_USER->id); crm_log($title, $vid, $content, substr($crm_log, 0, -12), 1, 'crm_care'); show_msg('编辑客户关怀信息成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&type=' . getGP('type', 'P')); } else { $view = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "crm_care WHERE id = '" . getGP('id', 'G', 'int') . "' "); if ($_GET['type'] == '2') { get_key("crm_care_edit_2"); } else { get_key("crm_care_edit_1"); } include_once 'company/care_edit.php';
$json = new Services_JSON(); include "../../../include/class.mysqldb.php"; include "../../../include/config.inc.php"; include "../../../include/class.function.php"; foreach ($_REQUEST as $key => $value) { ${$key} = $value; #echo $key ."=". $value."<br>"; } $model_name = trim($model_name); $model_name_temp = trim($model_name_temp); if ($model_name != $model_name_temp) { $car_model_chk = select_db('carmodel', "where carModelName = '" . $model_name . "' and carBannerId = '" . $bannerid . "'"); #print_r($car_model_chk); $find_chk = count($car_model_chk); if ($find_chk) { $data['success'] = false; $data['message'] = 'รุ่นรถ "' . $model_name . '" มีแล้วในระบบ'; } else { $TableName = 'carmodel'; $data = array('carModelName' => $model_name); $sql = update_db($TableName, array('carModelId=' => $id), $data); //echo $sql; mysql_query($sql); $data['success'] = true; $data['message'] = 'ปรับปรุงรุ่นรถ "' . $model_name_temp . '" เป็น "' . $model_name . '" เรียบร้อยแล้ว'; } } else { $data['success'] = false; $data['message'] = 'รุ่นรถ "' . $model_name . '" ไม่มีการเปลี่ยนแปลง'; } echo $_GET['callback'] . '(' . $json->encode($data) . ')';
get_key("istration_conference_type_type"); } elseif ($otype >= '10' && $otype <= '19') { get_key("office_type_r"); } else { } empty($do) && ($do = 'bbsclass'); if ($do == 'bbsclass') { if (getGP('view', 'P') == 'save') { $idarr = getGP('id', 'P', 'array'); $name = getGP('name', 'P', 'array'); foreach ($idarr as $id) { if ($name[$id] == '') { $name[$id] = '新' . $_cname['name']; } $office_type = array('oname' => $name[$id]); update_db('office_type', $office_type, array('oid' => $id)); } $newname = '515158'; foreach (getGP('newname', 'P', 'array') as $name) { $newname .= ',,' . $name; } $newname = explode(',,', str_replace('515158,,', '', $newname)); if ($newname != '') { for ($i = 0; $i < sizeof($newname); $i++) { if (str_replace('515158', '', $newname[$i]) != '') { if (str_replace('515158', '', $newname[$i]) == '') { $newname[$i] = '新' . $_cname['name']; } $office_type = array('oname' => str_replace('515158', '', $newname[$i]), 'otype' => $otype, 'uid' => $_USER->id); insert_db('office_type', $office_type); }
if (isset($_GET["key"]) && isset($_GET["msg"]) && isset($_GET["title"]) && isset($_GET["file"])) { $data['success'] = 1; $key = $_GET["key"]; $title = $_GET["title"]; $file = $_GET["file"]; create_post_folder($_GET['file']); create_post_image(explode(".", $_GET['file'])[0], $_GET['msg']); $type = "jokes"; if (isset($_GET["type"])) { $type = $_GET["type"]; } $by = "Miku"; if (isset($_GET["by"])) { $by = $_GET["by"]; } update_db($key, $title, $file, $by, $type); } else { $data['error'] = "Post Id Required"; } if ($p == 1) { echo json_encode($data); exit(0); } else { echo "<pre>" . json_encode($data, JSON_PRETTY_PRINT) . "</pre>"; exit(0); } function create_post_folder($file) { global $domain, $data; $data['folder-create-info'] = file_get_contents($domain . 'make-post.php?p=1&a=1&post=' . $file); }
$_title['name'] = '编辑'; } else { get_key("training_"); $user['number'] = get_date('YmdHis', PHP_TIME); $_title['name'] = '发布'; } include_once 'template/trainingadd.php'; } } elseif ($do == 'views') { $id = getGP('id', 'G', 'int'); if ($_POST['view'] != '') { $id = getGP('id', 'P'); $type = getGP('type', 'P'); //主表信息 $training = array('type' => $type, 'examinationdate' => get_date('Y-m-d H:i:s', PHP_TIME)); update_db('training', $training, array('id' => $id)); $content = serialize($training); $title = '审批培训计划'; get_logadd($id, $content, $title, 28, $_USER->id); show_msg('审批培训计划成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id); } else { if ($id != '') { if ($_GET["keys"] == '1') { $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "training WHERE id = '{$id}' and examination='" . get_realname($_USER->id) . "' "); if ($blog["examination"] == '') { show_msg('对不起,你没有权限执行本操作!', 'home.php'); } } else { $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "training WHERE id = '{$id}' "); } $_title['name'] = '信息浏览';
} } include_once 'template/documentviews.php'; } elseif ($do == 'documenttype') { get_key("office_document_type_" . getGP('type', 'G') . ""); $type = getGP('type', 'G', 'int'); if ($_POST['view'] == 'save') { $idarr = getGP('id', 'P', 'array'); $name = getGP('name', 'P', 'array'); $date = get_date('Y-m-d H:i:s', PHP_TIME); foreach ($idarr as $id) { if ($name[$id] == '') { $name[$id] = '新文件夹名称'; } $document_type = array('title' => $name[$id]); update_db('document_type', $document_type, array('id' => $id)); } if (getGP('newid', 'P', 'array') != '' || getGP('newids', 'P', 'array') != '') { $newname = ''; foreach (getGP('newname', 'P', 'array') as $name) { $newname .= $name . ','; } $newinherited = ''; foreach (getGP('newinherited', 'P', 'array') as $name) { $newinherited .= $name . ','; } $newname = explode(',', substr($newname, 0, -1)); $newinherited = explode(',', substr($newinherited, 0, -1)); if ($newname != '') { for ($i = 0; $i < sizeof($newname); $i++) { if ($newname[$i] != '') {
$sql = update_db($TableName, array('configName=' => 'time_ready'), $data); mysql_query($sql); } if ($time_working != 0 && $time_working != '') { $data = array('configValue' => $time_working); $sql = update_db($TableName, array('configName=' => 'time_working'), $data); mysql_query($sql); } if ($time_orderjob != 0 && $time_orderjob != '') { $data = array('configValue' => $time_orderjob); $sql = update_db($TableName, array('configName=' => 'time_orderjob'), $data); mysql_query($sql); } if ($time_other != 0 && $time_other != '') { $data = array('configValue' => $time_other); $sql = update_db($TableName, array('configName=' => 'time_other'), $data); mysql_query($sql); } //echo $sql; //mysql_query($sql); $message = "เปลี่ยนแปลงเวลาเรียบร้อยแล้วค่ะ"; ?> <script type="text/javascript"> $(document).ready(function() { alertPopup('msg3','alert3','<?php echo $message; ?> ',0); }); </script> <?php
show_msg('考勤信息清理成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . ''); } elseif ($do == 'add') { if ($_POST['view'] != '') { $id = getGP('id', 'P', 'int'); if ($id != '') { $name = check_str(getGP('user', 'P')); $uid = check_str(getGP('userid', 'P')); $startdate = getGP('startdate', 'P') . " " . getGP('starth', 'P') . ":" . getGP('starti', 'P') . ":00"; $enddate = getGP('enddate', 'P') . " " . getGP('endh', 'P') . ":" . getGP('endi', 'P') . ":00"; $startnote = check_str(getGP('startnote', 'P')); $endnote = check_str(getGP('endnote', 'P')); $date = check_str(getGP('date', 'P')); $startyype = check_str(getGP('startyype', 'P')); $endtype = check_str(getGP('endtype', 'P')); $registration = array('name' => $name, 'startdate' => $startdate, 'enddate' => $enddate, 'startnote' => $startnote, 'endnote' => $endnote, 'uid' => $uid, 'startyype' => $startyype, 'endtype' => $endtype, 'date' => $date); update_db('registration', $registration, array('id' => $id)); $content = ''; $content = serialize($registration); $title = '编辑考勤信息'; get_logadd($id, $content, $title, 7, $_USER->id); } else { $name = check_str(getGP('user', 'P')); $uid = check_str(getGP('userid', 'P')); $startdate = getGP('startdate', 'P') . " " . getGP('starth', 'P') . ":" . getGP('starti', 'P') . ":00"; $enddate = getGP('enddate', 'P') . " " . getGP('endh', 'P') . ":" . getGP('endi', 'P') . ":00"; $startnote = check_str(getGP('startnote', 'P')); $endnote = check_str(getGP('endnote', 'P')); $date = check_str(getGP('date', 'P')); $startyype = check_str(getGP('startyype', 'P')); $endtype = check_str(getGP('endtype', 'P')); $registration = array('name' => $name, 'startdate' => $startdate, 'enddate' => $enddate, 'startnote' => $startnote, 'endnote' => $endnote, 'uid' => $uid, 'startyype' => $startyype, 'endtype' => $endtype, 'date' => $date);
/** modifie l'etape d'installation dans la base de données en relattion avec une fonction verif_install() qui **/ function install_edit_step_record($step = 3) { if ($step === 3) { insert_db('Caranille_Configuration', array('Configuration_Name' => 'install-step', 'Configuration_Value' => $step)); } else { update_db('Caranille_Configuration', array('Configuration_Name' => 'install-step', 'Configuration_Value' => $step)); } }
// Noel // Récupération de paques. Permet ensuite d'obtenir le jour de l'ascension et celui de la pentecote $easter = self::easter_date($year); $arr_bank_holidays[] = $easter + 86400; // Paques $arr_bank_holidays[] = $easter + 86400 * 39; // Ascension $arr_bank_holidays[] = $easter + 86400 * 50; // Pentecote return $arr_bank_holidays; } if (request_confirm('End_Add_Event')) { insert_db('Caranille_Events', $_POST); } if (request_confirm('End_Edit_Event')) { update_db('Caranille_Events', $_POST); } $month = request_confirm('m') ? str_pad(request_get('m'), 2, "0", STR_PAD_LEFT) : date('m'); $year = request_confirm('y') ? str_pad(request_get('y'), 4, "0", STR_PAD_LEFT) : date('Y'); debug_log("period({$year},{$month})"); $calendar = get_months($year, $month); foreach ($calendar as $day => $week) { $events[$day] = get_db('request_event', array('date' => "{$year}-{$month}-{$day}%", 'guild' => guild_data('Guild_ID'))); } /** $list_events = list_db('list_event',array( 'date' => "$year-$month%", 'guild' => guild_data('Guild_ID') )); **/ $pm = intval($month) == 1 ? 12 : $month - 1;
if ($do == 'list') { include_once 'template/department.php'; } elseif ($do == 'save') { $idarr = getGP('id', 'P', 'array'); $persno = getGP('persno', 'P', 'array'); $name = getGP('name', 'P', 'array'); $date = get_date('Y-m-d H:i:s', PHP_TIME); foreach ($idarr as $id) { if ($name[$id] == '') { $name[$id] = '新部门名称'; } if ($persno[$id] == '') { $persno[$id] = '负责人为空?'; } $department = array('name' => $name[$id], 'persno' => $persno[$id]); update_db('department', $department, array('id' => $id)); } if (getGP('newid', 'P', 'array') != '' || getGP('newids', 'P', 'array') != '') { $newname = ''; foreach (getGP('newname', 'P', 'array') as $name) { $newname .= $name . ','; } $newpersno = ''; foreach (getGP('newpersno', 'P', 'array') as $name) { $newpersno .= $name . ','; } $newinherited = ''; foreach (getGP('newinherited', 'P', 'array') as $name) { $newinherited .= $name . ','; } $newname = substr($newname, 0, -1);
function new_audit() { global $_DB, $_STATE; if (!field_input_audit()) { foreach ($_STATE->fields as $name => $field) { $field->disabled = false; } return FALSE; } $hash = md5($_STATE->fields["Name"]->value() . $_STATE->fields["Description"]->value()); $sql = "INSERT INTO " . $_DB->prefix . "a00_organization (name) VALUES (:hash);"; $stmt = $_DB->prepare($sql); $stmt->bindValue(':hash', $hash, PDO::PARAM_STR); $stmt->execute(); $sql = "SELECT organization_id FROM " . $_DB->prefix . "a00_organization WHERE name=:hash;"; $stmt = $_DB->prepare($sql); $stmt->bindValue(':hash', $hash, PDO::PARAM_STR); $stmt->execute(); $_STATE->record_id = $stmt->fetchObject()->organization_id; $stmt->closeCursor(); update_db(); $sql = "INSERT INTO " . $_DB->prefix . "a10_project (organization_idref,name,description)\n\t\t\tVALUES (" . $_STATE->record_id . ",'" . $hash . "','initial seed project - please change');"; $_DB->exec($sql); $sql = "SELECT project_id FROM " . $_DB->prefix . "a10_project WHERE name='" . $hash . "';"; $stmt = $_DB->query($sql); $ID = $stmt->fetchObject()->project_id; $stmt->closeCursor(); $sql = "UPDATE " . $_DB->prefix . "a10_project SET name='seed' WHERE project_id=" . $ID . ";"; $_DB->exec($sql); $sql = "INSERT INTO " . $_DB->prefix . "a12_task (project_idref,name,description)\n\t\t\tVALUES (" . $ID . ",'" . $hash . "','initial seed task - please change');"; $_DB->exec($sql); $sql = "SELECT task_id FROM " . $_DB->prefix . "a12_task WHERE name='" . $hash . "';"; $stmt = $_DB->query($sql); $ID = $stmt->fetchObject()->task_id; $stmt->closeCursor(); $sql = "UPDATE " . $_DB->prefix . "a12_task SET name='seed' WHERE task_id=" . $ID . ";"; $_DB->exec($sql); $sql = "INSERT INTO " . $_DB->prefix . "a14_subtask (task_idref,name,description)\n\t\t\tVALUES (" . $ID . ",'seed','initial seed subtask - please change');"; $_DB->exec($sql); $_STATE->msgStatus = "The organization \"" . $_STATE->fields["Name"]->value() . "\" has been added"; return TRUE; }
include_once 'template/goods_purchase.php'; } elseif ($do == 'update') { $idarr = getGP('id', 'P', 'array'); foreach ($idarr as $id) { $db->query("DELETE FROM " . DB_TABLEPRE . "goods_purchase WHERE id = '{$id}' "); $db->query("DELETE FROM " . DB_TABLEPRE . "goods_purchase_view WHERE goods_purchase= '{$id}' "); } $content = serialize($idarr); $title = '删除办公用品采购信息'; get_logadd($id, $content, $title, 23, $_USER->id); show_msg('办公用品采购信息删除成功!', 'admin.php?ac=goods_purchase&fileurl=goods'); } elseif ($do == 'keys') { $id = getGP('id', 'G', 'int'); $key1 = getGP('key1', 'G', 'int'); $goods_purchase = array('key1' => $key1, 'examination' => get_realname($_USER->id), 'keydate' => get_date('Y-m-d H:i:s', PHP_TIME)); update_db('goods_purchase', $goods_purchase, array('id' => $id)); show_msg('办公用品采购信息审批成功!', 'admin.php?ac=goods_purchase&fileurl=goods&key1=' . $_GET["key1"] . ''); } elseif ($do == 'excel') { $datename = "goods_" . get_date('YmdHis', PHP_TIME); $outputFileName = 'data/excel/' . $datename . '.xls'; $content = array(); $archive = array("编号", "申请人", "申请日期", "金额合计", "审批人", "采购人", "审批时间", "状态", "发布人", "采购产品清单"); $content[] = $archive; $wheresql = ''; if ($number = getGP('number', 'P')) { $wheresql .= " AND number ='" . $number . "'"; } //时间 $vstartdate = getGP('vstartdate', 'P'); $venddate = getGP('venddate', 'P'); if ($vstartdate != '' && $venddate != '') {
<?php include "../../../include/class.mysqldb.php"; include "../../../include/config.inc.php"; include "../../../include/class.function.php"; foreach ($_REQUEST as $key => $value) { ${$key} = $value; #echo $key ."=". $value."<br>"; } $TableName = 'drivertaxi'; $data = array('lock' => $status); $sql = update_db($TableName, array('driverId=' => $id), $data); $rs = mysql_query($sql); //echo $sql; if ($rs) { if ($status == 0) { ?> <a href="#" class="ttip_t" title="สถานะล๊อค" aria-describedby="ui-tooltip" onclick="fn_changeLock('<?php echo $id; ?> ',1);"><i class="splashy-thumb_down"></i></a> <?php } else { ?> <a href="#" class="ttip_t" title="สถานะไม่ล๊อค" aria-describedby="ui-tooltip" onclick="fn_changeLock('<?php echo $id; ?> ',0);"><i class="splashy-thumb_up"></i></a> <?php } } else {
<?php require_once "admin_functions.php"; if (isset($_GET['logout']) || !logged_in()) { session_destroy(); header('Location: login.php'); exit; } if (logged_in()) { admin_header(); ?> <?php if (isset($_POST['update']) && $_POST['update'] == 'updated') { $updated_user = $_POST; $update_query = "UPDATE users\n SET `f_name` = \"{$updated_user['f_name']}\",\n `l_name` = \"{$updated_user['l_name']}\",\n `u_name` = \"{$updated_user['u_name']}\",\n `email` = \"{$updated_user['email']}\",\n `pass` = \"{$updated_user['pass']}\"\n WHERE `id` = {$updated_user['id']}\n "; update_db($update_query); } if (isset($_POST['create']) && $_POST['create'] == 'created') { $new_user = $_POST; $create_query = "INSERT INTO `users`(\n `f_name`, `l_name`, `u_name`, `email`, `pass`)\n VALUES (\"{$new_user['f_name']}\",\n \"{$new_user['l_name']}\",\n \"{$new_user['u_name']}\",\n \"{$new_user['email']}\",\n \"{$new_user['pass']}\"\n )"; create_user($create_query); } if (isset($_GET['delete'])) { $delete_query = "DELETE FROM `users`\n WHERE `id` = {$_GET['delete']}"; delete_db($delete_query); } ?> <div class="content content-all-users"> <table> <tr> <th>First Name</th>
if (update_db($update, $dbh, "Removed 1 from quantity field of item", "Failed to subtract one from quantity field of item")) { header('Location: product.php?product_id=' . $item_id . '&was_bid=' . $_POST["bid_button_pressed"] . '&was_bin=' . $_POST["buy_it_now_pressed"]); } } } if (isset($_POST["bid_button_pressed"])) { if ($_POST["bid_button_pressed"] == "true") { // a bid occured -> insert bid echo "bid_button pushed"; $bid_if_exists = "Select * from Bids where user_id ='" . $seller_id . "' AND sales_item_id=" . $item_id; $existstance_query = $dbh->query($bid_if_exists); $result = $existstance_query->fetch(PDO::FETCH_ASSOC); if (isset($result['sales_item_id'])) { $update = "Update Bids " . "set user_id='" . $seller_id . "', sales_item_id=" . $item_id . ",time_of_bid='" . date("Y-m-d H:i:s") . "', amount=" . $_POST['bid_amount'] . " " . " where user_id ='" . $seller_id . "' AND sales_item_id=" . $item_id; // if update was succesful redirect if (update_db($update, $dbh, "Bid Updated", "Failed to update bid")) { header('Location: product.php?product_id=' . $item_id . '&was_bid=' . $_POST["bid_button_pressed"] . '&was_bin=' . $_POST["buy_it_now_pressed"]); } } else { $insert = "INSERT into Bids(user_id,sales_item_id,time_of_bid,amount) " . "VALUES('" . $seller_id . "'," . $item_id . ",'" . date("Y-m-d H:i:s") . "'," . $_POST['bid_amount'] . ")"; if (insert_into_db($insert, $dbh, "New bid Made", "Failed to insert new bid")) { header('Location: product.php?product_id=' . $item_id . '&was_bid=' . $_POST["bid_button_pressed"] . '&was_bin=' . $_POST["buy_it_now_pressed"]); } } } } if (isset($_POST["add_to_cart_pressed"])) { echo "in add_to_cart_pressed isset()"; if ($_POST["add_to_cart_pressed"] == "true") { $insert = "INSERT into ShoppingCarts(user_id, item_id) " . " VALUES('" . $seller_id . "'," . $item_id . ")"; echo "<br> " . $insert;
} elseif ($do == 'add') { include_once 'mana/type_add.php'; } elseif ($do == 'addsave') { $project_type[title] = getGP('title', 'P'); $project_type[manauser] = getGP('manauser', 'P'); $project_type[keyuser] = getGP('keyuser', 'P'); $project_type[type1] = getGP('type1', 'P'); $project_type[type2] = '1'; $project_type[uid] = $_USER->id; //写入主表信息 insert_db('project_type', $project_type); $id = $db->insert_id(); $content = serialize($project_type); $title = '添加项目类别'; get_logadd($id, $content, $title, 32, $_USER->id); show_msg('项目类别添加成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . ''); } elseif ($do == 'edit') { $tid = getGP('tid', 'G', 'int'); $view = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "project_type WHERE tid = '{$tid}'"); include_once 'mana/type_edit.php'; } elseif ($do == 'editsave') { $project_type[title] = getGP('title', 'P'); $project_type[manauser] = getGP('manauser', 'P'); $project_type[keyuser] = getGP('keyuser', 'P'); $project_type[type1] = getGP('type1', 'P'); update_db('project_type', $project_type, array('tid' => getGP('tid', 'P'))); $content = serialize($project_type); $title = '编辑项目类别'; get_logadd($id, $content, $title, 32, $_USER->id); show_msg('项目类别修改成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . ''); }
function new_audit() { global $_DB, $_STATE; if (!field_input_audit()) { return FALSE; } $hash = md5($_STATE->fields["Name"]->value() . $_STATE->fields["Description"]->value()); $sql = "INSERT INTO " . $_DB->prefix . "a14_subtask (name, task_idref) VALUES (:hash, " . $_STATE->task_id . ");"; $stmt = $_DB->prepare($sql); $stmt->bindValue(':hash', $hash, PDO::PARAM_STR); $stmt->execute(); $sql = "SELECT subtask_id FROM " . $_DB->prefix . "a14_subtask WHERE name=:hash;"; $stmt = $_DB->prepare($sql); $stmt->bindValue(':hash', $hash, PDO::PARAM_STR); $stmt->execute(); $_STATE->record_id = $stmt->fetchObject()->subtask_id; $stmt->closeCursor(); update_db(); $_STATE->msgStatus = "The subtask record for \"" . $_STATE->fields["Name"]->value() . "\" has been added to the task"; return TRUE; }
<?php (!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!'); get_key("office_sms_channel"); empty($do) && ($do = 'list'); if ($do == 'list') { $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "phone_channel order by id desc"); include_once 'template/channel_edit.php'; } elseif ($do == 'save') { $savetype = getGP('savetype', 'P'); //发送消息表 $phone_channel = array('username' => getGP('username', 'P'), 'password' => getGP('password', 'P')); update_db('phone_channel', $phone_channel, array('id' => 1)); //insert_db('channel_edit',$channel_edit); show_msg('信息更新成功!', 'admin.php?ac=channel_edit&fileurl=sms'); }