예제 #1
0
 public function index()
 {
     $workTime = new WorkTimeUtil();
     if (RequestUtil::isPost()) {
         $params = RequestUtil::postParams();
         $params = array_map(function ($time) {
             if (!preg_match("~^\\d{2}:\\d{2}:\\d{2}\$~", $time)) {
                 return "{$time}:00";
             } else {
                 return $time;
             }
         }, $params);
         $allDay = $workTime->build($params['allDayStart'], $params['allDayEnd']);
         $morningShift = $workTime->build($params['morningShiftStart'], $params['morningShiftEnd']);
         $middayShift = $workTime->build($params['middayShiftStart'], $params['middayShiftEnd']);
         $nightShift = $workTime->build($params['nightShiftStart'], $params['nightShiftEnd']);
         $workTime->saveWorkTime($allDay, $morningShift, $nightShift, $middayShift);
         $workTime->getTime();
     }
     list($allDayStart, $allDayEnd) = $workTime->explode($workTime->getAllDay());
     list($morningShiftStart, $morningShiftEnd) = $workTime->explode($workTime->getMorningShift());
     list($middayShiftStart, $middayShiftEnd) = $workTime->explode($workTime->getMiddayShift());
     list($nightShiftStart, $nightShiftEnd) = $workTime->explode($workTime->getNightShift());
     $setting = array('allDayStart' => $allDayStart, 'allDayEnd' => $allDayEnd, 'morningShiftStart' => $morningShiftStart, 'morningShiftEnd' => $morningShiftEnd, 'nightShiftStart' => $nightShiftStart, 'nightShiftEnd' => $nightShiftEnd, 'middayShiftStart' => $middayShiftStart, 'middayShiftEnd' => $middayShiftEnd);
     $this->view('workTimeSetting', array('setting' => $setting));
 }
예제 #2
0
파일: Slider.php 프로젝트: guohao214/xinya
 public function updateSlider($sliderId)
 {
     if (!$sliderId) {
         $this->message('ID不能为空!');
     }
     if (RequestUtil::isPost()) {
         $this->sliderModel->deleteSliderCache();
         $params = RequestUtil::postParams();
         // href
         if (!preg_match('~^http[s]?://~', $params['href'])) {
             $params['href'] = 'http://' . $params['href'];
         }
         if ($this->sliderModel->rules()->run()) {
             $upload = UploadUtil::commonUpload(array('upload/resize_200x200', 'upload/resize_100x100', 'upload/resize_600x600'));
             if ($upload) {
                 $params['pic'] = $upload;
             }
             $returnUrl = 'slider/updateSlider/' . $sliderId;
             if ((new CurdUtil($this->sliderModel))->update(array('slider_id' => $sliderId), $params)) {
                 $this->message('修改成功!', $returnUrl);
             } else {
                 $this->message('修改失败!', $returnUrl);
             }
         }
     }
     $slider = (new CurdUtil($this->sliderModel))->readOne(array('slider_id' => $sliderId, 'disabled' => 0));
     if (!$slider) {
         $this->message('记录不存在或者已被删除!', 'slider/index');
     }
     $this->view('slider/updateSlider', array('slider' => $slider));
 }
예제 #3
0
파일: Login.php 프로젝트: guohao214/xinya
 public function index()
 {
     $error = '';
     if (RequestUtil::isPost()) {
         $validate = new ValidateUtil();
         $validate->required('user_name');
         $validate->required('password');
         $validate->required('verify_code');
         $params = RequestUtil::postParams();
         if ($params['verify_code'] != UserUtil::getVerifyCode()) {
             $error = '验证码错误!';
         } else {
             if ($validate->run()) {
                 $userModel = new UserModel();
                 $params['password'] = $userModel->encodePassword($params['password']);
                 $where = array('user_name' => $params['user_name'], 'password' => $params['password']);
                 $user = (new CurdUtil($userModel))->readOne($where, 'user_id desc', '*, user_type+0 as type');
                 if (!$user) {
                     $error = '登录失败,账号或者密码错误,请重试!';
                 } else {
                     (new CurdUtil($userModel))->update($where, array('last_login_time' => DateUtil::now()));
                     UserUtil::saveUser($user);
                     if (UserUtil::isAdmin()) {
                         ResponseUtil::redirect(UrlUtil::createBackendUrl('project/index'));
                     } else {
                         ResponseUtil::redirect(UrlUtil::createBackendUrl('beautician/index'));
                     }
                 }
             }
         }
     }
     $this->load->view('backend/login', array('error' => $error));
 }
