Jump to content

chriscloyd

Members
  • Posts

    488
  • Joined

  • Last visited

Everything posted by chriscloyd

  1. Try this <?php $host = "localhost"; $username = "root"; $password = "root"; $db_name = "test2.0"; $tbl_name = "permohonan"; mysql_connect("$host", "$username", "$password") or die("cannot connect"); mysql_select_db("$db_name") or die("cannot select DB"); if (isset($_POST['submit'])) { $Jabatan = mysql_real_escape_string($_POST['Jabatan']); $unit = mysql_real_escape_string($_POST['unit']); $lain2 = mysql_real_escape_string($_POST['lain2']); $nama_pemohon = mysql_real_escape_string($_POST['nama_pemohon']); $destinasi = mysql_real_escape_string($_POST['destinasi']); $tujuan = mysql_real_escape_string($_POST['tujuan']); $maklumat_ = mysql_real_escape_string($_POST['maklumat_']); $datedepart_ = mysql_real_escape_string($_POST['datedepart_']); $timedepart_ = mysql_real_escape_string($_POST['timedepart_']); $datearrive_ = mysql_real_escape_string($_POST['datearrive_']); $timearrive_ = mysql_real_escape_string($_POST['timearrive_']); $query1 = mysql_query("INSERT INTO permohonan VALUES(NULL,'$Jabatan','$unit','$lain2','$nama_pemohon','$destinasi','$tujuan','$maklumat_','$datedepart_','$timedepart_,'$datearrive_',$timearrive_')"); if ($query1) { header("location : reservationform.php"); } else { echo mysql_errno() . ": " . mysql_error() . "\n"; } } ?>
  2. I agree with Psycho, but it does not have to be a cron job, if you do not want to use one. You could do it on login. When the user logs in and if it is the first login of the day you can show all available job matches/alerts for that user.
  3. Hello, I would create another row in your member table called subscription_id or what ever you would name the subscriptions table. Then in the subscriptions table just create the rows for the id, name, description (if one), term (months, years), cost, renewal automatically, signup_date, end_date? Some of the things I add to the new table. Then just do your magic.
  4. var x = "#inputList", y = 2; $(add_button).on('click', function(e) { e.preventDefault(); $(x + y).css('display','inline); console.log($(x + y)); //this should show you if you have the right object check your console y++; return false; });
  5. Well hello this is easy if you use jquery.... A couple of things $(document).ready(function() { var appendEle = $("#updateFixture"); $("#fixtures").on('change', function() { appendEle.html(""); var stage = $(this).val(); $.post('getFixtures.php', {stage: stage}, function(data) { var obj = $.parseJSON(data); $.each(obj, function(index, fixture) { var newEle = $("<div></div>"); var goalsfor = $('<label>' + fixture.hometeam + ' Goals</label><input type="text" id="goalsfor_' + fixture.id + '" name="goalsfor_' + fixture.id + '" value="' + fixture.goalsfor + '" />'); var goalsagainst = $('<label>' + fixture.awayteam + ' Goals</label><input type="text" id="goalsagaint_' + fixture.id + '" name="goalsagaint_' + fixture.id + '" value="' + fixture.goalsagaint_+ '" />'); goalsfor.append(newEle); goalsagainst.append(newEle); newEle.append(appendEle); }); }); }); $("#saveButton").on('click', function() { $.post('saveFixtures.php', $("#contactForm").serialize(), function(data) { if(data == "success") { //do what you want } else { //do what you want } }); }); }); That is the jquery file you will need two other files to save the changes and update I can help with that too if you need
  6. function multi_array_permutations($arrays) { $loops = 1; foreach ($arrays as $array) { $loops *= count($array); } for ($i = 0; $i < $loops; $i++) { $product = 1; for ($j = 0; $j < count($arrays); $j++) { $product *= count($arrays[$j]); print($arrays[$j][$i/($loops/$product) % count($arrays[$j])]); } print(PHP_EOL); } }
  7. What exactly are you trying to do with this array?
  8. Fastsol, you know he was trying to show an example so I will help him with that array(array(1,1,1,1),array(2,2,2,2),array(3,3,3,3),array(4,4,4,4));
×
×
  • 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.