my js files are included through header. i dont want to have some .js files included in certain pages, while that particular page is loading. is it is possible.??? help me please.....
I have a table providers that has three columns (containing more columns but not important in this case):
starttime, start time in which you can contact him.
endtime, final hour in which you can contact him.
region_id, region where the provider resides. In USA: California, Texas, etc. In UK: England, Scotland, etc
starttime and endtime are time without timezone columns, but, "indirectly", their value has time zone of the region in which the provider resides. For example:
starttime | endtime | region_id (time zone of region) | "real" st | "real" et
----------|----------|---------------------------------|-----------|-----------
03:00:00 | 17:00:00 | 1 (EGT => -1) | 02:00:00 | 16:00:00
Often I need to get the list of suppliers whose time range is within the current server time (taking into account the time zone conversion). The problem is that the time zones aren't "constant", ie, they may change during the summer time. However, this change is very specific to the region and not always carried out at the same time: EGT <= EGST, ART <= ARST, etc.
The question is:
1. Is it necessary to use a webservice to update every so often the time zones in the regions? Does anyone know of a web service that can serve?
2. Is there a better approach to solve this problem?
Thanks in advance.
UPDATE
I will give an example to clarify what I'm trying to get. In the table providers I found this records:
idproviders | starttime | endtime | region_id
------------|-----------|----------|-----------
1 | 03:00:00 | 17:00:00 | 23 (Texas)
2 | 04:00:00 | 18:00:00 | 23 (Texas)
If I execute the query in January, with this information:
Server time (UTC offset) = 0 hours
Texas providers (UTC offset) = +1 hour
Server time = 02:00:00
I should get the following results: idproviders = 1
If I execute the query in June, with this information:
Server time (UTC offset) = 0 hours
Texas providers (UTC offset) = +2 hours (their local time has not changed, but their time zone has changed)
Server time = 02:00:00
I should get the following results: idproviders = 1 and 2
Hi
I have a check box when check that check box the id corresponding to the check box is placed on a text box ... but when there is only single value in the database i cant get the check value why?
here is my code
<? if(isset($AcceptFriend)) {?>
<form action="<?=site_url()?>friends/Accept_Friend" name="orderform" id="orderform" method="post" style="background:#CCCC99">
<input type="text" name="chId" id="chId" >
<table border="0" height="50%" id="chkbox" width="50%" >
<tr>
<? foreach($AcceptFriend as $row)
{?>
<tr>
<td>Name</td><td><?=$row['dFrindName'].'</br>';?></td>
<td> <input type="checkbox" name="checkId" id="checkId" value="<? echo $row['dMemberId']; ?>" onClick="get_check_value()" ></td>
</tr>
<? }}?>
</tr>
<tr> <td width="10px"><input type="submit" name="submit" id="submit" class="buttn" value="AcceptFriend"></td></tr>
</table>
</form>
This is the script i am using
function get_check_value()
{
var c_value = "";
for (var i=0; i < document.orderform.checkId.length; i++)
{
if (document.orderform.checkId[i].checked)
{
c_value = c_value + document.orderform.checkId[i].value + "\n";
}
}
alert(c_value);
document.getElementById('chId').value= c_value;
}
Hey there,
I have an sql database. In this database is 3 tables I need to query. The first table has all the item info called item and the other two tables has data for votes and comments called userComment and the third for votes called userItem
I currently have a function which uses this sql query to get the latest more popular (in terms of both votes and comments):
$sql = "SELECT itemID, COUNT(*) AS cnt
FROM (
SELECT `itemID`
FROM `userItem`
WHERE FROM_UNIXTIME( `time` ) >= NOW() - INTERVAL 1 DAY
UNION ALL
SELECT `itemID`
FROM `userComment`
WHERE FROM_UNIXTIME( `time` ) >= NOW() - INTERVAL 1 DAY AND `itemID` > 0
) q
GROUP BY
`itemID`
ORDER BY
cnt DESC";
I know how to change this for either by votes alone or comments....
HOWEVER - I need to query the database to only return the itemID's of the ones which have specific conditions in only the item table these are WHERE categoryID = 'xx' AND typeID = 'xx'
If the sql ninja could please help me on this one? Do I have to first return the results from the above query and the for each in the array fetched then check each against the item table and see if it fits the conditions to build a new array - or is that overkill?
Thanks,
Stefan
So I have a form that is using the Zend_Filter_Null filter. When I call it directly, it works:
$makeZeroNull = new Zend_Filter_Null();
$null = $makeZeroNull->filter('0');
//$null === null
However, when I try to add it to an element in my form, it doesn't filter the value when I call getValue().
class My_Form extends Zend_Form {
public function init() {
$makeZeroNull = new Zend_Filter_Null();
$this->addElement('text', 'State_ID', array('filters' => array($makeZeroNull)));
}
}
//in controller
if ($form->isValid($_POST)) {
$zero = $form->State_ID->getValue();
//getValue() should return null, but it is returning 0
}
What is going on? What am I doing wrong?
Hi,
I create custom CMS sites and then go ahead for the backend/admin side. Is there any tool out there to automatically create admin side of my sites, for example, based on table relationships or whatever customization we may put in place.
PHPMaker seems to claim something like what i ask for but i have not used it. Any tool out there to auto-create admin side or PHPMaker is up to the point?
Thanks
Is it possible to Use cursor in triggers in MySQL? Is it recommended? as someone told me its helpfull to use cursor in triggers for auditing
I need this for auditing...
Please help ..
Thank You
Hello,
I want to create a website where the main pages will be served from CodeIgniter. I will use Wordpress in the /blog/ sub-directory to host the blog. Thats it! I want nothing else. Just to make sure that:
example.com/somepage/ calls a CI controller where as example.com/blog/some-post/ is handled by Wordpress.
I don't need any kind of integration or interaction between CI and WP.
Is it possible to install in that way? If not, any workarounds so that I can achieve the objectives?
Thanks and Regards,
Masnun
When testing some donations on my local machine, I set various key=value pairs to do various things (return to specific thank you page, get POST data from PayPal and not GET data and others) I also built my code around the response from the PayPal sandbox.
BUT, when my code goes to the production server and we switch on live payments and test with real accounts and money, a few strange things happen;
We get a GET response from PayPal - the URL is filled with crap.
We get no transaction details. This is the biggie, no name, no txn_id, no dates, nothing. We get a handful of keys etc, its not totally empty and the payment has gone through, but nowhere near the verbosity of the sandbox.
Curious about why this might be? It doesn't really make sense to have a sandbox (or dev environment) that is substantially different from the production environment. Or, am I missing something?
EDIT: Still no response to my question in the PayPal Developer Forums. I don't even get a donation amount back from PayPal. Is this a setting maybe?
EDIT #2: Two of you have suggested to check PDT and Auto-Return. The data analytics guy for the project only 2 hrs ago suggested the same. I have asked the client to confirm this. I can't see a setting for it in the Sandbox so can assume that it is enabled by default?
For so many time, I have encountered problems with managing image having abnormally long height or width.
If I fixed their height and widht, they will appear streched?
If I fixed their width, and if the height of the image is very long then also it will mess up the overall website.
If I fixed their height, and if the width of the image is very long then also it will mess up the overall website.
The images I save in the local drive are saved maintaining the ratio?
Let say user decides to upload image 1(height)*32(width).
When he uploads this image, the script is made to resize the user uploaded image to height:1000px(just an example)
So the resulting image in 1000px(height)*32000(widht), you see now the image is abnormally large.
Now while displaying this image in a box of 1000px * 1000px, what is the best way to display this image?
Here is the situation
I create a instance of a class
$newobj = new classname1;
Then I have another class writtern below and I want to this class to access the object above
class newclass {
public function test() {
echo $newobj->display();
}
}
It is not allowed, is there a way define a variable globally through a class?
I'm using
var retval = value.replace(/<br[\s\/]?>/gi, '\n');
To strip the <br> tags from the textarea and nl2br('$_POST('newValueHere')') to insert into my database and to return back to jeditable to display the edits. The only problem I'm having is that each click on the editable field seems to make all the <br> tags be written twice? This makes no sense, does anyone have any ideas what could be going on?
Suppose we have a class. We create an object from the class and when we do the class Extends himself base on the object initialization value..
For example:
$objectType1 = new Types(1);
$objectType1->Activate(); // It calls an activation function for type 1
$objectType2 = new Types(2);
$objectType2->Activate(); // It calls an activation function for type 2
I don't want to use the standard procedure of class extending:
class type1 extends types{}
Hi, I am building an app on top of Google Reader. Since users have to enter their Google Account data, I'd like to use this data to assign personal settings to each user.
However, if I do so and a user would change his email adress or password(for the whole Google Account), I wouldn't be able to identify him anymore.
Thus, I need to know if there's a Google Account ID or something that I can use to identify users regardless of an email adress or password.
Thanks for your help!
I'm writing a web application that autorefreshes data with an AJAX call at set intervals.
Because it's doing that, server side user sessions never time out, since the last activity is refreshed with every ajax call.
Are there good client side rules I could implement to time out the user? I.e. should I track mouse movements in the browser, etc., or should I point the AJAX calls to URLs that don't refresh the session?
I like that my AJAX calls hit a session-enabled URL, because I can also validate that the user is logged in, etc.
Any thoughts in terms of whether I should even bother timing out the users?
I have created a basic class for a customer.
I haven't done this before and want to know the best way to access the data.
Should I have a get() method for every field in the customer array or should I simply pass the customer array back and access with the page.
i.e. Just return the array
class Customer {
protected $id;
protected $customer;
public function __construct($customer_id) {
$this->id = $customer_id;
$this->set_customer();
}
protected function set_customer() {
$query = mysql_query("SELECT * FROM customer WHERE id = '$this->id'");
$this->customer = mysql_fetch_row($query);
}
public function get_customer() {
return $this->customer;
}
}
versus create a method for each item in the array
class Customer {
protected $id;
protected $customer;
public function __construct($customer_id) {
$this->id = $customer_id;
$this->set_customer();
}
protected function set_customer() {
$query = mysql_query("SELECT * FROM customer WHERE id = '$this->id'");
$this->customer = mysql_fetch_row($query);
}
public function get_customer_name() {
return $this->customer->customer_name;
}
...
...
}
versus option 3 based on Tobias' feedback: (not sure if syntax is correct)
class Customer {
protected $id;
protected $customer;
public function __construct($customer_id) {
$this->id = $customer_id;
return $this->set_customer();
}
protected function set_customer() {
$query = mysql_query("SELECT * FROM customer WHERE id = '$this->id'");
return mysql_fetch_row($query);
}
}
I've been googling for this question but can't find any good answers. I found that there is a method called setPageName() for the paginator but it only works when used like Paginator::setPageName('page').
I looked up the paginator in the Laravel API (http://laravel.com/api/class-Illuminate.Pagination.Environment.html) and the method is a public function just like setBaseUrl which I am currently using like $albums->setBaseUrl('/album/');
for instance I want to have a Photo paginator (?photoPage=n) and a Comment paginator (?commentPage=n).
Is there any way that I can use two paginators that use different page names in the URL on one page, or at least call the setPageName() method like setBaseUrl()?
I want to ask just a thing. I am using paypal for the first time. not by buttons. the data i sends through html page , is it returned by the ipn?
i am using a paypal class and this is my custom data:
$this->paypal_class->add_field('cemail', $this->session->userdata('check_email'));
$this->paypal_class->add_field('fname', $this->session->userdata('check_name'));
just wanna ask if it returned by the ipn or not.
Hello guys, I have such text:
<[email protected]> If you do so, please include this problem report.
<[email protected]> You can delete your
own
text from the attached returned message.
The mail system
<[email protected]>: connect to *.net[82.*.86.*]: Connection timed
out
I have to parse email from it. Could you help me with this job?
upd
There could be another email addresses in <%here%. There should be connection between 'The mail system' text. I need in email which goes after that text.
I have the follow code:
if (isset($_GET['preis']) && $_GET['preis']==="0-100-euro"){
$preis = "WHERE preis >= 0 and preis <= 100";
}
elseif (isset($_GET['preis']) && $_GET['preis']==="100-200-euro"){
$preis = "WHERE preis >= 100 and preis <= 200";
}
elseif (isset($_GET['preis']) && $_GET['preis']==="200-300-euro"){
$preis = "WHERE preis >= 200 and preis <= 300";
}
elseif (isset($_GET['preis']) && $_GET['preis']==="300-500-euro"){
$preis = "WHERE preis >= 300 and preis <= 500";
}
else {
}
$abfrage = "SELECT * FROM outfits $preis LIMIT $start, $eintraege_pro_seite";
$ergebnis = mysql_query($abfrage);
example.com/?preis=100-200-euro works but example.com/preis-100-200-euro/ is not
This is my htaccess:
RewriteEngine On
RewriteRule ^preis-([^-]*)/seite-([^-]*)/$ ?preis=$1&seite=$2 [L]
RewriteRule ^preis-([^-]*)/$ ?preis=$1 [L]
RewriteRule ^seite-([^-]*)/$ ?seite=$1 [L]
I use the same rules for many other links and it works fine, but only in this case not
Hello,
If you go to wordpress admin and then settings-privacy, there are two options asking you whether you want to allow your blog to be searched though by seach engines and this option:
I would like to block search engines,
but allow normal visitors
How does wordpress actually block search bots/crawlers from searching through this site when the site is live?
I'm using the following for $headers:
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= "Reply-To: ". $from . "\r\n";
$headers .= "CC: [email protected]\r\n";
My html looks fine in Gmail, however, it appears as raw html in outlook.
Did I forget something in the header?
I am trying to put some images on my website that are hosted on Imgur but i only have the link to the Imgur page, not the actual image URL.
For example, on this album the URL I am trying to get is this: http://i.imgur.com/csb9Q.jpg (I only need the first image)
I have noticed that when the page only has one image, the image file name is the same as the URL address, for example: http://imgur.com/sYlGa & http://i.imgur.com/sYlGa.jpg So this isnt a problem.
But for pages with multiple images, this is not the case so how can i get the image URL?
Hi there,
In Zend Framework (1.10) i want to check if two input fields are identical
I have the following code in my form:
$this->addElement('password', 'password', array(
'label' => 'Wachtwoord:',
'required' => true
)
);
$this->addElement('password', 'verifypassword', array(
'label' => 'Bevestig wachtwoord:',
'required' => true,
)
);
I already tryed the "identical" validator, but I did'nt got it to work.
I am looking at building an external site with a CMS, probably Drupal or ExpressionEngine. The problem is that our company already has a membership database that is designed to work with our existing enterprise software.
Migrating data from the database manually is not an option as modifications and new data must be accessible in real-time. Because the design of the external database will differ from the CMS's own I have decided the best way forward is to use two databases and force the CMS to use the external to read user information (cannot write to) and a local for everything else the CMS needs to do (read + write).
Is this feasible with these Drupal or ExpressionEngine? Ideally I need to be able to use hooks as I do not wan't to modify core CMS files. Sifting through the docs I am not able to find what I would hook into for ether CMS.
(Note: I know it is possible, but I want to know if it's feasible).
Finally if there is a better way of handling this situation please also chime in. Perhaps there is something at the database level to reference a field or table in an external database?
I'm clutching at straws someone can point me in the right direction I'm sure.