本文整理汇总了PHP中create_folder函数的典型用法代码示例。如果您正苦于以下问题:PHP create_folder函数的具体用法?PHP create_folder怎么用?PHP create_folder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_folder函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
$ttH->func->load_language_admin($this->modules);
$ttH->temp_act = new XTemplate($ttH->path_html . $this->modules . DS . $this->action . ".tpl");
$ttH->temp_act->assign('LANG', $ttH->lang);
$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);
include $this->modules . "_func.php";
load_setting();
$this->dir = create_folder(date("Y_m"));
$data["link_manage"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage");
$data["link_manage_trash"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage_trash");
$data["link_add"] = $ttH->admin->get_link_admin($this->modules, $this->action, "add");
$this->sub = isset($ttH->input["sub"]) ? $ttH->input["sub"] : "manage";
switch ($this->sub) {
default:
$this->sub = "manage";
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->modules . "_manage"];
$data["main"] = $this->do_manage();
break;
}
$data["class"] = array();
$data["class"][$this->sub] = ' class="active"';
$data["page_title"] = $ttH->conf["page_title"];
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("main");
$ttH->output .= $ttH->temp_act->text("main");
}
示例2: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
include $this->modules . "_func.php";
$this->dir = create_folder(date("Y_m"));
require_once 'modules/common/include/item.php';
}
示例3: do_add
function do_add()
{
global $ttH;
$data = array();
$err = "";
$dir = create_folder(date("Y_m"));
if (isset($ttH->post['do_submit'])) {
/*print_arr($ttH->post);
die();*/
if (empty($ttH->post["list_color"])) {
$err = $ttH->html->html_alert('Vui lòng chọn màu', "error");
}
if (empty($ttH->post["list_size"])) {
$err = $ttH->html->html_alert('Vui lòng chọn size', "error");
}
if (empty($err)) {
$ok = 0;
$arr_color = $ttH->post["list_color"];
$arr_size = $ttH->post["list_size"];
foreach ($arr_color as $key => $color) {
$sql = "select id \n\t\t\t\t\t\t\t\t\tfrom product_combine \n\t\t\t\t\t\t\t\t\twhere type='" . $this->type . "' \n\t\t\t\t\t\t\t\t\tand type_id='" . $this->type_id . "' \n\t\t\t\t\t\t\t\t\tand color_id='" . $arr_color[$key] . "' \n\t\t\t\t\t\t\t\t\tand size_id='" . $arr_size[$key] . "' ";
$result = $ttH->db->query($sql);
if (!$ttH->db->num_rows($result)) {
$col = array();
$col["type"] = $this->type;
$col["type_id"] = $this->type_id;
$col["color_id"] = $arr_color[$key];
$col["size_id"] = $arr_size[$key];
$okf = $ttH->db->do_insert("product_combine", $col);
if ($okf) {
$ok++;
}
}
}
if ($ok) {
$data = array();
$err = $ttH->html->html_alert($ttH->lang["global"]["add_success"], "success");
} else {
$data = $ttH->post;
$err = $ttH->html->html_alert($ttH->lang["global"]["add_false"], "error");
}
} else {
$data = $ttH->post;
}
}
$data["err"] = $err;
$data["link_action"] = $ttH->admin->get_link_admin($this->modules, $this->action, $this->sub) . $this->ext_link;
$data["link_up"] = $ttH->admin->get_link_admin('library', 'library', 'popup_library') . '&type=1&folder_up=' . $this->modules . '&fldr=' . $dir . '&editor=mce_0';
$data["list_color"] = list_color("list_color[]", '', " class=\"form-control\"");
$data["list_size"] = list_size("list_size[]", '', " class=\"form-control\"");
for ($i = 1; $i <= 5; $i++) {
$data['index'] = $i;
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("add.row");
}
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("add");
return $ttH->temp_act->text("add");
}
示例4: getViewPath
/**
* Returns the path where the view will be created
**/
private function getViewPath($model, $view)
{
$view_path = VIEW_PATH . $this->sep . Text::pluralize($model);
if (!$this->test) {
create_folder($this->getPath($view_path, ""));
}
return $this->getPath($view_path, $view);
}
示例5: add_new_success
function add_new_success()
{
$user = $this->session->userdata("isLoggedIn");
if (strtolower($user->type_name) == "student") {
$this->form_validation->set_rules('semester_id', 'Semester', 'required');
}
$this->form_validation->set_rules('subject_id', 'Subject', 'required');
$this->form_validation->set_rules('filename', 'File Name', 'required');
if (empty($_FILES['doc_paths']['name'])) {
$this->form_validation->set_rules('doc_paths', 'Document', 'required');
}
if ($this->form_validation->run() == FALSE) {
$this->add_new();
} else {
$data['user_id'] = $this->session->userdata("isLoggedIn")->id;
if (strtolower($user->type_name) == "student") {
$data['semester_id'] = $this->input->post('semester_id');
}
$data['subject_id'] = $this->input->post('subject_id');
$data['filename'] = $this->input->post('filename');
if ($this->input->post('privacy') == "on") {
$data['privacy'] = 1;
} else {
$data['privacy'] = 0;
}
if (strtolower($user->type_name) == "student") {
$path = create_folder($data['user_id'], $data['semester_id'], $data['subject_id']);
} else {
$path = create_folder($data['user_id'], NULL, $data['subject_id']);
}
$docpath = str_replace('./uploads/', '', $path);
$data['doc_paths'] = $docpath;
for ($i = 0; $i < count($_FILES['doc_paths']['name']); $i++) {
$name = $_FILES['doc_paths']['name'][$i];
if (strlen($name)) {
$fname = time() . '_' . basename($_FILES['doc_paths']['name'][$i]);
$fname = str_replace(" ", "_", $fname);
$fname = str_replace("%", "_", $fname);
$name_ext = end(explode(".", basename($_FILES['doc_paths']['name'][$i])));
$name = str_replace('.' . $name_ext, '', basename($_FILES['doc_paths']['name'][$i]));
$uploaddir = $path . '/';
$uploadfile = $uploaddir . $fname;
if (move_uploaded_file($_FILES['doc_paths']['tmp_name'][$i], $uploadfile)) {
$doc_paths = $_FILES["doc_paths"];
$data['filesize'] = $doc_paths["size"][$i];
$data['type'] = $doc_paths["type"][$i];
$data['name'] = $doc_paths["name"][$i];
$data["uploaded_filename"] = $fname;
$this->common_model->insert("documents", $data);
} else {
}
}
}
}
}
示例6: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
$ttH->func->include_css($ttH->dir_css_global . 'excolor-master/css/excolor.css');
$ttH->func->include_js($ttH->dir_js . 'excolor-master/prettify.js');
$ttH->func->include_js($ttH->dir_js . 'excolor-master/jquery.excolor.js');
$ttH->func->include_js_content("\n\t\t\tjQuery(document).ready( function(\$) {\n\t\t\t\t\$('input.color_picker').excolor({\n\t\t\t\t\troot_path: '" . $ttH->dir_css_global . "excolor-master/img/'\n\t\t\t\t});\n\t\t\t});\n\t\t");
include $this->modules . "_func.php";
$this->dir = create_folder(date("Y_m"));
require_once 'modules/common/include/single.php';
}
示例7: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
$ttH->func->load_language_admin($this->modules);
$ttH->temp_act = new XTemplate($ttH->path_html . $this->modules . DS . $this->action . ".tpl");
$ttH->temp_act->assign('LANG', $ttH->lang);
$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);
$ttH->func->include_css($ttH->dir_css_global . 'excolor-master/css/excolor.css');
$ttH->func->include_js($ttH->dir_js . 'excolor-master/prettify.js');
$ttH->func->include_js($ttH->dir_js . 'excolor-master/jquery.excolor.js');
$ttH->func->include_js_content("\r\r\n\t\t\tjQuery(document).ready( function(\$) {\r\r\n\t\t\t\t\$('input.color_picker').excolor({\r\r\n\t\t\t\t\troot_path: '" . $ttH->dir_css_global . "excolor-master/img/'\r\r\n\t\t\t\t});\r\r\n\t\t\t});\r\r\n\t\t");
include $this->modules . "_func.php";
load_setting();
/*if(!isset($ttH->data['menu_group']['menu_header_top'])){
$ttH->data['menu_group']['menu_header_top'] = 'Menu đầu trang';
}*/
$this->dir = create_folder(date("Y_m"));
$this->cur_group = isset($ttH->input["group_id"]) && array_key_exists($ttH->input["group_id"], $ttH->data["menu_group"]) ? $ttH->input["group_id"] : $this->cur_group;
$data["link_manage"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage");
$data["link_manage_trash"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage_trash");
$data["link_add"] = $ttH->admin->get_link_admin($this->modules, $this->action, "add", array('group_id' => $this->cur_group));
$this->sub = isset($ttH->input["sub"]) ? $ttH->input["sub"] : "manage";
switch ($this->sub) {
case "add":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_add();
break;
case "edit":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_edit();
break;
case "manage_trash":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_manage("trash");
break;
default:
$this->sub = "manage";
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_manage"];
$data["main"] = $this->do_manage();
break;
}
$data["class"] = array();
$data["class"][$this->sub] = ' class="active"';
$data["page_title"] = $ttH->conf["page_title"];
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("main");
$ttH->output .= $ttH->temp_act->text("main");
}
示例8: sMain
function sMain()
{
global $ttH;
include $this->modules . "_func.php";
$ttH->func->load_language_admin($this->modules);
$ttH->temp_act = new XTemplate($ttH->path_html . $this->modules . DS . $this->action . ".tpl");
$ttH->temp_act->assign('LANG', $ttH->lang);
$this->dir = create_folder(date("Y_m"));
$this->link_act = "?mod=" . $this->modules . "&act=" . $this->action;
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->modules];
$data["page_title"] = $ttH->conf["page_title"];
$data["main"] = $this->do_edit();
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("main");
$ttH->output .= $ttH->temp_act->text("main");
}
示例9: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
$ttH->func->load_language_admin($this->modules);
$ttH->temp_act = new XTemplate($ttH->path_html . $this->modules . DS . $this->action . ".tpl");
$ttH->temp_act->assign('LANG', $ttH->lang);
$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);
include $this->modules . "_func.php";
$this->dir = create_folder(date("Y_m"));
$this->type = isset($ttH->get['type']) ? $ttH->get['type'] : '';
$this->type_id = isset($ttH->get['type_id']) ? (int) $ttH->get['type_id'] : 0;
$this->ext_link = '&type=' . $this->type . '&type_id=' . $this->type_id;
if ($this->type != 'group' && $this->type != 'item' || $this->type_id <= 0) {
$ttH->html->redirect_rel($ttH->admin->get_link_admin($this->modules, $this->modules, "manage"));
}
$data["link_manage"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage") . $this->ext_link;
$data["link_manage_trash"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage_trash") . $this->ext_link;
$data["link_add"] = $ttH->admin->get_link_admin($this->modules, $this->action, "add") . $this->ext_link;
$this->sub = isset($ttH->input["sub"]) ? $ttH->input["sub"] : "manage";
switch ($this->sub) {
case "add":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_add();
break;
case "edit":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_edit();
break;
case "manage_trash":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_manage("trash");
break;
default:
$this->sub = "manage";
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_manage"];
$data["main"] = $this->do_manage();
break;
}
$data["class"] = array();
$data["class"][$this->sub] = ' class="active"';
$data["page_title"] = $ttH->conf["page_title"];
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("main");
$ttH->output .= $ttH->temp_act->text("main");
}
示例10: generate_application
function generate_application($app_path)
{
$app_name = strtolower(end(split(DIRECTORY_SEPARATOR, $app_path)));
$app_real_path = realpath($app_path);
p('info', sprintf('will generate application %s in %s ', ucfirst($app_name), $app_real_path));
create_folder($app_real_path);
foreach (array('app', 'public', 'config', 'vendor', 'lib', 'log') as $f) {
create_folder(make_path($app_real_path, $f));
}
$medick_path = realpath(make_path(dirname(__FILE__), '..'));
create_file($app_real_path, 'boot.php', 'boot.php', array('app_real_path' => $app_real_path, 'medick_path' => $medick_path));
create_file($app_real_path, 'config.xml', make_path('config', $app_name . '.xml'), array('app_name' => $app_name, 'app_real_path' => $app_real_path));
create_file($app_real_path, 'htaccess', make_path('public', '.htaccess'), array('app_name' => $app_name));
create_file($app_real_path, 'index.php', make_path('public', 'index.php'), array('app_name' => $app_name, 'app_real_path' => $app_real_path));
touch(make_path($app_real_path, 'log', 'localhost.log'));
chmod(make_path($app_real_path, 'log', 'localhost.log'), 0777);
exit;
}
示例11: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
$ttH->func->include_js($ttH->dir_temp . 'js/config/location.js');
$ttH->func->include_js_content('
jQuery(document).ready( function($) {
ttHLocation.list_location_area_load_child();
ttHLocation.list_location_country_load_child();
ttHLocation.list_location_province_load_child();
});
');
$ttH->func->include_css($ttH->dir_js . 'gmap3/jquery-autocomplete.css');
$ttH->func->include_js('http://maps.googleapis.com/maps/api/js?sensor=false');
$ttH->func->include_js($ttH->dir_js . 'gmap3/gmap3.min.js');
$ttH->func->include_js($ttH->dir_js . 'gmap3/jquery-autocomplete.js');
include $this->modules . "_func.php";
$this->dir = create_folder(date("Y_m"));
require_once 'modules/common/include/item.php';
}
示例12: sMain
/**
* function sMain ()
* Khoi tao
**/
function sMain()
{
global $ttH;
$ttH->func->load_language_admin($this->modules);
$ttH->temp_act = new XTemplate($ttH->path_html . $this->modules . DS . $this->action . ".tpl");
$ttH->temp_act->assign('LANG', $ttH->lang);
$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);
$ttH->func->include_js($ttH->dir_temp . 'js/' . $this->modules . '/' . $this->action . ".js");
include $this->modules . "_func.php";
load_setting();
$this->dir = create_folder(date("Y_m"));
$this->cur_group = isset($ttH->input["group_id"]) && array_key_exists($ttH->input["group_id"], $ttH->data["banner_group"]) ? $ttH->input["group_id"] : $this->cur_group;
$data["link_manage"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage", array('group_id' => $this->cur_group));
$data["link_manage_trash"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage_trash", array('group_id' => $this->cur_group));
$data["link_add"] = $ttH->admin->get_link_admin($this->modules, $this->action, "add", array('group_id' => $this->cur_group));
$this->sub = isset($ttH->input["sub"]) ? $ttH->input["sub"] : "manage";
switch ($this->sub) {
case "add":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->modules . "_" . $this->sub];
$data["main"] = $this->do_add();
break;
case "edit":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->modules . "_" . $this->sub];
$data["main"] = $this->do_edit();
break;
case "manage_trash":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->modules . "_" . $this->sub];
$data["main"] = $this->do_manage("trash");
break;
default:
$this->sub = "manage";
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->modules . "_manage"];
$data["main"] = $this->do_manage();
break;
}
$data["class"] = array();
$data["class"][$this->sub] = ' class="active"';
$data["page_title"] = $ttH->conf["page_title"];
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("main");
$ttH->output .= $ttH->temp_act->text("main");
}
示例13: sMain_sub
/**
* function sMain ()
* Khoi tao
**/
function sMain_sub()
{
global $ttH;
$ttH->func->load_language_admin($this->modules);
$ttH->temp_act = new XTemplate($ttH->path_html . $this->modules . DS . $this->temp . ".tpl");
$ttH->temp_act->assign('LANG', $ttH->lang);
$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);
require_once "modules/" . $this->modules . "/" . $this->modules . "_func.php";
$this->dir = create_folder('', $this->folder_upload);
$data["link_manage"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage");
$data["link_manage_trash"] = $ttH->admin->get_link_admin($this->modules, $this->action, "manage_trash");
$data["link_add"] = $ttH->admin->get_link_admin($this->modules, $this->action, "add");
$this->sub = isset($ttH->input["sub"]) ? $ttH->input["sub"] : "manage";
switch ($this->sub) {
case "add":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_add();
break;
case "edit":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_edit();
break;
case "manage_trash":
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_" . $this->sub];
$data["main"] = $this->do_manage("trash");
break;
default:
$this->sub = "manage";
$ttH->conf["page_title"] = $ttH->lang[$this->modules][$this->action . "_manage"];
$data["main"] = $this->do_manage();
break;
}
$data["class"] = array();
$data["class"][$this->sub] = ' class="active"';
$data["page_title"] = $ttH->conf["page_title"];
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("main");
$ttH->output .= $ttH->temp_act->text("main");
}
示例14: do_edit
function do_edit()
{
global $ttH;
$err = "";
$arr_order_shipping = array();
$sql = "select shipping_id,title,content \r\r\n\t\t\t\t\t\tfrom order_shipping \r\r\n\t\t\t\t\t\twhere is_show=1 \r\r\n\t\t\t\t\t\torder by show_order desc, date_create asc";
//echo $sql;
$result = $ttH->db->query($sql);
$html_row = "";
while ($row = $ttH->db->fetch_row($result)) {
$arr_order_shipping[$row['shipping_id']] = $row;
}
$arr_order_method = array();
$sql = "select method_id,title,content \r\r\n\t\t\t\t\t\tfrom order_method \r\r\n\t\t\t\t\t\twhere is_show=1 \r\r\n\t\t\t\t\t\torder by show_order desc, date_create asc";
//echo $sql;
$result = $ttH->db->query($sql);
$html_row = "";
while ($row = $ttH->db->fetch_row($result)) {
$arr_order_method[$row['method_id']] = $row;
}
$dir = create_folder(date("Y_m"));
$order_id = $ttH->input["id"];
if (isset($ttH->post['do_submit'])) {
/*print_arr($ttH->post);
die();*/
if (empty($err)) {
$col = array();
$arr_key = array('o_full_name', 'o_email', 'o_phone', 'o_address', 'd_full_name', 'd_email', 'd_phone', 'd_address', 'is_status');
foreach ($arr_key as $key) {
$col[$key] = isset($ttH->post[$key]) ? $ttH->post[$key] : '';
}
$col["date_update"] = time();
$ok = $ttH->db->do_update("product_order", $col, " order_id='" . $order_id . "'");
if ($ok) {
$err = $ttH->html->html_alert($ttH->lang["global"]["edit_success"], "success");
} else {
$err = $ttH->html->html_alert($ttH->lang["global"]["edit_false"], "error");
}
}
}
$sql = "select * from product_order where order_id='" . $order_id . "'";
$result = $ttH->db->query($sql);
if ($data = $ttH->db->fetch_row($result)) {
}
$data["err"] = $err;
$data["link_action"] = $ttH->admin->get_link_admin($this->modules, $this->action, $this->sub, array("id" => $order_id));
$data["link_up"] = $ttH->admin->get_link_admin('library', 'library', 'popup_library') . '&type=1&folder_up=' . $this->modules . '&fldr=' . $dir . '&editor=mce_0&field_id=picture';
$data["table_cart"] = $this->table_cart($order_id);
$data["list_status_order"] = list_status_order('is_status', $data['is_status'], " class=\"form-control\"");
$data['shipping'] = isset($data['shipping']) && array_key_exists($data['shipping'], $arr_order_shipping) ? $arr_order_shipping[$data['shipping']] : array();
$data['method'] = isset($data['method']) && array_key_exists($data['method'], $arr_order_method) ? $arr_order_method[$data['method']] : array();
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("edit");
return $ttH->temp_act->text("edit");
}
示例15: response
response('wrong path', 400)->send();
exit;
}
$path = $current_path . $_POST['path'];
$info = pathinfo($path);
$base_folder = $current_path . fix_dirname($_POST['path']) . "/";
switch ($info['extension']) {
case "zip":
$zip = new ZipArchive();
if ($zip->open($path) === true) {
//make all the folders
for ($i = 0; $i < $zip->numFiles; $i++) {
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if (substr($FullFileName['name'], -1, 1) == "/") {
create_folder($base_folder . $FullFileName['name']);
}
}
//unzip into the folders
for ($i = 0; $i < $zip->numFiles; $i++) {
$OnlyFileName = $zip->getNameIndex($i);
$FullFileName = $zip->statIndex($i);
if (!(substr($FullFileName['name'], -1, 1) == "/")) {
$fileinfo = pathinfo($OnlyFileName);
if (in_array(strtolower($fileinfo['extension']), $ext)) {
copy('zip://' . $path . '#' . $OnlyFileName, $base_folder . $FullFileName['name']);
}
}
}
$zip->close();
} else {