Jump to content

angelicaescobar

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About angelicaescobar

  • Birthday 08/01/1979

Profile Information

  • Gender
    Not Telling

angelicaescobar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello !! I am new programing PHP, and slow to learn... please i need help.... I hope you can. this is my case: I have a date that is in an array in this posistion: $bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"] and i want to compare it with the actual time, and if it is bigger than one hour appears one message...... but it doesnt work :-\ I have the idea to use the time() like this: time($bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"]) but the time that geve me back is the system time, not the time that is storage inside the array... ??? then i have this idea.. but still do not works.... . $date1 = $bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"]; $date2 = time(); $dateArr = explode(".",$date1); $date1Int = mktime(0,0,0,$dateArr[1],$dateArr[2],$dateArr[0]) ; $dif = $date2-$date1/60/60/60; if (isset($bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))])){ //IF There is a booking and the time of request is smaller than 1 hour, con make changes if $dif > 3600{ echo "...make something..." } //IF There is a booking and the time of request is bigger than 1 hour, NO changes can made else { echo ":....Say other thing.." } } Where is the error?? Why i can compare the dates?? Why if i use the time() it gives me back other time?? THANKS FOR YOUR HELP!!!
  2. Hello again!! I need your help.. I hope you can help me. this is my case: I hape a date that is in an array in this posistion: $bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"] and i want to compare it with the actual time, (unixtime) and if it is bigger than one hour appears one message...... but it doesnt work I have the idea to use the time() like this: time($bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"]) but the time that geve me back is the system time, not the time that is storage inside the array... then i have this idea.. but still not works..... $date1 = $bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"]; $date2 = time(); $dateArr = explode(".",$date1); $date1Int = mktime(0,0,0,$dateArr[1],$dateArr[2],$dateArr[0]) ; $dif = $date2-$date1/60/60/60; if (isset($bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))])){ //IF There is a booking and the time of request is smaller than 1 hour, con make changes if $dif > 3600{ echo "...make something..." } //IF There is a booking and the time of request is bigger than 1 hour, NO changes can made else { echo ":....Say other thing.." } } THANKS FOR YOUR HELP!!!!!
  3. Thanks.. Any sugestion .. where can i find a example??
  4. UPS!! Houston...!!! OK OK!! No panic!!! So, if i need a javascript, that means that in the javascrip i will make the comparison of booths dates??
  5. HI! Sorry im new here, and i have this problem... I have this : $bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"]; where bookings is an array... The value that i got is a date, but i dont know how to manage it. Because i want to compare this value with the actual time. If the difference is bigger than one hour, i give a mesage telling something. The point is that i dont know what to do, because isf i make something like $dr=$bookings[$i-1][date("d.m.Y",$timestampOfMonday+($x*86400))]["daterequest"]; echo $dr will give me the actual time, not the one that i have stored on daterequest. HELP! HELP!!! please!! Thank you
  6. ??? Hi friends!, I am working in a php and oracle project, and i am new, a rockie. The project is a scheduler, for an office. Simple: the epmloyees habe to say in with schedule wants to work ((four blocks of working-hours), and it goes to register in a database. I am in the part of booking, and i have problems here: i dont know how to make, if one date is already taked, and tell to the user. I will like to give in the IU the posibility to choose the block (work schedule) of the day with radio buttons. I want to check before in the database wich block is occupied, and make to appear 'no-available' the radio buttons. As you can see in my code i am new... please , be patient with me... :-\ Thanks!!! here is my code... <?php define("FileName", "submit.php"); include_once("errorhandler.inc.php"); include_once(RelativePath . "/headerweek.php"); ?> <HTML> <HEAD> <link rel="stylesheet" type="text/css" href="data/css/default.css" /> </HEAD> <BODY> <?php $bnum = $_POST["bnum"]; //receive the block-schedule value $username = $_SERVER["REMOTE_USER"]; //Obtain the user_id extract($_GET); //Connect to DB $conn=ocilogon('mydatas','****','datas'); $id_sentencia = ociparse($conn); ociexecute($id_sentencia, OCI_DEFAULT); ocifreestatement($id_sentencia); //Connected ?> <table class="Header" cellspacing="0" cellpadding="0" border="0"> <tr> <br> <td class="HeaderLeft"><img src="Styles/Office/Images/Spacer.gif" border="0"></td> <th> <center><?php echo(" Confirmation for: ".$username) ?> <?php echo (" Work on: ".$dayID." / " .$monthID." / ".$yearID)?> <?php echo ("Block Number: " .$bnum) ?> </center> </th> <td class="HeaderRight"><img src="Styles/Office/Images/Spacer.gif" border="0"></td> </tr> </table> <?php //convert the picked date in a string, then can make the comparation and work with it. $datum="$yearID-$monthID-$dayID"; //Check if the date and block is already taked $checking = "SELECT count(*) from booking where (datebook like to_date('$datum','YYYY MM DD')) and (block_num like ($bnum))"; $id_statement = ociparse($conn,$checking) or die ("parse error"); ociexecute($id_statement, OCI_DEFAULT) or die ("execute error"); ocifreestatement($id_statement); // here muss verify if the block is ocupied //Insert the selected-block in the schedule $insertar = "INSERT INTO booking (booking_id, user_id, block_num, datebook, cal_id) VALUES (booking_seq.NEXTVAL,'$username',$bnum,to_date('$datum','YYYY MM DD'),1)"; $id_selection= ociparse($conn,$insertar) or die ("parse error"); ociexecute($id_selection, OCI_DEFAULT) or die ("execute error"); ocifreestatement($id_selection); // print the head of the grid-schedule day include_once("gridschedule.php"); // print the workers of the day (date picked). $consulta = "SELECT user_id, to_char(datebook, 'YYYY MM DD'), block_num from blockschedule.booking where datebook like to_date('$datum','YYYY MM DD')"; $id_sentencia = ociparse($conn,$consulta); ociexecute($id_sentencia, OCI_DEFAULT); while (ocifetchinto($id_sentencia,$row=null, OCI_ASSOC)){ print '<table border="1">'; print'<tr>'; foreach($row as $item) { print "<td>$item</td>"; } print '</tr>'; print '</table>'; } ocifreestatement($id_sentencia); ?> <?php ocicommit($conn); ocilogoff($conn); set_error_handler("eh"); include_once(RelativePath . "/footer.php"); ?> </BODY> </HTML>
×
×
  • 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.