コード例 #1
0
ファイル: savedaixie.php プロジェクト: jyyy410team/hts
} else {
    $action = @$_REQUEST["action"];
    $VipUser = $_COOKIE["AdminUser"];
    $title = @$_REQUEST["biaoti"];
    $content = @$_REQUEST["yaoqiu"];
    $pianshu = @$_REQUEST["pianshu"];
    $price = @$_REQUEST["jiage"];
    $data = date("Y-m-d H:i:s");
    $flag = @$_REQUEST["flag"];
    $encontent = @$_REQUEST["yijian"];
    $ID = @$_REQUEST["userid"];
    switch ($action) {
        case "add":
            $flag = 0;
            $flag1 = 3;
            $order_id = getyear($data) . getmonth($data) . getday($data) . rand(10000, 99999);
            $sqls = "select * from admin where AdminUser='******'";
            $results = mysql_db_query($dbname, $sqls);
            $rss = mysql_fetch_array($results);
            if ($rss != NULL) {
                $leixing = "软文代写";
                $sqlc = "insert into caiwu (order_id,VipUser,operator,leixing,jine,flag,data) values ('" . $order_id . "','" . $VipUser . "','" . $VipUser . "','" . $leixing . "'," . $price . "," . $flag1 . ",'" . $data . "')";
                mysql_db_query($dbname, $sqlc);
                $yue = $rss["yue"] - $price;
                $sqlu = "update admin set yue=" . $yue . " where AdminUser='******'";
                mysql_db_query($dbname, $sqlu);
                $sql = "insert into daixie_info (order_id,title,content,pianshu,price,VipUser,data,flag) values ('" . $order_id . "','" . $title . "','" . $content . "'," . $pianshu . "," . $price . ",'" . $VipUser . "','" . $data . "'," . $flag . ")";
                mysql_db_query($dbname, $sql);
                //mysql_select_db($dbname);
                //$result=mysql_query($sql);
                echo "<script>alert('提交代写成功!');location.href='daixie.php';</script>";
コード例 #2
0
ファイル: cnews.php プロジェクト: lxthien/batdongsan
 /**
  * Cnews::edit()
  * 
  * @param integer $catalogue_id
  * @param integer $news_id
  * @return
  */
 function edit($catalogue_id = 0, $news_id = 0)
 {
     $newscatalogue = new newscatalogue($catalogue_id);
     if (!$newscatalogue->exists()) {
         show_404();
     }
     $news = new article($news_id);
     if ($_SERVER['REQUEST_METHOD'] == "GET") {
         if (!$news->exists()) {
         } else {
             if (getconfigkey('use_ftp')) {
                 $this->load->library('ftp');
                 $config['hostname'] = $this->cauhinh->where('fieldname', 'ftp_server')->get()->value;
                 $config['username'] = $this->cauhinh->where('fieldname', 'ftp_username')->get()->value;
                 $config['password'] = $this->cauhinh->where('fieldname', 'ftp_password')->get()->value;
                 if (empty($news->dir)) {
                     $ex = explode(' ', $news->created);
                     $createdate = $ex[0];
                     $y = getyear($createdate);
                     $m = getmonth($createdate);
                     $d = getday($createdate);
                     $ddir = "img/news/" . $y . '/' . $m . '/' . $d . '/' . md5(date("Y-m-d h:i:s")) . '/';
                     $news->dir = $ddir;
                     $news->save();
                     $this->_create_dir($ddir);
                 } else {
                     if ($this->ftp->list_files($news->dir) == FALSE) {
                         $this->_create_dir($news->dir);
                     }
                 }
                 $this->ftp->close();
             } else {
                 if (empty($news->dir)) {
                     $news->dir = getconfigkey("default_news_dir");
                 }
             }
         }
     } else {
         $this->load->helper('remove_vn_helper');
         $this->load->library('file_lib');
         $news->title_vietnamese = $this->input->post('title_vietnamese');
         $news->title_english = $this->input->post('title_english');
         $news->title_japanese = $this->input->post('title_japanese');
         $news->title_none = remove_vn($news->title_vietnamese);
         $news->author = $this->input->post('author');
         $news->tag = $this->input->post('tag');
         $tags = remove_vn($this->input->post('tag') . ' ' . $this->input->post('title_vietnamese') . ' ' . $this->input->post('short_vietnamese'));
         $tags = explode('-', $tags);
         $news->tag_search = implode(' ', $tags);
         $news->short_vietnamese = strip_tags($this->input->post('txtShort_vietnamese'));
         $news->full_vietnamese = $this->input->post('txtFull_vietnamese');
         $news->short_english = strip_tags($this->input->post('txtShort_english'));
         $news->full_english = $this->input->post('txtFull_english');
         $news->short_japanese = strip_tags($this->input->post('txtShort_japanese'));
         $news->full_japanese = $this->input->post('txtFull_japanese');
         $news->dir = $this->input->post('dir');
         $news->pagi = $this->input->post('pagi');
         if ($this->logged_in_user->adminrole->id == 1) {
             $news->navigation = $this->input->post('navigation');
             $news->menu_active = $this->input->post('menu_active');
             $news->old_id = $this->input->post('old_id');
         }
         $new_image = $this->input->post('newimage');
         if ($new_image == '1') {
             $dataupload = $this->file_lib->upload('image', "img/news");
             if (!is_array($dataupload)) {
                 flash_message('error', $dataupload);
             } else {
                 $news->image = $dataupload['file_name'];
                 $this->resize_image($news->dir . $dataupload['file_name']);
             }
         } else {
             $news->image = trim($this->input->post('imagelink'));
         }
         //newstopic
         $newstp = new newstopic($this->input->post('newstopic'));
         $newsc = new newscatalogue($this->input->post('newscatalogue'));
         if (!$news->exists()) {
             $news->active = 0;
         }
         if ($news->save(array($newsc, $newstp))) {
             $this->session->unset_userdata('dir_for_news');
             redirect($this->admin . 'cnews/edit/' . $news->newscatalogue->id . '/' . $news->id);
         } else {
             flash_message("error", "Lỗi");
         }
     }
     //setup start folder for kfm
     $newscat = new newscatalogue();
     $newscat->where('parentcat_id !=', 'NULL');
     $newscat->where('parentcat_id', $newscatalogue->parentcat_id);
     $newscat->order_by('position', 'asc');
     $newscat->get();
     $newstopic = new newstopic();
     $newstopic->order_by('id', 'desc');
     $newstopic->get();
     $sitelanguage = new Sitelanguage();
     $sitelanguage->order_by('position', 'asc');
     $sitelanguage->get();
     $dis['sitelanguage'] = $sitelanguage;
     $dis['newstopic'] = $newstopic;
     $dis['base_url'] = base_url();
     $dis['newscatalogue'] = $newscat;
     $dis['currentcatalogue'] = $newscatalogue;
     $dis['title'] = "Thêm/ Sửa trang";
     $dis['menu_active'] = "Tin";
     $dis['view'] = "news/edit";
     $dis['object'] = $news;
     $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => "{$this->admin_url}cnews/list_all", "onclick" => ""));
     if ($this->logged_in_user->adminrole->id == 1 && $this->logged_in_user->adminrole->id == 1) {
         array_push($dis['nav_menu'], array("type" => "copymove", "text" => "Copy/Move", "link" => "javascript:void(0);", "onclick" => "show_copy()"));
     }
     $this->viewadmin($dis);
 }
コード例 #3
0
ファイル: tools2.php プロジェクト: bas2/diary
if (!isset($_SESSION[$diary->sessname])) {
    die('It was a dark, cloudy morning!');
}
// End if.
// End Access check code.
$act = @$_REQUEST['act'];
if (!isset($act)) {
    exit;
}
$gt_dt_d = @$_GET['dt_d'];
// Date passed to this script in the format yyyy-mm-dd
switch ($act) {
    // makerequest
    //
    case 'getday':
        getday($diary->link, $gt_dt_d, $d_date5, $arr_d, $datetoday);
        // $d_date5 will get passed to popp function
        break;
        //
    //
    case 'gotoday':
        gotoday($diary->link, $gt_dt_d, $arr_d);
        break;
        // Delete entry
    // Delete entry
    case 'del':
        del($diary->link);
        break;
        // Update / insert new entry
    // Update / insert new entry
    case 'upd':
コード例 #4
0
 function printdate($datetime)
 {
     return date('n月j日', $datetime) . ' ' . getday($datetime);
 }
コード例 #5
0
ファイル: dateutils.php プロジェクト: r3-gis/EcoGIS
/**
 * get all day names (eventually with short name)
 *
 * @param boolean $shortName define output format of day
 *
 * @return array with all day names
 */
function getalldays($shortName = false)
{
    $ret = array();
    for ($i = 1; $i < 8; $i++) {
        $ret[] = getday($i, $shortName);
    }
    return $ret;
}