예제 #4
0
 protected function _finish($code, $originalRedirectUri)
 {
     // This endpoint requires "Basic" auth.
     $clientCredentials = $this->appInfo->getKey() . ":" . $this->appInfo->getSecret();
     $authHeaderValue = "Basic " . base64_encode($clientCredentials);
     $response = RequestUtil::doPostWithSpecificAuth($this->clientIdentifier, $authHeaderValue, $this->userLocale, $this->appInfo->getHost()->getApi(), "1/oauth2/token", array("grant_type" => "authorization_code", "code" => $code, "redirect_uri" => $originalRedirectUri));
     if ($response->statusCode !== 200) {
         throw RequestUtil::unexpectedStatus($response);
     }
     $parts = RequestUtil::parseResponseJson($response->body);
     if (!array_key_exists('token_type', $parts) or !is_string($parts['token_type'])) {
         throw new Exception_BadResponse("Missing \"token_type\" field.");
     }
     $tokenType = $parts['token_type'];
     if (!array_key_exists('access_token', $parts) or !is_string($parts['access_token'])) {
         throw new Exception_BadResponse("Missing \"access_token\" field.");
     }
     $accessToken = $parts['access_token'];
     if (!array_key_exists('uid', $parts) or !is_string($parts['uid'])) {
         throw new Exception_BadResponse("Missing \"uid\" string field.");
     }
     $userId = $parts['uid'];
     if ($tokenType !== "Bearer" && $tokenType !== "bearer") {
         throw new Exception_BadResponse("Unknown \"token_type\"; expecting \"Bearer\", got  " . Client::q($tokenType));
     }
     return array($accessToken, $userId);
 }
예제 #5
0
 public function __construct($totalSize = 0, $config = 'pagination')
 {
     $config = ConfigUtil::loadConfig($config);
     $instance = get_instance();
     $config['total_rows'] = $totalSize;
     $config['base_url'] = RequestUtil::CM();
     $instance->load->library('pagination', $config);
     $this->pagination = $instance->pagination;
 }
예제 #6
0
 /**
  * Get connection string based on request variables
  */
 protected function GetConnectionString()
 {
     $cstring = new DBConnectionString();
     $cstring->Host = RequestUtil::Get('host');
     $cstring->Port = RequestUtil::Get('port');
     $cstring->Username = RequestUtil::Get('username');
     $cstring->Password = RequestUtil::Get('password');
     $cstring->DBName = RequestUtil::Get('schema');
     return $cstring;
 }
예제 #7
0
 /**
  * Initialize the GlobalConfig object
  */
 static function Init()
 {
     if (!self::$IS_INITIALIZED) {
         require_once 'verysimple/HTTP/RequestUtil.php';
         RequestUtil::NormalizeUrlRewrite();
         require_once 'verysimple/Phreeze/Controller.php';
         Controller::$SmartyViewPrefix = '';
         Controller::$DefaultRedirectMode = 'header';
         self::$IS_INITIALIZED = true;
     }
 }
 /**
  * Process the login, create the user session and then redirect to 
  * the appropriate page
  */
 public function Login()
 {
     $user = new ExampleUser();
     if ($user->Login(RequestUtil::Get('username'), RequestUtil::Get('password'))) {
         // login success
         $this->SetCurrentUser($user);
         $this->Redirect('SecureExample.UserPage');
     } else {
         // login failed
         $this->Redirect('SecureExample.LoginForm', 'Combinaçãoo de usuário ou senha incorretos');
     }
 }
예제 #9
0
 /**
  * Process the login, create the user session and then redirect to 
  * the appropriate page
  */
 public function Login()
 {
     $user = new User($this->Phreezer);
     if ($user->Login(RequestUtil::Get('username'), RequestUtil::Get('password'))) {
         // login success
         $this->SetCurrentUser($user);
         $this->Redirect('Secure.UserPage');
     } else {
         // login failed
         $this->Redirect('Secure.LoginForm', 'Usuario e senha invalidos.');
     }
 }
