Schedule My Classes
if it`s a good idea try to do a class scheduler in php HorarioEX.htm this is the visual part of what i want to do. the idea is the user insert the code of the class it`s called CRN, then appears on the table with some color and thats all. So do u think its a good idea to try with php ? or i should try javascript or another source?
View Complete Forum Thread with Replies
Related Forum Messages:
Static Classes Vs. Singleton Classes Vs. Globals
Sometimes I want to use certain data and functions anywhere in my code; for example, when writing logging routines. In PHP5 I could write a class with all static members and functions, a singleton class, or a regular class assigned to a global variable. What would be the advantages of each? In Java web-apps (or in non-web applications), these classes persist for much longer, so it's easier to see the reasons for using them. But in PHP, it seems like you could do pretty much the same thing with all three.
View Replies !
Classes Within Classes Scope Question
I have two classes, A and B. B is created as an object within A, but also needs to use a variable within A. How do you reference it? Example, class A { var somevar = "test"; A { $obj = new B (); } } class B { B { print ( * $somevar from the A class * ); } } The class B is trying to use the variable $somevar declared in class A. I just don't know how to use the variable.
View Replies !
Schedule
Currently, I have a database that stores a course schedule. For example: Course Title, Start Time (datetime), End Time (datetime), Mon (T/F), Tues (T/F), Wed (T/F) Thurs (T/F), Fri (T/F) I want to take this data and graph it as a visual calendar using tables. For example: Time Monday Tuesday Wednes ... 10:00AM WS1093 10:30AM WS1093 11:00AM WS1093 11:30AM 12:00PM EH2312 12:30PM EH2312 1:00PM EH2312 Something like that. What's the best way to do this? Clearly, I could make a an html calendar and load it up with a bunch of if statements but is there a more elegant way to fill in the calendar? Are there any classes available to easily do this? Code examples are very much welcomed!
View Replies !
TV Schedule?
I've seen this on a number of TV sites, where on the front page they tell you what's playing at the time you're browsing, what's coming up next, etc. I want to do this for a site I'm working on, but I have no idea where to start.
View Replies !
Schedule And Php.exe
i am making an installer for a shoutcast control panel i have designed http://sourceforge.net/projects/cast-control it runs on both windows and linux I have made a bitrate controller that runs a batch file or cron job (depending on the operating system) which will run a php file with php. In the batch file i have c:/php/php.exe "D:/pathto/shoutcast_cpanel/bitrate/bitrate.php" The problem is that i cannot include the database.php file which is in the same directory as bitrate.php. I was wondering how to make this possible or at least include the database settings from the file somehow. The reason im not just running http://serverurl/bitrate/bitrate.php is because under windows it opens up a new windows in explorer for every time.
View Replies !
Schedule Job
i need to schule a php script to run once a month in apache/windows environment. what would be the easiest best way to accomplish this task?
View Replies !
Creating A Schedule
I am building a diet/weight loss website where a customer would subscribe for 1,3,6 or 12 months. I am using Paypal IPN to handle the subscription payments. I would like to create a schedule when the customer first logs on, from the date they signed up to the date when the subscription ends and every 7 days is highlighted as the weigh in day. Basically I would like to generate a list of dates from one date to another with every 7th day highlighted.
View Replies !
Schedule Emails
Has anybody every attempting scheduling emails or trigering any event from a php site? for example, everyday at 10:00am call function x(); ?
View Replies !
Schedule Script Run
I need to schedule a php script to be run daily at 12.30am. What command can I place in my crontab to do this? I'm confused because a web browser is required to run a typical php script. I thought about lynx, but I'm not sure how to run it, and then exit after it runs.
View Replies !
Schedule Script
Is there a way to get my script to run on regularly scheduled intervals without using cron? My hosting provider sucks. cannot use cron. I was thinking perhaps I could create a file every hour in a certain directory and then fire the script when the file count reaches a certain number, and then clear out the directory or something like that.
View Replies !
Simple Calendar/schedule
I'm looking to develop a simple php calendar/schedule - similar to outlook calendar - that does not rely on a database but rather writes to a file. I need to be able to add to/delete from the schedule. As I am only starting out with php I am a little confused by the codes which links to databases and how to adapt them to only write to a flat file.
View Replies !
Wrong Dates In A Schedule
I am using the following code (many thanks for the code folks BTW) to generate 3 schedules in three tables one is a schedule with 7 day intervals and two are daily schedules. The two daily schedules seem to have out of sync dates at the start of each schedule. The dates look as if they may be dates from the preceding loop. I am presuming that I need to reset something after the completion of each loop but I am not sure what. $now = time(); $day = $now + 7*24*60*60; $cutoff = strtotime("+$months months"); while ($day <= $cutoff) { $date = date('Y-m-d', $day); $insert = "INSERT INTO daily_data SET subscr_id='$subscr_id', date='$date'"; mysql_query($insert); $day = $day + 7*24*60*60; } //then create a daily schedule in the excercise table for($i=0;$i<=($sched);$i++) mysql_query("INSERT INTO exercise_data SET subscr_id='$subscr_id', date=date_add(now(),INTERVAL LAST_INSERT_ID() DAY)"); //then create a daily schedule in the food and diet table for($i=0;$i<=($sched);$i++) mysql_query("INSERT INTO food_data SET subscr_id='$subscr_id', date=date_add(now(),INTERVAL LAST_INSERT_ID() DAY)");
View Replies !
Calculate A Firefighters Schedule In PHP
I need to calculate the following schedule in php. What I need out of the script is what shift is working “today” E.G. $shift = d;. There are 4 shifts working 24hr days starting at 7 am. The days rotate on 28 day cycles. E.G. ‘C shift’ is working on July 1 (Sunday) the next Sunday they work is the 29th. I found some code that works with 3 shifts on a different cycle but I have 4 shifts. Code:
View Replies !
Calender Script/Schedule
Does anyone have any recommendations or tips on where I can go to find a good scheduling script or a tutorial to make one? I'd perfer to make my own for security reasons so I know the code and for later addons. Basically I need to re-create something like http://radio.virtualdj.com/schedule/schedule.php where djs can login to book a time on the online radio and then it blocks the slot off.
View Replies !
Allow A User To Schedule A Stay
I am trying to code a program in PHP that would allow a user to schedule a stay at this place, it would save that to a database. If a particular day has 5 people booking it, it is no longer able to be scheduled. I can't get the scheduler page to check how many people have booked or my calendar to display a day in red if it is booked.
View Replies !
How To Schedule Tasks On Website.
I am trying to figure out how to schedule tasks on my website. For example, PAGE1 should perform a different task in the morning than in the afternoon. And at the end of the day, I have to extract some data from the database and put them into a file. This should be done automatically.
View Replies !
Schedule Mail Sending
I need to send an newsletter as an email that is scheduled. The user will prepare the newsletter and save it in database. He will also input the scheduling option i.e date and time the newsletter has to be sent. I have a table Newsletter_T where newsletter contents are being saved and Contacts_T where the email address resides. I am using PHP 5.2.3, Apache and MySQL.
View Replies !
Send Email With Schedule
I want to create an option to the user to suscribe to a service that sends an automatic mails everyday with information taken from a database created in MySQL. I have the form and the access with PHP to the database and I can send an automatic mail at the moment that the users press a button to activate the action, but I do not know how to do it everyday (or the period of time chosen by the user).
View Replies !
Creating A Schedule Script
I have a league based web site and I'm looking to make a script that can make a schedule of matches. Last year I did alot of hard coding with a ton of if statements (not very fun). There are 2 vars. how many weeks you play number of teams.
View Replies !
How To Set Up Multiple Dates For Schedule?
I have a question about how to set up dates in my mysql database. I am setting up a show schedule database for a friend at a local college tv station. This would normally be pretty straight forward and easy. The problem lies in the fact that their show lineup is not huge, therefore they air most of their shows that the students produce up to 5 times a day and also some of these shows -not all- come on all week long (Sunday thru Saturday) and some only come on one or two days out of the week. My database (so far) contains the following tables: ...
View Replies !
Schedule A Cron Job With Php Script
Is it at all possible to schedule a cron job from a php script? Perhaps cron isn't my best option. I need to have a script run automatically at one specific time and not repeat. The way I was thinking of doing this is to schedule a cron job, then when it runs remove it from crontab. Is this possible, or even the right solution?
View Replies !
How To Schedule Jobs On A Host?
I'm using a php hosting company for my website. It seems most php pages are user-event triggered, so it is difficult to schedule something to run regularly. For example, user puts something in discussion board, and I need to update my search index to include it. Since building index is pretty IO intensive and takes long time, I hope to do it once a day when traffic is very low or zero so it doesn't impact server performance. I can't really rely on user events to trigger such things. For example, user won't expect his click would trigger a 20 minute delay so I can piggy bag an index-build at the page handler, and there might not even be user clicking my site at the time I desire. Is scheduling for jobs (or something similar) achievable using regular PHP? (I don't have shell login, etc. for the typical PHP hosting service).
View Replies !
Setting Up A Time Schedule?
I have a php script that needs to run 6 times a day, the documents that came with it suggest that it should be setup as a cron job, but where my site is hosted, I'm unable to do this. so I thought that maybe I could setup a php time schedule, so that the script will run inbetween these times when a users hits the site: 12am-1am 4am-5am 8am-9am 12pm-1pm 4pm-5pm 8pm-9pm but also I'm wondering how the script could keep track if the script has already been ran for a particular time period.
View Replies !
Table With Weekly Schedule From A Database?
I'm designing a site for a community radio station and the schedule needs to be generated from the list of programs that are in the database the shows table has the following colums show_id, show_name, day, start_time, end_time (i didn't list the non-relevant ones for this portion of the site) because a table has to be built left to right instead of top to bottom (cell for monday 8am then tuesday 8am instead of all the monday then tuesday etc) and not all the programs are the same length (i think i can use row span="x" depending on the length of the show) I'm quite lost. should i have other colums? how do i query the database to pull the data out in the proper order and build the table?
View Replies !
Using Classes Inside Of Other Classes
I'm wondering how to use another class inside a preexisting class, without passing the constructor in the preexisting class an object from a file that contains a new declaration. IE: Instead of doing something like this...
View Replies !
How Would Watchers Know, Without A Cyclic Check On MySQL Schedule Table About Task Validity?
I have developed a PHP-based website where a "planner" user can make up schedules of activities to be performed, storing them into MySQL tables. Afterwards, other "watcher" users can connect to the website and retrieve closest task due time, and keep retrieving next task after each one has been performed. The problem arises if the planner asynchronously changes the schedule, e.g. deleting the task "watcher" users consider to be the next one, or inserting a closer one. How would watchers know, without a cyclic check on MySQL schedule table about task validity? I would need a sort of asynchronous server-pushing tecnhique towards watcher's browser when any schedule modification occurs. Would you say this could be done with PHP alone?
View Replies !
Why Use Classes?
I feel that i mastered functions and now there is something called classes. What makes it superior to functions? Is it better to use them?
View Replies !
PDF , Classes, And PHP
I'm stuck at first base here. Currently working on turning a rather static PDF building script into a more modular, OO PHP app. I have scaled this example down to the bare bones, trying to see what the heck is going wrong. It recognizes that is should spawn a pdf file, but then there is just no data. Nothing, no error, no helper app. I'm only a week or so into PDFs and only a couple of days into OO with PHP, so I'm on the lookout for the obvious. I do have PHP/PDF apps that run fine off the same system. Here is the class: <? error_reporting(E_ERROR); /******************************************** pdfReport.class.php - description ********************************************/ /* common functions / classes */ //class used to build rectangles - how exciting (-: class pdfReport{ //define our common properties //page properties var $pdf; function createPDF() { header("Content-type: application/pdf"); header("Content-Dispositions: filename=report.pdf"); $this -> pdf = pdf_open(); pdf_begin_page($pdf, 612, 792); }//end function createPDF function closePDF() { pdf_close($pdf); }//end function pdf_close function buildText() { pdf_set_font($pdf, "Times-Roman", 15, "host"); pdf_show_xy($pdf, "Active Case Review Quarterly Report", 25, 780); pdf_set_font($pdf, "Times-Roman", 26, "host"); }//end function buildText }//end class ?> And here is the page where I call the class: <? include("test.class.php"); //error_reporting(E_ERROR); //create a report $quarterlyPDF = new pdfReport; $quarterlyPDF -> createPDF(); $quarterlyPDF -> buildText(); $quarterlyPDF -> closePDF(); //end pdf document ?> thanks much for any input.
View Replies !
Value Of PHP Classes?
So PHP classes are pretty cool. But what is the value they provide? I understand the value of OO, but in the PHP environment, every class you instantiate lives only in the span of that request. There is no concept of singleton classes, or classes that remain across requests. The notion of allocating new memory for every instance of a class for every request seems wasteful. Thoughts?
View Replies !
Why Uses Classes?
I've read a DevShed article about classes in PHP, but still can't see a practical application for them considering you can use functions throughout your script, or (such as classes) include classes for certain scripts. Can anyone tell me clearcut, what they are and why I'd use one, and in what instance?
View Replies !
Classes
I've been introduced to the concept of classes in PHP. Everyone says that they're the essence of object oriented programming and that they are extremely useful. Could someone give me an example of a good use of classes?
View Replies !
Classes - Why Would I Want To Use Classes In PHP?
okay, this is really (!) embarassing, but I have to ask: Why would I want to use classes in PHP? I have been using PHP for years now and writing the "normal" functions all the time. I have never even bothered working with classes, but now I would love to know what makes the classes so special......
View Replies !
DIR CLASSES Wth Is This?
ok, I have the following code: this file is called cont.php: <?php require_once(DIR_CLASSES . 'container/containerbase.php'); . . class Container extends Containerbase { . . . class def's . . } ?> Now nowhere in the containerbase.php file is the value DIR_CLASSES defined and its not some PHP global value. I also have no common.inc file that might define this value. Where/How do I define the DIR_CLASSES value?
View Replies !
Php Classes Within Classes?
I've been programming PHP for about 2 years and have dabbled with classes. I'm working on a project and can't seam to figure out how to use classes within classes. For example: --foo.class.php-- <? class Foo { var $test1; function Foo() { require_once('bar.class.php'); $test1=new Bar(); } function testFooBar() { return $this->test1->testBar(); } } ?> --bar.class.php-- <? class Bar { var $return; function Bar() { $this->return='FooBar Works!' } function testBar() { return $this->return; } } ?> --index.php-- <? require_once('foo.class.php'); $test = new Foo(); echo $test->testFooBar(); ?> index.php will disply a blank page instead of 'FooBar Works!'.
View Replies !
OOP PHP Classes
I was interested in looking at some php5 classes and objects that are object orientated to get an idea of what other people are doing. But more "real world" examples, more than "class FruitBowl" if you know what I mean by this. Does anyone have any links handy for something like this?
View Replies !
PHP Classes :: & ->
What is the difference between "::" and "->" when using classes? It always hard to find documentation for something that i only a symbol.
View Replies !
Use And Need Of Classes In PHP
I know what object oriented programming is - I know what classes are and how they work - I'm just trying to figure out when they should be used in PHP... I have two questions: 1-How do you keep your objects? For example if we had a shopping cart, would we create a new shopping cart object and everytime the user adds/removes items update that same object? and how would you keep that object's information as the user browses through the site? Would you use serialize/unserialize session variable functions? or is there a better way? 2- For example, if we have a website that has users why would we want to make a "Users" class containing all the user information? Can't we just insert/retrieve data directly from the database? and when we get the data from the database what exactly is the point of creating an object out of them when we can just print it out? I guess my question is why would having a Users class be useful in a php web application? (assume users have name, username, password, address, etc.)
View Replies !
Using Two Classes
Lets say I have one class that deals with the database (class called SQL), a class that manages the user authentication (class called User) and another class that does something like getting all the options from the database for a poll (class called Options). The class Options is extended by another class called Poll which is extended by the class called Gateway, like this: class SQL {} class User {} class Gateway {} class Poll extends Gateway {} class Options extends Poll {} $sql = new SQL; $sql->connect(); $user = new User; $user->authenticate(); $poll = new Options; As you see, SQL and User are in no way connected to the other classes, however sometimes I'd like to use SQL inside the Options class. Would it be better to use global inside one of Options' function, like this: class Options { public function __construct() { global $sql; $sql->query(); } } ...or would it be better to let Gateway extend Users and SQL, like this: class SQL {} class User extends SQL {} class Gateway extends User {} class Poll extends Gateway {} class Options extends Poll {} // etc...
View Replies !
When To Use Classes
I've been developing websites using PHP for several years now, yet have never used OOP concepts. I am familiar with them, but have never had a need for them in my projects. However, I am now interested in using them to expand my knowledge, but unsure when they are really needed. Lets say I have a MySQL database with a "customer" table that stores all their information such as name, address, phone number, etc. The web page will do basic queries on the customer info, inserts, updates, selects, and so forth. I'm trying to incorporate classes with this, yet it seems like it's a lot more work than if I were simply using function to perform the actions on the database. I did some browsing on the web and it doesn't seem like classes are really needed when your dealing with data from a database (other than possible a class to connect to the db). Is this true? Any examples maybe?
View Replies !
PHP Classes
Today I looked at the documentation for PHP classes and now I would like to rewrite a member system and content mangement system using classes. In the past Ive used classes in java, and PHP seems very similar other than some syntax stuff. My primary concern with using classes is that if I wanted to make each member an object would it be possible to store that object in a mysql database, or would I have to have a method within my class to get all the data from the object and put it into the database, and another to then later get the data from the database and construct the object.
View Replies !
'&' In Classes
I am fairly new to coding PHP in classes,I have come across some code an old employee has written with the 'and' symbol used throughout the code. could anyone elaborate on the use of this for me? e.g. function &generateDays($start_date, &$rs) { how does this differ from just: function generateDays($start_date, &$rs) { ??
View Replies !
PHP And Classes
Specefically, how do they work? php.net describes them as a collection of variables and functions working with these variables. So far I'm doing this with collections of function and include'' statements. For any given operation, a link will include a $_GET['thing'] variable. The index then have: if ((isset($_GET['thing'])) && ($_GET['thing'] == "linkname")) { include 'useful_pile_of_functions.php' } This method seems to me to be somewhat like using includes as classes, as the called file contains everything needed to support the users desired function. How is using classes better than this method?
View Replies !
Regarding Classes
What is a class. is it like a function? this has allways confused me as i am a newby to programming (since Basic in the 80's).
View Replies !
Using Css Classes
why can't i use css classes in an echo or print function? for example: Code: echo ("<center>"); echo ("<b>updated on $date</b><br><br>"); echo ("$entry<br><br>"); echo ("</center>"); prints the appropriated variables centered, bolded, etc. but when i try Code: echo ("<center>"); echo ("<b class="entryhead">updated on $date</b><br><br>"); echo ("$entry<br><br>"); echo ("</center>"); it returns a t_string error on that line. why can't i use css classes in my php code, is there a way to apply classes like that via php? if so how do i use them?
View Replies !
|