Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Perplexity 🤖

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by Perplexity 🤖

  1. When you type them in to the database they save just fine however, if you don't enter a phone number into the database then it will automatically put a "0" in the database. They are saved into an SQL area.
  2. Hello everyone! I have a code that is for a phone number entry. The code works fine however, it will automatically fill "0" in the spot for the phone number if it is null. This is throwing our system off for numbers. If you can see what may be causing this, I would appreciate it. <div class="row"> <div class="row-left"> <?php echo $form->labelEx($info,'student_mobile_no'); ?> <?php echo $form->textField($info,'student_mobile_no',array('size'=>12,'maxlength'=>12)); ?><span class="status"> </span><br/><br/><b style="color:red;"> <?php echo $form->error($info,'student_mobile_no'); ?></b> </div>
  3. The wrapping of the text works, however, it is cutting off the first line of each new page.
  4. I did that- worked! FACEPALM!
  5. I have a problem with text. I have a report system that when you click on "print"- it will generate a PDF report that our employees can print the report. My problem is that if the report is too long it will shift the text to an entirely seperate page. It also looks like the text is in it's own box and the longer the report, the shortly the text will shrink to try and fit it all inside this box. Here is the code: <h4 class="title">REPORT NARRATIVE</h4> <table> <tr> <td><?php echo nl2br($StudentInfo->report_pdf);?></td> </tr> </table>
  6. Is the code above what was needed?
  7. Here is the code: <style> table{ display: table; border-collapse: collapse; border:1.5px solid #74b9f0; font-size: 12.5px; width:100%; } .no_border tr,td{ border:none; border:hidden; /* background:none; */ border:1.5px solid white; } table tr:nth-child(even) { /*(even) or (2n 0)*/ background: #f1f6ff; } table tr:nth-child(odd) { /*(odd) or (2n 1)*/ background: white; } th{text-align:left;font-weight:normal;color:#990a10;width:110px;border:0.4px solid #74b9f0;height:24px;} .title{color:black;} td{border:0.4px solid #74b9f0;height:24px;} .label{text-align:left;font-weight:normal;color:#990a10;width:110px;height:24px;} </style> <?php $StudentInfo = StudentInfo::model()->findByPk($student_transaction[0]->student_transaction_student_id); $AcademicTermPeriod = AcademicTermPeriod::model()->findByPk($student_transaction[0]->academic_term_period_id); $AcademicTerm = AcademicTerm::model()->findByPk($student_transaction[0]->academic_term_id); if($student_transaction[0]->student_transaction_nationality_id != null) $Nationality = Nationality::model()->findByPk($student_transaction[0]->student_transaction_nationality_id); else $Nationality = new Nationality; $Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id); $Course = Course::model()->findByPk($student_transaction[0]->course_id); if($student_transaction[0]->student_transaction_languages_known_id != null) $LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id); if($student_transaction[0]->student_transaction_student_address_id != null) $StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id); else $StudentAddress = new StudentAddress; if($student_transaction[0]->student_transaction_parent_id != null || $student_transaction[0]->student_transaction_parent_id != 0) $parent = ParentLogin::model()->findByPk($student_transaction[0]->student_transaction_parent_id); else $parent = new ParentLogin; ?> <h3 class="title">CALL RECORDS SUMMARY</h3> <table class="no_border"> </table> <h4 class="title">ADMINISTRATIVE</h4> <table> <tr> <td class="label">DATE</label></td><td><?php echo $StudentInfo->student_adm_date;?></td> <td class="label">DISPATCH TIME</label></td><td><?php echo $StudentInfo->student_guardian_qualification;?></td> </tr> <tr> <td class="label">ARRIVAL TIME</label></td><td><?php echo $StudentInfo->student_guardian_relation;?></td> <td class="label">CLEARANCE</label></td><td><?php echo $StudentInfo->student_guardian_occupation;?></td> </tr> <tr> </tr> </table> <h4 class="title">INCIDENT</h4> <table> <tr> <td class="label">TYPE OF INCIDENT</td><td><?php if($Nationality) echo $Nationality->nationality_name; else echo ""; ?> <td class="label">REPORT NUMBER</label></td><td><?php echo $StudentInfo->student_guardian_name;?></td> </tr> <tr> <td class="label">PRIMARY OFFICER</label></td><td><?php echo $StudentInfo->student_guardian_home_address;?></td> <td class="label">JUVENILE Y/N</td><td><?php echo $StudentInfo->emergency_cont_no;?></td> </tr> <!--tr> <!--td class="label">Semester</td><td><?php echo (empty($AcademicTerm->academic_term_name) ? "Not Set" : $AcademicTerm->academic_term_name);?></td> </tr--> </table> </br></br> <h4 class="title">INCIDENT ADDRESS</h4> <table> <tr> <td class="label">STREET</td><td colspan="3"><?php echo $StudentAddress->student_address_p_line1;?></td> <td class="label">APT/LOCATION</td><td colspan="3"><?php echo $StudentAddress->student_address_p_line2;?></td> </tr> <tr> <td class="label">CITY</td><td colspan="3"><?php echo $StudentAddress->student_p_house_no;?></td> <td class="label">ZIP CODE</td><td colspan="3"><?php echo $StudentAddress->student_address_p_pin;?></td> </tr> </table> <h4 class="title">REPORT COMPLAINANT</h4> <table> <tr> <td class="label">COMPLAINANT</td><td colspan="3"><?php echo $StudentAddress->student_c_house_no;?></td> <td class="label">PHONE NUMBER</td><td colspan="3"><?php echo $StudentAddress->student_address_c_phone;?></td> </tr> </table> <h4 class="title">REPORT NARRATIVE</h4> <table> <tr> <td colspan="3"><?php echo nl2br($StudentInfo->student_guardian_occupation_address);?></td> </tr> </table> </br></br> <?php echo "</br></br>"; ?> <h4 class="title">DOCUMENTS ATTACHED TO REPORT</h4> <?php $k=0; if ($student_docs != null){ ?> <table> <tr> <th> LOCAL NUMBER </th> <th> TITLE </th> <th> DOCUMENT CATEGORY </th> <th width="70px"> DESCRIPTION </th> <th> DATE SUBMITTED </th> </tr> <?php foreach($student_docs as $m=>$v) { $StudentDocs = StudentDocs::model()->findByPk($v['student_docs_trans_stud_docs_id']); ?> <tr> <td> <?php echo ++$k; ?> </td> <td> <?php echo $StudentDocs->title;?> </td> <td> <?php echo DocumentCategoryMaster::model()->findByPk($StudentDocs->doc_category_id)->doc_category_name; ?> </td> <td width="70px"> <?php echo $StudentDocs->student_docs_desc; ?> </td> <td> <?php $docdate = date_create($StudentDocs->student_docs_submit_date); echo date_format($docdate,'d-m-Y');?> </td> </tr> <?php }// end for loop ?> </table> <?php } else echo "NO DOCUMENTS AVAILABLE"; ?>
  8. What do you need? The PHP side for the PDF generator or the PHP/HTML side that controls the text field boxes?
  9. I have a data textbox area that our employees type an incident report into. When we hit print, it generates a PDF report including other information and the text field (the report). The only problem is if the report is lenghty it will shift the entire text area to a seperate page leaving a good portion of the first page blank. I have attached a report showing what I'm talking about. Is this something that can be fixed by adding something to the code? I really would like to keep a portion of the narritave on one page and have it flow to the second page. ANYONE who can figure out a way to do this please let me know! StundentFinalView.pdf
  10. Hello everyone. I have a report generator for my database and for some reason it is putting a watermark of our company logo in the middle of each page. I have attached the code for the beginning of the script that makes the PDF generator work. Maybe you can find where it should be removed because I am not finding it. <style> table{ display: table; border-collapse: collapse; border:1.5px solid #74b9f0; font-size: 12.5px; width:100%; } .no_border tr,td{ border:none; border:hidden; /* background:none; */ border:1.5px solid white; } table tr:nth-child(even) { /*(even) or (2n 0)*/ background: #f1f6ff; } table tr:nth-child(odd) { /*(odd) or (2n 1)*/ background: white; } th{text-align:left;font-weight:normal;color:#990a10;width:110px;border:0.4px solid #74b9f0;height:24px;} .title{color:black;} td{border:0.4px solid #74b9f0;height:24px;} .label{text-align:left;font-weight:normal;color:#990a10;width:110px;height:24px;} </style> <?php $StudentInfo = StudentInfo::model()->findByPk($student_transaction[0]->student_transaction_student_id); $AcademicTermPeriod = AcademicTermPeriod::model()->findByPk($student_transaction[0]->academic_term_period_id); $AcademicTerm = AcademicTerm::model()->findByPk($student_transaction[0]->academic_term_id); if($student_transaction[0]->student_transaction_nationality_id != null) $Nationality = Nationality::model()->findByPk($student_transaction[0]->student_transaction_nationality_id); else $Nationality = new Nationality; $Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id); $Course = Course::model()->findByPk($student_transaction[0]->course_id); if($student_transaction[0]->student_transaction_languages_known_id != null) $LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id); if($student_transaction[0]->student_transaction_student_address_id != null) $StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id); else $StudentAddress = new StudentAddress; if($student_transaction[0]->student_transaction_parent_id != null || $student_transaction[0]->student_transaction_parent_id != 0) $parent = ParentLogin::model()->findByPk($student_transaction[0]->student_transaction_parent_id); else $parent = new ParentLogin; ?> <h3 class="title">CALL RECORDS SUMMARY</h3> <table class="no_border"> </table>
  11. I am now trying to get the nl2br to work with my PDF final view when I go to print a report. Here is the code: <td class="label">BODY</td><td colspan="3"><?php echo $StudentInfo->student_guardian_occupation_address;?></td> Where would I put the nl2br in this case?
  12. You are amazing! It worked perfectly! My final question and to get out of your hair with this- I have my SQL tables set to VCHAR (1000) characters. However, when I type something it cuts me off at 100 characters and won't let any more characters go. Maybe you could shine some light on this.
  13. Someone told me my problem is as you said needing to add nl2br into my code. I am struggling extremely on trying to get this figured out. Below is my HTML for viewing the notes section and the PHP code that is making it work. Could someone possibly edit it and show me what I need to do correctly. As I said I am new and doing this so any guidance is appreciated. PHP: <div class="row"> <?php echo $form->labelEx($info,'student_guardian_occupation_address'); ?> <?php echo $form->textArea($info,'student_guardian_occupation_address',array('size'=>59,'maxlength'=>500,'style'=>'width:1200px;height:340px;margin-bottom:15px')); ?><span class="status"> </span> <?php echo $form->error($info,''); ?> </div> Here is the HTML code for viewing it: <td class="table-cell-title">NARRATIVE</td> <td class="table-cell-content"> <?php echo (!empty($studInfo->Rel_Stud_Info->student_guardian_occupation_address) ? $studInfo->Rel_Stud_Info->student_guardian_occupation_address : "Not Set"); ?></td>
  14. It is not working for me! I tested it and it's not showing up. However, I found that if I type <br> into the notes section when I am adding notes it will space the thing but I really would like it to do it automatically.
  15. Hello! What exactly do you suggest I change? I have never used nl2br before. If you could maybe give me a little explination that would help me out tremendously. I basically want to be able to type my notes and the spaces automatically translate to the PDF and overview screen. If that makes any sense from what I posed above.
  16. Hello everyone! I will try to make this as easy as possible to understand. I have a database that we use in PHP attached to our website that keeps a detailed log of each member. We just recently added a section to the database that allows for notes to be added to the members record. However, each time we type something it does not take the spaces or anything into consideration. Let me show you with pictures: 1. This is what the database looks like when you are typing the notes into the members profile; Once you click save and go to the member's "Overview" this is what the notes section looks like; you can see that the text is there but it stays in a block format and does not take any spacing/formatting into consideration. The more you type the worse and blocky it looks. The biggest problem is that we have an option to geneate the report into a PDF. It looks horrible when the notes are blocked and not formatted correctly with spaces ect. I believe my SQL table is currently set to VCHAR (100) and the php file is telling the command to read everything as text. Does anyone know what I need to do to keep the formatting. I am pretty new to all of this so if someone could take a few minutes and explain a little bit to me that would be great. I am quite honestly five seconds from pulling my hair out. For anyone who cares this is what the PHP code looks like for the table; <div class="row"> <?php echo $form->labelEx($info,'student_notes'); ?> <?php echo $form->textArea($info,'student_notes',array('size'=>59,'maxlength'=>500,'style'=>'width:1503px;height:340px;margin-bottom:15px')); ?><span class="status"> </span> <?php echo $form->error($info,'student_notes'); ?> </div>
  17. Does anyone know why I would be getting this error all of a sudden when I never got it before? I didn't do anything different and nothing was deleted. CDbException CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mccombpo_data.t' doesn't exist
  18. <div class="portlet box blue"> <div class="portlet-title"><i class="fa fa-plus"></i><span class="box-title">Upload File to Incident</span> </div> <div class="form"> <?php $form=$this->beginWidget('CActiveForm', array( 'id'=>'student-docs-trans-form', 'enableAjaxValidation'=>true, 'htmlOptions'=>array('enctype'=>'multipart/form-data'), 'clientOptions'=>array('validateOnSubmit'=>true,'validateOnCnange'=>true), )); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <div class="row"> <?php echo $form->labelEx($stud_doc,'doc_category_id'); ?> <?php echo $form->dropDownList($stud_doc,'doc_category_id',CHtml::listData(DocumentCategoryMaster::model()->findAll(),'doc_category_id','doc_category_name'),array('empty' => 'Select Category')); ?><span class="status"> </span> <?php echo $form->error($stud_doc,'doc_category_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($stud_doc,'title'); ?> <?php echo $form->textField($stud_doc,'title',array('size'=>17,'maxlength'=>20)); ?><span class="status"> </span> <?php echo $form->error($stud_doc,'title'); ?> </div> <div class="row"> <?php echo $form->labelEx($stud_doc,'student_docs_desc'); ?> <?php echo $form->textArea($stud_doc,'student_docs_desc',array('rows'=>3,'cols'=>16)); ?><span class="status"> </span> <?php echo $form->error($stud_doc,'student_docs_desc'); ?> </div> <div class="row"> <?php echo $form->labelEx($stud_doc,'student_docs_submit_date'); ?> <?php $this->widget('CustomDatePicker', array( 'model'=>$stud_doc, 'attribute'=>'student_docs_submit_date', 'options'=>array( 'dateFormat'=>'dd-mm-yy', 'changeYear'=>'true', 'changeMonth'=>'true', 'showAnim' =>'slide', 'yearRange'=>'1900:'.(date('Y')+1), 'buttonImage'=>Yii::app()->request->baseUrl.'/images/calendar.png', ), 'htmlOptions'=>array( 'style'=>'width:165px;vertical-align:top' ), )); ?> <span class="status"> </span> <?php echo $form->error($stud_doc,'student_docs_submit_date'); ?> </div> <div class="row"> <?php echo $form->labelEx($stud_doc,'student_docs_path'); ?> <?php echo $form->fileField($stud_doc, 'student_docs_path',array('size'=>'15')); ?> <span class="status"> </span> <?php echo $form->error($stud_doc,'student_docs_path'); ?> </div> <div class="hint"><b>Hint:-</b> Upload Only Jpeg, Jpg, Pdf, Txt, Doc, Gif, Png Type Document</div> <div> </div> </div><!-- form --> <div class="row buttons"> <?php echo CHtml::submitButton($model->isNewRecord ? 'Add' : 'Save', array('class'=>'submit')); ?> <?php echo CHtml::link('Cancel', Yii::app()->request->urlReferrer , array('class'=>'btnCan')); ?> </div> <?php $this->endWidget(); ?> </div> This is what is showing that is controlling the widget
  19. Thanks for the reply! Correct, I did try uploading the files specified. It was still giving me the error. Unfortunately I purchased the script off a website to have and they do not offer support on setting it up. I guess I will have to look around for the javascript controlling it. Do you have any suggestions? Like I said I have been frustrated working on this small setback for weeks now.
  20. <?php /** * This is the model class for table "student_docs". * * The followings are the available columns in table 'student_docs': * @property integer $student_docs_id * @property string $doc_category_id * @property string $title * @property string $student_docs_desc * @property string $student_docs_path */ class StudentDocs extends CActiveRecord { /** * Returns the static model of the specified AR class. * @param string $className active record class name. * @return StudentDocs the static model class */ public static function model($className=__CLASS__) { return parent::model($className); } /** * @return string the associated database table name */ public function tableName() { return 'student_docs'; } /** * @return array validation rules for model attributes. */ public function rules() { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( array('student_docs_path, doc_category_id, title,student_docs_submit_date', 'required','message'=>""), array('student_docs_desc', 'length', 'max'=>50), array('student_docs_path', 'file', 'types'=>'jpeg, jpg, pdf, txt, doc,docx, gif, png', 'maxSize'=>1024*1024*2, 'tooLarge'=>'The document was larger than 2MB. Please upload a smaller document.',), //array('title','CRegularExpressionValidator','pattern'=>'/^[a-zA-Z& ]+([-]*[a-zA-Z0-9 ]+)*$/','message'=>''), // The following rule is used by search(). // Please remove those attributes that should not be searched. array('student_docs_id, student_docs_desc, student_docs_path, doc_category_id,student_docs_submit_date, title', 'safe', 'on'=>'search'), ); } /** * @return array relational rules. */ public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( ); } /** * @return array customized attribute labels (name=>label) */ public function attributeLabels() { return array( 'student_docs_id' => 'Student Docs', 'student_docs_desc' => 'Document Description', 'student_docs_path' => 'Document', 'doc_category_id' => 'Document Category', 'title' => 'Title', 'student_docs_submit_date'=>'Submit Date', ); } /** * Retrieves a list of models based on the current search/filter conditions. * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. */ public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('student_docs_id',$this->student_docs_id); $criteria->compare('doc_category_id',$this->doc_category_id,true); $criteria->compare('title',$this->title,true); $criteria->compare('student_docs_desc',$this->student_docs_desc,true); $criteria->compare('student_docs_path',$this->student_docs_path,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); } } Hello everyone! Please help save me because I am about to loose my mind. First- I have a database for a company I have been working on and for this database one of the things they would like is to have a tab to add documents to a specific clients database profile. I have done all of that and added the tab to add documents however, it will not allow me to add the document. I have attached a picture to show you what the error is. Basically everything else is working fine- I give the file a name, description, date of upload, and all of that gives me the green arrow beside it saying its fine however, when I add the file (any file extension) it will give me a red "x" beside the file path saying it can't be added. (see picture adddocument.png to see the display). Here is also the code that is controlling the document upload page- maybe I am missing something. Maybe you will be able to catch it before I will- I have been staring at this for days now trying to get it to work! Thanks for the help in advance!
×
×
  • 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.