예제 #10
0
 public function index($limit = '')
 {
     // 获得查询参数, 查询参数都为like模糊查询
     $where = RequestUtil::buildLikeQueryParamsWithDisabled();
     $this->db->select('*');
     $orders = (new CurdUtil($this->offlineOrderModel))->readLimit($where, $limit, 'offline_order_id desc');
     $ordersCount = (new CurdUtil($this->offlineOrderModel))->count($where);
     $pages = (new PaginationUtil($ordersCount))->pagination();
     $shops = (new ShopModel())->getAllShops();
     $beauticians = (new BeauticianModel())->getAllFormatBeauticians();
     $this->view('offline/order', array('orders' => $orders, 'pages' => $pages, 'beauticians' => $beauticians, 'params' => RequestUtil::getParams(), 'shops' => $shops, 'limit' => $limit));
 }
예제 #11
0
 /**
  * Process the login, create the user session and then redirect to 
  * the appropriate page
  */
 public function Login()
 {
     $user = new ExampleUser();
     if ($user->Login(RequestUtil::Get('username'), RequestUtil::Get('password'))) {
         // login success
         $this->SetCurrentUser($user);
         $this->Redirect('SecureExample.UserPage');
     } else {
         // login failed
         $this->Redirect('SecureExample.LoginForm', 'Unknown username/password combination');
     }
 }
예제 #12
0
 public function index($limit = '')
 {
     // 获得查询参数, 查询参数都为like模糊查询
     $where = RequestUtil::buildLikeQueryParamsWithDisabled();
     $this->db->select('*');
     $customers = (new CurdUtil($this->customerModel))->readLimit($where, $limit, 'customer_id desc');
     $customersCount = (new CurdUtil($this->customerModel))->count($where);
     $pages = (new PaginationUtil($customersCount))->pagination();
     // 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知
     $sex = array('未知', '男', '女');
     $this->view('customer/index', array('customers' => $customers, 'pages' => $pages, 'params' => RequestUtil::getParams(), 'limit' => $limit, 'sex' => $sex));
 }
예제 #13
0
 /**
  * 增加新用户专享
  */
 public function addForNewUserProject()
 {
     if (RequestUtil::isPost()) {
         $params = RequestUtil::postParams();
         $insertId = (new CurdUtil($this->projectPropertyModel))->create($params);
         if ($insertId) {
             $this->message('新增成功!', 'ProjectProperty/projectForNewUserList');
         } else {
             $this->message('新增失败!');
         }
     }
     $categories = (new CategoryModel())->getAllCategories();
     $this->view('projectProperty/forNewUser', array('categories' => $categories));
 }
 static function testDisallowed($url, $expectedExceptionMessage)
 {
     $curl = RequestUtil::mkCurl("test-ssl", $url);
     $curl->set(CURLOPT_RETURNTRANSFER, true);
     try {
         $curl->exec();
     } catch (Exception_NetworkIO $ex) {
         if (strpos($ex->getMessage(), $expectedExceptionMessage) == 0) {
             return true;
         } else {
             throw $ex;
         }
     }
     return false;
 }
예제 #15
0
파일: Article.php 프로젝트: guohao214/xinya
 public function addArticle()
 {
     if (RequestUtil::isPost()) {
         if ($this->articleModel->rules()->run()) {
             $params = RequestUtil::postParams();
             $insertId = (new CurdUtil($this->articleModel))->create(array_merge($params, array('create_time' => DateUtil::now())));
             if ($insertId) {
                 $this->message('新增文章成功!', 'article/index');
             } else {
                 $this->message('新增文章失败!', 'article/index');
             }
         }
     }
     $this->view('article/addArticle');
 }
