[PHP] Thank you everyone, What a wonderful world

2009-01-01 Thread Behzad
Hi List,

I would like to appreciate from you all. I hope that you enjoy your
holidays.
Children (yes! children) are dying in Gaza, and we're safe! We're happy.
Happy Christmas!!
Thank you for supporting Israel, and for being so quite. The God is with
you!

How Palestinians defend(!) themselves with stones, and how Zionist are
performing
a new holocaust using the American weapons in a prison, named Gaza strip.
But you now what... this is really good. At least this could bring
democracy, and freedom to
middle east. PEACE! HUMAN RIGHTS! YEAH! a lot of bullshit !!.

We're all responsible for this event. What a shame for mankind in 21th
century.

Forget this. This is SPAM and/or PROPAGANDA!

CHEERS!
-behzad


Re: [PHP] Thank you everyone, What a wonderful world

2009-01-03 Thread Behzad
Enjoy ! Be Happy ! Let's free the Gaza! Let's bring there Democracy ! YEAH!
Hamas is a terrorist group, and since it is elected by Gaza's people, they
are terrorists, too!

... Enough already!

For you information:

1) http://en.wikipedia.org/wiki/Sabra_and_Shatila_massacre
2) http://en.wikipedia.org/wiki/2006_Qana_airstrike

KILL TERRORIST! Kill all of those terrorist, including those women and
children! Victory is yours.
Soldiers! Don't make any mistake, since you have modern weapons, equipped
with lasers!
Use your modern war machine; Use F16 and 100-ton bombs to kill,
Do not let them to throw stones at you. Do not let them to leave the land.
Do not let them to have food.
Oh My God ! Look at their rockets... Look at those hand-made toys! How
miserable these terrorists are!

Who are we? Vampires or Blinds?


On Sat, Jan 3, 2009 at 9:59 PM, Dotan Cohen  wrote:

> WTF? Isn't it the Gaza government (Hamas) that chooses to build
> rockets instead of buying food for it's citizens? So long at Hamas is
> in charge both the Gaza residents and the Israelis will suffer. Let's
> hope this finally roots them out for good.
>
> By the way, of the 400+ killed in Gaza, about 70 were civilians. A
> six-to-one ratio of terrorists:civilians really is not that bad,
> especially considering that the Hamas hide among the civilians. Hell,
> they take kids with them, crying, when they launch rockets just so
> that they can say that another kid was killed if they get intercepted.
> According to the Geneva convention, it is _Hamas_ that is responsible
> for the civilian deaths in Gaza.
>
> By the way, Egypt (who knows better than anyone else in the world)
> blames Hamas fully for what has happened in the past week.
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
>
> א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
> ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
> А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
> а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
> ä-ö-ü-ß-Ä-Ö-Ü
>



-- 
Kind regards,
-behzad


[PHP] DB Question | A hotel reservation scenario

2009-08-18 Thread Behzad
Dear list,
e-Greetings!

I'm faced with an interesting and challenging problem.

Consider a database, designed for a hotel.
At any given time, each room has a different status: It's Busy or Reserved,
or Free.

It's easy to retrieve number of Free rooms at the current time.
But how can I count the number of rooms that were busy during the last week
?

I would appreciate if you take a brief moment of your time and share your
opinion.

Thank you in advance,
-b


Re: [PHP] Re: DB Question | A hotel reservation scenario

2009-08-18 Thread Behzad
Based on Ashely's reply, I created the following scheme:

The table "Rooms" has the following fields.

- id (PK)
- room_no (varchar)
- status (ENUM: Busy, Reserved)

the other table, "RoomLogs", has the following fields:
- room_id (the id from above table)
- status_modified_on (date)
- status (enumerated value - 'busy','reserved')

The problem is to generate a graph to display status of rooms in different
periods of
time (daily, weekly, monthly).
X Axis = Status (Busy, Reserved)
Y Axis = Number of rooms with a certain status (the last status for each
room makes sense)


On Tue, Aug 18, 2009 at 8:13 PM, Ralph Deffke  wrote:

> to answer this is in fact not possible on the base of information u give.
>
> I dont think there is a general db outlay for hotels. it depends how the
> "booking" tables are designed.
>
> does the application excist or u are doing a new one?
>
> if it excist, have a look how the availability of a room is calculated and
> then go from there. it would be the same calculation, just with backwards
> dates.
>
> hope that helps
>
> ralph_def...@yahoo.de
>
>
>
> "Behzad"  wrote in message
> news:470fa6660908180745i6bb6a442xd53d2c02fac7b...@mail.gmail.com...
> > Dear list,
> > e-Greetings!
> >
> > I'm faced with an interesting and challenging problem.
> >
> > Consider a database, designed for a hotel.
> > At any given time, each room has a different status: It's Busy or
> Reserved,
> > or Free.
> >
> > It's easy to retrieve number of Free rooms at the current time.
> > But how can I count the number of rooms that were busy during the last
> week
> > ?
> >
> > I would appreciate if you take a brief moment of your time and share your
> > opinion.
> >
> > Thank you in advance,
> > -b
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Kind regards,
-behzad


Re: [PHP] DB Question | A hotel reservation scenario

2009-08-20 Thread Behzad
Good questions, I need to talk to the client to determine the exact
requirements and
specifications. Thank you every one for helping me to figure out the
potential db-scheme
and for opening my view with your answers :)

