Jump to content

whitehat

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by whitehat

  1. Hello @all I'm having a problem creating a function for a deletion and inserting from 1 to another database table. Below are some sql query's to give you an idea of what i try to do: [code=php:0] function orders() { $mysample1 .= $db->sql_query("select * from cart inner join calendar on cart.products_id = calendar.calendar_id where cart.cookieId = '" . Getbasket_id() . "' and main_id = '$Pid'"); $mysample2 .= $db->sql_query("insert into orders(user_id, products_id, booking_date, qty) values('$uid', '$products_id', now(), '$qty')"); $mysample3 .= $db->sql_query("delete from cart where cookieId = '" . Getbasket_id() . "' and products_id = $products_id"); } return $mysamples; $content .= "<div><a href=\"#\" onclick=\"$mysamples\"><img src=\"modules/Fly_to_Basket/images/order.gif\"></div>"; [/code] on top is just to give an idea pls dont laugh lol. i really have no clue how to go on below i add the db examples if it is needed to help me out: [code] CREATE TABLE `cart` (   `basket_id` int(11) NOT NULL auto_increment,   `cookieId` varchar(50) default NULL,   `products_id` int(11) default NULL,   `booking_date` datetime NOT NULL default '0000-00-00 00:00:00',   `qty` int(11) default NULL,   PRIMARY KEY  (`basket_id`),   UNIQUE KEY `id` (`basket_id`) ) TYPE=MyISAM CREATE TABLE `orders` (   `orders_id` int(11) NOT NULL auto_increment,   `user_id` int(11) NOT NULL default '0',   `products_id` int(11) default NULL,   `booking_date` datetime NOT NULL default '0000-00-00 00:00:00',   `qty` int(11) default NULL,   PRIMARY KEY  (`orders_id`) ) TYPE=MyISAM [/code]
  2. [url=http://www.osc2nuke.com]osc2nuke[/url] maby to big for what you planing
  3. http://www.phpfreaks.com/forums/index.php/topic,102826.0.html
  4. whitehat

    Headers

    [code] <?php $your_top_code; ?> <style type="text/css"> float: right; clear: both; </style> <?php $the_rest_of_your_code [/code]
  5. on windows look in C:\WINDOWS for the php.ini find: [mail function] ; For Win32 only. SMTP = mail.yourhost.com <----use the mailserver from your isp ; For Win32 only. sendmail_from = admin@yourhost.com <-- pick 1 of your emails that runs on the isp server ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = dont forget to reboot your apache... if not now how.. just reboot windows
  6. To be hornest i cant help you with your own code However if you see this (i'm a fan of this guy's scripts) [url=http://www.dhtmlgoodies.com/scripts/ajax-poller/ajax-poller.html]Poll script[/url]
  7. you mean like this? [url=http://www.dhtmlgoodies.com/scripts/dhtmlgoodies-tree/dhtmlgoodies-tree-index.html]Folder tree[/url]
  8. I think this is what you need. [url=http://www.micronetwork.de/activecalendar/demo/examples.php]Activecalendar[/url]
  9. Hello @all i'm working on this project: http://www.inteladd.com/modules.php?name=Fly_to_Basket&file=products Currently only working in IE. As you can see when click a date , it add it to the right basket. However as you might seen it take a while before the page is loaded , this is couse it have to load 365 dates out of the db at once. I'm looking for a solution to catch only the selected month''s dates out of the db instead of all 365. This is the code i use for this page. If anyone can solve my problem with this i would much apreciate: [code] if (!defined('MODULE_FILE')) { die ("You can't access this file directly..."); } define('INDEX_FILE', true); require_once("mainfile.php"); require_once("source/activecalendar.php"); $module_name = basename(dirname(__FILE__)); get_lang($module_name); include("header.php"); global $db; $myurl= 'modules.php?name=Fly_to_Basket&file=products'; // the links url is this page $yearID=false; // GET variable for the year (set in Active Calendar Class), init false to display current year $monthID=false; // GET variable for the month (set in Active Calendar Class), init false to display current month $dayID=false; // GET variable for the day (set in Active Calendar Class), init false to display current day extract($_GET); $cal=new activeCalendar($yearID,$monthID,$dayID); $eventID="event"; // sets the name of the generated HTML class on the event day (css layout) $result = $db->sql_query("SELECT UNIX_TIMESTAMP(calendar_date) AS calendar_date, calendar_id, did FROM calendar"); OpenTable(); while ($row = $db->sql_fetchrow($result, MYSQL_BOTH)){ $mysqlDay=date("j",$row["calendar_date"]); // makes a day out of the database date $mysqlMonth=date("n",$row["calendar_date"]); // makes a month out of the database date $mysqlYear=date("Y",$row["calendar_date"]); // makes a year out of the database date $mysqlContent= $row["did"]; // gets the event content $products_id = $row["calendar_id"]; //$mysqlLink=$row[$tblLink]; // gets the event link $mysqlLink = "#\" onclick=\"addToBasket('$products_id','$calendar_name','$calendar_price');return false;"; // the name of your MySQL Table Link Field $cal->setEvent($mysqlYear,$mysqlMonth,$mysqlDay,$eventID); // set the event, if you want the whole day to be an event $cal->setEventContent($mysqlYear,$mysqlMonth,$mysqlDay,$mysqlContent,$mysqlLink); // set the event content and link ?> //here a 2 javascript files called <?php echo"<div id=\"slidingProduct_".$products_id."\"></div>"; } $cal->enableMonthNav($myurl); echo $cal->showMonth(); CloseTable(); include("footer.php"); ?> [/code]
  10. The code above comes from here: http://www.dhtmlgoodies.com/scripts/fly-to-basket/fly-to-basket.html i managed to make a shoppingcart of it can see it here on my TEST live server: http://www.inteladd.com/modules.php?name=Fly_to_Basket&file=productinfo&Pid=2 on my local i changed project and added 1 year dates as a product. Anyway i want as you already now show these dates as products in a calendar style view. Next year i just wanted to insert a new sql table for 2007.
  11. it work as i asked. However it not do the trick i thought i could do with it , it is to complex for me. [code] <?php define('INDEX_FILE', true); require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); get_lang($module_name); include("header.php"); global $db; $result = $db->sql_query("select * from calendar"); OpenTable(); while ($row = $db->sql_fetchrow($result)) {         $products_id = $row["calendar_id"];         ?> <div id="products"> <!-- DIV FOR A PRODUCT --> <div class="product_container"> <?php echo" <div id=\"slidingProduct_".$products_id."\" class=\"sliding_product\">"; ?> <?php echo $row["did"];  ?><br> <?php echo $row["calendar_price"]; ?> </div> <?php echo "<a href=\"#\" onclick=\"addToBasket('$products_id','$calendar_date','$calendar_price');return false;\"><img src=\"modules/Fly_to_Basket/images/basket.gif\"></a>"; ?> <!-- END DIV FOR A PRODUCT --> </div> <?php } ?> <a href="modules.php?name=Fly_to_Basket&file=cart">Your Shopping Cart &gt;&gt;</a> <?php CloseTable(); include("footer.php"); ?> [/code] your working example is totaly made as 1 function and including the calendar design. i'm sure it must be like that. But i cant get that running with the code i showed you. i'm so upset and feel guilt for taking your time and help.
  12. yes ofcourse i know it still require to use php date/time functions and my apolegies for let you misunderstand me. but to now use these date/time functions is where i'm stucked. And i would be greatfull if you or someone else could help me make this to work.
  13. i have this question posted in 4 different forums... i retrieve excact same questions as you now ask. pls i dont want to be offending but i'm really in a mood i could strugle some1 (lol.. i still am able to laugh abouth it.. lucky me) my whole concept is based on this methode , each day of the year fungate as a product. This is not for either reservations nore to make events. Please also not try tell me that you would still do it different then. i'm not a good php coder , then i also must work with php inside ajax,dhtml,css etc etc. I want to keep it simple for myself it is me who have to understand at the end what i made. So when i see all date/time functions and classes it is to much for me... however i'm able to trace references to a database verry well.(i think). for the loading time i not worry as i plan to load on the productpage only per month. if you want i send a pm to you with my full concept idea.
  14. NOOOO pls no classes that generate a calender directly out of php As i sayed all dates must be calculated from the dates inside the database. From these i find 1000's i really need it formatted out of the data from sql i apreciate that you want to help me this way but it isnt what i need.
  15. i changed the database to whati think make more sence to be able to retrieve , oncei know how, a better format : calendar_id  int(11)   Nee  0                (for all yearday) did  int(11)   Nee  0                (for calandarday) calendar_date  date   Nee  0000-00-00  (full date) 1,    1, '2006-01-01' 2,    2, '2006-01-02' 3,    3, '2006-01-03' 4,    4, '2006-01-04' 5,    5, '2006-01-05' 6,    6, '2006-01-06' 7,    7, '2006-01-07' 8,    8, '2006-01-08' 9,    9, '2006-01-09' 10, 10, '2006-01-10' 11, 11, '2006-01-11' 12, 12, '2006-01-12' xxx 244, 1, '2006-09-01'
  16. this is for date differences for a booking/reservation? what i ment was more like this: September 2006 Mon Tue Wed Thu Fri Sat Sun     1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
  17. Hello @all I'm working on a project to use database info as a calendar for example : Table calendar calendar_id  int(11)  Nee  0                calendar_date  date  Nee  0000-00-00  calendar_id|calendar_date 1, '2006-01-01' 2, '2006-01-02' 3, '2006-01-03' 4, '2006-01-04' 5, '2006-01-05' 6, '2006-01-06' 7, '2006-01-07' 8, '2006-01-08' 9, '2006-01-09' 10, '2006-01-10 11, '2006-01-11 12, '2006-01-12 until 365 I really tryed and looked at some date/time functions however all of them is to create calendar withouth setted dates from a database  ::) I really hope someone can help me out as i'm already strugling with it over a week and i cant go on and sleep anymore. It wont take long and i start crying as a girl
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.