Hello,
I have a PHP script that stores data with arrays, and contains "send-email" functions. (for a form).
I wanted to add the possibility to my client to add his own data using CouchCMS, but it's not working. My pages are loading forever and then it gives an error saying the page loaded for too long so it stopped. Some sort of infinite loop I guess?
Here's my code :
I haven't put all the "cms:show" elements yet, but still, I tried just using the "cms:show k_page_title" and nothing shows up. I mean, the page don't even load. Any idea what I am doing wrong here?
By the way, I am embedding this file (that is named "data.php") on a index.php file, using :
Along other PHP stuff.
Thanks!
I have a PHP script that stores data with arrays, and contains "send-email" functions. (for a form).
I wanted to add the possibility to my client to add his own data using CouchCMS, but it's not working. My pages are loading forever and then it gives an error saying the page loaded for too long so it stopped. Some sort of infinite loop I guess?
Here's my code :
- Code: Select all
<?php require_once( 'edit/cms.php' ); ?>
<cms:template title='Magasins' order="0" clonable="1">
<cms:repeatable name='manager_pass' label="Mots de passe pour Directeur" >
<cms:editable type='text' name='manager_pass_text' label='Mot de passe du Directeur' />
</cms:repeatable>
<cms:repeatable name='inspector_pass' label="Mots de passe pour Superviseur" >
<cms:editable type='text' name='inspector_pass_text' label='Mot de passe du Superviseur' />
</cms:repeatable>
<cms:repeatable name='submissions_pass' label="Mots de passe pour Magasin" >
<cms:editable type='text' name='submissions_pass_text' label='Mot de passe du Magasin' />
</cms:repeatable>
<cms:repeatable name='email_to' label="Envoyer aux courriels..." >
<cms:editable type='text' name='email_to_address' label='Courriel' />
</cms:repeatable>
</cms:template>
<cms:php>
$data = array();
$data[] = array(
"store_title" => "<cms:show k_page_title />",
"manager_pass" => array("12345"),
"inspector_pass" => array("12345"),
"submissions_pass" => array("qwerty"),
"email_to" => array("email1@gmail.com","email2@gmail.com")
);
$email_data = array(
"reply_to" => "", // Set your email here if you wanna resive copies of all emails
"email_from" => "email@email.com", // Email from
"name_from" => "Client name", // Name from
"subject" => "Rapport Contrôle des travaux - [STORENAME] - [DATE]", // Email subject (you can use [STORENAME] and [DATE] placeholders)
"filename" => "rapport-travaux-promaintenance.pdf", // pdf file name, for example "filename.pdf"
"body" => "Bonjour,<br/>
Vous trouverez en pièce jointe le rapport de contrôle des travaux pour le magasin [STORENAME] pour [DATE].<br/>
Merci de votre confiance<br/>
Client name<br/>", // plain text (you can use [STORENAME] and [DATE] placeholders and <br/> for line break)
);
</cms:php>
<?php COUCH::invoke(); ?>
I haven't put all the "cms:show" elements yet, but still, I tried just using the "cms:show k_page_title" and nothing shows up. I mean, the page don't even load. Any idea what I am doing wrong here?
By the way, I am embedding this file (that is named "data.php") on a index.php file, using :
- Code: Select all
include_once("data.php");
Along other PHP stuff.
Thanks!