예제 #16
0
파일: Shop.php 프로젝트: guohao214/xinya
 /**
  * 添加店铺
  */
 public function addShop()
 {
     if (RequestUtil::isPost()) {
         if ($this->shopModel->rules()->run()) {
             $params = RequestUtil::postParams();
             $params['shop_logo'] = UploadUtil::commonUpload(array('upload/resize_200x200', 'upload/resize_100x100'));
             $insertId = (new CurdUtil($this->shopModel))->create(array_merge($params, array('create_time' => DateUtil::now())));
             if ($insertId) {
                 $this->message('新增店铺成功!', 'shop/index');
             } else {
                 $this->message('新增店铺失败!', 'shop/index');
             }
         }
     }
     $this->view('shop/addShop');
 }
 /**
  * Returns the controller and method for the given URI
  *
  * @param string the url, if not provided will be obtained using the current URL
  * @return array($controller,$method)
  */
 public function GetRoute($uri = "")
 {
     $match = '';
     $qs = $uri ? $uri : (array_key_exists('QUERY_STRING', $_SERVER) ? $_SERVER['QUERY_STRING'] : '');
     $parsed = explode('&', $qs, 2);
     $action = $parsed[0];
     if (strpos($action, '=') > -1 || !$action) {
         // the querystring is empty or the first param is a named param, which we ignore
         $match = $this->defaultAction;
     } else {
         // otherwise we have a route.  see if we have a match in the routemap, otherwise return the 'not found' route
         $method = RequestUtil::GetMethod();
         $route = $method . ':' . $action;
         $match = array_key_exists($route, $this->routes) ? $this->routes[$route]['route'] : self::$ROUTE_NOT_FOUND;
     }
     return explode('.', $match, 2);
 }
예제 #18
0
파일: User.php 프로젝트: guohao214/xinya
 public function addUser()
 {
     if (RequestUtil::isPost()) {
         if ($this->userModel->rules()->run()) {
             $params = RequestUtil::postParams();
             unset($params['re_password']);
             $params['password'] = $this->userModel->encodePassword($params['password']);
             $insertId = (new CurdUtil($this->userModel))->create(array_merge($params, array('create_time' => DateUtil::now())));
             if ($insertId) {
                 $this->message('新增账户成功!', 'user/index');
             } else {
                 $this->message('新增账户失败!', 'user/index');
             }
         }
     }
     $this->view('user/addUser');
 }
예제 #19
0
 public function updateCouponCode($couponCodeId, $limit = '')
 {
     if (!$couponCodeId) {
         $this->message('优惠码不能为空!');
     }
     if (RequestUtil::isPost()) {
         if ($this->couponCodeModel->rules()->run()) {
             $params = RequestUtil::postParams();
             if ((new CurdUtil($this->couponCodeModel))->update(array('coupon_code_id' => $couponCodeId), $params)) {
                 $this->message('修改优惠码成功!', 'couponCode/updateCouponCode/' . $couponCodeId . "/{$limit}");
             } else {
                 $this->message('修改优惠码失败!', 'couponCode/updateCouponCode/' . $couponCodeId . "/{$limit}");
             }
         }
     }
     $coupon = $this->couponCodeModel->readOne($couponCodeId);
     $this->view('couponCode/updateCouponCode', array('coupon' => $coupon, 'limit' => $limit));
 }
예제 #20
0
파일: Order.php 프로젝트: guohao214/xinya
 public function index($limit = '')
 {
     $shopId = $this->input->get('shop_id') + 0;
     if ($shopId == 0) {
         unset($_GET['shop_id']);
     } else {
         $this->db->where_in('shop_id', array(0, $shopId));
     }
     // 获得查询参数, 查询参数都为like模糊查询
     $where = RequestUtil::buildLikeQueryParamsWithDisabled();
     $this->db->select('*');
     $this->db->select('order_status+0 as order_sign', false);
     $orders = (new CurdUtil($this->orderModel))->readLimit($where, $limit, 'order_id desc');
     $ordersCount = (new CurdUtil($this->orderModel))->count($where);
     $pages = (new PaginationUtil($ordersCount))->pagination();
     $shops = (new ShopModel())->getAllShops();
     $beauticians = (new BeauticianModel())->getAllFormatBeauticians();
     $this->view('order/index', array('orders' => $orders, 'pages' => $pages, 'beauticians' => $beauticians, 'params' => RequestUtil::getParams(), 'shops' => $shops, 'limit' => $limit));
 }
