/**
  * Define array with couple subtitution key => subtitution value
  *
  * @param	Object		$object			Object
  * @param   Translate	$outputlangs    Language object for output
  * @return	array						Array of substitution key->code
  */
 function get_substitutionarray_thirdparty($object, $outputlangs)
 {
     global $conf;
     if (empty($object->country) && !empty($object->country_code)) {
         $object->country = $outputlangs->transnoentitiesnoconv("Country" . $object->country_code);
     }
     if (empty($mysoc->state) && !empty($mysoc->state_code)) {
         $object->state = getState($object->state_code, 0);
     }
     return array('company_name' => $object->name, 'company_email' => $object->email, 'company_phone' => $object->phone, 'company_fax' => $object->fax, 'company_address' => $object->address, 'company_zip' => $object->zip, 'company_town' => $object->town, 'company_country' => $object->country, 'company_country_code' => $object->country_code, 'company_state' => $object->state, 'company_state_code' => $object->state_code, 'company_web' => $object->url, 'company_barcode' => $object->barcode, 'company_vatnumber' => $object->tva_intra, 'company_customercode' => $object->code_client, 'company_suppliercode' => $object->code_fournisseur, 'company_customeraccountancycode' => $object->code_compta, 'company_supplieraccountancycode' => $object->code_compta_fournisseur, 'company_juridicalstatus' => $object->forme_juridique, 'company_capital' => $object->capital, 'company_idprof1' => $object->idprof1, 'company_idprof2' => $object->idprof2, 'company_idprof3' => $object->idprof3, 'company_idprof4' => $object->idprof4, 'company_idprof5' => $object->idprof5, 'company_idprof6' => $object->idprof6, 'company_note' => $object->note);
 }
Beispiel #2
0
</td>
                                                                    <td align="center"><?php 
            echo $row['BuyerName'];
            ?>
</td>
                                                                    <td align="center"><?php 
            echo $row['Address'];
            ?>
</td>
                                                                    <td align="center"><?php 
            echo getCountry($row['CountryId']);
            ?>
</td>
                                                                    <td align="center"><?php 
            if ($row['State'] != 0) {
                echo getState($row['State']);
            } else {
                echo $row['OtherState'];
            }
            ?>
</td>
                                                                    <td align="center"><?php 
            if ($row['City'] != 0) {
                echo getCity($row['City']);
            } else {
                echo $row['OtherCity'];
            }
            ?>
