/** * 函数名称:saveAction * 功能描述:保存系统配置 */ public function saveSystemAction() { $arr = array('domain' => $this->getPost('domain'), 'title' => $this->getPost('title'), 'keywords' => $this->getPost('keywords'), 'description' => $this->getPost('description'), 'connect' => $this->getPost('connect'), 'email' => $this->getPost('email'), 'phone' => $this->getPost('phone'), 'icp' => $this->getPost('icp'), 'address' => $this->getPost('address')); $model = new Admin_SystemModel(); $res = $model->saveSystem(filterStr($arr)); $this->redirect('index'); }
public function getQuery($key, $filter = TRUE) { if ($filter) { return filterStr($this->getRequest()->getQuery($key)); } else { return $this->getRequest()->getQuery($key); } }
/** * 函数名称:loginAction * 功能描述:登录验证 */ public function loginAction() { $arr = array('username' => filterStr($this->getPost('username')), 'password' => md5(filterStr($this->getPost('password')))); $login = new Admin_LoginModel(); $res = $login->checkUserExist($arr); if (empty($res)) { $this->redirect('/Admin/Login/index'); } else { $this->setSession('userid', $res['id']); $this->setSession('groupid', $res['groupid']); $this->redirect('/Admin/Index/index'); } }
public function handleReplyAction() { Yaf_Dispatcher::getInstance()->disableView(); if (!$this->getRequest()->isXmlHttpRequest()) { header("http/1.1 404 not found"); return; } $return = array(); $uid = $this->getSession("uid"); if (!isset($uid)) { $return = array("status" => 0, "msg" => "请登录后再评论"); echo json_encode($return); die; } $POST = filterStr($_POST); $data = array(); $data["article_id"] = $POST["artileId"]; //文章id $data["from_id"] = $uid; //当前评论用户id $data["to_id"] = $POST["toUid"]; //文章作者ID $data["content"] = $POST["content"]; $time = time(); $data["ctime"] = $time; $data["type"] = $POST["type"]; $data["comment_id"] = $POST["commentId"]; $commentId = $this->m_comment->Insert($data); if ($commentId) { //增加评论数 if ($POST["type"] == 1) { $this->m_study->Where("id=" . $POST["artileId"])->Update(array("comment_num" => "comment_num+1"), True); } elseif ($POST["type"] == 2) { $this->m_travel->Where("id=" . $POST["artileId"])->Update(array("comment_num" => "comment_num+1"), True); } elseif ($POST["type"] == 3) { $this->m_discuss->Where("id=" . $POST["artileId"])->Update(array("comment_num" => "comment_num+1"), True); } //压入redis消息通知 $this->setMsg($POST["toUid"], 2); $return = array("status" => 1, "msg" => "评论成功", "ctime" => time_format($time), "content" => $POST["content"], "comment_id" => $commentId); echo json_encode($return); die; } else { $return = array("status" => 0, "msg" => "评论失败,请稍候再试"); echo json_encode($return); die; } }
<td><b>Budget:</b> <?php echo $value['price'] == null ? "Budget is not specified" : $value['price']; ?> </td> <td><b>Pickup Date:</b> <?php echo date('d-m-Y', strtotime($value['pickup_date'])); ?> </td> <td><b>Delivery Date:</b> <?php echo date('d-m-Y', strtotime($value['delivery_date'])); ?> </td> </tr> <tr> <td colspan="3"><b>Instructions:</b> <br/><?php echo filterStr($value['special_instructions']); ?> </td> </tr> </tbody> </table> <br/> <br/> <form action="<?php echo base_url(); ?> carrier/post_bid/<?php echo $value['id']; ?> " method="post" > <input type="hidden" name="key" value="<?php
/** * 函数名称:saveEditeAction * 功能描述:保存编辑 */ public function saveeditAction() { $groupid = $this->getSession('groupid'); $ruleid = $this->getPost('id'); $arr = array('pid' => $this->getPost('pid'), 'cateid' => $this->getPost('cateid'), 'name' => $this->getPost('name'), 'url' => $this->getPost('url'), 'level' => $this->getPost('level'), 'status' => $this->getPost('status')); $checkResult = $this->checkIsHaveAuth($ruleid, $groupid); if ($checkResult) { $map = filterStr($arr); $model = new Admin_AuthModel(); $result = $model->saveEditById($map, $ruleid); if ($result) { $this->redirect('list'); return true; } else { $this->redirect('edit?ruleid=' . $ruleid); return false; } } else { $this->redirect('edit?ruleid=' . $ruleid); return false; } }
<th>Delivery Date</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php if (count($data['deliveries']) == 0) { echo '<tr><td colspan="7">No Delivery exist quoted by you!</td></tr>'; } foreach ($data['deliveries'] as $key => $value) { echo '<tr>'; echo '<td>' . filterStr($value['name']) . '</td>'; echo '<td>' . ($value['price'] == null ? "Budget is not specified" : $value['price']) . '</td>'; echo '<td><address>' . filterStr($value['pickup_place'] . ',' . $value['pickup_city'] . '- ' . $value['pickup_pin']) . '</address></td>'; echo '<td><address>' . filterStr($value['delivery_place'] . ',' . $value['delivery_city'] . '- ' . $value['delivery_pin']) . '</address></td>'; echo '<td>' . date('d-m-Y', strtotime($value['pickup_date'])) . '</td>'; echo '<td>' . date('d-m-Y', strtotime($value['delivery_date'])) . '</td>'; ?> <td> <?php if ($value['status'] == 4) { ?> <span class='btn btn-success'>In Progress</span> <?php } else { if ($value['status'] == 5) { ?> <span class='btn btn-success'>Completed</span> <?php } else {
?> </td> <td><?php echo filterStr($value['name']); ?> </td> <td><?php echo filterStr($value['height_m'] . '.' . $value['height_cm'] . ' * ' . $value['width_m'] . '.' . $value['width_cm'] . ' * ' . $value['length_m'] . '.' . $value['length_cm'] . ' (' . $dimensions[$value['dimension']] . ')'); ?> </td> <td><?php echo filterStr($value['qty']); ?> </td> <td><?php echo filterStr($value['details']); ?> </td> </tr> <?php } ?> </tbody> </table> <?php if ($winner_carrier != null) { $key = array_search($winner_carrier, array_column($data['bid_detail'], 'carrier_id')); ?> <h3>You Chose following bidder:</h3> <table class="table table-striped"> <thead>
<?php } ?> </select> </div> <div class="form-group"> <label for="price">Price:</label> <input type="number" value="<?php echo filterStr($shipment_details['price']); ?> " placeholder="Keep blank if want get proposals" class="form-control" name="price" id="price" /> </div> <div class="form-group"> <label for="special_instructions">Any Instructions:</label> <textarea class="form-control details" name="special_instructions" ><?php echo filterStr($shipment_details['special_instructions']); ?> </textarea> </div> </div> <div class="col-md-12"> <button class="btn btn-warning" type="submit">Next</button> </div> </form> </div> </div> </div> </div> </div> </div>
/** * Method init * 初始化方法 * */ public function init() { $this->request = filterStr($this->getRequest()->getParams()); $this->view = $this->getView(); }
</td> <td class="td10"> <input required type="text" value="" class="form-control name" name="name" /> </td> <td class="td10"> <select required name='dimension' class='form-control dimension'> <?php foreach ($data['dimension_types'] as $dimension) { var_dump($data['dimension_types']); ?> <option value="<?php echo $dimension['id']; ?> "> <?php echo filterStr($dimension['name']); ?> </option> <?php } ?> </select> </td> <td class="td10"> <input required type="number" value="" class="form-control height_m mtr_units" name="height_m"/> <input required type="number" value="" class="form-control height_cm cmtr_units" name="height_cm"/> </td> <td class="td10"> <input required type="number" value="" class="form-control width_m mtr_units" name="width_m" /> <input required type="number" value="" class="form-control width_cm cmtr_units" name="width_cm" />
</div> <div class="form-group"> <div class="small-12 large-12 columns"> <select class="form-control" name="categories" id="categories" required="required"> <option value="">Select a category...</option> <?php foreach ($categories as $key => $value) { ?> <option <?php echo $value->id == $categories['selected_cat'][0] ? 'selected' : ''; ?> value="<?php echo $value->id; ?> "><?php echo filterStr($value->name); ?> </option> <?php } ?> </select> </div> </div> <div class="form-group"> <div class="small-12 large-12 columns"> <select class="form-control" name="sub_categories" id="sub_categories" required="required"> <option value="">Select a Sub Category...</option> </select> </div> </div>
public function getSubCategories() { $input = $this->input->post(); $this->load->model('SC_model'); $result = $this->SC_model->getSubCategories($input['type_id']); $ret = '<option value="">Select a Sub Category...</option>'; foreach ($result as $key => $value) { $ret = $ret . '<option value = "' . $value->id . '">' . filterStr($value->name) . '</option>'; } echo $ret; }
/** * 函数名称:saveeditAction * 功能描述:保存编辑用户组 */ public function saveeditAction() { $groupid = $this->getPost('id'); $arr = array('name' => $this->getPost('name'), 'status' => $this->getPost('status')); if (is_numeric($groupid)) { $data = filterStr($arr); $model = new Admin_GroupModel(); $updateResult = $model->saveEdit($data, $groupid); if ($updateResult) { $this->redirect('list'); return true; } else { $this->redirect('edit?groupid=' . $groupid); return false; } } else { $this->redirect('list'); return false; } }