Jump to content

Frank Schneider

Members
  • Posts

    23
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Frank Schneider's Achievements

Jr. Member

Jr. Member (3/6)

0

Reputation

  1. i add this and no changes, $_FILES is empty
  2. I have a Processwire application. In it I have two areas company and their employees. I insert an image in Employees and upload it, it works fine so far, now I do the same in the company and want to use it as a logo, it doesn't work there. When I click save, the $_files field is empty, but not for the employee. So exactly the same as with the employee does not work, same fields, same code. The field is defined in fields as Image and assigned to the template I've searched the whole internet but can't find the reason. my code: $form_fields = array( ..... 'foto' => array('type' => 'file', 'required' => true), ); // --- WireUpload settings --- $upload_path = $config->paths->assets . "files/.tmp_uploads/"; // tmp upload folder $file_extensions = array('jpg', 'jpeg', 'gif', 'png'); $max_files = 1; $max_upload_size = 1*1024*1024; // make sure PHP's upload and post max size is also set to a reasonable size $overwrite = false; $update_page = ($page->url == $pages->get("/firmenverwaltung/edit/")->url) ? $pages->get("id=".(int)$input->urlSegment0) : null; $file_field = "foto"; //HTML <div class="col-lg-6"> <div class="form-group"> <label class="form-control-label">Logo: <?php if ($form_fields['foto']['required']) { ?><span class="tx-danger">*</span><?php } ?></label> <div class="<?php if ($errors["foto"]) { echo "parsley-error"; } ?> custom-file"> <input id="foto" type="file" name="foto[]"> </div> <?php showError($errors, "foto"); ?> </div> <?php if ($firma) { $foto = null; foreach ($firma->foto as $image) { $foto = $image->width(250); break; } if ($foto != null) { echo "<img src='".$foto->url."' />"; } } ?> </div> //Save if($input->post->action == 'send') { // first validate the CSRF token to check if it is a valid request if(!$session->CSRF->hasValidToken()){$errors['csrf'] = "Form submit was not valid, please try again."; } //Look for required fields and make sure they have a value foreach($required_fields as $req) { //print_r($_FILES); //die; // required file upload field if($form_fields[$req]['type'] == 'file'){if(empty($_FILES[$req]['name'][0])){$errors[$req] = "Wählen Sie Dateien zum Hochladen aus.."; } } else if($form_fields[$req]['type'] == 'checkbox'){if($form_fields[$req]['value'] == 0){$errors[$req] = "field necessary.";} // erforderliche Textfelder } else if($form_fields[$req]['type'] == 'text' || $form_fields[$req]['type'] == 'textarea' || $form_fields[$req]['type'] == 'email') { if(!strlen($form_fields[$req]['value'])){$errors[$req] = "Feld notwendig."; } // reqired email fields if($form_fields[$req]['type'] == 'email') { if($form_fields[$req]['value'] != $input->post->$req){$errors[$req] = "Bitte eine gültige E-Mail Adresse angeben.";} } } }
  3. Thanks in advance for the help. But I'm looking for an editor where you don't have to edit the HTML code. I'm looking for an editor like a CMS.
  4. Is there a front end editor or something similar for pw. This html syntax is not my thing. So it's easier to edit.
  5. I've also tried the parameters I, D and F the same. It must be an attitude, but where. WirePDF I installed it via Modules-> Site-> New-> Add Module Manualy
  6. i create a pdf file with WirePdf on PW andand want it download to browser downloads folder. $header = ''; $footer = $pages->get("/einstellungen/")->company_name; $filename = 'Ausgabe.pdf'; error_reporting(0); // E_ALL=Melde alle PHP-Fehler 0=deaktiviert ob_start(); ob_clean(); $pdf = $modules->get('WirePDF'); $pdf->pageFormat = 'A4'; $pdf->leftMargin = 20; $pdf->rightMargin = 20; $pdf->topMargin = 20; $pdf->bottomMargin = 20; $mpdf = $pdf->mpdf; $mpdf->SetHTMLHeader($header); $mpdf->SetHTMLFooter($footer); $mpdf->WriteHTML($content); ob_end_clean(); $mpdf->Output($filename, 'F'); $mpdf->Output($filename, 'F'); works and create in template folder. $mpdf->Output(); not working and the browser shows, annot load file. Know anyone the reason. Ist it a parameter in PW?
  7. i have a string as follows $content='<h2>asdfgjklöä</h2>Familienname xName'; and i want replace xName but i cannot find any function. Is there a way like c# replace?
  8. I try to use RockPdf when i dump $pdf->dump(); the pdf show perfect When i $pdf->download('pdf-filename.pdf'); it not work It show it is no valid pdf $pdf = $modules->get('RockPdf'); $pdf->set('SetHeader', 'This is my header text'); $pdf->write('Hello World ' . date('H:i:s')); $pdf->write('<!-- my custom comment -->'); $pdf->html(); // output html in tracy console $pdf->save(); // generate pdf //$pdf->dump(); // dump pdf to iframe in tracy console $pdf->download('pdf-filename.pdf'); What is the reason
  9. Here is the call. <h1><?php echo get_zehner($pages->get("/mitglieder")) ?></h1> Field typ of mitglied_kategorie is text
  10. /* Kategorie */ $siteconfig["kategorie"] = array(); $siteconfig["kategorie"][] = "Mitglied"; $siteconfig["kategorie"][] = "Probetraining"; $siteconfig["kategorie"][] = "Zehnerkarte"; $siteconfig["kategorie"][] = "Ehemaliges Mitglied"; $siteconfig["kategorie"][] = "Personal"; $siteconfig["kategorie"][] = "Abo"; $siteconfig["kategorie"][] = "Neuanmeldung"; sort($siteconfig["kategorie"]); <!-- Kategorie --> <div class="col-lg-2"> <div class="form-group"> <label class="form-control-label">Kategorie: </label> <select class="form-control " name="Kategorie" data-placeholder="Kategorie wählen" > <?php foreach ($siteconfig["kategorie"] as $kategorie) { if ($mitglied->mitglied_kategorie == $form_fields['kategorie']['value']) { echo "<option value='".$kategorie."' selected='selected'>".$kategorie."</option>\n"; } else {echo "<option value='".$kategorie."'>".$kategorie."</option>\n";} } ?> </select> </div> </div> //Save $mitglied->mitglied_kategorie = $_POST['Kategorie']; //Filter return count the kategorie <?php //========================================================================================= // //========================================================================================= function get_zehner($page) { $selector = "template=mitglied,mitglied_kategorie=Zehnerkarte"; $ret=$page->count($selector); return($ret); } //========================================================================================= // //========================================================================================= function get_member($page) { $selector = "template=mitglied,mitglied_kategorie=Mitglied"; $ret=$page->count($selector); return($ret); }
  11. I have a page member, and i want count a field wich have same entry. /* Kategorie */ $siteconfig["kategorie"] = array(); $siteconfig["kategorie"][] = "Mitglied"; $siteconfig["kategorie"][] = "Probetraining"; $siteconfig["kategorie"][] = "Zehnerkarte"; $siteconfig["kategorie"][] = "Ehemaliges Mitglied"; $siteconfig["kategorie"][] = "Personal"; $siteconfig["kategorie"][] = "Abo"; $siteconfig["kategorie"][] = "Neuanmeldung"; sort($siteconfig["kategorie"]); I want count member who has Zehnerkarte, i do as folow but get all member //========================================================================================= // //========================================================================================= function get_zehner($page) { $selector = "template=mitglied,mitglied_kategorie==Zehnerkarte"; $ret=$page->count($selector); return($ret); } How i can filter to "Zehnerkarte"
  12. i try but it not save here my code. $mitglied = $pages->get("id=".(int)$input->urlSegment0); $ts_entry = $mitglied; $ts_entry->setOutputFormatting(false); $ts_entry->title =$mitglied->mitglied_name." ".$mitglied->mitglied_vorname; $ts_entry->parent = $pages->get("/mitglieder/"); $ts_entry->mitglied_name =$mitglied->mitglied_name; $ts_entry->mitglied_vorname =$mitglied->mitglied_vorname; $ts_entry->mitglied_strasse =$mitglied->mitglied_strasse; $ts_entry->mitglied_plz =$mitglied->mitglied_plz; $ts_entry->mitglied_ort =$mitglied->mitglied_ort; ....... $ts_entry->mitglied_beitrag =$mitglied->mitglied_beitrag; $ts_entry->mitglied_zahlart =$mitglied->mitglied_zahlart; $ts_entry->mitglied_vertragsbeginn =$mitglied->mitglied_vertragsbeginn; $ts_entry->save();
×
×
  • Create New...