On Wed, Aug 19, 2009 at 10:39 PM, Bob McConnell  wrote:

> From: Ashley Sheridan
> > On Tue, 2009-08-18 at 19:15 +0430, Behzad wrote:
> >>
> >> I'm faced with an interesting and challenging problem.
> >>
> >> Consider a database, designed for a hotel.
> >> At any given time, each room has a different status: It's Busy or
> Reserved,
> >> or Free.
> >>
> >> It's easy to retrieve number of Free rooms at the current time.
> >> But how can I count the number of rooms that were busy during the
> last week
> >> ?
> >>
> >> I would appreciate if you take a brief moment of your time and share
> your
> >> opinion.
> >
> > Keep a table that lists all the rooms along with their current status
> >
> > Keep another table that has these fields:
> >   * room_id (the id from above table)
> >   * status (enumerated value - 'busy','reserved')
> >   * start_date
> >   * end_date
> >
> > Then you perform your query using a join of these two tables, within a
> > particular date range. I've left out 'free' from the second table
> > because there's no point updating the table for a period if a room is
> > not being used.
> >
> > You could also have start_date and end_date as datetime fields, as
> every
> > hotel i've ever been in has a set time for check-in and another for
> > check-out.
>
> It would be easier if you kept a record of the status changes to and
> from busy (check-in and check-out) as a transaction log. Then you can
> scan the log to see the status changes for any time period. But you
> still have to deal with a room that stayed busy for the entire period.
>
> First question, does busy include the time needed by housekeeping to
> clean the room after checkout? You might want to consider a separate
> status for that.
>
> Second question, does the system keep track of when each room is
> reserved? If one is reserved for three nights beginning Friday, can it
> still be used Wednesday for a one or two night stay?
>
> Bob McConnell
>



-- 
Kind regards,
-behzad


[PHP] LoginShare | How to authenticate once, and login to different websites

2009-08-31 Thread Behzad
Dear list,

i'm trying to integrate two php-driven web applications, which both
require the user to authenticate using a username and a password.

Consider a situation where the user has logged-in to the 1st application.
She
clicks over a hyper-link, which directs her to the 2nd application. The
challenge
is to automatically authenticate the user on the 2nd application as well.

i'm wondering how?
Is it secure to store the username and password in the $_SESSION, and
share the session between the two applications?

Please let me know what do you think.

Thank you in advance,
-behzad


Re: [PHP] Re: LoginShare | How to authenticate once, and login to different websites

2009-09-01 Thread Behzad
Thank you all for your answers.

i was looking for a simple and fast answer -> I'm going to store the a
unique id
in the database, and pass it between applications using the $_SESSION.
Shawn and Martin, Thank you very much for your help.

Kind regards,
-behzad


Re: [PHP] Re: LoginShare | How to authenticate once, and login to different websites

2009-09-02 Thread Behzad
Dear paragasu,
Never heard of oAuth before, but I guess that it's complex for my purpose.
But I'll take a look at it, I'll use it for the next version.
Thank you so much for introducing this great tool!

On Wed, Sep 2, 2009 at 5:51 AM, paragasu  wrote:

> why not use ready available php library OAuth?
>
> http://oauth.net/
>
> On 9/1/09, Shawn McKenzie  wrote:
> > Behzad wrote:
> >> Dear list,
> >>
> >> i'm trying to integrate two php-driven web applications, which both
> >> require the user to authenticate using a username and a password.
> >>
> >> Consider a situation where the user has logged-in to the 1st
> application.
> >> She
> >> clicks over a hyper-link, which directs her to the 2nd application. The
> >> challenge
> >> is to automatically authenticate the user on the 2nd application as
> well.
> >>
> >> i'm wondering how?
> >> Is it secure to store the username and password in the $_SESSION, and
> >> share the session between the two applications?
> >>
> >> Please let me know what do you think.
> >>
> >> Thank you in advance,
> >> -behzad
> >>
> >
> > Each application has a mechanism to tell whether the user is loggedin,
> > and if so, who is loggedin.  One of the most common is probably a uid or
> > something saved in the session.  If both apps are on the same domain and
> > use the same session handler, then you just need to modify each apps
> > login code to set the login stuff for the other app.  Possibly create
> > your own login code that sets the login for both apps.  Either way,
> > there's no need (and I wouldn't advise) to store the password in the
> > session.  If it's not too verbose you can post the login code for each.
> >
> > --
> > Thanks!
> > -Shawn
> > http://www.spidean.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>



-- 
Kind regards,
-behzad


[PHP] RegEx to check for non-Latin characters

2008-11-14 Thread Behzad
Dear List,

For a Form Validation process, I need a function to avoid Latin characters
to be provided as the first or last name. Since we expect our users to
enter their personal info in Persian.

Do you know any regular expression to provide this functionality?
1) Regex to check whether there are Latin and Numerical characters in a
string.
2) Regex to check whether the string only consists of certain characters.

Thanks you very much in adnvace,
Kind regards,
-behzad


Re: [PHP] RegEx to check for non-Latin characters

2008-11-15 Thread Behzad
Thanks everyone. I guess I find the answer:

*// return true if the $str ONLY consists of Arabic characters and
space-character
public function isArabicString($str)
{
return preg_match('/^([\p{Arabic}]|\s)*$/u', $str);
}
*
PHP 5.1.x or higher is required.
@see: http://www.regular-expressions.info/unicode.html

Cheers,
-b