예제 #21
0
 /**
  * Process the login, create the user session and then redirect to 
  * the appropriate page
  */
 public function Login()
 {
     $user = new Usuario($this->Phreezer);
     if ($user->Login(RequestUtil::Get('username'), RequestUtil::Get('password'))) {
         // login success
         $this->SetCurrentUser($user);
         $_SESSION['nomeUser'] = $this->GetCurrentUser()->Nome;
         //se existir uma pagina na url, senão manda para pagina padrao
         if ($this->paginaLoginRedirect) {
             $pagina = $this->paginaLoginRedirect;
         } elseif ($this->GetCurrentUser()->TipoUsuario != '') {
             $pagina = 'Default.Home';
         }
         //$pagina = ;
         $this->Redirect($pagina);
     } else {
         // login failed
         $this->Redirect('SecureExample.LoginForm', 'Combinação de usuário ou senha incorretos');
     }
 }
예제 #22
0
 public function updateCategory($categoryId)
 {
     if (!$categoryId) {
         $this->message('分类ID错误!');
     }
     if (RequestUtil::isPost()) {
         if ($this->categoryModel->rules()->run()) {
             $params = RequestUtil::postParams();
             $affectedRows = (new CurdUtil($this->categoryModel))->update(array('category_id' => $categoryId), array('category_name' => $params['category_name'], 'order_sort' => $params['order_sort']));
             if ($affectedRows > 0) {
                 $this->message('修改分类信息成功!', 'category/index');
             } else {
                 $this->message('修改分类信息失败!', 'category/index');
             }
         }
     }
     $category = (new CurdUtil($this->categoryModel))->readOne(array('category_id' => $categoryId));
     if (!$category) {
         $this->message('分类不存在!', 'category/index');
     }
     $this->view('category/updateCategory', $category);
 }
예제 #23
0
 public function updateExchangeGoods($exchangeGoodsId, $limit = '')
 {
     if (RequestUtil::isPost()) {
         if ($this->exchangeGoodsModel->rules()->run()) {
             $params = RequestUtil::postParams();
             $upload = UploadUtil::commonUpload(array('upload/resize_200x200', 'upload/resize_600x600', 'upload/resize_100x100'));
             if ($upload) {
                 $params['exchange_goods_pic'] = $upload;
             }
             if ((new CurdUtil($this->exchangeGoodsModel))->update(array('exchange_goods_id' => $exchangeGoodsId), $params)) {
                 $this->message('修改兑换商品成功!', 'exchangeGoods/updateExchangeGoods/' . $exchangeGoodsId . "/{$limit}");
             } else {
                 $this->message('修改兑换商品失败!', 'exchangeGoods/updateExchangeGoods/' . $exchangeGoodsId . "/{$limit}");
             }
         }
     }
     $shops = (new ShopModel())->getAllShops();
     $exchangeGoods = $this->exchangeGoodsModel->readOne($exchangeGoodsId);
     if (!$exchangeGoods) {
         $this->message('兑换商品不存在或者已被删除!', "exchangeGoods/index/{$limit}");
     }
     $this->view('exchangeGoods/updateExchangeGoods', array('exchangeGoods' => $exchangeGoods, 'shops' => $shops, 'limit' => $limit));
 }
예제 #24
0
 /**
  * Create a {@link Curl} object that is pre-configured with {@link getClientIdentifier()},
  * and the proper OAuth 2 "Authorization" header.
  *
  * @param string $url
  *    Generate this URL using {@link buildUrl()}.
  *
  * @return Curl
  */
 function mkCurl($url)
 {
     $_CURL = RequestUtil::mkCurlWithOAuth($this->clientIdentifier, $url, $this->accessToken);
     return $_CURL;
 }
예제 #25
0
 /**
  * Output a Json error message to the browser
  * @param string $message
  * @param array key/value pairs where the key is the fieldname and the value is the error
  */
 protected function RenderErrorJSON($message, $errors = null, $exception = null)
 {
     $err = new stdClass();
     $err->success = false;
     $err->message = $message;
     $err->errors = array();
     if ($errors != null) {
         foreach ($errors as $key => $val) {
             $err->errors[lcfirst($key)] = $val;
         }
     }
     if ($exception) {
         $err->stackTrace = explode("\n#", substr($exception->getTraceAsString(), 1));
     }
     @header('HTTP/1.1 401 Unauthorized');
     $this->RenderJSON($err, RequestUtil::Get('callback'));
 }
예제 #26
0
        <a class="crumb-name" href="<?php 
echo UrlUtil::createBackendUrl('coupon/index');
?>
">优惠券管理</a>
        <span class="crumb-step">&gt;</span><span>新增优惠券</span></div>
