コード例 #1
0
ファイル: site_helper.php プロジェクト: GordonTees/masterdash
 function call_model_function2($model_name, $class, $function, $args = array())
 {
     $result = '';
     $CI =& get_instance();
     $CI->load->model($model_name);
     if ($class != '' && $function != '') {
         $result = $CI->{$class}->{$function}(chk($args[0]), chk($args[1]), chk($args[2]), chk($args[3]), chk($args[4]), chk($args[5]), chk($args[6]));
     }
     return $result;
 }
コード例 #2
0
ファイル: smap_clean.php プロジェクト: ink-ru/sm_clean
        $sRule = '#' . $sRule . '#i';
        log_push($sRule);
        $sRules[] = $sRule;
    }
}
if (file_exists($_GET['sm'])) {
    $sFile = $_GET['sm'];
    $sM = file($sFile);
    if (!chk($sM)) {
        die('не удалось прочитать' . $sFile);
    }
    log_push('карта сайта найдена');
} elseif (!empty($_SERVER['HTTP_HOST'])) {
    $sFile = 'http://' . $_SERVER['HTTP_HOST'] . '/' . $_GET['sm'];
    $sM = @file($sFile);
    if (!chk($sM)) {
        die('не удалось прочитать' . $sFile);
    }
    log_push('карта сайта найдена');
} else {
    die('не удалось открыть ' . $_GET['sm']);
}
foreach ($sM as $k => $v) {
    if (preg_match('#</?sitemapindex>#i', $v) || preg_match('#</?sitemap>#i', $v)) {
        log_push('Ошибка!', 'error');
        die('Этот скрипт пока не может обрабатывать вложенные катры!');
    }
    // удаляем лишние дискрипторы
    if (!preg_match('#<\\?xml#i', $v) && !preg_match('#</?urlset#i', $v) && !preg_match('#</?url>#i', $v) && !preg_match('#</?loc>#i', $v) && !preg_match('#</?sitemapindex>#i', $v) && !preg_match('#</?sitemap>#i', $v)) {
        $sM[$k] = '';
        unset($sM[$k]);
コード例 #3
0
 /**
  * Delete Relationships
  * 
  * Method is designed to delete any relationship that contains the UUID
  * 
  * @return integer
  */
 function deleteRelationships()
 {
     if (!chk($this->id)) {
         return false;
     }
     //initializing variables
     $relationships = $this->getRelationships();
     $count = 0;
     foreach ($relationships as $rel) {
         $table = false;
         if ($rel['lhs_table'] == $this->_tbl) {
             $key = $rel['join_key_lhs'];
             $table = $rel['join_table'];
         }
         if ($rel['rhs_table'] == $this->_tbl) {
             $key = $rel['join_key_rhs'];
             $table = $rel['join_table'];
         }
         if ($table) {
             //query to delete THIS record
             $query = "DELETE FROM `" . $table . "` " . " WHERE `" . $key . "` = '" . $this->id . "';";
             if ($this->_db->query($query, false, '')) {
                 $count++;
             }
         }
     }
     return $count;
 }
コード例 #4
0
 function Dump_address($con, $coin, $session, $dump_adr, $dump_pass)
 {
     $password = sha1($dump_pass);
     $sqli_chk = mysqli_query($con, "SELECT Password,Username FROM users WHERE Password='" . $password . "' AND Session_id='" . $session . "'");
     if (mysqli_num_rows($sqli_chk) == 1) {
         $is_vid = $coin->validateaddress($dump_adr);
         if ($is_vid["isvalid"] == 1) {
             $getuser = mysqli_fetch_array($sqli_chk);
             $list_adrs = $coin->getaddressesbyaccount($getuser["Username"]);
             function chk($list_adrs, $dump_adr)
             {
                 foreach ($list_adrs as $index => $key) {
                     if ($list_adrs[$index] == $dump_adr) {
                         return "Ok!";
                     }
                 }
             }
             if (chk($list_adrs, $dump_adr) == "Ok!") {
                 $dmp = $coin->dumpprivkey($dump_adr);
                 echo $dmp;
             } else {
                 echo "ERROR! Reload page";
             }
         } else {
             echo "ERROR! Invalid Address!";
         }
     } else {
         echo "Incorrect Account Password!";
     }
 }
コード例 #5
0
ファイル: home_sample.php プロジェクト: hezrul/seashell
<?php

require_once 'setting.php';
require_once @$fwfolder . '/emenudmenu.php';
$do = $_GET['do'];
if ($do == '') {
    $do = emenu(chk($keybefore), chk($mainpage));
}
$do = dmenu($keybefore, $do);
if ($do == 'utama') {
    $side_utama = 'current';
}
### mula : logout
if (@chk($_GET['logout'])) {
}
### tamat : logout
?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Framework 3.0 
            <?php 
error_reporting(E_ALL ^ E_DEPRECATED);
if ($url_live != $url) {
    echo $do;
    ini_set("display_errors", 1);
} else {
    ini_set("display_errors", 0);
}
?>
コード例 #6
0
ファイル: class-edit.php プロジェクト: ade24/vcorner
?>
>Pelayanan Hotel Plus<br>
<input type="checkbox" value="bath" name="5" <?php 
echo chk("bath");
?>
>Kamar Mandi<br>
<input type="checkbox" value="dinner" name="6" <?php 
echo chk("dinner");
?>
>Makan Malam<br>
<input type="checkbox" value="parking" name="7" <?php 
echo chk("parking");
?>
>Parkir<br>
<input type="checkbox" value="laundry" name="8" <?php 
echo chk("laundry");
?>
>Laundry<br>
      <label>Deskripsi</label>
      <textarea id="editor1" name="editor1" rows="10" cols="80"> <?php 
echo $r['description'];
?>
</textarea>
   
      <p></p>
      <input type="submit" class="btn btn-primary" name="button" id="button" value="Update">
</form>
<script type="text/javascript">

// This is a check for the CKEditor class. If not defined, the paths must be checked.
if ( typeof CKEDITOR == 'undefined' )
コード例 #7
0
ファイル: main.php プロジェクト: prolin99/tad_web
function tad_web_form($WebID = null)
{
    global $xoopsDB, $xoopsUser, $xoopsTpl, $TadUpFiles;
    $pic = "";
    //抓取預設值
    if (!empty($WebID)) {
        $DBV = get_tad_web($WebID);
        //圖案
        $TadUpFiles->set_col("WebLogo", $WebID, "1");
        $web_logo = $TadUpFiles->get_pic_file("thumb");
        $pic = empty($web_logo) ? "" : "background-image:url({$web_logo});background-repeat: no-repeat;  background-position: top right;";
    } else {
        $DBV = array();
    }
    //預設值設定
    //設定「WebID」欄位預設值
    $WebID = !isset($DBV['WebID']) ? $WebID : $DBV['WebID'];
    //設定「WebName」欄位預設值
    $WebName = !isset($DBV['WebName']) ? "" : $DBV['WebName'];
    //設定「WebSort」欄位預設值
    $WebSort = !isset($DBV['WebSort']) ? tad_web_max_sort() : $DBV['WebSort'];
    //設定「WebEnable」欄位預設值
    $WebEnable = !isset($DBV['WebEnable']) ? "" : $DBV['WebEnable'];
    //設定「WebCounter」欄位預設值
    $WebCounter = !isset($DBV['WebCounter']) ? "" : $DBV['WebCounter'];
    //設定「WebOwner」欄位預設值
    $WebOwner = !isset($DBV['WebOwner']) ? "" : $DBV['WebOwner'];
    //設定「WebOwnerUid」欄位預設值
    $WebOwnerUid = !isset($DBV['WebOwnerUid']) ? "" : $DBV['WebOwnerUid'];
    //設定「WebTitle」欄位預設值
    $WebTitle = !isset($DBV['WebTitle']) ? "" : $DBV['WebTitle'];
    $op = empty($WebID) ? "insert_tad_web" : "update_tad_web";
    //$op="replace_tad_web";
    if (!file_exists(TADTOOLS_PATH . "/formValidator.php")) {
        redirect_header("index.php", 3, _MA_NEED_TADTOOLS);
    }
    include_once TADTOOLS_PATH . "/formValidator.php";
    $formValidator = new formValidator("#myForm", true);
    $formValidator_code = $formValidator->render();
    $sql = "select uid,uname,name from " . $xoopsDB->prefix("users") . " order by uname";
    $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error());
    $user_menu = "<select name='WebOwnerUid'>";
    while ($all = $xoopsDB->fetchArray($result)) {
        foreach ($all as $k => $v) {
            ${$k} = $v;
        }
        $name = empty($name) ? "" : "({$name})";
        $selected = $uid == $WebOwnerUid ? "selected" : "";
        $user_menu .= "<option value='{$uid}' {$selected}>{$uname} {$name}</option>";
    }
    $user_menu .= "</select>";
    //$jquery = get_jquery(true);
    $xoopsTpl->assign('pic', $pic);
    $xoopsTpl->assign('user_menu', $user_menu);
    $xoopsTpl->assign('WebName', $WebName);
    $xoopsTpl->assign('WebTitle', $WebTitle);
    $xoopsTpl->assign('WebOwner', $WebOwner);
    $xoopsTpl->assign('WebEnable1', chk($WebEnable, "1", "1"));
    $xoopsTpl->assign('WebEnable0', chk($WebEnable, "0"));
    $xoopsTpl->assign('WebSort', $WebSort);
    $xoopsTpl->assign('WebID', $WebID);
    $xoopsTpl->assign('next_op', $op);
    $xoopsTpl->assign('jquery', $jquery);
}
コード例 #8
0
<?php

// Страница проверки существования логина
include_once "config.php";
function chk()
{
    $err = array();
    # проверям логин
    if (!preg_match("/^[a-zA-Z0-9]+\$/", $_GET['tlogin'])) {
        echo "Логин может состоять только из букв английского алфавита и цифр";
        return;
    }
    if (strlen($_GET['tlogin']) < 3 or strlen($_GET['tlogin']) > 30) {
        echo "Логин должен быть не меньше 3-х символов и не больше 30";
        return;
    }
    # проверяем, не сущестует ли пользователя с таким именем
    $query = mysql_query("SELECT COUNT(user_id) FROM sample_users WHERE user_login='" . mysql_real_escape_string($_GET['tlogin']) . "'");
    if (mysql_result($query, 0) > 0) {
        echo "Пользователь с таким логином уже существует в базе данных";
        return;
    }
    echo "login valid";
    return;
}
if (isset($_GET['tlogin'])) {
    chk();
} else {
    echo "Нет данных";
}
コード例 #9
0
 public function Dump_address($session, $dump_adr, $dump_pass)
 {
     $sel_session = $this->con->prepare("SELECT Username,Password FROM users WHERE Session_id=:id");
     $ses = array(":id" => $session);
     $sel_session->execute($ses);
     $get_user = $sel_session->fetch(PDO::FETCH_ASSOC);
     $verify_pass = password_verify($dump_pass, $get_user["Password"]);
     if ($verify_pass == true) {
         $is_vid = $this->coin->validateaddress($dump_adr);
         if ($is_vid["isvalid"] == 1) {
             $list_adrs = $this->coin->getaddressesbyaccount($get_user["Username"]);
             function chk($list_adrs, $dump_adr)
             {
                 foreach ($list_adrs as $index => $key) {
                     if ($list_adrs[$index] == $dump_adr) {
                         return "Ok!";
                     }
                 }
             }
             if (chk($list_adrs, $dump_adr) == "Ok!") {
                 $dmp = $this->coin->dumpprivkey($dump_adr);
                 echo $dmp;
             } else {
                 echo "ERROR! Reload page";
             }
         } else {
             echo "ERROR! Invalid Address!";
         }
     } else {
         echo "Incorrect Account Password!";
     }
 }
コード例 #10
0
ファイル: emenudmenu.php プロジェクト: hezrul/seashell
<?php

$keybefore = chk($_SESSION['keybefore']);
$dobefore = chk($_GET['do']);
$dobefore = dmenu($keybefore, $dobefore);
// echo "keybefore : ".$keybefore;
// echo "<br>dobefore : ".$dobefore;
$key = rand();
$_SESSION['keybefore'] = $key;
if (dmenu($keybefore, chk($_GET['ch'])) == 1) {
    $_SESSION['lang'] = chk($_GET['lang']);
}
$dobefore = emenu($key, $dobefore);
if (!chk($_SESSION['lang'])) {
    $_SESSION['lang'] = 'bm';
}
コード例 #11
0
ファイル: func.php プロジェクト: hezrul/seashell
function datagrid($data, $totalreturned)
{
    if ($data) {
        extract($data);
        $page = chk($page);
        $perpage = chk($perpage);
        $kurang = chk($kurang);
        $pagekurang = chk($pagekurang);
        $tambah = chk($tambah);
        $pagetambah = chk($pagetambah);
        $pageakhir = chk($pageakhir);
        $output['bilrow'] = $perpage;
        if ($kurang == ' < ') {
            $output['page'] = $pagekurang;
        } elseif ($kurang == ' << ') {
            $output['page'] = 0;
        } elseif ($tambah == ' > ') {
            $output['page'] = $pagetambah;
        } elseif ($tambah == ' >> ') {
            $output['page'] = $pageakhir;
        } else {
            $output['page'] = $page;
        }
        $output['cari'] = chk($cari);
    }
    if ($output['bilrow'] == '') {
        $output['bilrow'] = '10';
    }
    $output['limit'] = chk($totalreturned) / $output['bilrow'];
    $output['limittambah'] = (int) $output['limit'] + 1;
    if ($output['page'] <= -1) {
        $output['page'] = 0;
    } elseif ($output['page'] >= $output['limittambah']) {
        $output['page'] = $output['limittambah'] - 1;
    }
    if ($output['page'] == '') {
        $output['page'] = '0';
    }
    $output['page_end'] = $output['page'] * $output['bilrow'];
    return $output;
}
コード例 #12
0
ファイル: php.php プロジェクト: Tahongpao/Server-local
		$ban[] = $url ;
	else
		$proxy = $proxy +$p[0];
}
$proxies = array_values( array_unique($proxy) );
$countProxy = count ($proxies);
if($countProxy<=$n)
{
	chk($proxies);
}
else
{
	$c = floor($countProxy/$n);
	for($i=1; $i<=$c; $i++)
		chk(array_slice($proxies,$n*$i,$n));
	chk(array_slice($proxies,$n*($c+1),$countProxy - $n*$c));
}
if(count($ban)==1)
	echo '<hr>Сайт не принес пользы: ' . $ban[0];
