Mostrando entradas con la etiqueta PHP 6. Mostrar todas las entradas
Mostrando entradas con la etiqueta PHP 6. Mostrar todas las entradas

martes, 13 de septiembre de 2016

Mostrar un listado de modulosde php que se pueden instalar

cesar@sisweb:/usr/bin$ sudo apt-cache search php5-



php5-common - Common files for packages built from the php5 source
php5-curl - CURL module for php5
php5-dev - Files for PHP5 module development
php5-json - JSON module for php5
php5-readline - Readline module for php5
php5-cgi - Lenguaje de guiones embebidos en HTML para servidores (binario CGI)
php5-cli - intérprete de órdenes para el lenguaje de guión php5
php5-dbg - Símbolos de depuración para PHP5
php5-gd - Módulo GD para php5
php5-gmp - Módulo GMP para php5
php5-ldap - Módulo LDAP para php5
php5-mysql - Módulo MySQL para php5
php5-odbc - Módulo ODBC para php5
php5-pgsql - Módulo PostgreSQL para php5
php5-pspell - Módulo pspell para php5
php5-recode - Módulo recode para php5
php5-snmp - Módulo SNMP para php5
php5-sqlite - Módulo SQLite para php5
php5-tidy - Módulo tidy para php5
php5-xmlrpc - Módulo XML-RPC para php5
php5-xsl - Módulo XSL para php5
bluefish - advanced Gtk+ text editor for web and software development
libphp5-embed - HTML-embedded scripting language (Embedded SAPI library)
libssh2-php - transitional dummy package for php5-ssh2
php-smb - php wrapper for smbclient and libsmbclient-php
php5-adodb - Extension optimising the ADOdb database abstraction library
php5-apcu - APC User Cache for PHP 5
php5-enchant - Enchant module for php5
php5-facedetect - Detect faces with PHP
php5-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php5-gdcm - Grassroots DICOM PHP5 bindings
php5-gearman - PHP wrapper to libgearman
php5-geos - GEOS bindings for PHP
php5-gnupg - wrapper around the gpgme library
php5-igbinary - igbinary extension
php5-imagick - Provides a wrapper to the ImageMagick library
php5-interbase - interbase/firebird module for php5
php5-intl - internationalisation module for php5
php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings
php5-librdf - PHP5 language bindings for the Redland RDF library
php5-libvirt-php - libvirt bindings for PHP
php5-mapscript - php5-cgi module for MapServer
php5-memcache - memcache extension module for PHP5
php5-memcached - memcached extension module for PHP5, uses libmemcached
php5-midgard2 - Midgard2 Content Repository - PHP5 language bindings and module
php5-mongo - MongoDB database driver
php5-msgpack - PHP extension for interfacing with MessagePack
php5-mysqlnd - MySQL module for php5 (Native Driver)
php5-mysqlnd-ms - MySQL replication and load balancing module for PHP
php5-oauth - OAuth 1.0 consumer and provider extension
php5-pecl-http - pecl_http module for PHP 5 Extended HTTP Support
php5-pecl-http-dev - pecl_http module for PHP 5 Extended HTTP Support development headers
php5-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php5-pinba - Pinba module for PHP 5
php5-propro - propro module for PHP 5
php5-propro-dev - propro module for PHP 5 development headers
php5-radius - Radius client library
php5-raphf - raphf module for PHP 5
php5-raphf-dev - raphf module for PHP 5 development headers
php5-redis - PHP extension for interfacing with Redis
php5-remctl - PECL module for Kerberos-authenticated command execution
php5-rrd - PHP bindings to rrd tool system
php5-sasl - Cyrus SASL Extension
php5-solr - solr module for PHP 5
php5-ssh2 - Bindings for the libssh2 library
php5-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP 5
php5-svn - PHP Bindings for the Subversion Revision control system
php5-symfony-debug - Symfony debug extension
php5-tokyo-tyrant - PHP interface to Tokyo Cabinet's network interface, Tokyo Tyrant
php5-twig - Enhance performance of the Twig template engine
php5-uprofiler - hierarchical profiler for PHP (extension)
php5-vtkgdcm - Grassroots DICOM VTK PHP bindings
php5-xcache - Fast, stable PHP opcode cacher
php5-xhprof - Hierarchical Profiler for PHP5
php5-yac - YAC (Yet Another Cache) for PHP 5
php5-zmq - ZeroMQ messaging
php5-exactimage - fast image manipulation library (PHP bindings)
php5-geoip - Módulo GeoIP para php5
php5-imap - Módulo IMAP para php5
php5-mcrypt - Módulo MCrypt para php5
php5-ming - Módulo Ming para php5
php5-ps - módulo ps para PHP 5
php5-sybase - Módulo de servidor Sybase/MS SQL para php5
php5-xdebug - Módulo Xdebug para PHP 5
php5-phalcon - High performance PHP framework
cesar@sisweb:/usr/bin$ sudo apt-cache search php5-^C
cesar@sisweb:/usr/bin$ sudo apt-cache search php5-
php5-common - Common files for packages built from the php5 source
php5-curl - CURL module for php5
php5-dev - Files for PHP5 module development
php5-json - JSON module for php5
php5-readline - Readline module for php5
php5-cgi - Lenguaje de guiones embebidos en HTML para servidores (binario CGI)
php5-cli - intérprete de órdenes para el lenguaje de guión php5
php5-dbg - Símbolos de depuración para PHP5
php5-gd - Módulo GD para php5
php5-gmp - Módulo GMP para php5
php5-ldap - Módulo LDAP para php5
php5-mysql - Módulo MySQL para php5
php5-odbc - Módulo ODBC para php5
php5-pgsql - Módulo PostgreSQL para php5
php5-pspell - Módulo pspell para php5
php5-recode - Módulo recode para php5
php5-snmp - Módulo SNMP para php5
php5-sqlite - Módulo SQLite para php5
php5-tidy - Módulo tidy para php5
php5-xmlrpc - Módulo XML-RPC para php5
php5-xsl - Módulo XSL para php5
bluefish - advanced Gtk+ text editor for web and software development
libphp5-embed - HTML-embedded scripting language (Embedded SAPI library)
libssh2-php - transitional dummy package for php5-ssh2
php-smb - php wrapper for smbclient and libsmbclient-php
php5-adodb - Extension optimising the ADOdb database abstraction library
php5-apcu - APC User Cache for PHP 5
php5-enchant - Enchant module for php5
php5-facedetect - Detect faces with PHP
php5-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php5-gdcm - Grassroots DICOM PHP5 bindings
php5-gearman - PHP wrapper to libgearman
php5-geos - GEOS bindings for PHP
php5-gnupg - wrapper around the gpgme library
php5-igbinary - igbinary extension
php5-imagick - Provides a wrapper to the ImageMagick library
php5-interbase - interbase/firebird module for php5
php5-intl - internationalisation module for php5
php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings
php5-librdf - PHP5 language bindings for the Redland RDF library
php5-libvirt-php - libvirt bindings for PHP
php5-mapscript - php5-cgi module for MapServer
php5-memcache - memcache extension module for PHP5
php5-memcached - memcached extension module for PHP5, uses libmemcached
php5-midgard2 - Midgard2 Content Repository - PHP5 language bindings and module
php5-mongo - MongoDB database driver
php5-msgpack - PHP extension for interfacing with MessagePack
php5-mysqlnd - MySQL module for php5 (Native Driver)
php5-mysqlnd-ms - MySQL replication and load balancing module for PHP
php5-oauth - OAuth 1.0 consumer and provider extension
php5-pecl-http - pecl_http module for PHP 5 Extended HTTP Support
php5-pecl-http-dev - pecl_http module for PHP 5 Extended HTTP Support development headers
php5-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php5-pinba - Pinba module for PHP 5
php5-propro - propro module for PHP 5
php5-propro-dev - propro module for PHP 5 development headers
php5-radius - Radius client library
php5-raphf - raphf module for PHP 5
php5-raphf-dev - raphf module for PHP 5 development headers
php5-redis - PHP extension for interfacing with Redis
php5-remctl - PECL module for Kerberos-authenticated command execution
php5-rrd - PHP bindings to rrd tool system
php5-sasl - Cyrus SASL Extension
php5-solr - solr module for PHP 5
php5-ssh2 - Bindings for the libssh2 library
php5-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP 5
php5-svn - PHP Bindings for the Subversion Revision control system
php5-symfony-debug - Symfony debug extension
php5-tokyo-tyrant - PHP interface to Tokyo Cabinet's network interface, Tokyo Tyrant
php5-twig - Enhance performance of the Twig template engine
php5-uprofiler - hierarchical profiler for PHP (extension)
php5-vtkgdcm - Grassroots DICOM VTK PHP bindings
php5-xcache - Fast, stable PHP opcode cacher
php5-xhprof - Hierarchical Profiler for PHP5
php5-yac - YAC (Yet Another Cache) for PHP 5
php5-zmq - ZeroMQ messaging
php5-exactimage - fast image manipulation library (PHP bindings)
php5-geoip - Módulo GeoIP para php5
php5-imap - Módulo IMAP para php5
php5-mcrypt - Módulo MCrypt para php5
php5-ming - Módulo Ming para php5
php5-ps - módulo ps para PHP 5
php5-sybase - Módulo de servidor Sybase/MS SQL para php5
php5-xdebug - Módulo Xdebug para PHP 5
php5-phalcon - High performance PHP framework


