Jump to content

SalientAnimal

Members
  • Posts

    366
  • Joined

  • Last visited

Everything posted by SalientAnimal

  1. What I currently have in place is a PHP calendar which uses JSON to populate the events from a MySQL database. So what I am hoping to do is the following: Create Events In The Calendar (Similar to what one would see in Outlook) Each Event will have: A Start Date A End Date (Milestone) Event Name Some Events may not only have the End Date as a Milestone, but could have Milestones, say, two days into the event. So I would like the Calendar to generate Notifications based on the Milestones of each event. So the should receive a e-mail, sms or both, notify them of the status of a particular event at particular milestones. All milestones will be defined by a DATETIME field. (I will create multiple DATETIME fields in the database for this). I'm not sure if this is helps with what I am looking for?
  2. Hi All, So I have been introduced to JSON for the irst time and managed to build a database driven events calendar using JSON. I would like to take this to the next step now, where notifications get sent from the calendar to a list of recipients. This method of comunication would have to happen in the following ways: 1. E-Mail 2. SMS 3. Updates for each milestone reached in a particular event. I am thinking that I would probably have to change the structure of my database structure to allow multiple milestone dates, events, etc. But I am not sure if this would be best practice and if anyone could maybe give a better solution? Thanks...
  3. What do I need to change in the php.ini file? I've lokoed through it, but I'm not sure what to configure/change. The Webserver (XAMPP) is installed on E:\XAMPP\.....(The entire package is then installed in the XAMPP default locations) I want the MySQL instance to run on F:\MySQL\....
  4. Hi All, I have installed a webservice using XAMPP. However I would like my MySQL directory to lie on a different hard drive, hence I installed MySQL prior to installing XAMPP. However I am now having issues access MySQL/Starting the service. Can someone tell me how I can point XAMPP to the correct location for my prefered MySQL installtion directory? Thanks.
  5. Hi All, So I know best practice is to list your codethat you are using and then get guidance from there, however right now, I don't even know where to start, so I can't even begin to write my code I would like some guidance on where it would be best to start. I have a set of data, extracted from a MySQL database into Excel. This data then needs to be randomly assigned to 5 different users based on their ranking. So as an example I have 100 records all ranked as: 15 Bronze, 50 Silver, 20 Gold, 15 Platinum. The users are ranked 1 - 5. However you could have two users equally ranked. So lets assume: User 1 = Rank 1 User 2 = Rank 2 User 3 = Rank 2 User 4 = Rank 4 User 5 = Rank 5 All the users need to be assigned the same amount of records (20), but User 1 needs to have more Platinum records assigned to them than any of the other users. User 5 needs to have more Bronze records assigned to them than the other users. So can anyone suggest a way of doing this? Can I do it with a SQL query? OR Would it be easier to do it with a marco? Thanks
  6. Ok I will have to give you two sets of code, as this is happening, both with the original submit of the form, as well as with the udpate of the form: This is my submit code/script <?php $con = mysql_connect("localhost","root","MYPASSWORD"); if (!$con) { die('Could not connect: ' . mysql_error()); } if ( $_POST['owner'] == "User1" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[email]"; $subject = "New Request - Reference Number $_POST[reference]_$_POST[request_type]"; $message = " Hi $_POST[owner] A new $_POST[request_type] request has been logged to your name. Please log onto the drc portal via the link http://10.249.135.30 and action the request accordingly. If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. Request Details: $_POST[request_details] "; } else if ( $_POST['owner'] == "User2" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[email]"; $subject = "New Request - Reference Number $_POST[reference]_$_POST[request_type]"; $message = " Hi $_POST[owner] A new $_POST[request_type] request has been logged to your name. Please log onto the drc portal via the link http://10.249.135.30 and action the request accordingly. If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. Request Details: $_POST[request_details] "; } else if ( $_POST['owner'] == "User3" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[email]"; $subject = "New Request - Reference Number $_POST[reference]_$_POST[request_type]"; $message = " Hi $_POST[owner] A new $_POST[request_type] request has been logged to your name. Please log onto the drc portal via the link http://10.249.135.30 and action the request accordingly. If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. Request Details: $_POST[request_details] "; } else if ( $_POST['owner'] == "User4" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[email]"; $subject = "New Request - Reference Number $_POST[reference]_$_POST[request_type]"; $message = " Hi $_POST[owner] A new $_POST[request_type] request has been logged to your name. Please log onto the drc portal via the link http://10.249.135.30 and action the request accordingly. If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. Request Details: $_POST[request_details] "; } else if ( $_POST['owner'] == "User5" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[email]"; $subject = "New Request - Reference Number $_POST[reference]_$_POST[request_type]"; $message = " Hi $_POST[owner] A new $_POST[request_type] request has been logged to your name. Please log onto the drc portal via the link http://10.249.135.30 and action the request accordingly. If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. Request Details: $_POST[request_details] "; } else if ( $_POST['owner'] == "User6" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[email]"; $subject = "New Request - Reference Number $_POST[reference]_$_POST[request_type]"; $message = " Hi $_POST[owner] A new $_POST[request_type] request has been logged to your name. Please log onto the drc portal via the link http://10.249.135.30 and action the request accordingly. If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. Request Details: $_POST[request_details] "; } mail($to, $subject, $message); mysql_select_db("drc", $con); $sql="INSERT INTO drc_portal (username , email , reference , owner , request_type , request_details , status ) VALUES ('$_POST[username]' ,'$_POST[email]' ,'$_POST[reference]_$_POST[request_type]' ,'$_POST[owner]' ,'$_POST[request_type]' ,'$_POST[request_details]' ,'Open' )"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } else { echo "<b><font color='white' face='segoe' size='2'>Your reference number is: $_POST[reference]_$_POST[request_type]. Please record this number for future reference.</b>"; include "redirect_drc_portal.html"; } mysql_close($con) ?> This is my update code/script <?php session_start(); $conn = @mysql_connect("localhost","root","MYPASSWORD") or exit("Could not establish a connection to MySQL Server. mysql_error()"); $select = @mysql_select_db("mydatabase1",$conn) or exit("Could not select the appropriate database for this operation. mysql_error()"); if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $name = $_COOKIE['ID_my_name']; $pass = $_COOKIE['Key_my_site']; $check = @mysql_query("SELECT * FROM userinfo WHERE username='$username'") or die("Failed to execute SQL Statement."); while($info = mysql_fetch_array($check)) { if($pass != $info['password']) { header("Location: login.php"); } else{ } } } ?> <?php $con = mysql_connect("localhost","root","MYPASSWORD"); if (!$con) { die('Could not connect: ' . mysql_error()); } if ( $_POST['ud_owner'] == "User1" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[ud_email]"; $subject = "Reference Number $_POST[ud_reference]"; $message = " Hi $_POST[ud_owner] Reference Number $_POST[ud_reference] has been $_POST[ud_reason]. Please log onto the drc portal via the link http://10.249.135.30 to ensure that all information has been updated correctly. The request status is: $_POST[ud_status] If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. "; } else if ( $_POST['ud_owner'] == "User2" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[ud_email]"; $subject = "Reference Number $_POST[ud_reference]"; $message = " Hi $_POST[ud_owner] Reference Number $_POST[ud_reference] has been $_POST[ud_reason]. Please log onto the drc portal via the link http://10.249.135.30 to ensure that all information has been updated correctly. The request status is: $_POST[ud_status] If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. "; } else if ( $_POST['ud_owner'] == "User3" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[ud_email]"; $subject = "Reference Number $_POST[ud_reference]"; $message = " Hi $_POST[ud_owner] Reference Number $_POST[ud_reference] has been $_POST[ud_reason]. Please log onto the drc portal via the link http://10.249.135.30 to ensure that all information has been updated correctly. The request status is: $_POST[ud_status] If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. "; } else if ( $_POST['ud_owner'] == "User4" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[ud_email]"; $subject = "Reference Number $_POST[ud_reference]"; $message = " Hi $_POST[ud_owner] Reference Number $_POST[ud_reference] has been $_POST[ud_reason]. Please log onto the drc portal via the link http://10.249.135.30 to ensure that all information has been updated correctly. The request status is: $_POST[ud_status] If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. "; } else if ( $_POST['ud_owner'] == "User5" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[ud_email]"; $subject = "Reference Number $_POST[ud_reference]"; $message = " Hi $_POST[ud_owner] Reference Number $_POST[ud_reference] has been $_POST[ud_reason]. Please log onto the drc portal via the link http://10.249.135.30 to ensure that all information has been updated correctly. The request status is: $_POST[ud_status] If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. "; } else if ( $_POST['ud_owner'] == "User6" ) { $to = "e-mail1@domain.co.za,email2@domain.co.za,$_POST[ud_email]"; $subject = "Reference Number $_POST[ud_reference]"; $message = " Hi $_POST[ud_owner] Reference Number $_POST[ud_reference] has been $_POST[ud_reason]. Please log onto the drc portal via the link http://10.249.135.30 to ensure that all information has been updated correctly. The request status is: $_POST[ud_status] If this request was logged to the incorrect owner, please reassign it to the correct owner and advise all the parties concerned that you have done so. "; } mail($to, $subject, $message); mysql_select_db("drc", $con); ?> <?php $ud_reference=$_POST['ud_reference']; $ud_sys_date=$_POST['ud_sys_date']; $ud_owner=$_POST['ud_owner']; $ud_username2=$_POST['ud_username2']; $ud_request_type=$_POST['ud_request_type']; $ud_request_details=$_POST['ud_request_details']; $ud_status=$_POST['ud_status']; $ud_reason=$_POST['ud_reason']; if ($ud_reference == "") echo "! No identifier retrieved"; else echo "<p>Updating record: $ud_reference"; //clean up any carriage returns etc $ud_reference = preg_replace("/[\n\r]*/","",$ud_reference); $ud_sys_date = preg_replace("/[\n\r]*/","",$ud_sys_date); $ud_owner = preg_replace("/[\n\r]*/","",$ud_owner); $ud_username2 = preg_replace("/[\n\r]*/","",$ud_username2); $ud_request_type = preg_replace("/[\n\r]*/","",$ud_request_type); $ud_request_details = preg_replace("/[\n\r]*/","",$ud_request_details); $ud_status = preg_replace("/[\n\r]*/","",$ud_status); $ud_reason = preg_replace("/[\n\r]*/","",$ud_reason); $host = "localhost"; $login_name = "root"; $password = "MYPASSWORD"; $link = mysql_connect("$host","$login_name","$password"); if (!$link) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db('drc', $link); if (!$db_selected) { die ('Can\'t use drc: ' . mysql_error()); } $query = "UPDATE drc_portal SET sys_date='$ud_sys_date' , date_modified = NOW() , username2='$ud_username2' , owner='$ud_owner' , request_type='$ud_request_type' , request_details='$ud_request_details' , status='$ud_status' WHERE reference='$ud_reference'"; mysql_query($query) or die('mysql error ' . mysql_error() . ' in query : ' . $query); echo "<BR>Record ⇒ $ud_reference sucessfuly updated<BR><BR>"; //echo $query; include "update_drc_portal.html"; ?>
  7. Hi All, I have a PHP form which submits to a MySQL Database table as well as sends of an e-mail to up 3 users. The problem I have having is that once you click on submit, the form takes up to 10seconds before actually submitting. Can anyone think of any reasons for this? Thanks.
  8. Ok, so slowly but surely, I am making progress on this. And I have been able to get my list to be returned from the database. The problem is that is it returning everything, rather than returning results based on the calculation. Here's what I have: $result2 = mysql_query("SELECT * FROM handset_stock GROUP BY handset"); $handset = mysql_fetch_array($result2); And then to return the list: <td width="34%" align="right" valign="middle"><strong>Handset Sold :</strong></td> <td width="66%" align="left" valign="middle"><select name="ud_handset_sold" id="ud_handset_sold"> <option value="<?php echo "$handset_sold"?>">-- Select the Handset Sold --</option> <?php while ($handset = mysql_fetch_array($result2)){ ?> <option value="<?php $handset['handset']; ?>"><?php echo $handset['handset'];?></option> <?php } ?> </select> </td></tr> So yes that works, but I'm not able to use the result set that I want to use. The result that I want to use will be from the following query: $result2 = mysql_query("SELECT handset_stock.handset , handset_stock.total_stock , COALESCE( handset_stock.total_stock - ( SELECT COUNT( sales.phone_deals ) AS 'handset_stock' FROM sales WHERE sales.phone_deals = handset_stock.handset AND DATE(sys_date) = CURDATE() GROUP BY phone_deals ) , handset_stock.total_stock) AS Balance FROM handset_stock WHERE Balance >= '1' GROUP BY handset"); $handset = mysql_fetch_array($result2); Oh and the problem with the query above is that the where clause on the balance field does not seem to be working. How do I get it to display only the handsets if there is 1 or more left?
  9. Ok, so I think I might have a some progress on coding this, but I'm not sure if I at all on the right, please any advise will be appreciated. So at the top of my paeg I have the folowing: $result2 = mysql_query("SELECT handset_stock.handset , handset_stock.total_stock , COALESCE( handset_stock.total_stock - ( SELECT COUNT( sales.phone_deals ) AS 'handset_stock' FROM sales WHERE sales.phone_deals = handset_stock.handset AND DATE(sys_date) = CURDATE() GROUP BY phone_deals ) , handset_stock.total_stock) AS Balance FROM handset_stock GROUP BY handset"); And then as my select option on the form I have this: <tr> <td width="34%" align="right" valign="middle"><strong>Handset Sold :</strong></td> <select name="ud_handset_sold"><?php while($handset = mysql_fetch_array( $result2 ))?> <option value="<?php echo $handset[handset];?>"><?php echo $handset['handset'];?></option> </select> </td></tr> Now my page isn't displaying, and I'm getting an HTTP 500 Internal Server Error. What am I doing wrong? Oh, and the reason the query is showing as $result2 is because I have two queries running on this page. The first one, collects information from another table on the database, and then pre-populates the form, the only field that is not populated is the handset field, hence the second query to look up for stock in the table.
  10. Hi All, I have a bit of a complex question. (Well not sure how complex it is ) But basically here's what I want to do. I want my PHP form to select the values for the drop-down from the database table. This list however needs to update real-time. Here's what I mean (Hope it makes sense): Every morning I get a list of stock that is available: This stock is uploaded into the handset_stock table During the coarse of the day the availablity of stock changes according to what is sold. Each item sold gets captured seperately. I want my drop-down list on my form to be populated by doing the following: Count All the Stock of a particular type sold Subtract the stock sold from the list of stock uploaded in the morning Once the stock has sold out, this option must be removed from the list At the moment I have the query below which displays on a screen what stock is available SELECT handset_stock.handset , handset_stock.total_stock , COALESCE( handset_stock.total_stock - ( SELECT COUNT( sales.phone_deals ) AS 'handset_stock' FROM sales WHERE sales.phone_deals = handset_stock.handset AND DATE(sys_date) = CURDATE() GROUP BY phone_deals ) , handset_stock.total_stock) AS Balance FROM handset_stock GROUP BY handset I think what might need to happen here is that this has to become a temporary table? But I'm not sure. Can anyone tell me how to have my drop-down list populated by the result of this query?
  11. Sorry I placed this under the wrong forum, how do I move it?
  12. Hi All, I have a bit of a complex question. (Well not sure how complex it is ) But basically here's what I want to do. I want my PHP form to select the values for the drop-down from the database table. This list however needs to update real-time. Here's what I mean (Hope it makes sense): Every morning I get a list of stock that is available: This stock is uploaded into the handset_stock table During the coarse of the day the availablity of stock changes according to what is sold. Each item sold gets captured seperately. I want my drop-down list on my form to be populated by doing the following: Count All the Stock of a particular type sold Subtract the stock sold from the list of stock uploaded in the morning Once the stock has sold out, this option must be removed from the list At the moment I have the query below which displays on a screen what stock is available SELECT handset_stock.handset , handset_stock.total_stock , COALESCE( handset_stock.total_stock - ( SELECT COUNT( sales.phone_deals ) AS 'handset_stock' FROM sales WHERE sales.phone_deals = handset_stock.handset AND DATE(sys_date) = CURDATE() GROUP BY phone_deals ) , handset_stock.total_stock) AS Balance FROM handset_stock GROUP BY handset I think what might need to happen here is that this has become a temporary table? But I'm not sure. Can anyone tell me how to have my drop-down list populated by the result of this query?
  13. Hi All, I have a very simple question. My table consists of two field, namely Model and Quantity. I need a SQL that will add the values in the Quantity field if the values in the Model field are the same. EG. Model Quantity CDM198 10 CDM198 19 CCD190 10 In the above example, I want the information to be populated into a new table, or even to replace the existing table with the sumed values: i.e. Model Quantity CDM198 29 CCD190 10 Thanks.
  14. Sadly, my PHP knowledge is still extremely new. I've had no formal training it, and everything I know is self taught from research and talknig to one or two other people. So basically, I don't know what best practice is to get best results.
  15. Hi All, I'm busy creating a log system to keep track of tasks and when the need to be completed. This question is based on some of my questions I have had in the past and I have used all the smaller solutions to get from Point A-Point B.... Now I just need to get to the next point. The problems I am experiencing are as follows: 1. I think my code is a bit "too much", and feel it can be simplified to speed up the processing of each query. Does anyone have suggestions? 1.1 Sorry a question I left out, so I'm putting it in here before going onto the code stuff. How do you insert a wildcard in PHP? As in my example $_POST['organogram'] == "%" the % doesn't seem to work. 2. My form submits to multiple tables, however, I need to it to only submit to each of the tables individually provided they have matched certain criteria... 2.1 eg. My form has 6 fields - Field 1,2,3 apply to table 1 - Field 4 applies to table 2 - Field 5 applies to table 3 - Field 6 is the randomly generated reference number 2.2 If Fields 1,2,3,4 have been completed, the information must be written to tables 1 and 2 only (currently all the tables has the reference number field as a unique identifier) 2.3 If all the fields are completed then the information must be written to all the tables. 2.4 If only field 2 is completed then the information must still be written to only table 1. Here is my code that I have having a problem with cleaning it up: $con = mysql_connect("localhost","root","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } if ( $_POST['pc'] == "Desktop" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['pc'] == "Laptop" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['champ_portal'] == "Champ Portal" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['email'] == "E-Mail" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['phone'] == "Hard Phone" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['phone'] == "Soft Phone" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['lan'] == "LAN" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['g_drive'] == "G:" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['h_drive'] == "H:" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" | $_POST['distribution'] == "Yes" & $_POST['access_card'] == "Access Card" & $_POST['organogram'] == "%" ) { $to = 'myemail@mydomain.co.za'; $subject = "New Change Request - Reference Number $_POST[reference]_$_POST[lname]"; $message = " New Churn Request - $_POST[churn_type]. Action Required A Churn request has been logged for $_POST[fname] $_POST[lname]. Please log onto the churn management system via the link http://10.249.135.30 and action the request accordingly. "; } else if ( $_POST['pc'] == "Desktop" & $_POST['access_card'] == "Access Card" | $_POST['pc'] == "Laptop" & $_POST['access_card'] == "Access Card" | $_POST['champ_portal'] == "Champ Portal" & $_POST['access_card'] == "Access Card" | $_POST['email'] == "E-Mail" & $_POST['access_card'] == "Access Card" | $_POST['phone'] == "Hard Phone" & $_POST['access_card'] == "Access Card" | $_POST['phone'] == "Soft Phone" & $_POST['access_card'] == "Access Card" | $_POST['lan'] == "LAN" & $_POST['access_card'] == "Access Card" | $_POST['g_drive'] == "G:" & $_POST['access_card'] == "Access Card" | $_POST['h_drive'] == "H:" & $_POST['access_card'] == "Access Card" | $_POST['distribution'] == "Yes" & $_POST['access_card'] == "Access Card" ) { $to = 'myemail@mydomain.co.za'; $subject = "New Change Request - Reference Number $_POST[reference]_$_POST[lname]"; $message = " New Churn Request - $_POST[churn_type]. Action Required A Churn request has been logged for $_POST[fname] $_POST[lname]. Please log onto the churn management system via the link http://10.249.135.30 and action the request accordingly. "; } else if ( $_POST['pc'] == "Desktop" & $_POST['organogram'] == "%" | $_POST['pc'] == "Laptop" & $_POST['organogram'] == "%" | $_POST['champ_portal'] == "Champ Portal" & $_POST['organogram'] == "%" | $_POST['email'] == "E-Mail" & $_POST['organogram'] == "%" | $_POST['phone'] == "Hard Phone" & $_POST['organogram'] == "%" | $_POST['phone'] == "Soft Phone" & $_POST['organogram'] == "%" | $_POST['lan'] == "LAN" & $_POST['organogram'] == "%" | $_POST['g_drive'] == "G:" & $_POST['organogram'] == "%" | $_POST['h_drive'] == "H:" & $_POST['organogram'] == "%" | $_POST['distribution'] == "Yes" & $_POST['organogram'] == "%" ) { $to = 'myemaipart2l@mydomain.co.za'; $subject = "New Change Request - Reference Number $_POST[reference]_$_POST[lname]"; $message = " New Churn Request - $_POST[churn_type]. Action Required A Churn request has been logged for $_POST[fname] $_POST[lname]. Please log onto the churn management system via the link http://10.249.135.30 and action the request accordingly. "; } else if ( $_POST['pc'] == "Desktop" | $_POST['pc'] == "Laptop" | $_POST['champ_portal'] == "Champ Portal" | $_POST['email'] == "E-Mail" | $_POST['phone'] == "Hard Phone" | $_POST['phone'] == "Soft Phone" | $_POST['lan'] == "LAN" | $_POST['g_drive'] == "G:" | $_POST['h_drive'] == "H:" | $_POST['distribution'] == "Yes" ) { $to = 'myemail@mydomain.co.za,mail2@mydomain.co.za; $subject = "New Change Request - Reference Number $_POST[reference]_$_POST[lname]"; $message = " New Churn Request - $_POST[churn_type]. IT Action Required A Churn request has been logged for $_POST[fname] $_POST[lname]. Please log onto the churn management system via the link http://10.249.135.30 and action the request accordingly. "; } else if ( $_POST['access_card'] == "Access Card" ) { $to = 'myemail@mydomain.co.za'; $subject = "New Change Request - Reference Number $_POST[reference]_$_POST[lname]"; $message = " New Churn Request - $_POST[churn_type]. Forensics Action Required A Churn request has been logged for $_POST[fname] $_POST[lname]. Please log onto the churn management system via the link http://10.249.135.30 and action the request accordingly. "; } else if ( $_POST['organogram'] == "%" ) { $to = 'myemail@mydomain.co.za'; $subject = "New Change Request - Reference Number $_POST[reference]_$_POST[lname]"; $message = " New Churn Request - $_POST[churn_type]. Organogram Action Required A Churn request has been logged for $_POST[fname] $_POST[lname]. Please log onto the churn management system via the link http://10.249.135.30 and action the request accordingly. "; } if ( $_POST['pc'] == "Desktop" & $_POST['organogram'] == "%" | $_POST['pc'] == "Laptop" & $_POST['organogram'] == "%" | $_POST['champ_portal'] == "Champ Portal" & $_POST['organogram'] == "%" | $_POST['email'] == "E-Mail" & $_POST['organogram'] == "" | $_POST['phone'] == "Hard Phone" & $_POST['organogram'] == "%" | $_POST['phone'] == "Soft Phone" & $_POST['organogram'] == "%" | $_POST['lan'] == "LAN" & $_POST['organogram'] == "%" | $_POST['g_drive'] == "G:" & $_POST['organogram'] == "%" | $_POST['h_drive'] == "H:" & $_POST['organogram'] == "%" | $_POST['distribution'] == "Yes" & $_POST['organogram'] == "%" ) { $to = 'myemail@mydomain.co.za'; $subject = "New Change Request - Reference Number $_POST[reference]_$_POST[lname]"; $message = " New Churn Request - $_POST[churn_type]. Action Required A Churn request has been logged for $_POST[fname] $_POST[lname]. Please log onto the churn management system via the link http://10.249.135.30 and action the request accordingly. "; }
  16. Hi Basically what I am checking for in the PHP code is if there is any value captured in the Organogram field. If there is and kind of text captured in this field the "Owner" of organogram must be notified via e-mail that an action has been been logged for them to attend to. If however it is left blank, then they must not recieve anything. And the e-mailer must only notify the area's that have actions to attend to.
  17. I am using the upload function from PHPMyAdmin, so I am not running any code for the upload.
  18. Hi All, I am trying to upload data from and excel file into a MySQL database, however as soon as I am uploading more than 10,000 records the upload fails. This is a bit of a probelm as the data I need to upload consists of 190,000+ records. I have tried increase the maximum allowed file size to 100MB, even though the file I am uploading is less than 10MB. No error message is being displayed so I can't even provide you with this, as the upload session timesout and I get the "Internet Explorer cannot display the webpage" message. Thanks
  19. I have to be honest, I'm not entirely sure how to use what you have suggested. Sorry, everything I have done here is self taught and a lot of trial and error so getting everything to wrok together is a bit of a challenge.
  20. I was being stupid here, managed to find my error.
  21. Does anyone here use PHPGraphLib? I'm using this on my page to display graphs, but when running a query to get the data, I only get one bar on my graph, despite the fact that I am grouping the information by username. Any help? My Query Collecting Data: $sql="SELECT *, COUNT(*) AS 'queries' FROM product WHERE status = 'Open' GROUP BY username "; $result = mysql_query($sql) or die('Query failed: ' . mysql_error()); if ($result) { while ($row = mysql_fetch_assoc($result)) { $status=$row["Open Query"]; $count=$row["queries"]; //add to data array $dataArray[$status]=$count; } } I've run the query in PHPMyAdmin and I get two sets of data.
  22. You could also set a session duration which would terminate their current session if they are inactive for a given period of time.
  23. The Javascript validation is being done on the form on the required fields. The check I am now looking at doing is once all the form information has been submitting and is being processes by the PHP script. Basically what happens here is the following: 1. Data is being captured to 4 different tables in a given database, also dependant on which fields were selected on the form... 2. Depending on the fileds selected/completed on the form only certain parties need to recieve the e-mail. If I work through everything that btherl has been saying I know I'm on the right track, and the other functions appear to be working. The problem is because the organogram field is a free text field and not a predefined field so the validation determaining the e-mail doesn't have a set entry to look for, hence why I would need to use some kind of wildcard check.
  24. Yes, I think that would be the best way to explain it. If the text field is empty then the owner of the organogram should not get an e-mail, however if it does have text in it then they must get and e-mail. I spent the whole day yesterday working on the mailing code validations, and I think I might have too much code, but I will post that once I get this component working. Taking baby steps here :-).
×
×
  • 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.