/**
* getDirStructure
* get the recursive folder structure of the destionation folder
* @param string $path folder path
* @param array array resultant folders and files
* @access public
*/
public function getDirStructure($path, &$a, $sOriginalZipFilepath){
$aDir=array();
$aFiles=array();
$nd=0;
$nf=0;
$hndl=opendir($path);
while($file=readdir($hndl)){
if ($file ==’.’ || $file==’..’) continue;
if (is_dir($path.’/’.$file)){
$aDir[$nd++]=$file;
}
else{
$aFiles[$nf++]=$file;
}
}
closedir($hndl);
$n=1;
for ($i=0;$i<count($aDir);$i++){
$this->getDirStructure($path.’/’.$aDir[$i].’/', $a[$n]);
$a[$n++][0]=str_replace("//","/",$path.$aDir[$i]);
}
for ($i=0;$i<count($aFiles);$i++){
$a[$n++]=str_replace("//","/",$path.$aFiles[$i]);
}
}
$package_code = ‘AUS03B’;
$client_id = 499;
$conn = odbc_connect(DSN,USER,PASS,SQL_CUR_USE_ODBC);
//SQL_CUR_USE_IF_NEEDED,SQL_CUR_USE_ODBC ,SQL_CUR_USE_DRIVER SQL_CUR_DEFAULT
$sql_result = odbc_prepare($conn, "EXEC usp_packagesearch_xml ‘$package_code’,'$client_id’");
$result = odbc_execute($sql_result);
//$string = odbc_result($sql_result,1);
$string = odbc_result_all($sql_result,"border=1");
create or replace PROCEDURE send_mail (p_sender IN VARCHAR2,
p_recipient IN VARCHAR2,
p_message IN VARCHAR2)
as
l_mailhost VARCHAR2(255) := ‘192.168.1.21′;
l_mail_conn utl_smtp.connection;
BEGIN
l_mail_conn := utl_smtp.open_connection(l_mailhost, 25);
utl_smtp.helo(l_mail_conn, l_mailhost);
utl_smtp.mail(l_mail_conn, p_sender);
utl_smtp.rcpt(l_mail_conn, p_recipient);
utl_smtp.open_data(l_mail_conn );
utl_smtp.write_data(l_mail_conn, p_message);
utl_smtp.close_data(l_mail_conn );
utl_smtp.quit(l_mail_conn);
end;
/
Now execute the procedure above:
begin send_mail( ’satishg@imageonline.co.in’,
‘rolvy@imageonline.co.in’,
‘Hello Tom’ );
end; /
All the system tables that stores the user defined tables/sequences/object types :
user_types
USER_TYPE_ATTRS
user_sequences
user_tables
USER_TAB_COLUMNS
Code for creating a table for already existing table:
CREATE TABLE HIP_TASK_INFO_satish as SELECT HIP_TASK_ID ,
HIP_TASK_ID as HIP_TASK_BUDGET_ID,
HIP_TASK_ID as HIP_DUTY_DETAIL_ID,
IS_ACTIVE,
IS_DELETE,
ADDDT
FROM HIP_TASK_INFO
Command to rename table :
RENAME HIP_TASK_INFO_satish TO HIP_TASK_INFOÂ ;
Code example for limits implementaion:
SELECT temp.*,rownum FROM (
SELECT sp.company_name, sp.contact_phone, sp.office_fax, sp.sub_id, sb.branch_id, sb.branch_url, sp.Office_Address.Address1 || ‘, [...]
function validDate(sDatePassed) {
//if the date is in dd/mm/yyyy format then valid date returns 1else 0
if (sDatePassed.length > 0) {
aDate = sDatePassed.split("/");
if (aDate.length != 3) return(0); if (aDate[1].length == 1) aDate[1]= "0"+aDate[1];
var iLeapyear = 0;
// check whether the year is leap year – aleap year is div by 4 ,100, 400
if ((aDate[2] % 4) == [...]
Google Wave is a new tool for communication and collaboration on the web, coming later this year.
The service seems to combine Gmail and Google Docs into an interesting free-form workspace that could be used to write documents collaboratively, plan events, play games or discuss a recent news.
“In Google Wave you create a wave and add [...]