miércoles, 30 de enero de 2013

Envio de correos desde gmail


    function SendMail($folio_iems,$mensaje,$mail_soporte,$mail_ing){


    require("class.phpmailer.php");
    $mail = new PHPMailer();
    // Recipient’s e-mail address
    $email="ms_ces@hotmail.com";
    $email2="cesar.morones1@gmail.com";
    // Message text (may contain HTML)
    $milo="Aviso!!!";
    $mail->Mailer = "smtp";
    $mail->Host = "ssl://smtp.gmail.com";
    $mail->Port = 465;
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->Username = "cesar.morones@iems.edu.mx"; // SMTP username
    $mail->Password = "tupassword"; // SMTP password

    $webmaster_email = "cesar.morones1@gmail.com"; //Reply to this email ID
  //  $name="$nombreuser[1]"; // Recipient’s name
    $mail->From = "cesar@planeacion.unam.mx";
    $mail->FromName = "Sistema Integral de Soporte IEMS";
  //  $mail->FromName = "$nombreuser[1] $nombreuser[2]"; // Edit this to select “From” header
   // $mail->AddAddress($email, $valor); ///  $valor  esta variable es el correo del usuario en produccion hay que remplazarla por $email
    $mail->AddAddress($email2, 'cesar morones');
    $mail->AddAddress($mail_soporte, 'JUD');
    $mail->AddAddress($mail_ing, 'Tecnico');
  // $mail->AddReplyTo($webmaster_email, "Youraccount.com");
    $mail->WordWrap = 70; // set word wrap
    $mail->IsHTML(true); // send as HTML
    $mail->Subject = "Se genero Ticket folio:$folio_iems";
    $mail->Body = $mensaje;//HTML Body
    $mail->Send();

    }

Diferencias entre fechas


$fecha_hoy =date("Y\-n\-j");
$date1=strtotime($objDep->fecha2); // fecha de inicio
$date2=strtotime($fecha_hoy); // fecha de hoy
//calculo timestam de las dos fechas
$timestamp1=mktime(0, 0, 0, date("m", $date1), date("d", $date1), date("Y", $date1));
$timestamp2=mktime(0, 0, 0, date("m", $date2), date("d", $date2), date("Y", $date2));

//$timestamp1 = mktime(0,0,0,$mes1,$dia1,$ano1);
//$timestamp2 = mktime(4,12,0,$mes2,$dia2,$ano2);

//resto a una fecha la otra
$segundos_diferencia = $timestamp1 - $timestamp2;
//echo $segundos_diferencia;

//convierto segundos en días
$dias_diferencia = $segundos_diferencia / (60 * 60 * 24);


$dias_diferencia = round($dias_diferencia,0);

if($dias_diferencia <= 0){

    $estado_lsgs ="<div style='color:#FF0000;'><STRONG>VENCIDO</STRONG></div>";

}

if($dias_diferencia <= 20 && $dias_diferencia > 0 ){

    $estado_lsgs ="<div style='color:#088A08;'><STRONG>EN TRAMITE</STRONG></div>";

}

if($dias_diferencia > 20 ){

    $estado_lsgs ="<div><STRONG>NORMAL</STRONG></div>";

}

lunes, 14 de enero de 2013

Para mostrar los errores de PHP en un servidor en produccion

Solo hay que poner estas lineas al principio del archivo

error_reporting(E_ALL);
ini_set("display_errors", 1);

viernes, 13 de abril de 2012

Llenar un select con la base de datos

<select name=id_proveedor id=id_proveedor>
    <option value=>Seleccione una opcion</option>";

        $arrayObjDep = $DATABASE->getInvProveedores($valor);
        if (is_array($arrayObjDep)) {
            foreach ($arrayObjDep as $objDep) {

                //    $html .="<option value=$objDep->id_tipo_falla>$objDep->nombre</option>";
                //       $nombre =htmlentities($objDep->nombre);
                $html .="<option value='" . $objDep->clave . "'>" . $objDep->razon_social . "</option>";
            }
        }
        $html .="
                               </select>

lunes, 12 de marzo de 2012

PHP: redondeo de números decimales hacia abajo (floor) y hacia arriba

La función PHP floor permite eliminar la parte decimal de un número redondeándolo hacia abajo. Por ejemplo, 11.22 se redondearía a 11, 11.9999 se redondearía a 11:
echo floor(11.22); // 11
echo floor(11.9999); // 11
 
La función PHP ceil permite eliminar la parte decimal de un número redondeándolo hacia arriba. Por ejemplo, 11.22 se redondearía a 12, 11.9999 se redondearía a 12:
echo ceil(11.22); // 12 echo ceil(11.9999); // 12
 

PHP: convertir cadena de texto a mayúsculas o a minúsculas

Para pasar a minúsculas:
$resultado = strtolower($origen)
Para pasar a mayúsculas:
$resultado = strtoupper($origen)

viernes, 2 de marzo de 2012

Clase pagina con constructor

<?php
// Page class
class Page {

    // Declare a class member variable
    var $page;
    var $title;
    var $year;
    var $copyright;

    // The constructor function
    function Page($title,$year,$copyright) {
        // Assign values to member variables
        $this->page = '';
        $this->title = $title;
        $this->year = $year;
        $this->copyright = $copyright;

        // Call the addHeader() method
        $this->addHeader();
    }

    // Generates the top of the page
    function addHeader() {
        $this->page.=<<<EOD
<html>
<head>
<title>$this->title</title>
</head>
<body>
<h1 align="center">$this->title</h1>
EOD;
    }

    // Adds some more text to the page
    function addContent($content) {
        $this->page.=$content;
    }

    // Generates the bottom of the page
    function addFooter() {
        $this->page.=<<<EOD
<div align="center">&copy; $this->year $this->copyright</div>
</body>
</html>
EOD;
    }

    // Gets the contents of the page
    function get() {
        // Keep a copy of the page with no footer
        $temp = $this->page;

        // Call the addFooter() method
        $this->addFooter();

        // Restore $page for the next call to get
        $page = $this->page;
        $this->page = $temp;

        return $page;
    }
}

// Instantiate the page class
$webPage=new Page('As Easy as it Gets',date('Y'),'Easy Systems Inc.');

// Add something to the body of the page
$webPage->addContent(
    "<p align=\"center\">It's so easy to use!</p>\n" );

// Display the page
echo ( $webPage->get() );
?>

Clase Page que recibe parametros

<?php
// Page class
class Page {

    // Declare a class member variable
    var $page;

    // The constructor function
    function Page() {
        $this->page = '';
    }

    // Generates the top of the page
    function addHeader($title) {
        $this->page.=<<<EOD
<html>
<head>
<title>$title</title>
</head>
<body>
<h1 align="center">$title</h1>
EOD;
    }

    // Adds some more text to the page
    function addContent($content) {
        $this->page.=$content;
    }

    // Generates the bottom of the page
    function addFooter($year,$copyright) {
        $this->page.=<<<EOD
<div align="center">&copy; $year $copyright</div>
</body>
</html>
EOD;
    }

    // Gets the contents of the page
    function get() {
        return $this->page;
    }
}

// Instantiate the page class
$webPage=new Page();

// Add the header to the page
$webPage->addHeader('A Page Built with an Object');

// Add something to the body of the page
$webPage->addContent(
    "<p align=\"center\">This page was generated using an object</p>\n" );


// Add the footer to the page
$webPage->addFooter(date('Y'),'Object Designs Inc.');

// Display the page
echo ( $webPage->get() );
?>

Ejemplo de una clase en php

<?php
// Page class
class Page {
    // Generates the top of the page
    function addHeader($page,$title) {
        $page.=<<<EOD
<html>
<head>
<title>$title</title>
</head>
<body>
<h1 align="center">$title</h1>
EOD;
        return $page;
    }

    // Generates the bottom of the page
    function addFooter($page,$year,$copyright) {
        $page.=<<<EOD
<div align="center">&copy; $year $copyright</div>
</body>
</html>
EOD;
        return $page;
    }
}

// Inicializar variable
$page='';

// Agregar encabezado de la pagina
$page = Page::addHeader($page,'A Script Using Static Methods');

// agregar cuerpo d ela pagina
$page.=<<<EOD
<p align="center">Esta pagia es generada por metodos de una clase</p>
EOD;

// Agregar pie de pagina
$page = Page::addFooter($page,date('Y'),'Static Designs Inc.');

// Display the page
echo ( $page );
?>