if(count($ban)>1)
{
	echo '<hr>Сайты не приносят пользы:<br>';
	foreach($ban as $sitename)
		echo $sitename.'<br>';
}
function chk($proxies)
{
	$mc = curl_multi_init ();
	for ($thread_no = 0; $thread_no<count ($proxies); $thread_no++)
	{
		$c [$thread_no] = curl_init ();
コード例 #13
0
ファイル: class.db.php プロジェクト: hezrul/seashell
 public static function table_list_grid($request, $table, $field, $condition, $order = '', $bilrow = 10, $dbg = 'N')
 {
     $error = '';
     $x = 0;
     $cari = chk($request['cari']);
     $all = chk($request['fw_all']);
     $sql = "SELECT {$field} FROM {$table} WHERE {$condition}";
     list($data, $sts) = Db::query($sql);
     if ($sts != '1') {
         echo $sts;
     } else {
         if ($order == '') {
             $order = Db::field_name($data, 0);
         }
         if ($cari != '') {
             $cari = str_replace("'", "''", $cari);
             $bil_field = Db::num_fields($data);
             $carian = '';
             $array_field = explode(",", $field);
             //echo '<pre>'; print_r($array_field); echo '</pre>';
             $bil_field = count($array_field);
             for ($a = 0; $a < $bil_field; $a++) {
                 $nama_field = Db::field_name($data, $a);
                 //                            $nama_field_all = $array_field[$a];
                 //
                 //                            $pos = strpos($nama_field_all, '*');
                 //
                 //                                if ($pos === false) {
                 //                                    $nama_field = $nama_field_all;
                 //                                    switch (Db::$db)
                 //                                    {
                 //                                        case 'Pg':
                 //                                            $carian = "$carian CAST($nama_field AS TEXT) ILIKE '%$cari%' OR";
                 //                                            break;
                 //                                        case 'Mysql':
                 //                                            $carian = "$carian $nama_field LIKE '%$cari%' OR";
                 //                                            break;
                 //                                        case 'Oci':
                 //                                            $carian = "$carian lower($nama_field) LIKE lower('%$cari%') OR";
                 //                                            break;
                 //                                    }
                 //                                }
                 $type_field = Db::field_type($data, $a);
                 $array_type = array("timestamp", "float8", "int4");
                 foreach ($array_field as $fieldselect) {
                     if (strpos($fieldselect, $nama_field) !== false) {
                         $nama_field = $fieldselect;
                     }
                     $position = strpos($nama_field, ' as ');
                     if ($position != '') {
                         $nama_field = substr($nama_field, '0', $position);
                     }
                     $position = strpos($nama_field, ' AS ');
                     if ($position != '') {
                         $nama_field = substr($nama_field, '0', $position);
                     }
                     $nama_field = str_replace('DISTINCT ', '', $nama_field);
                 }
                 if (!in_array($type_field, $array_type)) {
                     switch (Db::$db) {
                         case 'Pg':
                             $carian = "{$carian} CAST({$nama_field} AS TEXT) ILIKE '%{$cari}%' OR";
                             break;
                         case 'Mysql':
                             $carian = "{$carian} {$nama_field} LIKE '%{$cari}%' OR";
                             break;
                         case 'Oci':
                             $carian = "{$carian} lower({$nama_field}) LIKE lower('%{$cari}%') OR";
                             break;
                     }
                 }
             }
             $carian = "(" . substr($carian, 1, -3) . ")";
             $condition = "{$condition} AND {$carian}";
         }
         $totalreturned = Db::num_rows($table, $field, $condition);
         $request = datagrid($request, $totalreturned, $bilrow);
         $request['fw_all'] = $all;
         $page_end = $request['page_end'];
         $bilrow = $request['bilrow'];
         $limit = $request['limit'];
         if ($totalreturned == $page_end) {
             $page_end = $page_end - $bilrow;
         }
         if ($page_end < '0') {
             $page_end = '0';
         }
         if (Db::$db == 'Oci') {
             $maxrow = $page_end + $bilrow;
             $sql = "SELECT * FROM (\n                                SELECT a.*, ROWNUM fw_bil FROM (\n                                  SELECT {$field}\n                                    FROM {$table}\n                                       WHERE {$condition}\n                                           ORDER BY {$order}\n                                ) a WHERE rownum <= {$maxrow}\n                              ) where fw_bil > {$page_end}";
             //  ORDER BY $order";
         } else {
             $condition = "{$condition} ORDER BY {$order} LIMIT {$bilrow} OFFSET {$page_end} ";
             $sql = "SELECT {$field} FROM {$table} WHERE {$condition}";
         }
         list($data, $sts) = Db::query($sql);
         if ($sts != '1') {
             echo $sts;
         } else {
             $datarow = Db::fetch_assoc($data);
             if (is_array($datarow)) {
                 foreach ($datarow as $row => $value) {
                     $datarow[$row]['fw_bil'] = $row + $page_end;
                 }
             }
         }
     }
     if ($dbg == 'Y') {
         echo "<br>DEBUG : " . $sql . "<br>";
     } elseif ($dbg == 'D') {
         echo "<br>DEBUG : " . $sql . "<br>";
         echo "<pre>";
         print_r($datarow);
         echo "</pre>";
     }
     return array('totalreturned' => $totalreturned, 'page_end' => $page_end, 'request' => $request, 'fw_senarai' => chk($datarow));
 }
コード例 #14
0
ファイル: download.php プロジェクト: hezrul/seashell
<?php

$dload = 1;
require_once '../setting.php';
$key = $_SESSION['keybefore'];
$id_upload = dmenu($key, @$_GET['id']);
if (chk($id_upload) != '' and is_numeric($id_upload)) {
    $file = Db::chkval('fw_uploads', 'link', "id='" . chk($id_upload) . "'");
    $file = '../' . $file;
    if (file_exists($file)) {
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename=' . basename($file));
        header('Expires: 0');
        header('Cache-Control: must-revalidate');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file));
        readfile($file);
        exit;
    }
} else {
    echo 'Tidak Sah!';
}
コード例 #15
0
ファイル: aboutus.php プロジェクト: prolin99/tad_web
function tad_web_mems_form($WebID = "0", $MemID = "0")
{
    global $xoopsDB, $xoopsUser, $TadUpFiles;
    //抓取預設值
    if (!empty($MemID)) {
        $DBV = get_tad_web_mems($MemID);
        $DBV2 = get_tad_web_link_mems($MemID);
    } else {
        $DBV = $DBV2 = array();
    }
    //`MemID`, `MemName`, `MemNickName`, `MemSex`, `MemUnicode`, `MemBirthday`, `MemUrl`, `MemClassOrgan`, `MemExpertises`, `uid`, `MemUname`, `MemPasswd`, `MemNum`, `MemSort`, `MemEnable`, `top`, `left`
    //設定「MemName」欄位預設值
    $MemName = !isset($DBV['MemName']) ? "" : $DBV['MemName'];
    //設定「MemNickName」欄位預設值
    $MemNickName = !isset($DBV['MemNickName']) ? "" : $DBV['MemNickName'];
    //設定「MemSex」欄位預設值
    $MemSex = !isset($DBV['MemSex']) ? "" : $DBV['MemSex'];
    //設定「MemUnicode」欄位預設值
    $MemUnicode = !isset($DBV['MemUnicode']) ? "" : $DBV['MemUnicode'];
    //設定「MemBirthday」欄位預設值
    $MemBirthday = !isset($DBV['MemBirthday']) ? "" : $DBV['MemBirthday'];
    //設定「MemUrl」欄位預設值
    $MemUrl = !isset($DBV['MemUrl']) ? "" : $DBV['MemUrl'];
    //設定「MemClassOrgan」欄位預設值
    $MemClassOrgan = !isset($DBV['MemClassOrgan']) ? "" : $DBV['MemClassOrgan'];
    //設定「MemExpertises」欄位預設值
    $MemExpertises = !isset($DBV['MemExpertises']) ? "" : $DBV['MemExpertises'];
    //設定「uid」欄位預設值
    $uid = !isset($DBV['uid']) ? "" : $DBV['uid'];
    //設定「MemUname」欄位預設值
    $MemUname = !isset($DBV['MemUname']) ? "" : $DBV['MemUname'];
    //設定「MemPasswd」欄位預設值
    $MemPasswd = !isset($DBV['MemPasswd']) ? "" : $DBV['MemPasswd'];
    //設定「MemNum」欄位預設值
    $MemNum = !isset($DBV2['MemNum']) ? "" : $DBV2['MemNum'];
    //設定「MemSort」欄位預設值
    $MemSort = !isset($DBV2['MemSort']) ? "" : $DBV2['MemSort'];
    //設定「MemEnable」欄位預設值
    $MemEnable = !isset($DBV2['MemEnable']) ? "" : $DBV2['MemEnable'];
    //設定「top」欄位預設值
    $top = !isset($DBV['top']) ? "" : $DBV['top'];
    //設定「left」欄位預設值
    $left = !isset($DBV['left']) ? "" : $DBV['left'];
    $op = empty($MemID) ? "insert_tad_web_mems" : "update_tad_web_mems";
    $TadUpFiles->set_col("MemID", $MemID, 1);
    $pic_url = $TadUpFiles->get_pic_file('thumb');
    if (empty($pic_url)) {
        $pic = $MemSex == '1' ? XOOPS_URL . "/modules/tad_web/images/boy.gif" : XOOPS_URL . "/modules/tad_web/images/girl.gif";
        $cover = "";
    } else {
        $pic = $pic_url;
        $cover = "background-size: cover;";
    }
    $color2 = $MemSex == '1' ? "#000066" : "#660000";
    $pic = !empty($MemID) ? "\n  <div id='{$MemID}' style='padding: 5px;font-size: 12px; border:0px dotted gray;width:60px;height:50px;background:transparent url({$pic}) top center no-repeat;margin:0px auto;{$cover}'>\n  </div>" : "";
    if (!file_exists(TADTOOLS_PATH . "/formValidator.php")) {
        redirect_header("index.php", 3, _MA_NEED_TADTOOLS);
    }
    include_once TADTOOLS_PATH . "/formValidator.php";
    $formValidator = new formValidator("#myForm", true);
    $formValidator_code = $formValidator->render();
    if (!empty($MemID)) {
        $del_btn = "<a href=\"javascript:delete_student_func({$MemID});\" class='btn btn-danger'>" . _TAD_DEL . "</a>\n    ";
    } else {
        $del_btn = "";
    }
    $main = "\n      {$formValidator_code}\n      <script type='text/javascript' src='" . TADTOOLS_URL . "/My97DatePicker/WdatePicker.js'></script>\n      <script type='text/javascript'>\n      function delete_student_func(MemID){\n        var sure = window.confirm('" . _TAD_DEL_CONFIRM . "');\n        if (!sure)  return;\n        location.href=\"{$_SERVER['PHP_SELF']}?op=delete_tad_web_mems&MemID=\" + MemID;\n      }\n      </script>\n      <form action='{$_SERVER['PHP_SELF']}' method='post' id='myForm' enctype='multipart/form-data'>\n      <fieldset>\n        <legend>" . _MD_TCW_STUDENT_SETUP . "</legend>\n\n        <!--學生姓名-->\n        <div class='row'>\n          <label class='col-md-1'>" . _MD_TCW_MEM_NAME . "</label>\n          <div class='col-md-3'>\n            <input type='text' name='MemName' value='{$MemName}' id='MemName' class='validate[required] form-control' placeholder='" . _MD_TCW_MEM_NAME . "'>\n          </div>\n\n          <!--學生暱稱-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_NICKNAME . "</label>\n          <div class='col-md-3'>\n            <input type='text' name='MemNickName' value='{$MemNickName}' id='MemNickName' class='form-control' placeholder='" . _MD_TCW_MEM_NICKNAME . "'>\n          </div>\n\n          <div class='col-md-4'>\n            {$pic}\n          </div>\n        </div>\n\n\n        <div class='row'>\n          <!--性別-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_SEX . "</label>\n          <div class='col-md-3'>\n            <select name='MemSex' class='form-control'>\n              <option value='1' " . chk($MemSex, '1', '1', 'selected') . ">" . _MD_TCW_BOY . "</option>\n              <option value='0' " . chk($MemSex, '0', '0', 'selected') . ">" . _MD_TCW_GIRL . "</option>\n            </select>\n          </div>\n\n          <!--生日-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_BIRTHDAY . "</label>\n          <div class='col-md-3'>\n            <input type='text' name='MemBirthday' value='{$MemBirthday}' id='MemBirthday' class='form-control' onClick=\"WdatePicker({dateFmt:'yyyy-MM-dd' , startDate:'%y-%M-%d}'})\" placeholder='" . _MD_TCW_MEM_BIRTHDAY . "'>\n          </div>\n\n          <label class='col-md-1'>" . _MD_TCW_UPLOAD_MEM_PHOTO . "</label>\n          <div class='col-md-3'>\n            <input type='file' name='upfile[]' class='form-control' maxlength='1' accept='gif|jpg|png|GIF|JPG|PNG'>\n          </div>\n        </div>\n\n\n        <div class='row'>\n\n          <!--學號-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_UNICODE . "</label>\n          <div class='col-md-3'>\n            <input type='text' name='MemUnicode' value='{$MemUnicode}' id='MemUnicode' class='validate[required] form-control' placeholder='" . _MD_TCW_MEM_UNICODE . "'>\n          </div>\n\n          <!--座號-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_NUM . "</label>\n          <div class='col-md-3'>\n            <input type='text' name='MemNum' value='{$MemNum}' id='MemNum' class='validate[required] form-control' placeholder='" . _MD_TCW_MEM_NUM . "'>\n          </div>\n\n\n          <!--是否還在班上-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_STATUS . "</label>\n          <div class='col-md-3'>\n            <select name='MemEnable' id='MemEnable' class='form-control'>\n              <option value='1'  " . chk($MemEnable, '1', '1', 'selected') . ">" . _MD_TCW_MEM_ENABLE . "</option>\n              <option value='0'  " . chk($MemEnable, '0', '', 'selected') . ">" . _MD_TCW_MEM_UNABLE . "</option>\n            </select>\n          </div>\n\n        </div>\n\n\n        <div class='row'>\n\n          <!--帳號-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_UNAME . "</label>\n          <div class='col-md-3'>\n            <input type='text' name='MemUname' value='{$MemUname}' id='MemUname' class='validate[required] form-control' placeholder='" . _MD_TCW_MEM_UNAME . "'>\n          </div>\n\n          <!--密碼-->\n          <label class='col-md-1'>" . _MD_TCW_MEM_PASSWD . "</label>\n          <div class='col-md-3'>\n            <input type='text' name='MemPasswd' value='{$MemPasswd}' id='MemPasswd' class='validate[required] form-control' placeholder='" . _MD_TCW_MEM_PASSWD . "'>\n          </div>\n\n          <div class='col-md-4'>\n            {$del_btn}\n            <input type='hidden' name='WebID' value='{$WebID}'>\n            <input type='hidden' name='MemID' value='{$MemID}'>\n            <input type='hidden' name='op' value='{$op}'>\n            <button type='submit' class='btn btn-primary'>" . _TAD_SAVE . "</button>\n          </div>\n        </div>\n\n      </fieldset>\n    </form>\n    ";
    return $main;
}
コード例 #16
0
ファイル: main.php プロジェクト: prolin99/tad_cal
function tad_cal_cate_form($cate_sn = "")
{
    global $xoopsDB, $xoopsUser, $xoopsTpl;
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    //include_once(XOOPS_ROOT_PATH."/class/xoopseditor/xoopseditor.php");
    //抓取預設值
    if (!empty($cate_sn)) {
        $DBV = get_tad_cal_cate($cate_sn);
    } else {
        $DBV = array();
    }
    //預設值設定
    //設定「cate_sn」欄位預設值
    $cate_sn = !isset($DBV['cate_sn']) ? "" : $DBV['cate_sn'];
    //設定「cate_title」欄位預設值
    $cate_title = !isset($DBV['cate_title']) ? _MA_TADCAL_NEW_CALENDAR : $DBV['cate_title'];
    //設定「cate_sort」欄位預設值
    $cate_sort = !isset($DBV['cate_sort']) ? tad_cal_cate_max_sort() : $DBV['cate_sort'];
    //設定「cate_enable」欄位預設值
    $cate_enable = !isset($DBV['cate_enable']) ? "" : $DBV['cate_enable'];
    //設定「cate_handle」欄位預設值
    $cate_handle = !isset($DBV['cate_handle']) ? "" : $DBV['cate_handle'];
    //設定「enable_group」欄位預設值
    $enable_group = !isset($DBV['enable_group']) ? "" : explode(",", $DBV['enable_group']);
    //設定「enable_upload_group」欄位預設值
    $enable_upload_group = !isset($DBV['enable_upload_group']) ? array('1') : explode(",", $DBV['enable_upload_group']);
    //設定「google_id」欄位預設值
    $google_id = !isset($DBV['google_id']) ? "" : $DBV['google_id'];
    //設定「google_pass」欄位預設值
    $google_pass = !isset($DBV['google_pass']) ? "" : $DBV['google_pass'];
    //設定「cate_bgcolor」欄位預設值
    $cate_bgcolor = !isset($DBV['cate_bgcolor']) ? "rgb(120,177,255)" : $DBV['cate_bgcolor'];
    //設定「cate_color」欄位預設值
    $cate_color = !isset($DBV['cate_color']) ? "rgb(255,255,255)" : $DBV['cate_color'];
    $op = empty($cate_sn) ? "insert_tad_cal_cate" : "update_tad_cal_cate";
    //$op="replace_tad_cal_cate";
    //可見群組
    $SelectGroup_name = new XoopsFormSelectGroup("", "enable_group", false, $enable_group, 3, true);
    $SelectGroup_name->addOption("", _MA_TADCAL_ALL_OK, false);
    $SelectGroup_name->setExtra('class="span12 form-control"');
    $enable_group = $SelectGroup_name->render();
    //可上傳群組
    $SelectGroup_name = new XoopsFormSelectGroup("", "enable_upload_group", false, $enable_upload_group, 3, true);
    $SelectGroup_name->setExtra('class="span12 form-control"');
    $enable_upload_group = $SelectGroup_name->render();
    if (!file_exists(TADTOOLS_PATH . "/formValidator.php")) {
        redirect_header("index.php", 3, _MA_NEED_TADTOOLS);
    }
    include_once TADTOOLS_PATH . "/formValidator.php";
    $formValidator = new formValidator("#myForm", true);
    $formValidator_code = $formValidator->render();
    $xoopsTpl->assign('next_op', $op);
    $xoopsTpl->assign('cate_sn', $cate_sn);
    $xoopsTpl->assign('cate_handle', $cate_handle);
    $xoopsTpl->assign('enable_upload_group', $enable_upload_group);
    $xoopsTpl->assign('enable_group', $enable_group);
    $xoopsTpl->assign('cate_enable1', chk($cate_enable, '1', '1'));
    $xoopsTpl->assign('cate_enable0', chk($cate_enable, '0'));
    $xoopsTpl->assign('cate_sort', $cate_sort);
    $xoopsTpl->assign('cate_color', $cate_color);
    $xoopsTpl->assign('cate_bgcolor', $cate_bgcolor);
    $xoopsTpl->assign('cate_title', $cate_title);
    $xoopsTpl->assign('formValidator_code', $formValidator_code);
    $xoopsTpl->assign('google_id', $google_id);
    $xoopsTpl->assign('google_pass', $google_pass);
    $xoopsTpl->assign('op', 'tad_cal_cate_form');
}