</td>
                                                                    <td align="center"><?php 
            echo $row['Email'];
 public function processMessage($message)
 {
     LogWrite("LinnDSClientSocket::processMessage - {$message}");
     $DataHandled = false;
     if ($DEBUG > 1) {
         LogWrite($message);
     }
     if (strpos($message, "Jukebox") !== false) {
         // Here things happens - we execute the actions sent from the
         // application, by issuing a number of ACTIONs.
         $D = getParameters($message);
         if (strpos($message, "Jukebox PlayNow ") !== false) {
             //Jukebox PlayNow \"(\d+)\" \"(\d+)\"
             $JukeBoxPlay = $D[0];
             $JukeBoxTrack = $D[1];
             LogWrite("JukeBoxPlayNow: " . $JukeBoxPlay . ", " . $JukeBoxTrack);
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Stop') == false) {
                 $Continue = false;
             }
             $musicDB = new MusicDB();
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients1('DeleteAll', $musicDB) == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $JukeBoxPlay, $JukeBoxTrack, 0) == false) {
                 $Continue = false;
             }
             $musicDB->close();
             //Send("ACTION Ds/Jukebox 3 SetCurrentPreset \"" . $JukeBoxPlay . "\"");
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray") == false) {
                 $Continue = false;
             }
             $DataHandled = true;
         } elseif (strpos($message, "Jukebox PlayNext ") !== false) {
             //Jukebox PlayNext \"(\d+)\" \"(\d+)\"
             $JukeBoxPlay = $D[0];
             $JukeBoxTrack = $D[1];
             LogWrite("JukeBoxPlayNext: " . $JukeBoxPlay . ", " . $JukeBoxTrack);
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) {
                 $Continue = false;
             }
             $musicDB = new MusicDB();
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $JukeBoxPlay, $JukeBoxTrack, $this->getState()->getState('Id')) == false) {
                 $Continue = false;
             }
             $musicDB->close();
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray") == false) {
                 $Continue = false;
             }
             if ($DEBUG > 0) {
                 //LogWrite($message);
                 //print_r($State);
             }
             $DataHandled = true;
         } elseif (strpos($message, "Jukebox PlayLater ") !== false) {
             //Jukebox PlayLater \"(\d+)\" \"(\d+)\"
             $JukeBoxPlay = $D[0];
             $JukeBoxTrack = $D[1];
             LogWrite("JukeBoxPlayLater: " . $JukeBoxPlay . ", " . $JukeBoxTrack);
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) {
                 $Continue = false;
             }
             $musicDB = new MusicDB();
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $JukeBoxPlay, $JukeBoxTrack, end($this->getState()->getState('IdArray'))) == false) {
                 $Continue = false;
             }
             $musicDB->close();
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) {
                 $Continue = false;
             }
             $this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray");
             if ($DEBUG > 0) {
                 //LogWrite($message);
                 //print_r($State);
             }
             $DataHandled = true;
         } elseif (strpos($message, "Jukebox PlayRandomTracks ") !== false) {
             //Jukebox PlayRandomTracks \"(\d+)\" \"(\d+)\"
             $JukeBoxFirstAlbum = $D[0];
             $JukeBoxLastAlbum = $D[1];
             LogWrite("JukeBoxPlayRandomTracks: " . $JukeBoxFirstAlbum . ", " . $JukeBoxLastAlbum);
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) {
                 $Continue = false;
             }
             $musicDB = new MusicDB();
             if ($this->getState()->getState('TransportState') == "Stopped") {
                 if ($this->listeningSocket->getLPECListeningSocket()->CallClients1('DeleteAll', $musicDB) == false) {
                     $Continue = false;
                 }
             }
             for ($i = 0; $i < 50; $i++) {
                 $RandomPreset = rand($JukeBoxFirstAlbum, $JukeBoxLastAlbum);
                 $RandomTrack = rand(1, $musicDB->NumberOfTracks($RandomPreset));
                 if ($i == 0) {
                     if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $RandomPreset, $RandomTrack, end($this->getState()->getState('IdArray'))) == false) {
                         $Continue = false;
                     }
                 } else {
                     if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $RandomPreset, $RandomTrack, "%NewId%") == false) {
                         $Continue = false;
                     }
                 }
             }
             $musicDB->close();
             if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) {
                 $Continue = false;
             }
             $this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray");
             if ($DEBUG > 0) {
                 //LogWrite($message);
                 //print_r($State);
             }
             $DataHandled = true;
         }
     } elseif (strpos($message, "Volume") !== false) {
         $D = getParameters($message);
         // Here things happens - we execute the actions sent from the
         // application, by issuing a number of ACTIONs.
         if (strpos($message, "Volume Set ") !== false) {
             //Volume Set \"(\d+)\"
             $value = $D[0];
             if ($value > $this->getState()->getState('MAX_VOLUME')) {
                 $value = $this->getState()->getState('MAX_VOLUME');
             }
             if ($value != $this->getState()->getState('Volume') && $value != "") {
                 LogWrite("VolumeSet: " . $value);
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 SetVolume \"" . $value . "\"") == false) {
                     $Continue = false;
                 }
                 $this->getState()->setState('Volume', $value);
             }
             $DataHandled = true;
         } elseif (strpos($message, "Volume Incr5") !== false) {
             //Volume Incr5
             if ($this->getState()->getState('Volume') < $this->getState()->getState('MAX_VOLUME') - 5) {
                 LogWrite("VolumeIncr5: ");
                 $value = $this->getState()->getState('Volume');
                 $value = $value + 5;
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) {
                     $Continue = false;
                 }
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) {
                     $Continue = false;
                 }
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) {
                     $Continue = false;
                 }
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) {
                     $Continue = false;
                 }
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) {
                     $Continue = false;
                 }
                 $this->getState()->setState('Volume', $value);
             } else {
                 LogWrite("VolumeIncr: IGNORED MAX_VOLUME REACHED");
             }
             $DataHandled = true;
         } elseif (strpos($message, "Volume Incr") !== false) {
             //Volume Incr
             if ($this->getState()->getState('Volume') < $this->getState()->getState('MAX_VOLUME')) {
                 LogWrite("VolumeIncr: ");
                 $value = $this->getState()->getState('Volume');
                 $value = $value + 1;
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) {
                     $Continue = false;
                 }
                 $this->getState()->setState('Volume', $value);
             } else {
                 LogWrite("VolumeIncr: IGNORED MAX_VOLUME REACHED");
             }
             $DataHandled = true;
         } elseif (strpos($message, "Volume Decr5") !== false) {
             //Volume Decr5
             LogWrite("VolumeDecr: ");
             $value = $this->getState()->getState('Volume');
             $value = $value - 5;
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) {
                 $Continue = false;
             }
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) {
                 $Continue = false;
             }
             $this->getState()->setState('Volume', $value);
             $DataHandled = true;
         } elseif (strpos($message, "Volume Decr") !== false) {
             //Volume Decr
             LogWrite("VolumeDecr: ");
             $value = $this->getState()->getState('Volume');
             $value = $value - 1;
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) {
                 $Continue = false;
             }
             $this->getState()->setState('Volume', $value);
             $DataHandled = true;
         } elseif (strpos($message, "Volume Reset") !== false) {
             //Volume Reset
             LogWrite("VolumeReset: ");
             $value = 30;
             LogWrite("VolumeSet: " . $value);
             if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 SetVolume \"" . $value . "\"") == false) {
                 $Continue = false;
             }
             $this->getState()->setState('Volume', $value);
             $DataHandled = true;
         }
     } elseif (strpos($message, "Control") !== false) {
         // Here things happens - we execute the actions sent from the
         // application, by issuing a number of ACTIONs.
         if (strpos($message, "Control Play") !== false) {
             //Control Play
             if ($this->getState()->getState('TransportState') === "Stopped" || $this->getState()->getState('TransportState') === "Paused") {
                 LogWrite("ControlPlay: ");
                 if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) {
                     $Continue = false;
                 }
             }
             $DataHandled = true;
         } elseif (strpos($message, "Control Pause") !== false) {
             //Control Pause
             if ($this->getState()->getState('TransportState') !== "Paused") {
                 LogWrite("ControlPause: ");
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 Pause") == false) {
                     $Continue = false;
                 }
             } else {
                 LogWrite("ControlPause - restart: ");
                 if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) {
                     $Continue = false;
                 }
             }
             $DataHandled = true;
         } elseif (strpos($message, "Control Stop") !== false) {
             //Control Stop
             if ($this->getState()->getState('TransportState') !== "Stopped") {
                 LogWrite("ControlStop: ");
                 if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Stop') == false) {
                     $Continue = false;
                 }
             }
             $DataHandled = true;
         } elseif (strpos($message, "Control Next") !== false) {
             //Control Next
             if ($this->getState()->getState('TransportState') != "Stopped") {
                 LogWrite("ControlNext: ");
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 Next") == false) {
                     $Continue = false;
                 }
             }
             $DataHandled = true;
         } elseif (strpos($message, "Control Previous") !== false) {
             //Control Previous
             if ($this->getState()->getState('TransportState') != "Stopped") {
                 LogWrite("ControlPrevious: ");
                 if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 Previous") == false) {
                     $Continue = false;
                 }
             }
             $DataHandled = true;
         }
     } elseif (strpos($message, "Source") !== false) {
         // Here things happens - we execute the actions sent from the
         // application, by issuing a number of ACTIONs.
         if (strpos($message, "Source Off") !== false) {
             //Source Off
             if ($this->getState()->getState('Standby') == "false") {
                 if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetStandby "true"') == false) {
                     $Continue = false;
                 }
                 $this->getState()->setState('Standby', true);
             }
             $DataHandled = true;
         } else {
             if ($this->getState()->getState('Standby') == "true") {
                 if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetStandby "false"') == false) {
                     $Continue = false;
                 }
                 $this->getState()->setState('Standby', true);
             }
             if (strpos($message, "Source Playlist") !== false) {
                 //Source Playlist
                 if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'Playlist')) {
                     if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this->getState()->getStateArray('SourceName', 'Playlist') . '"') == false) {
                         $Continue = false;
                     }
                 }
                 if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) {
                     $Continue = false;
                 }
                 $DataHandled = true;
             } elseif (strpos($message, "Source TV") !== false) {
                 //Source TV
                 if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'TV')) {
                     if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this->getState()->getStateArray('SourceName', 'TV') . '"') == false) {
                         $Continue = false;
                     }
                 }
                 $DataHandled = true;
             } elseif (strpos($message, "Source Radio") !== false) {
                 //Source Radio
                 if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'Radio')) {
                     if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this - getState()->getStateArray('SourceName', 'Radio') . '"') == false) {
                         $Continue = false;
                     }
                 }
                 $DataHandled = true;
             } elseif (strpos($message, "Source NetAux") !== false) {
                 //Source NetAux
                 if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'Net Aux')) {
                     if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this->getState()->getStateArray('SourceName', 'Net Aux') . '"') == false) {
                         $Continue = false;
                     }
                 }
                 $DataHandled = true;
             }
         }
     } elseif (strpos($message, "State") !== false) {
         LogWrite("HTState: " . $this->getState()->dump());
         $seri = $this->getState()->Serialize();
         LogWrite("Serialized: " . $seri);
         $this->Send($seri);
         $DataHandled = true;
     }
     return $DataHandled;
 }
