• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP unique函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中unique函数的典型用法代码示例。如果您正苦于以下问题:PHP unique函数的具体用法?PHP unique怎么用?PHP unique使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了unique函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: submit_form

 public function submit_form()
 {
     $subject = $_POST["subject"];
     $topic = $_POST["topic"];
     $question = $_POST["question"];
     $file = $_FILES["file"];
     $key = 0;
     $data = array();
     $data["file_path"] = "";
     if ($file["size"] != 0) {
         $this->load->helper('common_function');
         $uniquename = unique();
         $config['upload_path'] = $this->gallery_path;
         $config['allowed_types'] = 'jpeg|jpg|bmp|png|pdf|docx';
         $config['file_name'] = $uniquename;
         $config['max_size'] = '3000';
         $config['overwrite'] = false;
         $this->load->library('upload', $config);
         if ($this->upload->do_upload('file')) {
             $data["upload_data"] = $this->upload->data();
             $data["file_path"] = base_url() . 'vidhyasanidhi/files/' . $data["upload_data"]["file_name"];
         }
     }
     if ($subject == "") {
         $data["error"][$key]["type"] = "subject";
         $data["error"][$key]["msg"] = "You should select a subject";
         $key++;
     }
     if ($topic == "") {
         $data["error"][$key]["type"] = "topic";
         $data["error"][$key]["msg"] = "Topic can not be blank";
         $key++;
     }
     if ($question == "") {
         $data["error"][$key]["type"] = "question";
         $data["error"][$key]["msg"] = "Question can not be blank";
         $key++;
     }
     if ($key == 0) {
         $data["success"] = 1;
         $session = $this->session->userdata("user_data");
         $user_id = $session["user_id"];
         $data_to = array();
         $data_to["user_id"] = $user_id;
         $data_to["subject"] = $subject;
         $data_to["topic"] = $topic;
         $data_to["question"] = $question;
         $data_to["post"] = 0;
         $data_to["course"] = $_POST["course"];
         $data_to["unique_id"] = uniqid();
         $data_to["file_url"] = $data["file_path"];
         $this->db->insert("tbl_ask_question", $data_to);
         $question_id = $this->db->insert_id();
         $this->session->set_flashdata("ask_question", 2);
     } else {
         $data["success"] = 0;
     }
     return $data;
 }
开发者ID:virendrayadav,项目名称:educationportal,代码行数:59,代码来源:add_question.php


示例2: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('categories', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name') - unique();
         $table->string('description');
         $table->timestamps();
     });
 }
开发者ID:a-madhukar,项目名称:clubEcommerce,代码行数:14,代码来源:2015_08_16_083618_create_categories_table.php


示例3: trier_rss