</div>
<div class="result-wrap">
    <div class="result-content">
        <div class="error">
            <?php 
echo validation_errors();
?>
        </div>

        <?php 
echo form_open(RequestUtil::CM());
?>
        <table class="insert-tab" width="100%">
            <tbody>

            <tr>
                <th><i class="require-red">*</i>优惠券名称:</th>
                <td>
                    <input class="common-text required" name="coupon_name"
                           value="<?php 
echo set_value('coupon_name');
?>
" size="50" type="text">
                </td>
            </tr>
예제 #27
0
 function Init()
 {
     $this->fh = fopen($this->filepath, "a");
     $this->fileIsOpen = true;
     fwrite($this->fh, "DEBUG:\t" . date("Y-m-d H:i:s:u") . "\t" . getmypid() . "\t########## ObserveToFile Initialized: " . RequestUtil::GetCurrentURL() . " ##########\r\n");
 }
 /**
  * API Method updates an existing CreatorAwardHonour record and render response as JSON
  */
 public function Update()
 {
     try {
         $json = json_decode(RequestUtil::GetBody());
         if (!$json) {
             throw new Exception('The request body does not contain valid JSON');
         }
         $pk = $this->GetRouter()->GetUrlParam('id');
         $creatorawardhonour = $this->Phreezer->Get('CreatorAwardHonour', $pk);
         // TODO: any fields that should not be updated by the user should be commented out
         // this is a primary key.  uncomment if updating is allowed
         // $creatorawardhonour->Id = $this->SafeGetVal($json, 'id', $creatorawardhonour->Id);
         $creatorawardhonour->Description = $this->SafeGetVal($json, 'description', $creatorawardhonour->Description);
         $creatorawardhonour->Grantedby = $this->SafeGetVal($json, 'grantedby', $creatorawardhonour->Grantedby);
         $creatorawardhonour->Title = $this->SafeGetVal($json, 'title', $creatorawardhonour->Title);
         $creatorawardhonour->Type = $this->SafeGetVal($json, 'type', $creatorawardhonour->Type);
         $creatorawardhonour->Validate();
         $errors = $creatorawardhonour->GetValidationErrors();
         if (count($errors) > 0) {
             $this->RenderErrorJSON('Please check the form for errors', $errors);
         } else {
             $creatorawardhonour->Save();
             $this->RenderJSON($creatorawardhonour, $this->JSONPCallback(), true, $this->SimpleObjectParams());
         }
     } catch (Exception $ex) {
         $this->RenderExceptionJSON($ex);
     }
 }
 /**
  * API Method updates an existing Itemdescription record and render response as JSON
  */
 public function Update()
 {
     try {
         $json = json_decode(RequestUtil::GetBody());
         if (!$json) {
             throw new Exception('The request body does not contain valid JSON');
         }
         $pk = $this->GetRouter()->GetUrlParam('id');
         $itemdescription = $this->Phreezer->Get('Itemdescription', $pk);
         // TODO: any fields that should not be updated by the user should be commented out
         // this is a primary key.  uncomment if updating is allowed
         // $itemdescription->Id = $this->SafeGetVal($json, 'id', $itemdescription->Id);
         $itemdescription->Item = $this->SafeGetVal($json, 'item', $itemdescription->Item);
         $itemdescription->Abstracttext = $this->SafeGetVal($json, 'abstracttext', $itemdescription->Abstracttext);
         $itemdescription->Accrual = $this->SafeGetVal($json, 'accrual', $itemdescription->Accrual);
         $itemdescription->Appraisaldesstructionschedulling = $this->SafeGetVal($json, 'appraisaldesstructionschedulling', $itemdescription->Appraisaldesstructionschedulling);
         $itemdescription->Arrangement = $this->SafeGetVal($json, 'arrangement', $itemdescription->Arrangement);
         $itemdescription->Broadcastmethod = $this->SafeGetVal($json, 'broadcastmethod', $itemdescription->Broadcastmethod);
         $itemdescription->Era = $this->SafeGetVal($json, 'era', $itemdescription->Era);
         $itemdescription->Fromcorporate = $this->SafeGetVal($json, 'fromcorporate', $itemdescription->Fromcorporate);
         $itemdescription->Frompersonal = $this->SafeGetVal($json, 'frompersonal', $itemdescription->Frompersonal);
         $itemdescription->Geographiccoodnates = $this->SafeGetVal($json, 'geographiccoodnates', $itemdescription->Geographiccoodnates);
         $itemdescription->Geographicname = $this->SafeGetVal($json, 'geographicname', $itemdescription->Geographicname);
         $itemdescription->Label = $this->SafeGetVal($json, 'label', $itemdescription->Label);
         $itemdescription->Language = $this->SafeGetVal($json, 'language', $itemdescription->Language);
         $itemdescription->Mediapresentation = $this->SafeGetVal($json, 'mediapresentation', $itemdescription->Mediapresentation);
         $itemdescription->Movement = $this->SafeGetVal($json, 'movement', $itemdescription->Movement);
         $itemdescription->Other = $this->SafeGetVal($json, 'other', $itemdescription->Other);
         $itemdescription->Period = $this->SafeGetVal($json, 'period', $itemdescription->Period);
         $itemdescription->Periodicity = $this->SafeGetVal($json, 'periodicity', $itemdescription->Periodicity);
         $itemdescription->Preservationstatus = $this->SafeGetVal($json, 'preservationstatus', $itemdescription->Preservationstatus);
         $itemdescription->Scope = $this->SafeGetVal($json, 'scope', $itemdescription->Scope);
         $itemdescription->Style = $this->SafeGetVal($json, 'style', $itemdescription->Style);
         $itemdescription->Subject = $this->SafeGetVal($json, 'subject', $itemdescription->Subject);
         $itemdescription->Tableofcontents = $this->SafeGetVal($json, 'tableofcontents', $itemdescription->Tableofcontents);
         $itemdescription->Targetaudience = $this->SafeGetVal($json, 'targetaudience', $itemdescription->Targetaudience);
         $itemdescription->Tocorporate = $this->SafeGetVal($json, 'tocorporate', $itemdescription->Tocorporate);
         $itemdescription->Topersonal = $this->SafeGetVal($json, 'topersonal', $itemdescription->Topersonal);
         $itemdescription->Validate();
         $errors = $itemdescription->GetValidationErrors();
         if (count($errors) > 0) {
             $this->RenderErrorJSON('Please check the form for errors', $errors);
         } else {
             $itemdescription->Save();
             $this->RenderJSON($itemdescription, $this->JSONPCallback(), true, $this->SimpleObjectParams());
         }
     } catch (Exception $ex) {
         $this->RenderExceptionJSON($ex);
     }
 }