require_once '../../resources/portabilityLayer.php';
# This script may only be used by appcache/fail-on-update-2.html test, since it uses global data.
$tmpFile = sys_get_temp_dir() . "/" . "appcache_fail-on-update-2_state";
function setState($newState, $file)
{
    file_put_contents($file, $newState);
}
function getState($file)
{
    if (!file_exists($file)) {
        return "Uninitialized";
    }
    return file_get_contents($file);
}
$command = $_GET['command'];
$state = getState($tmpFile);
header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
if ($command == "reset") {
    unlink($tmpFile);
} else {
    if ($command == "delete") {
        setState("Deleted", $tmpFile);
    } else {
        if ($state == "Uninitialized") {
            header("Content-Type: text/cache-manifest");
            print "CACHE MANIFEST\n";
            print "fail-on-update-2.html\n";
            print "NETWORK:\n";
            print "fail-on-update-2.php?command=\n";
Beispiel #5
0
function getBackUrl()
{
    return getState('back_url');
}
Beispiel #6
0
                $nome = $perfil['personaname'];
                $lastLogin = $perfil['lastlogoff'];
                $lastLogin = getTime($lastLogin);
                $imgProf = $perfil['avatarfull'];
                $estado = $perfil['personastate'];
                $estado = getState($estado);
                $tempoConta = $perfil['timecreated'];
                $tempoConta = getTimed($tempoConta);
                $jogando = $perfil['gameextrainfo'];		
	}*/
$imgProf = $steamprofile['avatarfull'];
$nome = $steamprofile['personaname'];
$lastLogin = $steamprofile['lastlogoff'];
$lastLogin = getTime($lastLogin);
$estado = $steamprofile['personastate'];
$estado = getState($estado);
$tempoConta = $steamprofile['timecreated'];
$tempoConta = getTimed($tempoConta);
$jogando = $steamprofile['gameextrainfo'];
$Img = "<img src={$imgProf} class=\"profimg\" style='";
if ($estado == "Offline") {
    $Img .= "border-color: #b6b6ba;'/>";
} else {
    $Img .= "border-color: #a2a9ec;'/>";
}
$Perf = "<div class=\"info\">\n                <span style='font-size:20px;font-weight: bold;'>{$nome}</span></br>\n                Estado: {$estado}</br>\n                Último Login: {$lastLogin}</br>\n                Usuário Steam desde: {$tempoConta}</br>";
if (isset($jogando)) {
    $Perf .= "Jogando: {$jogando}";
    echo "<style> .profimg{border-color: #47f360;}</style>";
} else {
}
Beispiel #7
0
 print '</td></tr>';
 // Status
 print '<tr><td>' . $langs->trans("Status") . '</td>';
 print '<td colspan="3">' . $account->getLibStatut(4) . '</td></tr>';
 // Country
 print '<tr><td>' . $langs->trans("BankAccountCountry") . '</td><td>';
 if ($account->country_id > 0) {
     $img = picto_from_langcode($account->country_code);
     print $img ? $img . ' ' : '';
     print getCountry($account->getCountryCode(), 0, $db);
 }
 print '</td></tr>';
 // State
 print '<tr><td>' . $langs->trans('State') . '</td><td>';
 if ($account->state_id > 0) {
     print getState($account->state_id);
 }
 print '</td></tr>';
 // Conciliate
 print '<tr><td>' . $langs->trans("Conciliable") . '</td>';
 print '<td colspan="3">';
 $conciliate = $account->canBeConciliated();
 if ($conciliate == -2) {
     print $langs->trans("No") . ' (' . $langs->trans("CashAccount") . ')';
 } else {
     if ($conciliate == -3) {
         print $langs->trans("No") . ' (' . $langs->trans("Closed") . ')';
     } else {
         print $account->rappro == 1 ? $langs->trans("Yes") : $langs->trans("No") . ' (' . $langs->trans("ConciliationDisabled") . ')';
     }
 }
Beispiel #8
0
echo $sno;
?>
</td>
                                                                    <td align="center"><?php 
echo $row['BuyerName'];
?>
</td>
                                                                    <td align="center"><?php 
echo $row['Address'];
?>
</td>
                                                                    <td align="center"><?php 
echo getCountry($row['CountryId']);
?>
</td>
                                                                    <td align="center"><? if($row['State']!=0){echo getState($row['State']);} else { echo $row['OtherState'];}?></td>
                                                                    <td align="center"><? if($row['City']!=0){ echo getCity($row['City']);} else{ echo $row['OtherCity'];}?></td>
                                                                    <td align="center"><?php 
echo $row['Email'];
?>
</td>
                                                                    <td align="center"><?php 
echo $row['ContactNumber'];
?>
</td>
                                                                    <td align="center"><a href="javascript:;" onClick="return hs.htmlExpand(this)">
                                                                    	<img src="images/Find-icon.png" border="0" width="24" height="24" /></a>
                                                                        <div class="highslide-maincontent">
                                                                        <table align="center" width="100%" cellpadding="1" cellspacing="1" border="0">
                                                                            <tr class="gredBg">
                                                                                <td align="center"><b>Name</b></td>
 /**
  * @param IGeoCodingService $geo_service
  * @return void
  */
 public function setCoordinates(IGeoCodingService $geo_service)
 {
     list($lat, $lng) = $geo_service->getAddressCoordinates(new AddressInfo($this->getAddress(), '', $this->getZipCode(), $this > getState(), $this->getCity(), $this->getCountry()));
     $this->Lat = $lat;
     $this->Lng = $lng;
 }
	function getLastColor() { return getState('last_color'); }	
Beispiel #11
0
/**
 *   	Return a string with full address formated
 * 		@param		outputlangs		Output langs object
 *   	@param      sourcecompany	Source company object
 *   	@param      targetcompany	Target company object
 *      @param      targetcontact	Target contact object
 * 		@param		usecontact		Use contact instead of company
 * 		@param		mode			Address type
 * 		@param		deliverycompany	Delivery company object
 * 		@return		string			String with full address
 */
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $deliverycompany = '')
{
    global $conf;
    $stringaddress = '';
    if ($mode == 'source' && !is_object($sourcecompany)) {
        return -1;
    }
    if ($mode == 'target' && !is_object($targetcompany)) {
        return -1;
    }
    if ($mode == 'delivery' && !is_object($deliverycompany)) {
        return -1;
    }
    if ($sourcecompany->departement_id && empty($sourcecompany->departement)) {
        $sourcecompany->departement = getState($sourcecompany->departement_id);
    }
    if ($targetcompany->departement_id && empty($targetcompany->departement)) {
        $targetcompany->departement = getState($targetcompany->departement_id);
    }
    if ($mode == 'source') {
        $stringaddress .= ($stringaddress ? "\n" : '') . pdf_format_address($outputlangs, $sourcecompany) . "\n";
        // Tel
        if ($sourcecompany->tel) {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Phone") . ": " . $outputlangs->convToOutputCharset($sourcecompany->tel);
        }
        // Fax
        if ($sourcecompany->fax) {
            $stringaddress .= ($stringaddress ? $sourcecompany->tel ? " - " : "\n" : '') . $outputlangs->transnoentities("Fax") . ": " . $outputlangs->convToOutputCharset($sourcecompany->fax);
        }
        // EMail
        if ($sourcecompany->email) {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Email") . ": " . $outputlangs->convToOutputCharset($sourcecompany->email);
        }
        // Web
        if ($sourcecompany->url) {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Web") . ": " . $outputlangs->convToOutputCharset($sourcecompany->url);
        }
    }
    if ($mode == 'target') {
        if ($usecontact) {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
            $stringaddress .= ($stringaddress ? "\n" : '') . pdf_format_address($outputlangs, $targetcontact) . "\n";
            // Country
            if ($targetcontact->pays_code && $targetcontact->pays_code != $sourcecompany->pays_code) {
                $stringaddress .= $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $targetcontact->pays_code)) . "\n";
            }
        } else {
            $stringaddress .= ($stringaddress ? "\n" : '') . pdf_format_address($outputlangs, $targetcompany) . "\n";
            // Country
            if ($targetcompany->pays_code && $targetcompany->pays_code != $sourcecompany->pays_code) {
                $stringaddress .= $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $targetcompany->pays_code)) . "\n";
            }
        }
        // Intra VAT
        if ($targetcompany->tva_intra) {
            $stringaddress .= "\n" . $outputlangs->transnoentities("VATIntraShort") . ': ' . $outputlangs->convToOutputCharset($targetcompany->tva_intra);
        }
        // Professionnal Ids
        if ($conf->global->MAIN_PROFID1_IN_ADDRESS) {
            $tmp = $outputlangs->transcountrynoentities("ProfId1", $targetcompany->pays_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof1);
        }
        if ($conf->global->MAIN_PROFID2_IN_ADDRESS) {
            $tmp = $outputlangs->transcountrynoentities("ProfId2", $targetcompany->pays_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof2);
        }
        if ($conf->global->MAIN_PROFID3_IN_ADDRESS) {
            $tmp = $outputlangs->transcountrynoentities("ProfId3", $targetcompany->pays_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof3);
        }
        if ($conf->global->MAIN_PROFID4_IN_ADDRESS) {
            $tmp = $outputlangs->transcountrynoentities("ProfId4", $targetcompany->pays_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof4);
        }
    }
    if ($mode == 'delivery') {
        $stringaddress .= ($stringaddress ? "\n" : '') . pdf_format_address($outputlangs, $deliverycompany) . "\n";
        // Tel
        if ($deliverycompany->phone) {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Phone") . ": " . $outputlangs->convToOutputCharset($deliverycompany->phone);
        }
        // Fax
        if ($deliverycompany->fax) {
            $stringaddress .= ($stringaddress ? $deliverycompany->phone ? " - " : "\n" : '') . $outputlangs->transnoentities("Fax") . ": " . $outputlangs->convToOutputCharset($deliverycompany->fax);
        }
    }
    return $stringaddress;
}
Beispiel #12
0
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("CompanyTown") . '</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN) ? '' : $conf->global->MAIN_INFO_SOCIETE_TOWN) . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CompanyCountry") . '</td><td>';
 if ($mysoc->country_code) {
     $img = picto_from_langcode($mysoc->country_code);
     print $img ? $img . ' ' : '';
     print getCountry($mysoc->country_code, 1);
 } else {
     print img_warning() . ' <font class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")) . '</font>';
 }
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td>' . $langs->trans("State") . '</td><td>';
 if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) {
     print getState($conf->global->MAIN_INFO_SOCIETE_STATE);
 } else {
     print '&nbsp;';
 }
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("CompanyCurrency") . '</td><td>';
 print currency_name($conf->currency, 1);
 print ' (' . $langs->getCurrencySymbol($conf->currency) . ')';
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Phone") . '</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL, $mysoc->country_code) . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Fax") . '</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX, $mysoc->country_code) . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Mail") . '</td><td>' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL, 0, 0, 0, 80) . '</td></tr>';
Beispiel #13
0
    $regionID = $_POST["regionID"];
    getRegionByID($regionID, $mysqli);
}
if ($functionname == 'delRegion') {
    $regionID = $_POST["regionID"];
    delRegion($regionID, $mysqli);
}
/*State*/
if ($functionname == 'setState') {
    $stateID = $_POST["stateID"];
    $stateName = $_POST["stateName"];
    $stateCode = $_POST["stateCode"];
    setState($stateID, $stateName, $stateCode, $mysqli);
}
if ($functionname == 'getState') {
    getState($mysqli);
}
if ($functionname == 'getStateByID') {
    $stateID = $_POST["stateID"];
    getStateByID($stateID, $mysqli);
}
if ($functionname == 'delState') {
    $stateID = $_POST["stateID"];
    delState($stateID, $mysqli);
}
/*City*/
if ($functionname == 'setCity') {
    $cityID = $_POST["cityID"];
    $cityName = $_POST["cityName"];
    $cityCode = $_POST["cityCode"];
    $cityStateID = $_POST["cityStateID"];
 /**
  * Define array with couple subtitution key => subtitution value
  *
  * @param	Contact 		$object        	contact
  * @param	Translate 	$outputlangs   	object for output
  * @param   array_key	$array_key	    Name of the key for return array
  * @return	array of substitution key->code
  */
 function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object')
 {
     global $conf;
     if (empty($object->country) && !empty($object->country_code)) {
         $object->country = $outputlangs->transnoentitiesnoconv("Country" . $object->country_code);
     }
     if (empty($object->state) && !empty($object->state_code)) {
         $object->state = getState($object->state_code, 0);
     }
     $array_contact = array($array_key . '_fullname' => $object->getFullName($outputlangs, 1), $array_key . '_lastname' => $object->lastname, $array_key . '_firstname' => $object->firstname, $array_key . '_address' => $object->address, $array_key . '_zip' => $object->zip, $array_key . '_town' => $object->town, $array_key . '_state_id' => $object->state_id, $array_key . '_state_code' => $object->state_code, $array_key . '_state' => $object->state, $array_key . '_country_id' => $object->country_id, $array_key . '_country_code' => $object->country_code, $array_key . '_country' => $object->country, $array_key . '_poste' => $object->poste, $array_key . '_socid' => $object->socid, $array_key . '_statut' => $object->statut, $array_key . '_code' => $object->code, $array_key . '_email' => $object->email, $array_key . '_jabberid' => $object->jabberid, $array_key . '_phone_pro' => $object->phone_pro, $array_key . '_phone_perso' => $object->phone_perso, $array_key . '_phone_mobile' => $object->phone_mobile, $array_key . '_fax' => $object->fax, $array_key . '_birthday' => $object->birthday, $array_key . '_default_lang' => $object->default_lang, $array_key . '_note_public' => $object->note_public, $array_key . '_note_private' => $object->note_private);
     // Retrieve extrafields
     require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
     $extrafields = new ExtraFields($this->db);
     $extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
     $object->fetch_optionals($object->id, $extralabels);
     foreach ($extrafields->attribute_label as $key => $label) {
         if ($extrafields->attribute_type[$key] == 'price') {
             $object->array_options['options_' . $key] = price($object->array_options['options_' . $key], 0, $outputlangs, 0, 0, -1, $conf->currency);
         } elseif ($extrafields->attribute_type[$key] == 'select') {
             $object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]];
         }
         $array_contact = array_merge($array_contact, array($array_key . '_options_' . $key => $object->array_options['options_' . $key]));
     }
     return $array_contact;
 }