function trier_rss($texte)
{
    if (preg_match_all(",<item.*</item>\\s*?,Uims", $texte, $matches, PREG_SET_ORDER)) {
        $placeholder = "<!--REINSERT-->";
        $items = array();
        foreach ($matches as $match) {
            if (preg_match(',<dc:date>(.*)</dc:date>,Uims', $match[0], $r)) {
                $items[strtotime($r[1])] = trim($match[0]);
                $texte = str_replace($match[0], unique($placeholder), $texte);
            }
        }
        krsort($items);
        $texte = str_replace($placeholder, implode("\n\t", $items) . "\n", $texte);
    }
    return $texte;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:16,代码来源:a_suivre_fonctions.php


示例4: salt

 public function salt($count = 10, $table_name = '', $field_name = '', $find = FALSE)
 {
     function unique($count)
     {
         return substr(strtoupper(sha1(uniqid() . $_SERVER['REMOTE_ADDR'] . microtime())), 0, $count);
     }
     if ($this->CI->db->table_exists($table_name) && $this->CI->db->field_exists($field_name, $table_name)) {
         while (!$find) {
             $salt = unique($count);
             if ($this->CI->db->select('h.' . $field_name)->from($table_name . ' h')->where('h.' . $field_name, $salt)->get()->num_rows() == 0) {
                 $find = TRUE;
             }
         }
     }
     return $salt;
 }
开发者ID:nvanilkumar,项目名称:ihospital,代码行数:16,代码来源:Auth.php


示例5: BOUCLE_langueshtml_9491858aea5af6033788aa1936ebca8d

function BOUCLE_langueshtml_9491858aea5af6033788aa1936ebca8d(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_langues';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.lang", "rubriques.titre");
        $command['orderby'] = array('rubriques.lang');
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_parent', 0), array('NOT', array('=', 'rubriques.lang', sql_quote(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lang', null), true)), '', 'varchar(10) NOT NULL DEFAULT \'\''))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-bas_menu-lang.html', 'html_9491858aea5af6033788aa1936ebca8d', '_langues', 18, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= ($t1 = strval(traduire_nom_langue(unique(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']))))) !== '' ? '
		<span lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '">| 
		<a href="spip.php?action=converser&amp;var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '&amp;redirect=/" rel="alternate"  title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . traduire_nom_langue(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang'])) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">' . $t1 . '</a>
		</span>
' : '';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_langues @ squelettes/inc/inc-bas_menu-lang.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:45,代码来源:html_9491858aea5af6033788aa1936ebca8d.php


示例6: create_thread

 public function create_thread($uid, $id)
 {
     //thread check if already created or not
     $thraedQuery = $this->db->query("select * from tbl_message_thread where (`sender_id`='{$uid}' and `receiver_id`='{$id}') or (`sender_id`='{$id}' and `receiver_id`='{$uid}')");
     if ($thraedQuery->num_rows() < 1) {
         $threadFields = array('thread_id' => unique(), 'sender_id' => $uid, 'receiver_id' => $id, 'created_time' => date('Y-m-d H:i:s'));
         $threadResponse = $this->db->insert('tbl_message_thread', $threadFields);
     } else {
         return true;
     }
 }
开发者ID:virendrayadav,项目名称:arfatmatrimonials,代码行数:11,代码来源:message_model.php


示例7: dump_afficher_progres

/**
 * Afficher l'avancement de la copie
 *
 * @staticvar int $etape    Nombre de fois ou on est passe dans cette foncion
 * @param <type> $courant   Flag pour indiquer si c'est la table sur laquelle on travaille actuellement
 * @param <type> $total     Nombre total de tables
 * @param <type> $table     Nom de la table
 */
function dump_afficher_progres($courant, $total, $table)
{
    static $etape = 1;
    if (unique($table)) {
        if ($total < 0 or !is_numeric($total)) {
            echo "<br /><strong>" . $etape . '. ' . "</strong>{$table} ";
        } else {
            echo "<br /><strong>" . $etape . '. ' . "{$table}</strong> " . ($courant ? " <i>({$courant})</i> " : "");
        }
        $etape++;
    }
    if (is_numeric($total) and $total >= 0) {
        echo ". ";
    } else {
        echo "(" . -intval($total) . ")";
    }
    flush();
}
开发者ID:xablen,项目名称:Semaine14_SPIP_test,代码行数:26,代码来源:dump.php


示例8: auditoria_sistema

function auditoria_sistema($conexion, $tabla, $id_user, $proceso, $id_registro, $fecha_larga, $fecha, $sql_nuevo, $sql_anterior)
{
    $cliente = $_SERVER['REMOTE_ADDR'];
    $server = $_SERVER['SERVER_ADDR'];
    $id = unique($fecha_larga);
    if ($proceso == 'Insert') {
        $consulta = "insert into auditoria values ('{$id}','{$tabla}','{$id_registro}',array[''],{$sql_nuevo}::text[],'{$proceso}','{$id_user}','{$cliente}','{$server}','0','{$fecha}')";
        pg_query($consulta);
    } else {
        if ($proceso == 'Update') {
            $consulta = "insert into auditoria values ('{$id}','{$tabla}','{$id_registro}',{$sql_anterior}::text[],{$sql_nuevo}::text[],'{$proceso}','{$id_user}','{$cliente}','{$server}','0','{$fecha}')";
            pg_query($consulta);
        } else {
            if ($proceso == 'Backup') {
            }
        }
    }
}
开发者ID:Oskrin,项目名称:neltex_formulario,代码行数:18,代码来源:funciones_generales.php


示例9: library_material

 public function library_material()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $file = $_FILES["filename"];
         $this->form_validation->set_rules('course', 'Course', 'required');
         $this->form_validation->set_rules('title', 'Title', 'required');
         $this->form_validation->set_rules('message', 'Description', 'required');
         $this->form_validation->set_rules('filename', 'PDF File', 'xss_clean');
         $this->form_validation->set_rules('course_subject', 'Subject', 'required');
         $this->form_validation->set_error_delimiters('<div class="alert alert-danger form-error">', '</div>');
         if ($this->form_validation->run() == FALSE) {
             $value['msg'] = '<div class="alert alert-danger form-error">Class Edit Error</div>';
             $data__header['page_name'] = 'library_material';
             $this->load->view('admin/header', $data__header);
             $this->load->view('admin/library_material', $value);
         } else {
             if ($file["name"] != "") {
                 $this->load->helper('common_function');
                 $uniquename = unique();
                 $config['upload_path'] = $this->gallery_path;
                 $config['allowed_types'] = 'pdf';
                 $config['file_name'] = $uniquename;
                 $config['max_size'] = '250000';
                 $config['overwrite'] = false;
                 $this->load->library('upload', $config);
                 if ($this->upload->do_upload('filename')) {
                     $data["upload_data"] = $this->upload->data();
                     $url = base_url() . 'vidhyasanidhi/files/' . $data["upload_data"]["file_name"];
                     $directory_path = $data['upload_data']['file_path'];
                     $directory_path_full = $data['upload_data']['full_path'];
                     $file_name = $data['upload_data']['raw_name'];
                 } else {
                     $this->custom_errors['avatar'] = $this->upload->display_errors();
                 }
             }
             $this->form_validation->set_rules('course', 'Course', 'required');
             $this->form_validation->set_rules('title', 'Title', 'required');
             $this->form_validation->set_rules('message', 'Description', 'required');
             $this->form_validation->set_rules('filename', 'PDF File', 'xss_clean|callback_filecheck1');
             $this->form_validation->set_rules('course_subject', 'Subject', 'required');
             $this->form_validation->set_error_delimiters('<div class="alert alert-danger form-error">', '</div>');
             if ($this->form_validation->run() == FALSE) {
                 $value['msg'] = '<div class="alert alert-danger form-error">Class Edit Error</div>';
                 $data__header['page_name'] = 'library_material';
                 $this->load->view('admin/header', $data__header);
                 $this->load->view('admin/library_material', $value);
             } else {
                 $course_details = $this->db->where(array("unique_id" => $_POST["course"]))->get("tbl_course")->row();
                 $data = array();
                 $data['board'] = $course_details->board;
                 $data['course_unique_id'] = $_POST["course"];
                 $data['stream'] = $course_details->stream;
                 $data['class'] = $course_details->class;
                 $data['subject'] = $_POST["course_subject"];
                 $data['section'] = "A";
                 $data["all_noti"] = $_POST["message"];
                 $data["url"] = $url;
                 $data['title'] = $_POST['title'];
                 $data['status'] = 1;
                 $data['unique_id'] = uniqid();
                 $this->db->insert('tbl_library', $data);
                 $this->session->set_flashdata('message_board_added', 'Added.');
                 redirect('admin/home/library_material');
             }
         }
     } else {
         $data__header['page_name'] = 'library_material';
         $this->load->view('admin/header', $data__header);
         $this->load->view('admin/library_material');
     }
 }
