当前位置: 首页>>代码示例>>PHP>>正文


PHP dol_stringtotime函数代码示例

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


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

示例1: write_record

 /**
  *  Output record line into file
  *
  *  @param      array		$array_selected_sorted      Array with list of field to export
  *  @param      resource	$objp                       A record from a fetch with all fields from select
  *  @param      Translate	$outputlangs                Object lang to translate values
  *  @param		array		$array_types				Array with types of fields
  * 	@return		int										<0 if KO, >0 if OK
  */
 function write_record($array_selected_sorted, $objp, $outputlangs, $array_types)
 {
     global $conf;
     // Create a format for the column headings
     if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
         $outputlangs->charset_output = 'ISO-8859-1';
         // Because Excel 5 format is ISO
     }
     // Define first row
     $this->col = 0;
     foreach ($array_selected_sorted as $code => $value) {
         if (strpos($code, ' as ') == 0) {
             $alias = str_replace(array('.', '-'), '_', $code);
         } else {
             $alias = substr($code, strpos($code, ' as ') + 4);
         }
         if (empty($alias)) {
             dol_print_error('', 'Bad value for field with code=' . $code . '. Try to redefine export.');
         }
         $newvalue = $objp->{$alias};
         $newvalue = $this->excel_clean($newvalue);
         $typefield = isset($array_types[$code]) ? $array_types[$code] : '';
         // Traduction newvalue
         if (preg_match('/^\\((.*)\\)$/i', $newvalue, $reg)) {
             $newvalue = $outputlangs->transnoentities($reg[1]);
         } else {
             $newvalue = $outputlangs->convToOutputCharset($newvalue);
         }
         if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i', $newvalue)) {
             if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
                 $formatdate = $this->workbook->addformat();
                 $formatdate->set_num_format('yyyy-mm-dd');
                 //$formatdate->set_num_format(0x0f);
                 $arrayvalue = preg_split('/[.,]/', xl_parse_date($newvalue));
                 //print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';
                 $newvalue = strval($arrayvalue[0]) . '.' . strval($arrayvalue[1]);
                 // $newvalue=strval(36892.521); directly does not work because . will be convert into , later
                 $this->worksheet->write($this->row, $this->col, $newvalue, PHPExcel_Shared_Date::PHPToExcel($formatdate));
             } else {
                 $newvalue = dol_stringtotime($newvalue);
                 $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, PHPExcel_Shared_Date::PHPToExcel($newvalue));
                 $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
                 $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd');
             }
         } elseif (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/i', $newvalue)) {
             if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
                 $formatdatehour = $this->workbook->addformat();
                 $formatdatehour->set_num_format('yyyy-mm-dd hh:mm:ss');
                 //$formatdatehour->set_num_format(0x0f);
                 $arrayvalue = preg_split('/[.,]/', xl_parse_date($newvalue));
                 //print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';
                 $newvalue = strval($arrayvalue[0]) . '.' . strval($arrayvalue[1]);
                 // $newvalue=strval(36892.521); directly does not work because . will be convert into , later
                 $this->worksheet->write($this->row, $this->col, $newvalue, $formatdatehour);
             } else {
                 $newvalue = dol_stringtotime($newvalue);
                 $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, PHPExcel_Shared_Date::PHPToExcel($newvalue));
                 $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
                 $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd h:mm:ss');
             }
         } else {
             if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
                 $this->worksheet->write($this->row, $this->col, $newvalue);
             } else {
                 if ($typefield == 'Text' || $typefield == 'TextAuto') {
                     //$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING);
                     $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, (string) $newvalue);
                     $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
                     $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
                     $this->workbook->getActiveSheet()->getStyle($coord)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
                 } else {
                     $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $newvalue);
                 }
             }
         }
         $this->col++;
     }
     $this->row++;
     return 0;
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:89,代码来源:export_excel.modules.php