Beispiel #15
0
$University = "";
$Campus = "";
$Store = "";
// --------------------------------------------------
while ($condition) {
    switch ($option) {
        case "":
            $option = getOptions();
            // General Options
            break;
        case 1:
            unset($state);
            unset($University);
            unset($Campus);
            unset($StoreUrl);
            $state = getState();
            $University = getStateUniversity($state);
            $Campus = getCampusUniversity($University[0]);
            $Store = getBK_BOOKS_URL($Campus[0]);
            $option = getOptions();
            break;
        case 2:
            if ($Store != "") {
                echo "Processsing File here \n\n\n";
                //------------------- Start Processing File
                //ProcessDataDigging($StoreUrl);
                ProcessDataDigging_Generic($Store, $University[1], $Campus[1]);
            }
            $option = getOptions();
            // General Options
            break;
{
    $url = 'http://www.auspost.com.au/postcode/' . $postcode;
    //$data = file_get_contents($url) or exit("Unable to open url: <br/>".$url);
    $data = getData($url) or exit("Unable to open url: <br/>" . $url);
    //echo $data;
    $regex = "/<td class=\"first\"><a class=\"result(?:.*)\" href=\"\\/(?:.*)\\/(?:.*)\\/(.*?)\\/(?:.*)\">" . $postcode . "<\\/a>/";
    preg_match($regex, $data, $state);
    $states = array('act', 'nsw', 'nt', 'qld', 'sa', 'tas', 'vic', 'wa');
    if (in_array($state[1], $states, true)) {
        return $state[1];
    } else {
        exit("Error finding state.");
    }
}
if (checkPostcode($postcode)) {
    $state = getState($postcode);
} else {
    exit("There is an issue. Please check regex.");
}
function getWeather($state, $postcode, $mycity, $mystate)
{
    //Generate url using state and postcode
    $url = 'https://weather.yahoo.com.au/local-forecast/' . $state . '/' . $postcode;
    //$data = file_get_contents($url) or exit("Unable to open weather url: <br/>".$url);
    $data = getData($url) or exit("Unable to open weather url: <br/>" . $url);
    // Get weather location name
    $regex = "/<span id='qualified_location_name' style='display: none;'>(.*?)<\\/span>/";
    preg_match($regex, $data, $loc);
    $autoloc = $loc[1];
    if (empty($autoloc)) {
        exit("Unable to fetch weather for postcode: " . $postcode);
Beispiel #17
0
		print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
		print '<td colspan="3">'.$account->getLibStatut(4).'</td></tr>';

		// Country
		print '<tr><td>'.$langs->trans("Country").'</td><td>';
		if ($account->fk_pays > 0)
		{
			$img=picto_from_langcode($account->pays_code);
			print $img?$img.' ':'';
			print getCountry($account->getCountryCode(),0,$db);
		}
		print '</td></tr>';

		// State
		print '<tr><td>'.$langs->trans('State').'</td><td>';
		if ($account->fk_departement > 0) print getState($account->fk_departement);
		print '</td></tr>';

		// Conciliate
		print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
		print '<td colspan="3">';
		$conciliate=$account->canBeConciliated();
		if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
        else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
		else print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')'));
		print '</td></tr>';

		// Accountancy code
		print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
		print '<td colspan="3">'.$account->account_number.'</td></tr>';
Beispiel #18
0
 public function checkZkState()
 {
     /*{{{*/
     $ext = new ReflectionExtension('zookeeper');
     $ver = $ext->getVersion();
     if (version_compare($ver, '0.2.0') < 0) {
         //throw new LogConfException("Required version of extension($name) is at least $version_min!");
         return;
     }
     $state = getState($this->zkClient_);
     if (ZOK != $state) {
         throw new LogConfException("zookeeper connection state wrong: {$state}");
     }
 }
/**
 * @author coster
 * checks if the parent has the same reservation
 * as the child room
 * */
function hasParentSameReservation($reservierungs_id)
{
    global $unterkunft_id;
    global $link;
    global $root;
    include_once $root . "/include/zimmerFunctions.php";
    $zi_id = getZimmerID($reservierungs_id, $link);
    if (!hasRoomParentRooms($zi_id)) {
        return false;
    }
    $gast = getIDFromGast($reservierungs_id, $link);
    $datum_von = getDatumVon($reservierungs_id, $link);
    $datum_bis = getDatumBis($reservierungs_id, $link);
    $status = getState($reservierungs_id, $link);
    $query = "SELECT\t\t \n\t\t\t   r.PK_ID\n\t\t\t   FROM\n\t\t\t   Rezervi_Reservierung r, Rezervi_Zimmer z\n\t\t\t   WHERE\t\t\t\t\n\t\t\t   FK_GAST_ID = '{$gast}' and" . " r.Datum_von = '{$datum_von}' and" . " r.Datum_bis = '{$datum_bis}' and" . " r.Status = '{$status}' and\n\t\t\t\t\tz.Parent_ID is null and \n\t\t\t\t\tr.FK_Zimmer_ID = z.PK_ID ";
    $res = mysqli_query($link, $query);
    if (!$res) {
        echo "die Anfrage scheitert";
        echo "<br/>" . mysqli_error();
    } else {
        $d = mysqli_fetch_array($res);
        $id = $d["PK_ID"];
        if (!empty($id)) {
            return true;
        }
    }
    return false;
}
function setState($newState, $file)
{
    file_put_contents($file, $newState);
}
function getState($file)
{
    if (!file_exists($file)) {
        return "";
    }
    return file_get_contents($file);
}
$stateFile = sys_get_temp_dir() . "/tripmine-status";
$command = $_GET['command'];
if ($command) {
    if ($command == "status") {
        echo getState($stateFile);
    }
    exit;
}
$method = $_SERVER['REQUEST_METHOD'];
$contentType = $_SERVER['CONTENT_TYPE'];
if ($method == "OPTIONS") {
    // Don't allow cross-site requests with preflight.
    exit;
}
// Only allow simple cross-site requests - since we did not allow preflight, this is all we should ever get.
if ($method != "GET" && $method != "HEAD" && $method != "POST") {
    setState("FAIL. Non-simple method {$method}.", $stateFile);
    exit;
}
if (isset($contentType) && !preg_match("/^application\\/x\\-www\\-form\\-urlencoded(;.+)?\$/", $contentType) && !preg_match("/^multipart\\/form\\-data(;.+)?\$/", $contentType) && !preg_match("/^text\\/plain(;.+)?\$/", $contentType)) {
function handleGetResourceCountCommand($path)
{
    $resourceCountFile = sys_get_temp_dir() . "/resource-count";
    $resourceCount = getState($resourceCountFile);
    $pieces = explode(" ", $resourceCount);
    generateNoCacheHTTPHeader();
    header('HTTP/1.1 200 OK');
    if (count($pieces) == 2 && $pieces[0] == $path) {
        echo $pieces[1];
    } else {
        echo 0;
    }
}
Beispiel #22
0
/**
 *   	Return a string with full address formated
 *
 * 		@param	Translate	$outputlangs		Output langs object
 *   	@param  Societe		$sourcecompany		Source company object
 *   	@param  Societe		$targetcompany		Target company object
 *      @param  Contact		$targetcontact		Target contact object
 * 		@param	int			$usecontact			Use contact instead of company
 * 		@param	int			$mode				Address type ('source', 'target', 'targetwithdetails')
 * 		@return	string							String with full address
 */
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source')
{
    global $conf;
    $stringaddress = '';
    if ($mode == 'source' && !is_object($sourcecompany)) {
        return -1;
    }
    if ($mode == 'target' && !is_object($targetcompany)) {
        return -1;
    }
    if (!empty($sourcecompany->state_id) && empty($sourcecompany->departement)) {
        $sourcecompany->departement = getState($sourcecompany->state_id);
    }
    //TODO: Deprecated
    if (!empty($sourcecompany->state_id) && empty($sourcecompany->state)) {
        $sourcecompany->state = getState($sourcecompany->state_id);
    }
    if (!empty($targetcompany->state_id) && empty($targetcompany->departement)) {
        $targetcompany->departement = getState($targetcompany->state_id);
    }
    if ($mode == 'source') {
        $withCountry = 0;
        if (!empty($sourcecompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
            $withCountry = 1;
        }
        $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset(dol_format_address($sourcecompany, $withCountry, "\n", $outputlangs)) . "\n";
        if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS)) {
            // Phone
            if ($sourcecompany->phone) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("PhoneShort") . ": " . $outputlangs->convToOutputCharset($sourcecompany->phone);
            }
            // Fax
            if ($sourcecompany->fax) {
                $stringaddress .= ($stringaddress ? $sourcecompany->phone ? " - " : "\n" : '') . $outputlangs->transnoentities("Fax") . ": " . $outputlangs->convToOutputCharset($sourcecompany->fax);
            }
            // EMail
            if ($sourcecompany->email) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Email") . ": " . $outputlangs->convToOutputCharset($sourcecompany->email);
            }
            // Web
            if ($sourcecompany->url) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Web") . ": " . $outputlangs->convToOutputCharset($sourcecompany->url);
            }
        }
    }
    if ($mode == 'target' || $mode == 'targetwithdetails') {
        if ($usecontact) {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
            if (!empty($targetcontact->address)) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset(dol_format_address($targetcontact)) . "\n";
            } else {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset(dol_format_address($targetcompany)) . "\n";
            }
            // Country
            if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
                $stringaddress .= $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $targetcontact->country_code)) . "\n";
            } else {
                if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
                    $stringaddress .= $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $targetcompany->country_code)) . "\n";
                }
            }
            if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails') {
                // Phone
                if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Phone") . ": ";
                }
                if (!empty($targetcontact->phone_pro)) {
                    $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
                }
                if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) {
                    $stringaddress .= " / ";
                }
                if (!empty($targetcontact->phone_mobile)) {
                    $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
                }
                // Fax
                if ($targetcontact->fax) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Fax") . ": " . $outputlangs->convToOutputCharset($targetcontact->fax);
                }
                // EMail
                if ($targetcontact->email) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Email") . ": " . $outputlangs->convToOutputCharset($targetcontact->email);
                }
                // Web
                if ($targetcontact->url) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Web") . ": " . $outputlangs->convToOutputCharset($targetcontact->url);
                }
            }
        } else {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset(dol_format_address($targetcompany)) . "\n";
            // Country
            if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
                $stringaddress .= $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $targetcompany->country_code)) . "\n";
            }
            if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails') {
                // Phone
                if (!empty($targetcompany->phone) || !empty($targetcompany->phone_mobile)) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Phone") . ": ";
                }
                if (!empty($targetcompany->phone)) {
                    $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone);
                }
                if (!empty($targetcompany->phone) && !empty($targetcompany->phone_mobile)) {
                    $stringaddress .= " / ";
                }
                if (!empty($targetcompany->phone_mobile)) {
                    $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile);
                }
                // Fax
                if ($targetcompany->fax) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Fax") . ": " . $outputlangs->convToOutputCharset($targetcompany->fax);
                }
                // EMail
                if ($targetcompany->email) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Email") . ": " . $outputlangs->convToOutputCharset($targetcompany->email);
                }
                // Web
                if ($targetcompany->url) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Web") . ": " . $outputlangs->convToOutputCharset($targetcompany->url);
                }
            }
        }
        // Intra VAT
        if (empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS)) {
            if ($targetcompany->tva_intra) {
                $stringaddress .= "\n" . $outputlangs->transnoentities("VATIntraShort") . ': ' . $outputlangs->convToOutputCharset($targetcompany->tva_intra);
            }
        }
        // Professionnal Ids
        if (!empty($conf->global->MAIN_PROFID1_IN_ADDRESS) && !empty($targetcompany->idprof1)) {
            $tmp = $outputlangs->transcountrynoentities("ProfId1", $targetcompany->country_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof1);
        }
        if (!empty($conf->global->MAIN_PROFID2_IN_ADDRESS) && !empty($targetcompany->idprof2)) {
            $tmp = $outputlangs->transcountrynoentities("ProfId2", $targetcompany->country_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof2);
        }
        if (!empty($conf->global->MAIN_PROFID3_IN_ADDRESS) && !empty($targetcompany->idprof3)) {
            $tmp = $outputlangs->transcountrynoentities("ProfId3", $targetcompany->country_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof3);
        }
        if (!empty($conf->global->MAIN_PROFID4_IN_ADDRESS) && !empty($targetcompany->idprof4)) {
            $tmp = $outputlangs->transcountrynoentities("ProfId4", $targetcompany->country_code);
            if (preg_match('/\\((.+)\\)/', $tmp, $reg)) {
                $tmp = $reg[1];
            }
            $stringaddress .= "\n" . $tmp . ': ' . $outputlangs->convToOutputCharset($targetcompany->idprof4);
        }
    }
    return $stringaddress;
}
<?php