开发者ID:virendrayadav,项目名称:educationportal,代码行数:71,代码来源:home.php


示例10: _unique

/**
 * @param $string
 * @return bool
 */
function _unique($string)
{
    return !unique($string);
}
开发者ID:Qti3e,项目名称:ContestFramework,代码行数:8,代码来源:string.module.php


示例11: migrer_vers_afficher_progres

/**
 * Afficher l'avancement de la copie
 * @staticvar int $etape
 * @param int $courant
 * @param int $total
 * @param string $table
 */
function migrer_vers_afficher_progres($courant,$total,$table) {
	static $etape = 1;
	if (unique($table)) {
		if ($total<0 OR !is_numeric($total)){
			#echo "<br /><strong>".$etape. '. '."</strong>$table ";
			$etape++;
			return;
		}
		else{
			echo(str_repeat("<span></span>\r\n",256));
			echo "<br /><strong>".$etape. '. '."$table</strong> ".($courant?" <i>($courant)</i> ":"");
		}
		$etape++;
	}
	if (is_numeric($total) AND $total>=0)
		echo ". ";
	else
		echo "(". (-intval($total)).")";
	flush();
}
开发者ID:nursit,项目名称:Migration,代码行数:27,代码来源:migrer_vers.php


示例12: conectarse

<?php

