Example #1
0
 public function _header($smarty)
 {
     //退出登录链接
     $out_login_url = url("myweb", "home::outlogin");
     $smarty->assign("out_login_url", $out_login_url);
     //个人中心链接
     $usercenter_url = url("myweb", "usercenter::index");
     $smarty->assign('usercenter_url', $usercenter_url);
     //说说链接
     $comment_url = url("myweb", "usercenter::comment");
     $smarty->assign('comment_url', $comment_url);
     //相册链接
     $photo_url = url("myweb", "photo::index");
     $smarty->assign('photo_url', $photo_url);
     //音乐链接
     $music_url = url("myweb", "usercenter::photo", "photo");
     $smarty->assign('music_url', $music_url);
     //日志链接
     $journal_url = url("myweb", "journal::index");
     $smarty->assign('journal_url', $journal_url);
     if (Legal::isMobileCall()) {
         $is_mobile = 'yes';
     } else {
         $is_mobile = 'no';
     }
     $smarty->assign("is_mobile", $is_mobile);
     if ($username = User::getLoginUsername()) {
         $smarty->assign("username", $username);
     }
     //首页
     $smarty->assign('homeurl', HOMEURL);
 }
Example #2
0
 protected function getView($template = null)
 {
     if (empty($template)) {
         $template = $this->template;
     }
     $settings = ['title' => Setting::get('ex_title'), 'customer' => Setting::get('ex_customer'), 'date' => Setting::get('ex_date'), 'version' => Setting::get('ex_version'), 'disclaimer' => Setting::get('ex_disclaimer_html')];
     return View::make($template, ['project_name' => Setting::get('project_name'), 'generated_at' => date('d-m-Y H:i'), 'users' => static::getUsers(), 'logbooks' => static::getLogbooks($this->logbooks), 'logbooksAll' => static::getLogbooks('all'), 'entriesAll' => Entry::all(), 'attachments' => static::getAttachments($this->logbooks), 'attachmentsAll' => Attachment::all(), 'evidences' => Evidence::all(), 'custody' => Custody::all(), 'suspects' => Suspect::all(), 'legals' => Legal::where('active', 1)->get(), 'settings' => $settings]);
 }
 public function __construct()
 {
     parent::__construct();
     $users = User::orderBy('username')->paginate(self::$per_page);
     $legals = Legal::orderBy('id')->paginate(self::$per_page);
     $this->features = ['entries', 'logbooks', 'tasks', 'attachments', 'evidences', 'exports', 'tools'];
     $this->export_features = ['ex_title', 'ex_customer', 'ex_date', 'ex_version', 'ex_disclaimer', 'ex_pdf_sh_evidences', 'ex_pdf_sh_coc', 'ex_pdf_sh_attachments', 'ex_pdf_sh_suspects', 'ex_pdf_sh_legals', 'ex_html_sh_evidences', 'ex_html_sh_coc', 'ex_html_sh_attachments', 'ex_html_sh_suspects', 'ex_html_sh_legals'];
     View::share('users', $users);
     View::share('settings', Setting::all());
     View::share('suspects', Suspect::all());
     View::share('features', $this->features);
     View::share('legals', $legals);
 }
Example #4
0
 public function sendcode($email = '')
 {
     $email = isset($_POST['email']) ? htmlspecialchars(trim($_POST['email'])) : '';
     if (!$email) {
         echo '{"result":"-1","msg":"邮箱不能为空"}';
         throw new Exception('exit');
     }
     $rs = Legal::isEmail($email);
     if ($rs) {
         self::_sendCode($email);
     } else {
         echo '{"result":"-2","msg":"邮箱格式不对"}';
         throw new Exception('exit');
     }
 }
 public function run()
 {
     /* see code below the laws */
     /* Import legal array */
     if (!@(include "./app/database/includes/legalArr.php")) {
         throw new Exception('Failed to include the legal file');
     }
     /* Import legal data */
     if (!@(include "./app/database/includes/legals.php")) {
         throw new Exception('Failed to include the legal file');
     }
     /* end legals */
     $query = DB::table('legals')->get();
     $exist = count($query);
     if ($exist == 0) {
         for ($i = 0; $i < count($legals); $i++) {
             $legals[$i]['body'] = $legal[$i];
             $legals[$i]['html_body'] = Markdown::string($legals[$i]['body']);
         }
         Legal::insert($legals);
     } elseif (count($legals) != $exist) {
         throw new Exception('Difference legal rows. Delete rows for new import.');
     }
 }
Example #6
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Legal $value A Legal object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Legal $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = serialize(array((string) $obj->getLegalId(), (string) $obj->getLanguageId()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Example #7
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $attachment_id
  * @return Response
  */
 public function destroy($legal_id)
 {
     $legal = Legal::findOrFail($legal_id);
     $legal->delete();
     return Redirect::to(route('settings.index'))->with('message', ['content' => 'Wet met succes verwijderd!', 'class' => 'success']);
 }
Example #8
0
 /**
  * Exclude object from result
  *
  * @param     Legal $legal Object to remove from the list of results
  *
  * @return    LegalQuery The current query, for fluid interface
  */
 public function prune($legal = null)
 {
     if ($legal) {
         $this->addCond('pruneCond0', $this->getAliasedColName(LegalPeer::LEGAL_ID), $legal->getLegalId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(LegalPeer::LANGUAGE_ID), $legal->getLanguageId(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
Example #9
0
File: reg.php Project: lughong/test
 public function reging()
 {
     //用户名输入是否为空
     $username = isset($_POST['username']) ? htmlspecialchars(trim($_POST['username'])) : '';
     if (!$username) {
         $msg['error'] = '-3';
         $msg['msg'] = "用户名不能为空";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     $username_len = strlen($username);
     if ($username_len < 3 || $username_len > 16) {
         $msg['error'] = '-3';
         $msg['msg'] = "请输入3-16个字符的用户名";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     //检查该用户名是否已经注册了
     $username_rs = User::isUsernameExists($username);
     if ($username_rs) {
         $msg['error'] = '-3';
         $msg['msg'] = "注册失败,用户名已被注册";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     //邮箱输入是否为空
     $email = isset($_POST['email']) ? htmlspecialchars(trim($_POST['email'])) : '';
     if (!$email) {
         $msg['error'] = '-3';
         $msg['msg'] = "邮箱不能为空";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     //检查邮箱是否已被注册
     $email_rs = User::isEmailExists($email);
     if ($email_rs) {
         $msg['error'] = '-3';
         $msg['msg'] = "注册失败,邮箱已被注册";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     //验证邮箱格式
     if (!Legal::isEmail($email)) {
         $msg['error'] = '-3';
         $msg['msg'] = "邮箱格式错误";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     $password = isset($_POST['password']) ? htmlspecialchars(trim($_POST['password'])) : '';
     $repassword = isset($_POST['repassword']) ? htmlspecialchars(trim($_POST['repassword'])) : '';
     if (!$password) {
         $msg['error'] = '-3';
         $msg['msg'] = "密码填写不能为空";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     $password_len = strlen($password);
     if ($password_len < 6 || $password_len > 18) {
         $msg['error'] = '-3';
         $msg['msg'] = "请输入6-18个字符的密码";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     if ($password !== $repassword) {
         $msg['error'] = '-3';
         $msg['msg'] = "两次密码填写不一致";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     //检查验证码
     $captcha = isset($_POST['captcha']) ? htmlspecialchars(trim($_POST['captcha'])) : '';
     if (!$captcha) {
         $msg['error'] = '-3';
         $msg['msg'] = "请输入验证码";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     if ($_SESSION['captcha'] !== $captcha) {
         $msg['error'] = '-3';
         $msg['msg'] = "输入的验证码不正确";
         echo json_encode($msg);
         throw new Exception('exit');
     }
     $insert_rs = User::addUser($username, $password, $email);
     if ($insert_rs) {
         User::login($insert_rs);
         $url = url("myweb", "home::index");
         $msg['error'] = $insert_rs;
         $msg['msg'] = "注册成功";
         $msg['url'] = $url;
         echo json_encode($msg);
         throw new Exception('exit');
     } else {
         $msg['error'] = '-3';
         $msg['msg'] = "注册失败";
         echo json_encode($msg);
         throw new Exception('exit');
     }
 }
Example #10
0
<?php

if (isset($_GET['legal_id'])) {
    $legal_id = (int) $_GET['legal_id'];
    require_once "model/Legal.php";
    $model = new Legal();
    $detail = $model->getDetailLegal($legal_id);
}
?>
<div class="row">
    <div class="col-md-8">

        <!-- Custom Tabs -->
        <button class="btn btn-primary btn-sm" onclick="location.href='index.php?mod=legal&act=list'">Danh sách</button>
        <div style="clear:both;margin-bottom:10px"></div>

        <div class="box box-primary">
            <div class="box-header">
                <h3 class="box-title"><?php 
echo $legal_id > 0 ? "Cập nhật" : "Tạo mới";
?>
 khoảng giá</h3>

            </div><!-- /.box-header -->
            <!-- form start -->
            <form role="form" method="post" action="controller/Legal.php">
                <?php 
if ($legal_id > 0) {
    ?>
                <input type="hidden" value="<?php 
    echo $legal_id;
 /**
  * Show the form for creating a new resource.
  * GET /debtors/create
  *
  * @return Response
  */
 public function create()
 {
     //
     return View::make('debtors.create')->with('countries', Country::lists('name', 'id'))->with('legals', Legal::lists('name', 'id'))->with('debtor_group', DebtorsGroup::lists('name', 'id'));
 }
Example #12
0
<?php

require_once "model/Legal.php";
$model = new Legal();
$link = "index.php?mod=legal&act=list";
if (isset($_GET['status']) && $_GET['status'] > 0) {
    $lang_id = (int) $_GET['status'];
    $status .= "&status={$status}";
} else {
    $status = -1;
}
$listTotal = $model->getListLegalByStatus($status, -1, -1);
$total_record = mysql_num_rows($listTotal);
$total_page = ceil($total_record / LIMIT);
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$offset = LIMIT * ($page - 1);
$list = $model->getListLegalByStatus($status, $offset, LIMIT);
?>
<div class="row">
    <div class="col-md-12">
    <button class="btn btn-primary btn-sm right" onclick="location.href='index.php?mod=legal&act=form'">Tạo mới</button>
         <div class="box-header">
                <h3 class="box-title">Danh sách tiện ích</h3>
            </div><!-- /.box-header -->
        <div class="box">

            <div class="box-body">
                <table class="table table-bordered table-striped">
                    <tbody><tr>
                        <th style="width: 10px">No.</th>
                        <th>Name</th>