예제 #30
0
 * file should be added instead and then copied for each install
 */
require_once 'verysimple/Phreeze/ConnectionSetting.php';
require_once "verysimple/HTTP/RequestUtil.php";
/** database connection settings */
GlobalConfig::$CONNECTION_SETTING = new ConnectionSetting();
GlobalConfig::$CONNECTION_SETTING->ConnectionString = ":3306";
GlobalConfig::$CONNECTION_SETTING->DBName = "test";
GlobalConfig::$CONNECTION_SETTING->Username = "******";
GlobalConfig::$CONNECTION_SETTING->Password = "";
GlobalConfig::$CONNECTION_SETTING->Type = "MySQL_PDO";
GlobalConfig::$CONNECTION_SETTING->Charset = "utf8";
GlobalConfig::$CONNECTION_SETTING->Multibyte = true;
// GlobalConfig::$CONNECTION_SETTING->BootstrapSQL = "SET SQL_BIG_SELECTS=1";
/** the root url of the application with trailing slash, for example http://localhost/pizzaria meveana/ */
GlobalConfig::$ROOT_URL = RequestUtil::GetServerRootUrl() . 'meveana/';
/** timezone */
// date_default_timezone_set("UTC");
/** functions for php 5.2 compatibility */
if (!function_exists('lcfirst')) {
    function lcfirst($string)
    {
        return substr_replace($string, strtolower(substr($string, 0, 1)), 0, 1);
    }
}
// if Multibyte support is specified then we need to check if multibyte functions are available
// if you receive this error then either install multibyte extensions or set Multibyte to false
if (GlobalConfig::$CONNECTION_SETTING->Multibyte && !function_exists('mb_strlen')) {
    die('<html>Multibyte extensions are not installed but Multibyte is set to true in _machine_config.php</html>');
}
/** level 2 cache */