include '../conexion.php';
include '../funciones_generales.php';
$conexion = conectarse();
date_default_timezone_set('America/Guayaquil');
$fecha = date('Y-m-d H:i:s', time());
$fecha_larga = date('His', time());
$sql = "";
$id = unique($fecha_larga);
$id_c = unique($fecha_larga);
$check = "off";
if (isset($_POST["switch-field-1"])) {
    $check = "on";
}
$cadena = " " . $_POST['img'];
$buscar = 'data:image/png;base64,';
$id_user = sesion_activa();
if ($_POST['tipo'] == "g") {
    if (strpos($cadena, $buscar) == FALSE) {
        $sql = "insert into empresa values ('" . $id . "','" . $_POST['txt_1'] . "','" . $_POST['txt_12'] . "','" . $_POST['txt_2'] . "','" . $_POST['txt_13'] . "','" . $_POST['txt_3'] . "','" . $_POST['txt_4'] . "','" . $_POST['txt_11'] . "','" . $_POST['txt_14'] . "','" . $_POST['txt_5'] . "','" . $_POST['txt_7'] . "','" . $_POST['txt_6'] . "','" . $_POST['txt_17'] . "','" . $_POST['txt_18'] . "','" . $_POST['txt_15'] . "','" . $_POST['txt_8'] . "','" . $_POST['txt_16'] . "','" . $_POST['spinner1'] . "','" . $_POST['spinner2'] . "','" . $_POST['spinner3'] . "','" . $_POST['txt_19'] . "','" . $_POST['txt_20'] . "','default.png','" . $check . "','" . $fecha . "','" . $_POST['txt_21'] . "','" . $_POST['txt_22'] . "','" . $_POST['txt_23'] . "','" . $_POST['txt_24'] . "','" . $_POST['txt_25'] . "')";
    } else {
        $resp = img_64("img", $_POST['img'], 'png', $id);
        if ($resp == "true") {
            $sql = "insert into empresa values ('" . $id . "','" . $_POST['txt_1'] . "','" . $_POST['txt_12'] . "','" . $_POST['txt_2'] . "','" . $_POST['txt_13'] . "','" . $_POST['txt_3'] . "','" . $_POST['txt_4'] . "','" . $_POST['txt_11'] . "','" . $_POST['txt_14'] . "','" . $_POST['txt_5'] . "','" . $_POST['txt_7'] . "','" . $_POST['txt_6'] . "','" . $_POST['txt_17'] . "','" . $_POST['txt_18'] . "','" . $_POST['txt_15'] . "','" . $_POST['txt_8'] . "','" . $_POST['txt_16'] . "','" . $_POST['spinner1'] . "','" . $_POST['spinner2'] . "','" . $_POST['spinner3'] . "','" . $_POST['txt_19'] . "','" . $_POST['txt_20'] . "','" . $id . ".png','" . $check . "','" . $fecha . "','" . $_POST['txt_21'] . "','" . $_POST['txt_22'] . "','" . $_POST['txt_23'] . "','" . $_POST['txt_24'] . "','" . $_POST['txt_25'] . "')";
        } else {
            $sql = "insert into empresa values ('" . $id . "','" . $_POST['txt_1'] . "','" . $_POST['txt_12'] . "','" . $_POST['txt_2'] . "','" . $_POST['txt_13'] . "','" . $_POST['txt_3'] . "','" . $_POST['txt_4'] . "','" . $_POST['txt_11'] . "','" . $_POST['txt_14'] . "','" . $_POST['txt_5'] . "','" . $_POST['txt_7'] . "','" . $_POST['txt_6'] . "','" . $_POST['txt_17'] . "','" . $_POST['txt_18'] . "','" . $_POST['txt_15'] . "','" . $_POST['txt_8'] . "','" . $_POST['txt_16'] . "','" . $_POST['spinner1'] . "','" . $_POST['spinner2'] . "','" . $_POST['spinner3'] . "','" . $_POST['txt_19'] . "','" . $_POST['txt_20'] . "','default.png','" . $check . "','" . $fecha . "','" . $_POST['txt_21'] . "','" . $_POST['txt_22'] . "','" . $_POST['txt_23'] . "','" . $_POST['txt_24'] . "','" . $_POST['txt_25'] . "')";
        }
    }
    $guardar = guardarSql($conexion, $sql);
    $sql_nuevo = "select (id_empresa,ruc_empresa,nombre_empresa,propietario,slogan,telefono1,telefono2,ciudad,direccion,correo,fax,sitio_web,nombre_contador,autorizacion_factura,ascesor_legal,representante_legal,identificacion_repre,inicio_fac_preimpresa,item_factura,anio_contable,modo_costeo,comentario,imagen,estado,fecha_creacion,ruc_contador,serie_retencion,autorizacion_retencion,serie_nota_credito,autorizacion_nota_credito) from empresa where id_empresa= '" . $id . "'";
开发者ID:Oskrin,项目名称:neltex_formulario,代码行数:31,代码来源:empresa.php


示例13: translate

}
include "header.php";
$pagesize = $show_user;
if (!isset($letter) or $letter == '') {
    $letter = translate("All");
}
$letter = removeHack(stripslashes(htmlspecialchars($letter, ENT_QUOTES, cur_charset)));
if (!isset($sortby)) {
    $sortby = 'uid DESC';
}
$sortby = removeHack($sortby);
if (!isset($page)) {
    $page = 1;
}
if (isset($list)) {
    $tempo = unique(explode(',', $list));
    $list = urlencode(implode(',', $tempo));
}
$result = sql_query("SELECT uname, user_avatar FROM " . $NPDS_Prefix . "users ORDER BY uid DESC limit 0,1");
list($lastuser, $lastava) = sql_fetch_row($result);
echo '
   <h2><img src="images/admin/users.png" alt="' . translate("Members List") . '" />' . translate("Members List");