require_once 'classes/match.php';
$app['match'] = function ($app) {
    return new Match();
};
$app->get('/matches', function () use($app) {
    $result = $app['match']->GetMatches();
    return getState($app, $result);
});
$app->get('/matches/{matchId}', function ($matchId) use($app) {
    $result = $app['match']->GetMatchById($matchId);
    return getState($app, $result);
});
$app->get('/matches/next', function () use($app) {
    $result = $app['match']->GetNextMatch();
    return getState($app, $result);
});
Beispiel #24
0
<div id="w_middle">
  <?php 
echo $this->renderPartial('_left', array('div_id' => 'tree_left', 'div_id' => 'w_tree_wrap', 'leaf_tree' => $leaf_tree, 'action' => $action), false, true);
?>
  <div id="w_right">
    <div id="w_location" >
      <div class="location">
        <a href="<?php 
echo getState('back_url');
?>
"><?php 
echo API::lc();
?>
返回列表</a>
      </div>
      <?php 
echo $this->renderPartial('//layouts/_location', array('action' => $action));
?>
      <span class='action on'>编辑内容 # <?php 
echo $model->id;
?>
 - <?php 
echo cnSubstr($model->title, 0, 20);
?>
</span>
      
      <div class='flR'>
        <span class="control_tree toggle" rel="#w_tree_wrap">栏目类别</span>
      </div>

    </div><!-- w_location end -->
Beispiel #25
0
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("CompanyTown") . '</td><td>' . $conf->global->MAIN_INFO_SOCIETE_VILLE . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CompanyCountry") . '</td><td>';
 if ($mysoc->country_code) {
     $img = picto_from_langcode($mysoc->country_code);
     print $img ? $img . ' ' : '';
     print getCountry($mysoc->country_code, 1);
 } else {
     print img_warning() . ' <font class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")) . '</font>';
 }
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td>' . $langs->trans("State") . '</td><td>';
 if ($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT) {
     print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT);
 } else {
     print '&nbsp;';
 }
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("CompanyCurrency") . '</td><td>';
 print currency_name($conf->currency, 1);
 print ' (' . getCurrencySymbol($conf->currency) . ')';
 print '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Tel") . '</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL, $mysoc->country_code) . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Fax") . '</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX, $mysoc->country_code) . '</td></tr>';
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("Mail") . '</td><td>' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL, 0, 0, 0, 80) . '</td></tr>';
}
function getState($file)
{
    if (!file_exists($file)) {
        return "0";
    }
    return file_get_contents($file);
}
$stateFile = sys_get_temp_dir() . "/remember-bad-password-status";
$command = $_GET['command'];
if ($command) {
    if ($command == "status") {
        echo getState($stateFile);
    } else {
        if ($command == "reset") {
            echo setState("0", $stateFile);
        }
    }
    exit;
}
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_REQUEST['uid']) || $_REQUEST['uid'] != $_SERVER['PHP_AUTH_USER']) {
    header('WWW-Authenticate: Basic realm="WebKit Test Realm"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Authentication canceled';
    if (isset($_SERVER['PHP_AUTH_USER'])) {
        setState(getState($stateFile) + 1, $stateFile);
    }
    exit;
} else {
    echo "User: {$_SERVER['PHP_AUTH_USER']}, password: {$_SERVER['PHP_AUTH_PW']}.";
}
function getQuery($sid, $pid)
{
    global $db;
    $first = true;
    $attributes = "";
    $values = "";
    if (isset($_POST["addr"])) {
        $addr = $_POST["addr"];
        if ($addr != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $addr . "'";
            $attributes .= "addr";
        }
    }
    if (isset($_POST["city"])) {
        $city = $_POST["city"];
        if ($city != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $city . "'";
            $attributes .= "city";
        }
    }
    if (isset($_POST["state"])) {
        $state = $_POST["state"];
        if ($state != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $better = getState($state);
            $values .= "'" . $better . "'";
            $attributes .= "state";
        }
    }
    if (isset($_POST["zip"])) {
        $zip = $_POST["zip"];
        if ($zip != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $zip . "'";
            $attributes .= "zip";
        }
    }
    if (isset($_POST["homeSize"])) {
        $homeSize = $_POST["homeSize"];
        if ($homeSize != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $homeSize . "'";
            $attributes .= "homeSize";
        }
    }
    if (isset($_POST["lotSize"])) {
        $lotSize = $_POST["lotSize"];
        if ($lotSize != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $lotSize . "'";
            $attributes .= "lotSize";
        }
    }
    if (isset($_POST["beds"])) {
        $beds = $_POST["beds"];
        if ($beds != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $beds . "'";
            $attributes .= "beds";
        }
    }
    if (isset($_POST["baths"])) {
        $baths = $_POST["baths"];
        if ($baths != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $baths . "'";
            $attributes .= "baths";
        }
    }
    if (isset($_POST["yearBuilt"])) {
        $yearBuilt = $_POST["yearBuilt"];
        if ($yearBuilt != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $yearBuilt . "'";
            $attributes .= "yearBuilt";
        }
    }
    if (isset($_POST["price"])) {
        $price = $_POST["price"];
        if ($price != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $price . "'";
            $attributes .= "price";
        }
    }
    if (isset($_POST["description"])) {
        $description = $_POST["description"];
        if ($description != "") {
            if (!$first) {
                $values .= ", ";
                $attributes .= ", ";
            } else {
                $first = false;
            }
            $values .= "'" . $description . "'";
            $attributes .= "description";
        }
    }
    //$maxPid = $maxResult->fetch_assoc()["MAX(pid)"];
    //$pid = $maxPid + 1;
    $attributes .= ", sellerID, pid";
    $values .= ", " . $sid . ", " . $pid;
    $query = "INSERT INTO PROPERTY ({$attributes}) VALUES ({$values});";
    return $query;
    //return $maxPid;
}