示例2: GETPOST

}
if (!empty($conf->ficheinter->enabled)) {
    $langs->load("interventions");
}
$projectid = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$datesrfc = GETPOST('datesrfc');
$dateerfc = GETPOST('dateerfc');
$dates = dol_mktime(0, 0, 0, GETPOST('datesmonth'), GETPOST('datesday'), GETPOST('datesyear'));
$datee = dol_mktime(23, 59, 59, GETPOST('dateemonth'), GETPOST('dateeday'), GETPOST('dateeyear'));
if (empty($dates) && !empty($datesrfc)) {
    $dates = dol_stringtotime($datesrfc);
}
if (empty($datee) && !empty($dateerfc)) {
    $datee = dol_stringtotime($dateerfc);
}
if (!isset($_POST['datesrfc']) && !isset($_POST['datesday']) && !empty($conf->global->PROJECT_LINKED_ELEMENT_DEFAULT_FILTER_YEAR)) {
    $new = dol_now();
    $tmp = dol_getdate($new);
    //$datee=$now
    //$dates=dol_time_plus_duree($datee, -1, 'y');
    $dates = dol_get_first_day($tmp['year'], 1);
}
if ($projectid == '' && $ref == '') {
    dol_print_error('', 'Bad parameter');
    exit;
}
$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1;	// Special for projects
$project = new Project($db);
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:31,代码来源:element.php

示例3: dol_stringtotime

     $invoice->lines[] = $invoiceline;
 }
 $invoice->socid = $conf_fksoc;
 $invoice->date_creation = $now;
 $invoice->date = $now;
 $invoice->date_lim_reglement = 0;
 $invoice->total_ht = $obj_facturation->prixTotalHt();
 $invoice->total_tva = $obj_facturation->montantTva();
 $invoice->total_ttc = $obj_facturation->prixTotalTtc();
 $invoice->note = $note;
 $invoice->cond_reglement_id = $cond_reglement_id;
 $invoice->mode_reglement_id = $mode_reglement_id;
 //print "c=".$invoice->cond_reglement_id." m=".$invoice->mode_reglement_id; exit;
 // Si paiement differe ...
 if ($obj_facturation->getSetPaymentMode() == 'DIF') {
     $resultcreate = $invoice->create($user, 0, dol_stringtotime($obj_facturation->paiementLe()));
     if ($resultcreate > 0) {
         $resultvalid = $invoice->validate($user, $obj_facturation->numInvoice());
     } else {
         $error++;
     }
     $id = $invoice->id;
 } else {
     $resultcreate = $invoice->create($user, 0, 0);
     if ($resultcreate > 0) {
         $resultvalid = $invoice->validate($user, $obj_facturation->numInvoice(), isset($_SESSION["CASHDESK_ID_WAREHOUSE"]) ? $_SESSION["CASHDESK_ID_WAREHOUSE"] : 0);
         $id = $invoice->id;
         // Add the payment
         $payment = new Paiement($db);
         $payment->datepaye = $now;
         $payment->bank_account = $conf_fkaccount;
开发者ID:nrjacker4,项目名称:crm-php,代码行数:31,代码来源:validation_verif.php

示例4: fetch

	function fetch($id, $user=0)
	{
		global $langs;

		$langs->load("companies");

		$sql = "SELECT c.rowid, c.fk_soc, c.civilite as civilite_id, c.name, c.firstname,";
		$sql.= " c.address, c.cp, c.ville,";
		$sql.= " c.fk_pays,";
		$sql.= " c.fk_departement,";
		$sql.= " c.birthday,";
		$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,";
		$sql.= " c.priv, c.note, c.default_lang, c.canvas,";
		$sql.= " p.libelle as pays, p.code as pays_code,";
		$sql.= " d.nom as departement, d.code_departement as departement_code,";
		$sql.= " u.rowid as user_id, u.login as user_login,";
		$sql.= " s.nom as socname, s.address as socaddress, s.cp as soccp, s.ville as soccity, s.default_lang as socdefault_lang";
		$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON c.fk_pays = p.rowid";
		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid";
		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople";
		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
		$sql.= " WHERE c.rowid = ". $id;

		dol_syslog("Contact::fetch sql=".$sql);
		$resql=$this->db->query($sql);
		if ($resql)
		{
			if ($this->db->num_rows($resql))
			{
				$obj = $this->db->fetch_object($resql);

				$this->id				= $obj->rowid;
				$this->ref				= $obj->rowid;
				$this->civilite_id		= $obj->civilite_id;
				$this->name				= $obj->name;
				$this->firstname		= $obj->firstname;
				$this->nom				= $obj->name;			// TODO deprecated
				$this->prenom			= $obj->firstname;		// TODO deprecated

				$this->address			= $obj->address;
				$this->adresse			= $obj->address; 		// TODO deprecated
				$this->cp				= $obj->cp;				// TODO deprecated
				$this->zip				= $obj->cp;
				$this->ville			= $obj->ville;			// TODO deprecated
				$this->town				= $obj->ville;

				$this->fk_departement	= $obj->fk_departement;
				$this->departement_code = $obj->departement_code;
				$this->departement		= $obj->departement;	// TODO deprecated
				$this->state			= $obj->departement;

				$this->fk_pays			= $obj->fk_pays;
				$this->pays_code		= $obj->fk_pays?$obj->pays_code:'';
				$this->pays				= ($obj->fk_pays > 0)?$langs->transnoentitiesnoconv("Country".$obj->pays_code):'';
				$this->country			= ($obj->fk_pays > 0)?$langs->transnoentitiesnoconv("Country".$obj->pays_code):'';

				$this->socid			= $obj->fk_soc;
				$this->socname			= $obj->socname;
				$this->poste			= $obj->poste;

				$this->phone_pro		= trim($obj->phone);
				$this->fax				= trim($obj->fax);
				$this->phone_perso		= trim($obj->phone_perso);
				$this->phone_mobile		= trim($obj->phone_mobile);

				$this->email			= $obj->email;
				$this->jabberid			= $obj->jabberid;
				$this->priv				= $obj->priv;
				$this->mail				= $obj->email;

				$this->birthday			= dol_stringtotime($obj->birthday);
				//print "fetch: ".$obj->birthday.'-'.$this->birthday;
				$this->birthday_alert 	= $obj->birthday_alert;
				$this->note				= $obj->note;
				$this->default_lang		= $obj->default_lang;
				$this->user_id			= $obj->user_id;
				$this->user_login		= $obj->user_login;
				$this->canvas			= $obj->canvas;

				// Recherche le user Dolibarr lie a ce contact
				$sql = "SELECT u.rowid ";
				$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
				$sql .= " WHERE u.fk_socpeople = ". $this->id;

				$resql=$this->db->query($sql);
				if ($resql)
				{
					if ($this->db->num_rows($resql))
					{
						$uobj = $this->db->fetch_object($resql);

						$this->user_id = $uobj->rowid;
					}
					$this->db->free($resql);
				}
				else
				{
					$this->error=$this->db->error();
					dol_syslog("Contact::fetch ".$this->error, LOG_ERR);
//.........这里部分代码省略.........
开发者ID:remyyounes,项目名称:dolibarr,代码行数:101,代码来源:contact.class.php

示例5: array_merge

 $icalevents = array_merge($icalevents, $moreicalevents);
 // Loop on each entry into cal file to know if entry is qualified and add an ActionComm into $eventarray
 foreach ($icalevents as $icalevent) {
     //var_dump($icalevent);
     //print $icalevent['SUMMARY'].'->'.var_dump($icalevent).'<br>';exit;
     if (!empty($icalevent['RRULE'])) {
         continue;
     }
     // We found a repeatable event. It was already split into unitary events, so we discard general rule.
     // Create a new object action
     $event = new ActionComm($db);
     $addevent = false;
     if (isset($icalevent['DTSTART;VALUE=DATE'])) {
         // For full day events, date are also GMT but they wont but converted using tz during output
         $datestart = dol_stringtotime($icalevent['DTSTART;VALUE=DATE'], 1);
         $dateend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1;
         // We remove one second to get last second of day
         //print 'x'.$datestart.'-'.$dateend;exit;
         //print dol_print_date($dateend,'dayhour','gmt');
         $event->fulldayevent = true;
         $addevent = true;
     } elseif (!is_array($icalevent['DTSTART'])) {
         $datestart = $icalevent['DTSTART'];
         $dateend = $icalevent['DTEND'];
         $datestart += +($offsettz * 3600);
         $dateend += +($offsettz * 3600);
         $addevent = true;
         //var_dump($offsettz);
         //var_dump(dol_print_date($datestart, 'dayhour', 'gmt'));
     } elseif (isset($icalevent['DTSTART']['unixtime'])) {
         $datestart = $icalevent['DTSTART']['unixtime'];
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:index.php

示例6: foreach

        $icalevents=array();
        if (is_array($ical->get_event_list())) $icalevents=array_merge($icalevents,$ical->get_event_list());
        if (is_array($ical->get_freebusy_list())) $icalevents=array_merge($icalevents,$ical->get_freebusy_list());

        if(count($icalevents)>0)
        {
            foreach($icalevents as $icalevent)
            {
                // Create a new object action
                $event=new ActionComm($db);
                $addevent = false;
                if($icalevent['DTSTART;VALUE=DATE']) //fullday event
                {
                    // For full day events, date are also GMT but they wont but converted using tz during output
                    $datestart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
                    $dateend=dol_stringtotime($icalevent['DTEND;VALUE=DATE'],1)-1;  // We remove one second to get last second of day
                    //print 'x'.$datestart.'-'.$dateend;exit;
                    //print dol_print_date($dateend,'dayhour','gmt');
                    $event->fulldayevent=true;
                    $addevent=true;
                }
                elseif (is_array($icalevent['RRULE'])) //repeatable event
                {
                    $addevent=false; //TODO: a faire
                }
                elseif(!is_array($icalevent['DTSTART'])) //non-repeatable and not fullday event
                {
                    $datestart=$icalevent['DTSTART'];
                    $dateend=$icalevent['DTEND'];
                    $addevent=true;
                }
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:index.php

示例7: price2num

}
if ($suser) {
    $sql .= ' AND u.login LIKE "%' . $db->escape($suser) . '%"';
}
if ($sttc) {
    $sql .= ' AND cf.total_ttc = ' . price2num($sttc);
}
if ($sdate)
{
    if (GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int') && GETPOST('search_dateyear', 'int'))
    {
	    $date = dol_mktime(0, 0, 0, GETPOST('search_datemonth', 'int'), GETPOST('search_dateday', 'int'), GETPOST('search_dateyear', 'int'));
    }
    else
    {
        $date = dol_stringtotime($sdate);
    }
    $sql .= " AND cf.date_creation = '" . $db->idate($date) . "'";
}
if ($sall) {
    $sql .= ' AND (cf.ref LIKE "%' . $db->escape($sall) . '%" ';
    $sql .= 'OR cf.note LIKE "%' . $db->escape($sall) . '%")';
}
if (!empty($socid)) {
    $sql .= ' AND s.rowid = ' . $socid;
}

if (GETPOST('statut', 'int')) {
    $sql .= ' AND fk_statut = ' . GETPOST('statut', 'int');
}
$sql .= ' GROUP BY cf.rowid, cf.ref, cf.date_creation, cf.fk_statut';
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:replenishorders.php

示例8: checkLoginPassEntity

 if ($test && $goontestloop) {
     $login = checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode);
     if ($login) {
         $dol_authmode = $conf->authmode;
         // This properties is defined only when logged, to say what mode was successfully used
         $dol_tz = $_POST["tz"];
         $dol_tz_string = $_POST["tz_string"];
         $dol_tz_string = preg_replace('/\\s*\\(.+\\)$/', '', $dol_tz_string);
         $dol_tz_string = preg_replace('/,/', '/', $dol_tz_string);
         $dol_tz_string = preg_replace('/\\s/', '_', $dol_tz_string);
         $dol_dst = 0;
         if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) {
             include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
             $datenow = dol_now();
             $datefirst = dol_stringtotime($_POST["dst_first"]);
             $datesecond = dol_stringtotime($_POST["dst_second"]);
             if ($datenow >= $datefirst && $datenow < $datesecond) {
                 $dol_dst = 1;
             }
         }
         //print $datefirst.'-'.$datesecond.'-'.$datenow.'-'.$dol_tz.'-'.$dol_tzstring.'-'.$dol_dst; exit;
     }
     if (!$login) {
         dol_syslog('Bad password, connexion refused', LOG_DEBUG);
         $langs->load('main');
         $langs->load('errors');
         // Bad password. No authmode has found a good password.
         $user->trigger_mesg = $langs->trans("ErrorBadLoginPassword") . ' - login=' . GETPOST("username", "alpha", 2);
         // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions
         if (empty($_SESSION["dol_loginmesg"])) {
             $_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword");
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:main.inc.php

示例9: dol_stringtotime

     print 'Rebuild PDF for all invoices' . "\n";
 }
 if ($value == 'filter=date') {
     $found = true;
     $option .= (empty($option) ? '' : '_') . 'date_' . $argv[$key + 1] . '_' . $argv[$key + 2];
     $filter[] = 'date';
     $dateafterdate = dol_stringtotime($argv[$key + 1]);
     $datebeforedate = dol_stringtotime($argv[$key + 2]);
     print 'Rebuild PDF for invoices validated between ' . dol_print_date($dateafterdate, 'day', 'gmt') . " and " . dol_print_date($datebeforedate, 'day', 'gmt') . ".\n";
 }
 if ($value == 'filter=payments') {
     $found = true;
     $option .= (empty($option) ? '' : '_') . 'payments_' . $argv[$key + 1] . '_' . $argv[$key + 2];
     $filter[] = 'payments';
     $paymentdateafter = dol_stringtotime($argv[$key + 1] . '000000');
     $paymentdatebefore = dol_stringtotime($argv[$key + 2] . '235959');
     if (empty($paymentdateafter) || empty($paymentdatebefore)) {
         print 'Error: Bad date format or value' . "\n";
         exit(-1);
     }
     print 'Rebuild PDF for invoices with at least one payment between ' . dol_print_date($paymentdateafter, 'day', 'gmt') . " and " . dol_print_date($paymentdatebefore, 'day', 'gmt') . ".\n";
 }
 if ($value == 'filter=nopayment') {
     $found = true;
     $option .= (empty($option) ? '' : '_') . 'nopayment';
     $filter[] = 'nopayment';
     print 'Rebuild PDF for invoices with no payment done yet.' . "\n";
 }
 if ($value == 'filter=bank') {
     $found = true;
     $option .= (empty($option) ? '' : '_') . 'bank_' . $argv[$key + 1];
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:rebuild_merge_pdf.php

示例10: createInvoice

/**
 * Create an invoice
 *
 * @param	array		$authentication		Array of authentication information
 * @param	Facture		$invoice			Invoice
 * @return	array							Array result
 */
function createInvoice($authentication, $invoice)
{
    global $db, $conf, $langs;
    $now = dol_now();
    dol_syslog("Function: createInvoiceForThirdParty login=" . $authentication['login']);
    if ($authentication['entity']) {
        $conf->entity = $authentication['entity'];
    }
    // Init and check authentication
    $objectresp = array();
    $errorcode = '';
    $errorlabel = '';
    $error = 0;
    $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
    if (!$error) {
        $newobject = new Facture($db);
        $newobject->socid = $invoice['thirdparty_id'];
        $newobject->type = $invoice['type'];
        $newobject->ref_ext = $invoice['ref_ext'];
        $newobject->date = dol_stringtotime($invoice['date'], 'dayrfc');
        $newobject->note_private = $invoice['note_private'];
        $newobject->note_public = $invoice['note_public'];
        $newobject->statut = 0;
        // We start with status draft
        $newobject->fk_project = $invoice['project_id'];
        $newobject->date_creation = $now;
        // Trick because nusoap does not store data with same structure if there is one or several lines
        $arrayoflines = array();
        if (isset($invoice['lines']['line'][0])) {
            $arrayoflines = $invoice['lines']['line'];
        } else {
            $arrayoflines = $invoice['lines'];
        }
        foreach ($arrayoflines as $key => $line) {
            // $key can be 'line' or '0','1',...
            $newline = new FactureLigne($db);
            $newline->product_type = $line['type'];
            $newline->desc = $line['desc'];
            $newline->fk_product = $line['fk_product'];
            $newline->tva_tx = $line['vat_rate'];
            $newline->qty = $line['qty'];
            $newline->subprice = $line['unitprice'];
            $newline->total_ht = $line['total_net'];
            $newline->total_tva = $line['total_vat'];
            $newline->total_ttc = $line['total'];
            $newline->date_start = dol_stringtotime($line['date_start']);
            $newline->date_end = dol_stringtotime($line['date_end']);
            $newline->fk_product = $line['product_id'];
            $newobject->lines[] = $newline;
        }
        //var_dump($newobject->date_lim_reglement); exit;
        //var_dump($invoice['lines'][0]['type']);
        $db->begin();
        $result = $newobject->create($fuser, 0, dol_stringtotime($invoice['date_due'], 'dayrfc'));
        if ($result < 0) {
            $error++;
        }
        if ($invoice['status'] == 1) {
            $result = $newobject->validate($fuser);
            if ($result < 0) {
                $error++;
            }
        }
        if (!$error) {
            $db->commit();
            $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $newobject->id, 'ref' => $newobject->ref);
        } else {
            $db->rollback();
            $error++;
            $errorcode = 'KO';
            $errorlabel = $newobject->error;
        }
    }
    if ($error) {
        $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
    }
    return $objectresp;
}
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:85,代码来源:server_invoice.php

示例11:

		$option.=(empty($option)?'':'_').'date_'.$argv[$key+1].'_'.$argv[$key+2];
		$filter[]='date';

		$dateafterdate=dol_stringtotime($argv[$key+1]);
		$datebeforedate=dol_stringtotime($argv[$key+2]);
		print 'Rebuild PDF for invoices validated between '.dol_print_date($dateafterdate,'day')." and ".dol_print_date($datebeforedate,'day').".\n";
	}

	if ($value == 'filter=payments')
	{
		$found=true;
		$option.=(empty($option)?'':'_').'payments_'.$argv[$key+1].'_'.$argv[$key+2];
		$filter[]='payments';

		$paymentdateafter=dol_stringtotime($argv[$key+1]);
		$paymentdatebefore=dol_stringtotime($argv[$key+2]);
		print 'Rebuild PDF for invoices with at least one payment between '.dol_print_date($paymentdateafter,'day')." and ".dol_print_date($paymentdatebefore,'day').".\n";
	}

	if ($value == 'filter=nopayment')
	{
		$found=true;
		$option.=(empty($option)?'':'_').'nopayment';
		$filter[]='nopayment';

		print 'Rebuild PDF for invoices with no payment done yet.'."\n";
	}

    if ($value == 'filter=nodeposit')
    {
        $found=true;
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:rebuild_merge_pdf.php

示例12: testDolStringToTime

    /**
     * testDolStringToTime
     *
     * @return int
     */
    public function testDolStringToTime()
    {
        global $conf,$user,$langs,$db;
        $conf=$this->savconf;
        $user=$this->savuser;
        $langs=$this->savlangs;
        $db=$this->savdb;

        $stime='1970-01-01T02:00:00Z';
        $result=dol_stringtotime($stime);
    	print __METHOD__." result=".$result."\n";
		$this->assertEquals(7200,$result);

        $stime='19700101T020000Z';
        $result=dol_stringtotime($stime);
    	print __METHOD__." result=".$result."\n";
		$this->assertEquals(7200,$result);

		$stime='19700101020000';
		$result=dol_stringtotime($stime);
		print __METHOD__." result=".$result."\n";
		$this->assertEquals(7200,$result);

		$stime='19700101';
		$result=dol_stringtotime($stime);
		print __METHOD__." result=".$result."\n";
		$this->assertEquals(0,$result);

        return $result;
    }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:35,代码来源:DateLibTest.php

示例13: GETPOST

if (! empty($conf->commande->enabled)) 	    $langs->load("orders");
if (! empty($conf->propal->enabled))   	    $langs->load("propal");
if (! empty($conf->ficheinter->enabled))	$langs->load("interventions");
if (! empty($conf->deplacement->enabled))	$langs->load("trips");
if (! empty($conf->expensereport->enabled)) $langs->load("trips");
if (! empty($conf->don->enabled))			$langs->load("donations");

$id=GETPOST('id','int');
$ref=GETPOST('ref','alpha');
$action=GETPOST('action','alpha');
$datesrfc=GETPOST('datesrfc');
$dateerfc=GETPOST('dateerfc');
$dates=dol_mktime(0, 0, 0, GETPOST('datesmonth'), GETPOST('datesday'), GETPOST('datesyear'));
$datee=dol_mktime(23, 59, 59, GETPOST('dateemonth'), GETPOST('dateeday'), GETPOST('dateeyear'));
if (empty($dates) && ! empty($datesrfc)) $dates=dol_stringtotime($datesrfc);
if (empty($datee) && ! empty($dateerfc)) $datee=dol_stringtotime($dateerfc);
if (! isset($_POST['datesrfc']) && ! isset($_POST['datesday']) && ! empty($conf->global->PROJECT_LINKED_ELEMENT_DEFAULT_FILTER_YEAR))
{
	$new=dol_now();
	$tmp=dol_getdate($new);
	//$datee=$now
	//$dates=dol_time_plus_duree($datee, -1, 'y');
	$dates=dol_get_first_day($tmp['year'],1);
}
if ($id == '' && $projectid == '' && $ref == '')
{
	dol_print_error('','Bad parameter');
	exit;
}

$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:element.php

示例14: yn

    }
    print '</td></tr>' . "\n";
}
// Client
$var = !$var;
$tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
print '<tr ' . $bc[$var] . '><td width="300">' . $langs->trans("ClientTZ") . '</td><td>' . ($tz ? ($tz >= 0 ? '+' : '') . $tz : '') . ' (' . ($tz >= 0 ? '+' : '') . $tz * 60 * 60 . ')';
print ' &nbsp; &nbsp; &nbsp; ' . $_SESSION['dol_tz_string'];
print ' &nbsp; &nbsp; &nbsp; ' . $langs->trans("DaylingSavingTime") . ': ';
if ($_SESSION['dol_dst'] > 0) {
    print yn(1);
} else {
    print yn(0);
}
if (!empty($_SESSION['dol_dst_first'])) {
    print ' &nbsp; &nbsp; (' . dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']), 'dayhour', 'gmt') . ' - ' . dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']), 'dayhour', 'gmt') . ')';
}
print '</td></tr>' . "\n";
print '</td></tr>' . "\n";
$var = !$var;
print '<tr ' . $bc[$var] . '><td width="300">&nbsp; => ' . $langs->trans("ClientHour") . '</td><td>' . dol_print_date(dol_now(), 'dayhour', 'tzuser') . '</td></tr>' . "\n";
$var = !$var;
$filesystemencoding = ini_get("unicode.filesystem_encoding");
// Disponible avec PHP 6.0
print '<tr ' . $bc[$var] . '><td width="300">' . $langs->trans("File encoding") . ' (php.ini unicode.filesystem_encoding)</td><td>' . $filesystemencoding . '</td></tr>' . "\n";
// date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
$var = !$var;
$tmp = ini_get("unicode.filesystem_encoding");
// Disponible avec PHP 6.0
if (empty($tmp) && !empty($_SERVER["WINDIR"])) {
    $tmp = 'iso-8859-1';
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:dolibarr.php

示例15: dol_stringtotime

 }
 print '<tr><td width="30%" class="nowrap"><span class="fieldrequired">' . $langs->trans("DateActionStart") . '</span></td><td>';
 if (GETPOST("afaire") == 1) {
     $form->select_date($datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 0, 'fulldayend');
 } else {
     if (GETPOST("afaire") == 2) {
         $form->select_date($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 0, 'fulldayend');
     } else {
         $form->select_date($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 0, 'fulldaystart');
     }
 }
 print '</td></tr>';
 // Date end
 $datef = $datef ? $datef : $object->datef;
 if (GETPOST('datef', 'int', 1)) {
     $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 0);
 }
 if (empty($datef) && !empty($datep) && !empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS)) {
     $datef = dol_time_plus_duree($datep, $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS, 'h');
 }
 print '<tr><td><span id="dateend"' . (GETPOST("actioncode") == 'AC_RDV' ? ' class="fieldrequired"' : '') . '>' . $langs->trans("DateActionEnd") . '</span></td><td>';
 if (GETPOST("afaire") == 1) {
     $form->select_date($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 0, 'fulldayend');
 } else {
     if (GETPOST("afaire") == 2) {
         $form->select_date($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 0, 'fulldayend');
     } else {
         $form->select_date($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 0, 'fulldayend');
     }
 }
 print '</td></tr>';
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:card.php


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