if (isset($uid_from_ws) and $uid_from_ws != '') {
    echo '<span class="text-muted"> ' . translate("for group") . ' #' . $gr_from_ws . '</span>';
}
echo '</h2>
   <hr />';
if (!isset($gr_from_ws)) {
    echo '
      <div class="media">';
    if ($ibid_avatar = avatar($lastava)) {
开发者ID:npds,项目名称:npds_dune,代码行数:31,代码来源:memberslist.php


示例14: translate

}
include "header.php";
$pagesize = $show_user;
if (!isset($letter) or $letter == "") {
    $letter = translate("All");
}
$letter = removeHack(stripslashes(htmlspecialchars($letter, ENT_QUOTES, cur_charset)));
if (!isset($sortby)) {
    $sortby = "uid DESC";
}
$sortby = removeHack($sortby);
if (!isset($page)) {
    $page = 1;
}
if (isset($list)) {
    $tempo = unique(explode(",", $list));
    $list = urlencode(implode(",", $tempo));
}
$result = sql_query("select uname from " . $NPDS_Prefix . "users order by uid DESC limit 0,1");
list($lastuser) = sql_fetch_row($result);
echo '<h2><img src="images/admin/users.png" border="0" alt="' . translate("Members List") . '" />' . translate("Members List");
if (isset($uid_from_ws) and $uid_from_ws != "") {
    echo " " . translate("for group") . " " . $gr_from_ws;
}
echo '</h2>';
if (!isset($gr_from_ws)) {
    echo "<p>" . translate("Greetings to our latest registered user:") . " <a href=\"user.php?op=userinfo&amp;uname={$lastuser}\">{$lastuser}</a></p>";
}
alpha();
echo "<br />";
SortLinks($letter);
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:31,代码来源:memberslist.php


示例15: explode

$campo2 = $_POST['campo2'];
$campo3 = $_POST['campo3'];
$campo4 = $_POST['campo4'];
$campo5 = $_POST['campo5'];
///////////////////////////////
/////descomponer detalle_inventario////
$arreglo1 = explode('|', $campo1);
$arreglo2 = explode('|', $campo2);
$arreglo3 = explode('|', $campo3);
$arreglo4 = explode('|', $campo4);
$arreglo5 = explode('|', $campo5);
$nelem = count($arreglo1);
/////////////////////////////////////
for ($i = 1; $i < $nelem; $i++) {
    $id2 = unique($fecha_larga);
    ///guardar detalle_factura/////
    $sql2 = "insert into detalle_inventario values (\n\t\t'{$id2}','{$id}','" . $arreglo1[$i] . "','" . $arreglo2[$i] . "','" . $arreglo3[$i] . "','" . $arreglo4[$i] . "','Activo','{$fecha}')";
    $guardar = guardarSql($conexion, $sql2);
    //////////////////////////////
    //////////////modificar productos///////////
    $sql3 = "update productos set stock='" . $arreglo3[$i] . "' where id_productos='" . $arreglo1[$i] . "'";
    $guardar = guardarSql($conexion, $sql3);
    ///////////////////////////////////////////
    ///kardex////
    $sql_kardex = "select id_kardex from kardex where id_productos ='" . $arreglo1[$i] . "'";
    $id_kardex = id_unique($conexion, $sql_kardex);
    $id_det_kardex = unique($fecha_larga);
    $sql_kardex = "insert into detalles_kardex values ('" . $id_det_kardex . "','" . $id_kardex . "','" . $fecha . "','" . 'Ajuste de Inventario con una diferencia de ' . $arreglo4[$i] . "','" . $arreglo3[$i] . "','" . $arreglo5[$i] . "','" . $arreglo3[$i] * $arreglo5[$i] . "','','','','" . $arreglo3[$i] . "','" . $arreglo5[$i] . "','" . $arreglo3[$i] * $arreglo5[$i] . "')";
    $guardar = guardarSql($conexion, $sql_kardex);
    ////////////
}
开发者ID:Oskrin,项目名称:neltex_formulario,代码行数:31,代码来源:inventario.php


示例16: getcwd

     $destino = $ruta . $nombre_original;
     $root = getcwd();
     //move_uploaded_file($file_tmp, $root.$file_destination)
     move_uploaded_file($temporal, $root . $destino);
 }
 if ($key['error'] == '') {
     $mensaje = 'Archivo ' . $nombre_original . ' subido correctamente';
     $data = 0;
     //cargamos el archivo_excel que deseamos leer
     $objPHPExcel = PHPExcel_IOFactory::load('plan_cuentas/' . $nombre_original);
     $objHoja = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
     $cont = 0;
     foreach ($objHoja as $iIndice => $objCelda) {
         if ($cont >= 1) {
             if ($objCelda['A'] != '') {
                 $id_cuentas = unique($fecha_larga);
                 $repetidos = repetidos($conexion, 'codigo_cuenta', $objCelda['A'], 'plan_cuentas', 'g', '', '');
                 if ($repetidos == 'false') {
                     $sql = "insert into plan_cuentas values ('{$id_cuentas}','" . $objCelda['A'] . "','" . $objCelda['B'] . "','" . $objCelda['D'] . "','{$fecha}','" . $objCelda['C'] . "')";
                     $guardar = guardarSql($conexion, $sql);
                 }
             }
         }
         $cont++;
     }
     $sql = "update plan_cuentas set estado = '0'";
     guardarSql($conexion, $sql);
 } else {
     if ($key['error'] != '') {
         $mensaje = 'No se puedo subir el archivo ' . $nombre_original . ' debido al siguiente error ' . $key['error'];
         $data = 1;
开发者ID:Oskrin,项目名称:neltex_formulario,代码行数:31,代码来源:plan_cuentas.php


示例17: conectarse

<?php

include '../conexion.php';
include '../funciones_generales.php';
$conexion = conectarse();
date_default_timezone_set('America/Guayaquil');
$fecha = date('Y-m-d H:i:s', time());
$fecha_larga = date('His', time());
$sql = "";
$id_user = sesion_activa();
$id = unique($fecha_larga);
$id_compras = unique($fecha_larga);
$id_ret_fuente = unique($fecha_larga);
$id_ret_iva = unique($fecha_larga);
if ($_POST['tipo'] == "g") {
    $repetidos = repetidos_1($conexion, "identificacion", strtoupper($_POST["txt_2"]), "proveedor", "g", "", "", "tipo_documento", $_POST['txt_1']);
    if ($repetidos == 'true') {
        $data = 1;
        /// este dato ya existe;
    } else {
        $sql = "insert into proveedor values ('{$id}','" . $_POST['txt_1'] . "','" . $_POST['txt_2'] . "','" . $_POST['txt_12'] . "','" . $_POST['txt_14'] . "','" . $_POST['txt_4'] . "','" . $_POST['txt_5'] . "','" . $_POST['txt_11'] . "','" . $_POST['txt_15'] . "','" . $_POST['txt_3'] . "','" . $_POST['txt_13'] . "','" . $_POST['txt_7'] . "','" . $_POST['txt_6'] . "','" . $_POST['txt_8'] . "','" . $_POST['txt_16'] . "','" . $_POST['txt_17'] . "','" . $_POST['txt_18'] . "','" . $_POST['txt_19'] . "','" . $_POST['txt_22'] . "','" . $_POST['txt_23'] . "','" . $_POST['txt_24'] . "','" . $id_user . "','" . $_POST['txt_26'] . "','0','{$fecha}','" . $_POST['txt_25'] . "','" . $_POST['txt_20'] . "','" . $_POST['txt_21'] . "')";
        $guardar = guardarSql($conexion, $sql);
        $sql_nuevo = "select (id_proveedor,tipo_documento,identificacion,nombres_completos,tipo,telefono1,telefono2,ciudad,direccion,empresa,visitador,fax,correo,forma_pago,principal,cupo_credito,serie_comprobante,autorizacion_sri,id,id_sustento,id_comprobante,id_usuario,comentario,estado,fecha_creacion,id_compras,id_ret_fuente,id_ret_iva) from proveedor where id_proveedor = '{$id}'";
        $sql_nuevo = sql_array($conexion, $sql_nuevo);
        auditoria_sistema($conexion, 'proveedor', $id_user, 'Insert', $id, $fecha_larga, $fecha, $sql_nuevo, '');
        if ($guardar == 'true') {
            $data = 0;
            ////datos guardados
        } else {
            $data = 2;
            /// error al guardar
开发者ID:Oskrin,项目名称:neltex_formulario,代码行数:31,代码来源:proveedores.php


示例18: unique

 public static function unique()
 {
     return self::make(unique());
 }
开发者ID:kamalpanhwar,项目名称:cmsoop,代码行数:4,代码来源:Hash.php


示例19: date_default_timezone_set

date_default_timezone_set('America/Guayaquil');
$fecha = date('Y-m-d H:i:s', time());
$fecha_larga = date('His', time());
$sql = "";
$id_user = sesion_activa();
$id = unique($fecha_larga);
/////////////////////////
$campo1 = $_POST['vect1'];
$arreglo1 = explode(',', $campo1);
$campo2 = $_POST['vect2'];
$arreglo2 = explode(',', $campo2);
$nelem = count($arreglo1);
$data = 0;
///////////////////////
if ($_POST['tipo'] == "g") {
    for ($i = 0; $i < $nelem; $i++) {
        $id_sust_compro = unique($fecha_larga);
        $repetidos = repetidos_1($conexion, "id_sustento", $arreglo1[$i], "sustento_comprobante", "g", "", "", "id_comprobante", $arreglo2[$i]);
        if ($repetidos == 'false') {
            $sql = "insert into  sustento_comprobante values('" . $id_sust_compro . "','" . $arreglo1[$i] . "','" . $arreglo2[$i] . "','0')";
            guardarSql($conexion, $sql);
            $sql_nuevo = "SELECT (id_sust_compro,id_sustento,id_comprobante,estado)  FROM  sustento_comprobante where id_sust_compro = '" . $id_sust_compro . "'";
            $sql_nuevo = sql_array($conexion, $sql_nuevo);
            $data = 1;
        } else {
            $data = 0;
        }
    }
} else {
}
echo $data;
开发者ID:Oskrin,项目名称:neltex_formulario,代码行数:31,代码来源:sustento_comprobante.php


示例20: strtoupper

     $data = "2";
     /// este nombre ya existe;
 } else {
     $sql = "update grupos set codigo_grupo = '" . strtoupper($_POST['txt_1']) . "',nombre_grupo = '" . strtoupper($_POST['txt_2']) . "',estado = '1',fecha = '" . $fecha . "' where id = '" . $_POST['txt_0'] . "'";
     $sql_nuevo = "SELECT (id,codigo_grupo,nombre_grupo,estado,fecha)  FROM grupos where id = '" . $_POST['txt_0'] . "'";
     $sql_nuevo = sql_array($conexion, $sql_nuevo);
     $guardar = guardarSql($conexion, $sql);
     if ($guardar == 'true') {
         $data = '0';
         ////datos guardados
         $sql_anterior = "SELECT (id,codigo_grupo,nombre_grupo,estado,fecha)  FROM grupos where id = '" . $_POST['txt_0'] . "'";
         $sql_anterior = sql_array($conexion, $sql_anterior);
         auditoria_sistema($conexion, 'grupos', $id_user, 'Update', $id, $fecha_larga, $fecha, $sql_nuevo, $sql_anterior);
         /////////////////////detalles grupos////////////
         for ($i = 0; $i < $nelem; $i++) {
             $id_detalles = unique($fecha_larga);
             if ($arreglo4[$i] == '') {
                 $sql = "insert into cuentas_grupos values('" . $id_detalles . "','" . $_POST['txt_0'] . "','" . $arreglo1[$i] . "','" . $fecha . "')";
                 guardarSql($conexion, $sql);
                 $sql_nuevo = "SELECT (id,id_grupo,id_plan,fecha)  FROM cuentas_grupos where id = '" . $id_detalles . "'";
                 $sql_nuevo = sql_array($conexion, $sql_nuevo);
                 auditoria_sistema($conexion, 'cuentas_grupos', $id_user, 'Insert', $id, $fecha_larga, $fecha, $sql_nuevo, '');
             } else {
                 $sql_anterior = "SELECT (id,id_grupo,id_plan,fecha)  FROM cuentas_grupos where id = '" . $arreglo4[$i] . "'";
                 $sql_anterior = sql_array($conexion, $sql_anterior);
                 $sql = "update cuentas_grupos set id_plan = '" . $arreglo1[$i] . "' where id = '" . $arreglo4[$i] . "'";
                 guardarSql($conexion, $sql);
                 $sql_nuevo = "SELECT (id,id_grupo,id_plan,fecha)  FROM cuentas_grupos where id = '" . $arreglo4[$i] . "'";
                 $sql_nuevo = sql_array($conexion, $sql_nuevo);
                 auditoria_sistema($conexion, 'cuentas_grupos', $id_user, 'Update', $id, $fecha_larga, $fecha, $sql_nuevo, $sql_anterior);
             }
开发者ID:Oskrin,项目名称:neltex_formulario,代码行数:31,代码来源:grupos.php



注:本文中的unique函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP unique_id函数代码示例发布时间:2022-05-23
下一篇:
PHP uniqid函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap